/* ============================================================
   ATELIER LIN — editorial stationery
   Refined minimalism: ivory paper, warm-black ink, antique gold
   + sage, hairline borders instead of shadows.
   ============================================================ */

:root {
  --paper: #FAF7F1;
  --paper-2: #F4EFE6;
  --ink: #23211C;
  --ink-soft: #6E6960;
  --ink-faint: #9B958A;
  --gold: #B0894B;
  --gold-soft: #CBAE7E;
  --sage: #5F7164;
  --sage-soft: #8A9B8E;
  --line: #E6DFD2;
  --line-strong: #D8CFBE;
  --white: #FFFFFF;
  --danger: #A4543F;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', 'Inter', system-ui, sans-serif;

  --sidebar-w: 232px;
  --radius: 2px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: .005em;
}

/* ---- ultra-subtle paper grain ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--gold-soft); color: var(--ink); }

:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

/* ---- typographic primitives ---- */
.micro-label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.4;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 40px 26px 26px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand { margin-bottom: 46px; }
.monogram {
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 16px;
  letter-spacing: .04em; color: var(--ink);
  margin-bottom: 16px;
}
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.1; color: var(--ink); }
.brand-tagline {
  font-weight: 600; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 6px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  text-align: left; padding: 9px 8px 9px 22px;
  position: relative; border-radius: var(--radius);
  transition: color .2s var(--ease);
  letter-spacing: .01em;
}
.nav-item::before {
  content: "✦"; position: absolute; left: 4px; top: 50%;
  transform: translateY(-50%) scale(.5);
  color: var(--gold); font-size: 11px; opacity: 0;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.nav-item:hover { color: var(--ink); }
.nav-item.is-active { color: var(--ink); font-weight: 500; }
.nav-item.is-active::before { opacity: 1; transform: translateY(-50%) scale(1); }

.sidebar-foot {
  margin-top: auto; font-size: 10px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
}
.foot-rule { display: block; height: 1px; background: var(--line); margin-bottom: 14px; }
.foot-settings {
  appearance: none; background: none; border: 0; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: 8px; padding: 4px 2px 10px;
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  transition: color .18s var(--ease);
}
.foot-settings:hover { color: var(--ink); }
.foot-dot {
  flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-faint); opacity: .5;
  box-shadow: 0 0 0 2px var(--paper);
  transition: background .2s var(--ease), opacity .2s var(--ease);
}
.foot-dot.is-ok { background: var(--sage); opacity: 1; box-shadow: 0 0 0 2px var(--paper), 0 0 5px rgba(95,113,100,.5); }
.foot-dot.is-fail { background: var(--danger); opacity: 1; }
.foot-caption { color: var(--ink-faint); }

/* ---- settings modal — reuses the search overlay's stationery chrome ---- */
.settings-overlay { position: fixed; inset: 0; z-index: 220; background: rgba(35,33,28,.34); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; animation: fadeIn .18s var(--ease); }
.settings-overlay[hidden] { display: none; }
.settings-panel { width: min(400px, 92vw); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(35,33,28,.24); overflow: hidden; animation: fadeUp .22s var(--ease) both; padding: 26px 26px 22px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.settings-title { font-family: var(--serif); font-size: 22px; font-weight: 500; margin: 0; }
.settings-close { appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-faint); font-size: 13px; padding: 4px; }
.settings-close:hover { color: var(--ink); }
.settings-sub { font-size: 12.5px; color: var(--ink-faint); margin: 0 0 18px; line-height: 1.5; }
.settings-body { display: flex; flex-direction: column; gap: 13px; }
.settings-test-row { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.settings-note { color: var(--ink-faint); }
.settings-note.is-ok { color: var(--sage); }
.settings-note.is-fail { color: var(--danger); }
.settings-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.erp-sync-note { display: block; margin: -6px 0 14px; color: var(--ink-faint); }
.single-user-note { margin-top: -10px; }

/* ---- sign-in gate — same stationery chrome as the settings modal, but
   blocking (no close button) and centred over a hidden app shell ---- */
body.auth-gated .sidebar, body.auth-gated .main { visibility: hidden; }
.auth-overlay { position: fixed; inset: 0; z-index: 260; background: var(--paper); display: flex; align-items: center; justify-content: center; animation: fadeIn .18s var(--ease); }
.auth-overlay[hidden] { display: none; }
.auth-panel { width: min(360px, 90vw); text-align: center; animation: fadeUp .3s var(--ease) both; }
.auth-monogram { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: .04em; color: var(--ink); border: 1px solid var(--line-strong); width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.auth-brand { font-family: var(--serif); font-weight: 500; font-size: 26px; color: var(--ink); }
.auth-sub { font-size: 12.5px; color: var(--ink-faint); margin: 4px 0 26px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-error { min-height: 14px; font-size: 11.5px; color: var(--danger); letter-spacing: .02em; }
.auth-offline { display: block; margin: 22px auto 0; }

/* ---- sidebar foot — signed-in user + role ---- */
.foot-user { margin-bottom: 12px; }
.foot-user-name { font-family: var(--serif); font-size: 15px; color: var(--ink); line-height: 1.3; }
.foot-user-role { color: var(--gold); margin: 2px 0 6px; }
.foot-signout { padding: 0; font-size: 10px; }

/* ---- release gate — "Internal draft" chip + Approve & release button ---- */
.release-control { display: flex; align-items: center; gap: 12px; margin: -8px 0 18px; }
.release-chip--draft { color: var(--ink-faint); }
.release-hint { color: var(--ink-faint); font-style: italic; text-transform: none; letter-spacing: 0; }
.ov-release-row { display: flex; flex-wrap: wrap; gap: 20px 28px; }
.ov-redirect-note { color: var(--ink-faint); margin-bottom: 14px; }

/* ============================================================
   Main / screens
   ============================================================ */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}
.screen { display: none; padding: 48px 56px 80px; max-width: 1160px; }
.screen.is-active { display: block; }

.screen-head { margin-bottom: 34px; }
.screen-title, .greet-title {
  font-family: var(--serif); font-weight: 500; font-size: 48px;
  line-height: 1.02; letter-spacing: -.01em; color: var(--ink);
  margin: 8px 0 0;
}
.screen-sub, .greet-sub {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 19px; color: var(--ink-soft); margin: 6px 0 0;
}

/* reveal animation */
.reveal { animation: fadeUp .5s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  appearance: none; cursor: pointer; font-family: var(--sans);
  font-size: 13px; font-weight: 500; letter-spacing: .04em;
  border-radius: var(--radius); padding: 12px 18px;
  transition: background .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease);
}
.btn-block { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.btn-ink { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-ink:hover { background: #34322b; }
.btn-ink .sparkle { color: var(--gold-soft); font-size: 12px; }
.btn-gold { background: transparent; color: var(--ink); border: 1px solid var(--gold); }
.btn-gold:hover { background: var(--gold); color: var(--paper); }

.ghost-btn {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  padding: 6px 2px; position: relative; transition: color .2s var(--ease);
}
.ghost-btn::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.ghost-btn:hover { color: var(--ink); }
.ghost-btn:hover::after { transform: scaleX(1); }

/* ============================================================
   1 · Dashboard
   ============================================================ */
.dash-greet { margin-bottom: 34px; }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); margin-bottom: 40px;
}
.stat { padding: 22px 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-val { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1; color: var(--ink); }
.stat-label { margin-top: 10px; }

.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 24px; }

.w-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
  display: flex; flex-direction: column;
}
.w-card:hover { border-color: var(--gold); }
.w-thumb { position: relative; height: 178px; overflow: hidden; }
.w-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.w-card:hover .w-thumb-img { transform: scale(1.03); }

.w-body { padding: 20px 22px 22px; display: flex; flex-direction: column; }
.w-phase {
  align-self: flex-start; font-size: 9.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sage);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; margin-bottom: 12px;
}
.w-couple { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.05; margin: 0 0 6px; color: var(--ink); }
.w-line { font-size: 12px; color: var(--ink-soft); letter-spacing: .02em; margin-bottom: 16px; }
.w-progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 12px; }
.w-progress-fill { display: block; height: 100%; background: var(--gold); }
.w-next { font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.w-next .micro-label { display: inline; margin-right: 6px; color: var(--gold); }
.w-budget { font-size: 13px; color: var(--ink-soft); }
.w-budget strong { font-weight: 500; color: var(--ink); }

/* ============================================================
   2 · Moodboard studio
   ============================================================ */
.mb-studio { display: grid; grid-template-columns: 330px 1fr; gap: 40px; align-items: start; }

.mb-controls { display: flex; flex-direction: column; gap: 16px; }
.field-label { display: block; margin-bottom: -6px; }
.brief-input, .lib-search, .w-select-input, .li-in {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius);
  width: 100%; padding: 10px 12px; transition: border-color .2s var(--ease);
}
.brief-input { resize: vertical; line-height: 1.5; min-height: 76px; }
.brief-input:focus, .lib-search:focus, .w-select-input:focus { border-color: var(--gold); outline: none; }

.w-select { display: flex; flex-direction: column; gap: 7px; }
.w-select-input {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E6960' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 34px;
}

/* settings */
.settings { display: flex; flex-direction: column; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.setting-row { display: flex; align-items: center; justify-content: space-between; }
.setting-label { font-size: 13px; color: var(--ink-soft); }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg {
  appearance: none; background: var(--white); border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .04em;
  color: var(--ink-soft); padding: 6px 13px; transition: background .2s var(--ease), color .2s var(--ease);
  border-left: 1px solid var(--line);
}
.seg:first-child { border-left: 0; }
.seg.active { background: var(--ink); color: var(--paper); }

.switch { appearance: none; cursor: pointer; width: 40px; height: 22px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper-2); position: relative; padding: 0; transition: background .22s var(--ease), border-color .22s var(--ease); }
.switch.sm { width: 34px; height: 19px; }
.switch-knob { position: absolute; top: 50%; left: 2px; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 1px solid var(--line-strong); transition: left .22s var(--ease), background .22s var(--ease); }
.switch.sm .switch-knob { width: 13px; height: 13px; }
.switch.on { background: var(--gold); border-color: var(--gold); }
.switch.on .switch-knob { left: calc(100% - 18px); border-color: var(--gold-soft); }
.switch.sm.on .switch-knob { left: calc(100% - 15px); }

.lib-label { margin-top: 4px; }
.lib-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.lib-thumb { appearance: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; cursor: pointer; background: var(--paper-2); aspect-ratio: 1 / 1; overflow: hidden; transition: border-color .2s var(--ease), transform .12s var(--ease); }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-thumb:hover { border-color: var(--gold); }
.lib-thumb.pressed { transform: scale(.92); }
.lib-note { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-faint); grid-column: 1 / -1; padding: 8px 0; margin: 0; }

.dropzone {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; cursor: pointer; color: var(--ink-faint);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.dropzone:hover, .dropzone.dz-over { border-color: var(--gold); color: var(--ink-soft); background: var(--paper-2); }
.dz-plus { font-size: 18px; line-height: 1; color: var(--gold); }
.dz-text { font-size: 12px; letter-spacing: .02em; }

/* studio archive — folded offline-fallback disclosure (library demoted behind it) */
.studio-archive { border-top: 1px solid var(--line); margin-top: 4px; }
.archive-head {
  appearance: none; background: none; border: 0; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 15px; text-align: left; color: var(--ink-soft);
  transition: color .2s var(--ease);
}
.archive-head:hover { color: var(--ink); }
.archive-label { color: inherit; }
.archive-chevron { font-size: 16px; line-height: 1; color: var(--gold); transition: transform .25s var(--ease); transform: rotate(90deg); }
.studio-archive.is-open .archive-chevron { transform: rotate(-90deg); }
.archive-body { display: none; flex-direction: column; gap: 16px; padding-bottom: 6px; }
.studio-archive.is-open .archive-body { display: flex; }
.archive-body .settings { padding-top: 0; border-top: 0; }

/* board area */
.mb-board-area { min-width: 0; }
.board-actions { display: flex; gap: 20px; justify-content: flex-end; margin-bottom: 16px; }
.board-actions.right { margin-bottom: 14px; }
.board-mount { min-width: 0; }

/* composing state */
.composing { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); min-height: 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.composing-mark { font-size: 30px; color: var(--gold); animation: pulse 1.1s var(--ease) infinite; }
.composing-text { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink-soft); }
@keyframes pulse { 0%,100% { opacity: .35; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }

/* ============================================================
   THE DOCUMENT (shared chrome — moodboard + invoice)
   ============================================================ */
.document {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 40px 44px 30px;
}
.doc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.doc-monogram {
  width: 34px; height: 34px; flex: none; border: 1px solid var(--line-strong); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 13px; color: var(--ink);
}
.doc-brand { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.doc-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-soft), var(--line) 60%, transparent); }

.doc-foot { margin-top: 30px; }
.doc-foot-rule { display: block; height: 1px; background: var(--line); margin-bottom: 14px; }
.doc-foot-row { display: flex; align-items: center; gap: 10px; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); flex-wrap: wrap; }
.doc-dot { color: var(--gold); }

/* ---- moodboard document body ---- */
.mb-title {
  font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.05;
  color: var(--ink); margin: 0; outline: none; letter-spacing: -.01em;
}
.mb-title:focus { box-shadow: inset 0 -1px 0 var(--gold-soft); }
.mb-brief { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-soft); margin: 8px 0 24px; max-width: 62ch; }

.mb-field { margin-bottom: 24px; }
.mb-field--masonry { column-gap: 12px; }
.mb-field--masonry.mb-field--airy { column-count: 2; }
.mb-field--masonry.mb-field--rich { column-count: 3; }
.mb-field--grid { display: grid; gap: 12px; }
.mb-field--grid.mb-field--airy { grid-template-columns: repeat(2, 1fr); }
.mb-field--grid.mb-field--rich { grid-template-columns: repeat(3, 1fr); }

.mb-tile { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; break-inside: avoid; background: var(--paper-2); }
.mb-field--grid .mb-tile { margin-bottom: 0; height: 100%; }
.mb-tile img { width: 100%; display: block; }
.mb-field--grid .mb-tile img { height: 100%; object-fit: cover; }
.mb-tile-x {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: rgba(35,33,28,.62); color: #fff; cursor: pointer; font-size: 11px; line-height: 1;
  opacity: 0; transition: opacity .18s var(--ease); backdrop-filter: blur(2px);
}
.mb-tile:hover .mb-tile-x { opacity: 1; }
.tile-in { animation: fadeUp .5s var(--ease) both; }

.mb-note { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-faint); text-align: center; padding: 60px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); margin: 0; }

.mb-palette { display: flex; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pal-in { animation: fadeUp .55s var(--ease) both; }
.mb-swatch { display: flex; flex-direction: column; gap: 6px; }
.mb-sw { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius); display: block; }
.mb-hex { font-size: 9px; font-weight: 600; letter-spacing: .06em; color: var(--ink-faint); }

/* ============================================================
   3 · Billing
   ============================================================ */
.billing { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.bill-editor { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ed-label { margin-bottom: -6px; }

.li-table { display: flex; flex-direction: column; }
.li-head, .li-row {
  display: grid; grid-template-columns: 1fr 52px 74px 84px 22px; gap: 10px; align-items: center;
}
.li-head { padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.li-head span { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.li-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.li-in { border: 0; border-bottom: 1px solid transparent; border-radius: 0; padding: 4px 2px; background: transparent; transition: border-color .2s var(--ease); }
.li-in:hover { border-bottom-color: var(--line); }
.li-in:focus { outline: none; border-bottom-color: var(--gold); }
.li-in.num { text-align: right; font-weight: 500; }
.li-total { font-weight: 500; text-align: right; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.li-x { appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-faint); font-size: 11px; opacity: 0; transition: opacity .18s var(--ease), color .18s var(--ease); }
.li-row:hover .li-x { opacity: 1; }
.li-x:hover { color: var(--danger); }
.li-xcol { width: 22px; }

.ghost-add { align-self: flex-start; appearance: none; background: none; border: 0; cursor: pointer; font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .04em; color: var(--sage); padding: 12px 2px; transition: color .2s var(--ease); }
.ghost-add:hover { color: var(--ink); }

.li-foot { margin-top: 6px; border-top: 1px solid var(--line-strong); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.li-foot-row { display: flex; align-items: center; justify-content: space-between; }
.lf-label { font-size: 13px; color: var(--ink-soft); }
.vat-label { display: inline-flex; align-items: center; gap: 10px; }
.li-foot-row .num { font-size: 14px; }
.li-foot-total { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.li-foot-total .lf-label { font-family: var(--serif); font-size: 20px; color: var(--ink); }
.total-num { font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--ink); }

.bill-right { position: sticky; top: 32px; }
.invoice-mount { min-width: 0; }

/* ---- invoice document body ---- */
.inv-top { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.inv-title { font-family: var(--serif); font-weight: 500; font-size: 38px; line-height: 1; margin: 0 0 12px; color: var(--ink); }
.inv-meta { font-size: 12px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 3px; }
.im-k { color: var(--ink-faint); font-weight: 500; }
.inv-due { color: var(--gold); font-weight: 500; margin-top: 4px; }
.inv-billto { text-align: right; }
.inv-billto .micro-label { margin-bottom: 6px; }
.bt-name { font-family: var(--serif); font-size: 20px; color: var(--ink); }
.bt-venue { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.inv-table { margin-bottom: 18px; }
.inv-tr { display: grid; grid-template-columns: 1fr 44px 74px 84px; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.inv-thead { padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.inv-thead span { font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.inv-tr .num { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.inv-desc { font-size: 13.5px; color: var(--ink); }

.inv-totals { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-bottom: 22px; }
.inv-trow { display: flex; justify-content: space-between; gap: 40px; width: 260px; font-size: 13px; color: var(--ink-soft); }
.inv-trow .num { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.inv-grand { border-top: 1px solid var(--line-strong); padding-top: 10px; margin-top: 2px; }
.inv-grand span { font-family: var(--serif); font-size: 22px; color: var(--ink); }
.inv-thanks { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--sage); margin: 0; }

/* ============================================================
   4 · Checklist
   ============================================================ */
.checklist { display: flex; flex-direction: column; gap: 22px; max-width: 720px; }
.checklist .w-select { max-width: 300px; }
.cl-groups { display: flex; flex-direction: column; gap: 12px; }
.cl-group { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; }
.cl-group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.cl-group-title { font-family: var(--serif); font-weight: 500; font-size: 23px; margin: 0; color: var(--ink); }
.cl-count { color: var(--ink-faint); }
.cl-bar { display: block; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 16px; }
.cl-bar-fill { display: block; height: 100%; background: var(--gold); transition: width .35s var(--ease); }
.cl-items { display: flex; flex-direction: column; }
.cl-item { appearance: none; background: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 13px; padding: 9px 0; text-align: left; width: 100%; }
.cl-check {
  width: 18px; height: 18px; flex: none; border: 1px solid var(--line-strong); border-radius: 2px;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.cl-text { font-size: 14px; color: var(--ink); transition: color .25s var(--ease); }
.cl-item:hover .cl-check { border-color: var(--gold); }
.cl-item.done .cl-check { background: var(--gold); border-color: var(--gold); color: var(--white); }
.cl-item.done .cl-text { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }

/* ============================================================
   THE SLIDE DECK  (studio primary output)
   ============================================================ */
:root { --terracotta: #A9573C; --cream: #FBF8F2; }
.deck-mount { min-width: 0; }
.deck-count { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-right: auto; align-self: center; }
.deck { display: flex; flex-direction: column; gap: 22px; }

.document--deck {
  --accent: var(--gold); --accent-soft: var(--gold-soft);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--cream); position: relative; overflow: hidden;
  aspect-ratio: 16 / 9; container-type: size; display: flex;
}
.slide-in { animation: fadeUp .55s var(--ease) both; }

.slide-foot {
  position: absolute; left: 4.5cqw; bottom: 3.4cqh; z-index: 3;
  display: flex; align-items: center; gap: 1cqw;
  font-family: var(--sans); font-weight: 600; font-size: 1.5cqw; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-faint);
}
.slide-foot-dot { color: var(--accent); }
.slide-kicker, .cover-eyebrow { font-size: 1.6cqw !important; letter-spacing: .28em; }
.slide-title { font-family: var(--serif); font-weight: 500; line-height: 1; margin: 0; color: var(--accent); }

/* cover */
.slide--cover { align-items: center; justify-content: center; text-align: center; }
.slide--cover-paper { background: linear-gradient(150deg, #FBF8F2, #F1E9DB); }
.cover-photo { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.slide--cover.has-photo::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(28,25,20,.30), rgba(28,25,20,.52)); }
.cover-inner { position: relative; z-index: 2; padding: 6cqh 8cqw; display: flex; flex-direction: column; align-items: center; }
.slide--cover.has-photo .cover-eyebrow, .slide--cover.has-photo .cover-couple, .slide--cover.has-photo .cover-venue, .slide--cover.has-photo .cover-date { color: #FBF8F2; }
.cover-eyebrow { color: var(--ink-faint); margin-bottom: 3.2cqh; }
.cover-couple { font-family: var(--serif); font-weight: 500; font-size: 9.2cqw; line-height: .98; letter-spacing: -.01em; color: var(--ink); margin: 0; }
.cover-rule { display: block; width: 12cqw; height: 1px; background: var(--gold); margin: 3.4cqh 0; }
.slide--cover.has-photo .cover-rule { background: var(--gold-soft); }
.cover-meta { display: flex; flex-direction: column; gap: .8cqh; }
.cover-venue { font-family: var(--serif); font-style: italic; font-size: 3cqw; color: var(--ink-soft); }
.cover-date { font-family: var(--sans); font-size: 1.7cqw; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }

/* direction */
.slide--direction { padding: 7cqh 6cqw 9cqh; gap: 5cqw; align-items: stretch; }
.dir-left { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dir-title { font-size: 5.6cqw; margin-bottom: 2cqh; color: var(--accent); }
.dir-brief { font-family: var(--serif); font-style: italic; font-size: 2.7cqw; line-height: 1.35; color: var(--ink-soft); margin: 0 0 auto; max-width: 34ch; }
.dir-palette { display: flex; gap: 1.4cqw; margin-top: 3cqh; }
.dir-sw { width: 4.2cqw; height: 4.2cqw; border-radius: 999px; border: 1px solid rgba(0,0,0,.08); display: block; }
.dir-collage { flex: 1.05; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 1.4cqw; }
.dir-cell { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.dir-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dir-cell.is-empty { background: repeating-linear-gradient(45deg, #F1E9DB, #F1E9DB 6px, #EDE4D3 6px, #EDE4D3 12px); }

/* element slides */
.slide--element, .slide--plan { flex-direction: column; padding: 6.5cqh 6cqw 8cqh; }
.el-head { display: flex; flex-direction: column; gap: .6cqh; margin-bottom: 1cqh; }
.el-title { font-size: 6.2cqw; }
.el-option { font-family: var(--serif); font-style: italic; font-size: 2.4cqw; color: var(--ink-soft); }
.el-stage { flex: 1; display: flex; align-items: center; justify-content: center; gap: 3cqw; min-height: 0; }
.el-stage--pair .el-line, .el-stage--pair .el-crop { flex: 0 1 34cqw; }
.el-cut { display: flex; align-items: center; justify-content: center; }
/* explicit height so viewBox-only SVGs (and rasters) size reliably in <img> */
.el-cut-img { height: 58cqh; width: auto; max-width: 56cqw; object-fit: contain; display: block; filter: drop-shadow(0 8px 18px rgba(40,32,20,.14)); }
.el-cut.is-svg .el-cut-img { filter: none; height: 60cqh; }
.el-stage--pair .el-cut-img { height: 46cqh; max-width: 30cqw; }
.el-cut.is-mirror, .el-line.is-mirror, .el-crop.is-mirror { transform: scaleX(-1); }
.el-line { width: 34cqw; height: 52cqh; color: var(--accent); opacity: .82; }
.el-line svg, .el-cut.is-fallback svg { width: 100%; height: 100%; }
.el-cut.is-fallback { color: var(--accent); width: 30cqw; height: 46cqh; opacity: .82; }
.el-crop { width: 46cqw; height: 56cqh; background-size: cover; background-position: center; border: 6px solid #fff; box-shadow: 0 8px 20px rgba(40,32,20,.16); border-radius: 2px; }

/* space plan */
.plan-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.plan-stage svg { width: 100%; height: 100%; max-height: 74cqh; }

/* per-element settings panel */
.el-settings { gap: 14px; }
.el-row { display: flex; flex-direction: column; gap: 7px; }
.el-row-head { display: flex; align-items: center; justify-content: space-between; }
.el-row-name { font-size: 13px; color: var(--ink); }
.opt-select { font-size: 12.5px; padding: 7px 30px 7px 10px; }
.opt-select:disabled { opacity: .5; cursor: not-allowed; }
.settings select.w-select-input { margin: 0; }

/* ============================================================
   5 · Inventory
   ============================================================ */
.inv-screen, .flowers-screen { display: flex; flex-direction: column; gap: 22px; }
.filter-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.filter-bar .lib-search { max-width: 320px; }
.filter-bar .w-select-input { max-width: 220px; }
.filter-bar .micro-label { margin-right: auto; }

.data-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.dt-row { display: grid; grid-template-columns: 2.2fr 1fr .7fr 1.3fr .9fr; gap: 16px; align-items: center; padding: 15px 22px; border-top: 1px solid var(--line); }
.dt-row:first-child { border-top: 0; }
.dt-head { background: var(--paper-2); }
.dt-head span { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.dt-item { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.dt-cat { font-size: 12.5px; color: var(--ink-soft); letter-spacing: .02em; }
.dt-res { font-size: 12.5px; color: var(--ink); }
.dt-res.is-free { color: var(--ink-faint); }
.cond { font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-soft); }
.cond--excellent, .cond--new { color: var(--sage); border-color: var(--sage-soft); }
.cond--fair { color: var(--danger); border-color: #D8B3A6; }
.dt-empty { padding: 40px 22px; text-align: center; font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-faint); }

/* ============================================================
   6 · Flowers
   ============================================================ */
.flower-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.flower-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; transition: border-color .3s var(--ease); }
.flower-card:hover { border-color: var(--gold); }
.flower-cut { height: 168px; border-radius: var(--radius); background: linear-gradient(160deg, #FBF8F2, #F1E9DB); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 14px; }
.flower-cut img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.flower-cut.is-empty, .flower-cut.is-type { background: repeating-linear-gradient(45deg, #FBF8F2, #FBF8F2 7px, #F3ECDD 7px, #F3ECDD 14px); }
.flower-initial { font-family: var(--serif); font-size: 56px; font-weight: 500; color: var(--gold-soft); }
.flower-name { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 8px; color: var(--ink); }
.flower-dots { display: flex; gap: 6px; margin-bottom: 10px; }
.flower-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); display: block; }
.flower-season { margin-bottom: 8px; }
.flower-note { font-family: var(--serif); font-style: italic; font-size: 14.5px; color: var(--ink-soft); margin: auto 0 0; line-height: 1.4; }

/* ============================================================
   Sidebar — portal divider + sublabel
   ============================================================ */
.nav-divider { display: block; height: 1px; background: var(--line); margin: 14px 8px 12px 4px; }
.nav-item--portal { line-height: 1.2; }
.nav-sublabel { display: block; font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }

/* ============================================================
   Dashboard — new-wedding card + inline form
   ============================================================ */
.w-card--new { border-style: dashed; border-color: var(--line-strong); background: transparent; justify-content: center; min-height: 322px; transition: border-color .3s var(--ease), background .3s var(--ease); }
.w-card--new:hover { border-color: var(--gold); background: var(--white); }
.w-card--new.is-form { cursor: default; border-style: solid; border-color: var(--line); background: var(--white); }
.wn-prompt { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 40px 20px; }
.wn-plus { font-size: 30px; line-height: 1; color: var(--gold); }
.wn-label { font-family: var(--serif); font-size: 25px; color: var(--ink); }
.wn-sub { color: var(--ink-faint); }
.wn-form { display: flex; flex-direction: column; gap: 13px; padding: 22px; }
.wn-field { display: flex; flex-direction: column; gap: 6px; }
.wn-row { display: grid; grid-template-columns: 1fr 90px; gap: 12px; }
.wn-in { font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 9px 11px; width: 100%; transition: border-color .2s var(--ease); }
.wn-in:focus { border-color: var(--gold); outline: none; }
.wn-brief { resize: vertical; line-height: 1.45; min-height: 62px; }
.wn-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.wn-create { padding: 10px 15px; }

/* ============================================================
   Billing — payment schedule + invoice deposit/balance
   ============================================================ */
.pay-sched { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 13px; }
.pay-sched > .micro-label { margin-bottom: 2px; }
.ps-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 14px; }
.ps-node { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); }
.ps-received .ps-node { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,137,75,.14); }
.ps-body { display: flex; flex-direction: column; }
.ps-title { font-size: 14px; color: var(--ink); }
.ps-upcoming .ps-title { color: var(--ink-soft); }
.ps-when { font-size: 11.5px; color: var(--ink-faint); letter-spacing: .02em; }
.ps-received .ps-when { color: var(--sage); font-weight: 600; }
.ps-amt { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.ps-upcoming .ps-amt { color: var(--ink-faint); }

.inv-deposit span, .inv-deposit .num { color: var(--ink-soft); }
.inv-balance { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.inv-balance span { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.inv-balance .num { font-weight: 500; }

/* ============================================================
   Studio Engine — button, progress, result
   ============================================================ */
/* primary action — the engine-first front door */
.primary-action { display: flex; flex-direction: column; gap: 10px; }
.primary-ghost { align-self: center; padding: 4px 2px; }
.primary-note { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-faint); text-align: center; letter-spacing: .01em; }
.primary-note::before { content: "·"; color: var(--gold); margin-right: 7px; }

.engine-mount:empty { display: none; }
.engine-mount { margin-bottom: 16px; }
.engine-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 20px 24px; display: flex; gap: 18px; align-items: flex-start; }
.engine-progress { background: linear-gradient(120deg, var(--white), var(--paper-2)); border-color: var(--line-strong); }
/* the star moment — a subtle gold-rule flourish crowns the ready card */
.engine-result { position: relative; overflow: hidden; background: linear-gradient(180deg, #FFFDF8, var(--white)); border-color: var(--line-strong); padding-top: 24px; }
.eng-flourish { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-soft) 20%, var(--gold) 50%, var(--gold-soft) 80%, transparent); }
.eng-mark { font-size: 26px; color: var(--gold); line-height: 1; flex: none; }
.engine-progress .eng-mark { animation: pulse 1.1s var(--ease) infinite; }
.eng-mark--done { color: var(--gold); }
.eng-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.eng-label { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); }
.eng-phase { font-size: 12px; color: var(--ink-faint); letter-spacing: .02em; }
.eng-steps { display: flex; gap: 8px; margin-top: 8px; }
.eng-step { width: 26px; height: 3px; border-radius: 2px; background: var(--line); transition: background .3s var(--ease); }
.eng-step.on { background: var(--gold); }
.eng-title { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 2px 0 0; color: var(--ink); }
.eng-note { font-size: 13px; color: var(--ink-soft); margin: 0; }
.eng-actions { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.eng-actions .btn { padding: 9px 16px; text-decoration: none; }
.engine-failed { background: var(--paper-2); }
.eng-fail { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ============================================================
   Users (admin)
   ============================================================ */
.users-table .dt-row { grid-template-columns: 1.3fr 1.7fr 1.1fr .9fr .7fr; }
.usr-email { font-size: 12.5px; color: var(--ink-soft); }
.usr-actions-cell { display: flex; flex-direction: column; gap: 4px; }
.usr-actions { display: flex; align-items: center; gap: 9px; }
.usr-role-label { font-size: 12.5px; color: var(--ink-soft); letter-spacing: .02em; }
.usr-msg { font-size: 11px; color: var(--danger); line-height: 1.35; }
.usr-remove { appearance: none; cursor: pointer; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink-soft); font-family: var(--sans); font-size: 11px; letter-spacing: .03em; padding: 6px 11px; transition: all .18s var(--ease); }
.usr-remove:hover { color: var(--danger); border-color: #D8B3A6; }
.usr-remove.is-armed { color: var(--white); background: var(--danger); border-color: var(--danger); }
.usr-remove:disabled { opacity: .55; cursor: default; }

/* ============================================================
   7 · Client Portal — the couple's lens
   ============================================================ */
.portal { max-width: 760px; display: flex; flex-direction: column; gap: 30px; }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.portal-top .w-select { flex-direction: row; align-items: center; gap: 10px; }
.portal-top .w-select-input { max-width: 220px; }
.portal-head { text-align: center; padding-top: 4px; }
.portal-couple { font-family: var(--serif); font-weight: 500; font-size: 52px; line-height: 1; margin: 0; color: var(--ink); letter-spacing: -.01em; }
.portal-meta { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink-soft); flex-wrap: wrap; }
.portal-dot { color: var(--gold); }
.portal-count { text-align: center; padding: 30px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(176,137,75,.035)); }
.pc-num { font-family: var(--serif); font-weight: 500; font-size: 96px; line-height: .88; color: var(--ink); letter-spacing: -.02em; }
.pc-label { margin-top: 12px; color: var(--gold); }

.portal-journey { display: flex; flex-direction: column; gap: 18px; }
.journey-track { display: flex; justify-content: space-between; position: relative; }
.journey-track::before { content: ""; position: absolute; left: 7%; right: 7%; top: 8px; height: 1px; background: var(--line-strong); z-index: 0; }
.journey-node { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; text-align: center; }
.jn-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--white); }
.journey-done .jn-dot { background: var(--gold); border-color: var(--gold); }
.journey-partial .jn-dot { background: var(--gold-soft); border-color: var(--gold-soft); }
.jn-label { font-size: 9px; letter-spacing: .08em; color: var(--ink-faint); max-width: 88px; }
.journey-done .jn-label, .journey-partial .jn-label { color: var(--ink-soft); }

.portal-feed { display: flex; flex-direction: column; gap: 16px; }
.feed-label { margin-bottom: 2px; }
.feed-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; }
.fc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fc-kind { color: var(--sage); margin-bottom: 6px; }
.fc-title { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0; color: var(--ink); }
.fc-chip { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fc-chip--approved { color: var(--gold); border-color: var(--gold); }
.chip-mark { color: var(--gold); font-size: 9px; }
.fc-desc { font-size: 14px; color: var(--ink-soft); margin: 12px 0 16px; }
.fc-actions { display: flex; align-items: center; gap: 22px; }
.fc-approve { padding: 8px 16px; }

.fc-thread { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.thread-list { display: flex; flex-direction: column; gap: 14px; }
.thread-empty { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-faint); margin: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; }
.comment-author { font-size: 12.5px; font-weight: 600; color: var(--ink); letter-spacing: .02em; }
.comment-date { font-size: 10.5px; color: var(--ink-faint); letter-spacing: .04em; }
.comment-text { font-family: var(--serif); font-size: 16px; font-style: italic; color: var(--ink-soft); margin: 0; line-height: 1.4; }
.comment-box { display: flex; align-items: center; gap: 12px; }
.comment-in { flex: 1; font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 12px; transition: border-color .2s var(--ease), background .2s var(--ease); }
.comment-in:focus { border-color: var(--gold); outline: none; background: var(--white); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1320px) {
  .screen { padding: 44px 40px 72px; }
  .mb-studio { grid-template-columns: 300px 1fr; gap: 32px; }
  .billing { gap: 32px; }
}
@media (max-width: 1300px) {
  /* at ~1280 the board area narrows — drop the rich board to 2 columns
     so tiles stay generous (~265px) and the layout reads deliberate */
  .mb-field--masonry.mb-field--rich { column-count: 2; }
  .mb-field--grid.mb-field--rich { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .tile-in, .pal-in { animation: none !important; }
  .composing-mark, .engine-progress .eng-mark { animation: none; opacity: .8; }
  * { transition-duration: .01ms !important; }
}

/* ============================================================
   Print / PDF export
   ============================================================ */
/* #print-root is kept out of the on-screen layout entirely; the print
   media query reveals it (and hides the app) only while printing, so
   the export never flashes a cloned document on screen. */
#print-root { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  body::before, .sidebar, .main { display: none !important; }
  #print-root { display: block !important; }
}

#print-root, #print-root * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* deck slides keep their own internal padding; only single docs get flattened */
#print-root .document:not(.document--deck) { border: 0; padding: 0; }
#print-root .mb-tile, #print-root .mb-palette, #print-root .mb-swatch, #print-root .inv-tr { break-inside: avoid; page-break-inside: avoid; }
#print-root .mb-tile-x { display: none; }
/* Cloned nodes restart entrance animations; print captures t=0 where `both` leaves them at opacity 0 */
#print-root * { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
/* preserve the mirrored-pair presentation despite the transform reset above */
#print-root .is-mirror { transform: scaleX(-1) !important; }
@media print { #print-root .document--moodboard { zoom: 0.78; } }

/* ---- deck export: one A4 landscape page per slide ---- */
@media print {
  #print-root.print-deck .deck { display: block; }
  #print-root.print-deck .slide {
    width: 297mm; height: 210mm; aspect-ratio: auto;
    margin: 0; border: 0 !important; border-radius: 0;
    overflow: hidden; container-type: size; display: flex;
    page-break-after: always; break-after: page; page-break-inside: avoid;
  }
  #print-root.print-deck .slide:last-child { page-break-after: auto; break-after: auto; }
}

/* ============================================================
   IA RESTRUCTURE — sidebar groups, workspace, today, overview,
   documents, search. Editorial stationery language throughout.
   ============================================================ */

/* ---- sidebar: search affordance + grouped nav ---- */
.sidebar-search {
  appearance: none; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: 9px;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 8px 11px; margin-bottom: 30px; color: var(--ink-faint);
  font-family: var(--sans); font-size: 12.5px; transition: border-color .2s var(--ease), color .2s var(--ease);
}
.sidebar-search:hover { border-color: var(--gold); color: var(--ink-soft); }
.ss-icon { font-size: 14px; color: var(--gold); line-height: 1; }
.ss-text { flex: 1; text-align: left; letter-spacing: .02em; }
.ss-kbd { font-size: 9.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 3px; padding: 2px 5px; }

.nav { gap: 0; overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 22px; }
.nav-group-label { padding: 0 8px 8px 4px; color: var(--ink-faint); }
.nav-item--muted { color: var(--ink-faint); font-size: 13px; }
.nav-item--new { color: var(--sage); font-weight: 500; }
.nav-item--new:hover { color: var(--ink); }

/* ============================================================
   Wedding workspace
   ============================================================ */
.ws-header { margin-bottom: 4px; }
.ws-back {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 0 0 14px;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint); transition: color .2s var(--ease);
}
.ws-back:hover { color: var(--gold); }
.ws-couple { font-family: var(--serif); font-weight: 500; font-size: 44px; line-height: 1; letter-spacing: -.01em; color: var(--ink); margin: 0; }
.ws-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--ink-soft); font-family: var(--serif); font-style: italic; font-size: 16px; }
.ws-dot { color: var(--gold); }
.ws-phase {
  font-family: var(--sans); font-style: normal; font-size: 9.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sage); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 3px 10px;
}
.ws-days { font-style: normal; color: var(--gold); margin-left: auto; }

.ws-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 26px 0 34px; }
.ws-tab {
  appearance: none; background: none; border: 0; cursor: pointer; position: relative;
  font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: .02em;
  color: var(--ink-soft); padding: 10px 14px 14px; transition: color .2s var(--ease);
}
.ws-tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: center; transition: transform .25s var(--ease); }
.ws-tab:hover { color: var(--ink); }
.ws-tab.is-active { color: var(--ink); }
.ws-tab.is-active::after { transform: scaleX(1); }
.ws-body { min-width: 0; }
/* inside the workspace the per-tab screen-head is a quiet section label, not a hero */
.ws-body .screen-head { margin-bottom: 26px; }
.ws-body .screen-title { font-size: 30px; }
.ws-body .screen-sub { font-size: 16px; }

/* ============================================================
   Today
   ============================================================ */
.today-block { margin-top: 44px; }
.today-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.today-h2 { font-family: var(--serif); font-weight: 500; font-size: 27px; color: var(--ink); margin: 0 0 18px; }
.today-block-head .today-h2 { margin: 0; }
.today-count { color: var(--ink-faint); }

.attn-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.attn-row {
  appearance: none; background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer;
  display: flex; align-items: center; gap: 16px; padding: 16px 22px; text-align: left; width: 100%;
  transition: background .2s var(--ease);
}
.attn-row:first-child { border-top: 0; }
.attn-row:hover { background: var(--paper-2); }
.attn-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--gold); }
.attn--comment .attn-dot { background: var(--sage); }
.attn--money .attn-dot { background: var(--gold); }
.attn--design .attn-dot { background: var(--gold-soft); }
.attn--task .attn-dot { background: var(--ink-faint); }
.attn-body { flex: 1; min-width: 0; }
.attn-label { font-size: 14.5px; color: var(--ink); }
.attn-detail { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-go { color: var(--gold); font-size: 18px; flex: none; transition: transform .2s var(--ease); }
.attn-row:hover .attn-go { transform: translateX(3px); }

.week-list { display: flex; flex-direction: column; }
.week-row {
  appearance: none; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
  display: flex; align-items: center; gap: 13px; padding: 12px 2px; text-align: left; width: 100%;
  transition: padding-left .2s var(--ease);
}
.week-row:hover { padding-left: 8px; }
.week-mark { color: var(--gold); font-size: 12px; flex: none; }
.week-text { flex: 1; font-size: 14px; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-couple { color: var(--ink-faint); flex: none; }

/* ============================================================
   Overview tab
   ============================================================ */
.ov-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: stretch; }
.ov-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; }
.ov-summary { display: flex; align-items: center; gap: 32px; }
.ov-count { text-align: center; flex: none; }
.ov-count-num { font-family: var(--serif); font-weight: 500; font-size: 72px; line-height: .86; color: var(--ink); letter-spacing: -.02em; }
.ov-count-label { margin-top: 8px; color: var(--gold); }
.ov-summary-meta { flex: 1; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.ov-progress { width: 100%; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.ov-progress-fill { display: block; height: 100%; background: var(--gold); }
.ov-progress-label { color: var(--ink-faint); }
.ov-links { display: flex; flex-direction: column; gap: 12px; }
.ov-links .btn { padding: 11px 16px; }
.ov-balance { margin-top: 4px; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--gold); }
.ov-balance--clear { color: var(--sage); }

.ov-block { margin-top: 40px; }
.ov-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ov-h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--ink); margin: 0 0 14px; }
.ov-block-head .ov-h3 { margin: 0; }

.activity-list { display: flex; flex-direction: column; }
.activity-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity-mark { color: var(--gold-soft); font-size: 11px; flex: none; }
.activity--deck .activity-mark { color: var(--gold); }
.activity--comment .activity-mark { color: var(--sage); }
.activity--task .activity-mark { color: var(--ink-faint); }
.activity--document .activity-mark { color: var(--gold-soft); }
.activity-text { flex: 1; font-size: 14px; color: var(--ink); min-width: 0; }
.activity-time { color: var(--ink-faint); flex: none; }

/* ============================================================
   Documents tab
   ============================================================ */
.docs { display: flex; flex-direction: column; gap: 22px; }
.docs-dropzone { padding: 30px 20px; }
.docs-empty { text-align: center; padding: 40px 24px 20px; }
.docs-empty .empty-line { font-size: 20px; margin-bottom: 6px; }
.docs-empty-sub { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-faint); margin: 0; max-width: 44ch; margin-inline: auto; }

.docs-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.doc-row { display: flex; align-items: center; gap: 16px; padding: 15px 22px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .2s var(--ease); }
.doc-row:first-child { border-top: 0; }
.doc-row:hover { background: var(--paper-2); }
.doc-icon { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--gold); font-size: 14px; }
.doc-body { flex: 1; min-width: 0; }
.doc-name { font-size: 14.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { color: var(--ink-faint); margin-top: 2px; }
.doc-open { color: var(--gold); flex: none; text-decoration: none; }
.doc-x { appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-faint); font-size: 12px; flex: none; opacity: 0; transition: opacity .18s var(--ease), color .18s var(--ease); }
.doc-row:hover .doc-x { opacity: 1; }
.doc-x:hover { color: var(--danger); }

/* ============================================================
   Client-view note bar (portal, framed inside workspace)
   ============================================================ */
.portal-note { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.pn-eye { color: var(--gold); flex: none; }
.pn-text { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-soft); }

/* ============================================================
   Empty states — italic serif one-liners
   ============================================================ */
.empty-state { padding: 30px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-line { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-faint); margin: 0; }
.empty-action { margin: 0; }

/* ============================================================
   Global search overlay
   ============================================================ */
.search-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(35,33,28,.34); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; animation: fadeIn .18s var(--ease); }
.search-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.search-panel { width: min(560px, 92vw); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(35,33,28,.24); overflow: hidden; animation: fadeUp .22s var(--ease) both; }
.search-input { width: 100%; font-family: var(--serif); font-size: 22px; color: var(--ink); background: var(--white); border: 0; border-bottom: 1px solid var(--line); padding: 20px 24px; }
.search-input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--gold); }
.search-input::placeholder { color: var(--ink-faint); font-style: italic; }
.search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-hint, .search-empty { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-faint); text-align: center; padding: 24px; margin: 0; }
.search-row { appearance: none; background: none; border: 0; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 16px; text-align: left; border-radius: var(--radius); transition: background .12s var(--ease); }
.search-row.is-active, .search-row:hover { background: var(--white); }
.search-kind { flex: none; width: 74px; color: var(--gold); }
.search-title { flex: none; font-size: 15px; color: var(--ink); }
.search-sub { flex: 1; font-size: 12.5px; color: var(--ink-faint); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- responsive: workspace + overview + today ---- */
@media (max-width: 1100px) {
  .ov-grid { grid-template-columns: 1fr; }
  .ws-days { margin-left: 0; }
}
