/* MEANSFUL client portal. Same identity as the MEANSFUL system: blueprint night, drafting-paper day, brand cyan. */
:root, :root[data-theme="night"] {
  color-scheme: dark;
  --bg: #08111e; --grid: rgba(34,211,238,.045); --grid-major: rgba(34,211,238,.075);
  --surface: #0f1a2b; --surface-2: #15233a; --inset: #0b1524;
  --line: #22344d; --line-strong: #31496a;
  --text: #e7eef7; --muted: #93a5bc; --faint: #64768f;
  --accent: #22d3ee; --accent-hover: #67e8f9; --accent-ink: #03222b; --accent-soft: rgba(34,211,238,.12);
  --warn: #f0b44c; --warn-soft: rgba(240,180,76,.12); --danger: #f07a7a; --danger-soft: rgba(240,122,122,.12);
  --ok: #5ee0a0;
  --shadow: 0 18px 40px -24px rgba(0,0,0,.7);
  --logo-line: #eafcff; --logo-word: #f5f7fa; --logo-tagline: #9caec5; --logo-node-edge: #031721;
}
:root[data-theme="day"] {
  color-scheme: light;
  --bg: #eef3f7; --grid: rgba(16,64,104,.05); --grid-major: rgba(16,64,104,.085);
  --surface: #ffffff; --surface-2: #f5f8fb; --inset: #f1f5f9;
  --line: #d4dee8; --line-strong: #b5c4d4;
  --text: #0f1d2e; --muted: #55667c; --faint: #8494a8;
  --accent: #0a7f9c; --accent-hover: #086e88; --accent-ink: #ffffff; --accent-soft: rgba(10,127,156,.09);
  --warn: #a8670a; --warn-soft: rgba(232,169,58,.14); --danger: #c23b3b; --danger-soft: rgba(224,90,90,.1);
  --ok: #1d8a57;
  --shadow: 0 12px 32px -20px rgba(15,29,46,.25);
  --logo-line: #12324a; --logo-word: #0f1d2e; --logo-tagline: #55667c; --logo-node-edge: #ffffff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background-color: var(--bg);
  background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; font-size: 15.5px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 21px; font-weight: 600; }
h3 { font-size: 16.5px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); transition: background-color .15s, border-color .15s;
}
button:hover, .button:hover { background: var(--accent-hover); }
button.secondary, .button.secondary { background: var(--surface-2); color: var(--text); border-color: var(--line); }
button.secondary:hover, .button.secondary:hover { border-color: var(--accent); background: var(--accent-soft); }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); padding: 8px 10px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.wide, .button.wide { width: 100%; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--inset); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px;
}
:root[data-theme="day"] input, :root[data-theme="day"] select, :root[data-theme="day"] textarea { background: #fff; border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; }
.check input { width: auto; margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }

/* frame */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(14px, 4vw, 40px); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: block; color: inherit; }
.space-logo { display: block; width: 220px; height: auto; }
.space-logo .logo-lines { stroke: var(--logo-line); }
.space-logo .logo-nodes { stroke: var(--logo-node-edge); }
.space-logo .logo-word { fill: var(--logo-word); }
.space-logo .logo-tagline { fill: var(--logo-tagline); }
.topnav { display: flex; gap: 4px; }
.topnav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.topnav a:hover, .topnav a.active { color: var(--text); background: var(--accent-soft); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.ghost-link { color: var(--text); text-decoration: none; font-weight: 600; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-moon { fill: currentColor; stroke: none; }
:root[data-theme="night"] .icon-moon, :root[data-theme="day"] .icon-sun { display: none; }
.view { max-width: 1120px; margin: 0 auto; padding: 28px clamp(14px, 4vw, 40px) 110px; outline: none; }
.tabbar { display: none; }

/* home */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; padding: 26px 0 40px; }
.hero p.lead { font-size: 18px; color: var(--muted); margin: 14px 0 24px; max-width: 52ch; }
.slogan { position: relative; display: inline-block; padding-bottom: 10px; font-weight: 500; font-size: 17px; margin-top: 10px; }
.slogan-track { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); border-radius: 2px; }
.slogan-track::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--accent));
  transform-origin: left; transform: scaleX(0); animation: extrude 1.5s cubic-bezier(.6,.05,.25,1) .3s forwards; }
.pacer { position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 14px 2px var(--accent); animation: lap 7s cubic-bezier(.5,0,.3,1) 2s infinite; opacity: 0; }
@keyframes extrude { to { transform: scaleX(1); } }
@keyframes lap { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 55% { left: calc(100% - 8px); opacity: 1; } 62%, 100% { left: calc(100% - 8px); opacity: 0; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.steps-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.steps-strip div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.steps-strip strong { display: block; margin-bottom: 4px; }
.hero-card .steps-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.stack { display: grid; gap: 14px; }
.narrow { max-width: 460px; margin: 20px auto; }
.page-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.notice { padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); font-size: 14px; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: var(--warn-soft); }
.notice.bad { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); background: var(--danger-soft); }
.dev-code { font-size: 22px; letter-spacing: .3em; font-weight: 700; color: var(--accent); }

/* order flow */
.flow-steps { display: flex; gap: 4px; margin: 0 0 22px; }
.flow-steps div { flex: 1; position: relative; text-align: center; font-size: 12.5px; color: var(--faint); }
.flow-steps div::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 7px; }
.flow-steps div.done { color: var(--muted); }
.flow-steps div.done::before, .flow-steps div.current::before { background: var(--accent); }
.flow-steps div.current { color: var(--text); font-weight: 600; }
.dropzone { display: grid; place-items: center; text-align: center; gap: 6px; min-height: 220px; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--accent) 60%, var(--line)); border-radius: 16px; background: var(--inset); padding: 24px; }
.dropzone.over { background: var(--accent-soft); }
.dropzone strong { font-size: 18px; }
.file-list { display: grid; gap: 8px; }
.file-row, .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--inset); font-size: 14.5px; }
.check-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
.viewer { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--inset); }
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer .viewer-note { position: absolute; left: 10px; bottom: 8px; font-size: 12px; color: var(--muted); }
.facts { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.facts div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.facts div:last-child { border-bottom: 0; }
.facts strong { text-align: right; }
.yes { color: var(--ok); }
.no { color: var(--danger); }
.options { display: grid; gap: 10px; }
.option { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.option input { width: auto; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option.unavailable { opacity: .55; cursor: not-allowed; }
.option .price { font-size: 19px; font-weight: 700; text-align: right; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.good { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.badge.late { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.totals { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.totals div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.totals div:last-child { border-bottom: 0; font-weight: 700; }
.flow-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }

/* orders */
.order-card { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; padding: 16px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.order-card:hover { border-color: var(--accent); }
.progress { display: flex; gap: 2px; margin: 8px 0 18px; }
.progress div { flex: 1; text-align: center; font-size: 12px; color: var(--faint); }
.progress div::before { content: ""; display: block; width: 14px; height: 14px; margin: 0 auto 6px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.progress div.done::before { background: var(--accent); border-color: var(--accent); }
.progress div.current { color: var(--text); font-weight: 600; }
.progress div.current::before { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: start; }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.product { display: grid; gap: 8px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.product:hover { border-color: var(--accent); }
.product .photo, .product-hero .photo { aspect-ratio: 4 / 3; background: var(--inset) center / cover no-repeat; display: grid; place-items: center; color: var(--faint); }
.product .body { padding: 0 14px 14px; display: grid; gap: 4px; }
.product-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.product-hero .photo { border-radius: 14px; border: 1px solid var(--line); }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 86px; transform: translateX(-50%); width: min(520px, calc(100vw - 28px));
  padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); box-shadow: var(--shadow); }
.toast.bad { border-left-color: var(--danger); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .hero, .check-layout, .two-col, .product-hero { grid-template-columns: 1fr; }
  .steps-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topnav { display: none; }
  .space-logo { width: 170px; }
  .tabbar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 3px; font-size: 12px; color: var(--muted); text-decoration: none; padding: 4px; }
  .tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.active .tab-dot { background: var(--accent); }
  .grid2 { grid-template-columns: 1fr; }
  .view { padding-top: 18px; }
  #account-link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .slogan-track::before { transform: scaleX(1); }
  .pacer { display: none; }
}
.location-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }


/* notifications */
.notify { position: relative; }
.notify-toggle { position: relative; display: inline-flex; align-items: center; gap: 7px; }
.notify-label { font-size: 13.5px; font-weight: 600; }
@media (max-width: 760px) { .notify-label { display: none; } }
.live-update { position: fixed; z-index: 55; inset-inline-end: 18px; bottom: 18px; width: min(400px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--surface);
  border: 1px solid var(--line); border-inline-start: 4px solid var(--warn); border-radius: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .3); }
.live-update > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.live-update.hidden { display: none; }
.notify-level.info { color: var(--accent); }
@media (max-width: 760px) { .live-update { inset-inline: 16px; bottom: 16px; width: auto; } }
.notify-toggle .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.notify-count { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
.notify-count.urgent { background: var(--warn); color: #1d1300; }
.notify-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; width: min(380px, calc(100vw - 32px));
  max-height: min(70vh, 520px); overflow: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .3); padding: 8px; }
.notify-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 6px 8px; }
.notify-item { display: grid; justify-content: stretch; justify-items: start; align-items: start; gap: 3px; width: 100%; text-align: start; padding: 10px 12px; margin: 0 0 6px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); color: var(--text); font-weight: 400; }
.notify-item.read { border-inline-start-color: var(--line); opacity: .78; }
.notify-item.action { border-inline-start-color: var(--warn); }
.notify-item:hover { border-color: var(--accent); }
.notify-level { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); }
.notify-empty { padding: 18px 10px; text-align: center; }
button.small { padding: 5px 10px; font-size: 13px; }
.status-line { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.notice.good { border-color: color-mix(in srgb, var(--ok, #3fbf7f) 50%, var(--line)); }
button.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
button.danger:hover { background: var(--danger-soft); }

/* earlier document versions, folded away */
.older-docs { margin-top: 4px; }
.older-docs summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 2px; }
.older-docs .row { opacity: .8; }
.pay-again { margin-bottom: 16px; }

/* the client's approval, right on the order page */
.approval-panel { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; margin-bottom: 16px;
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
@media (max-width: 760px) { .approval-panel { grid-template-columns: 1fr; } }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.accent-text { color: var(--accent); font-weight: 600; }
.totals .muted span { color: var(--muted); }
.satisfaction { border-inline-start: 4px solid var(--accent); }
.stars { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.stars legend { font-size: 14px; margin-bottom: 6px; padding: 0; }
.stars label { display: inline-flex; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--warn); cursor: pointer; letter-spacing: 1px; }
.stars input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.stars input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* services on the home page */
.services { margin: 8px 0 32px; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.service { display: grid; gap: 6px; align-content: start; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.service:hover { border-color: var(--accent, #22d3ee); transform: translateY(-2px); }
.service.soon { opacity: .62; cursor: default; }
.service-icon { font-size: 22px; color: var(--accent, #22d3ee); }
.service-go { color: var(--accent, #22d3ee); font-weight: 600; margin-top: 4px; }
@media (max-width: 860px) { .service-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 480px) { .service-grid { grid-template-columns: 1fr; } }
