/* Global Solutions onboarding.
   Brand taken from globalsolutionsfamilyoffice.com: dark green, copper, sand
   hairlines; Cormorant Infant headings over Montserrat; square edges and
   letterspaced uppercase labels. */

:root {
  --green: #223c39;
  --green-deep: #182c2a;
  --copper: #9e553d;
  --copper-deep: #84442f;
  --sand: #cabfac;
  --sand-soft: #e6dfd3;
  --paper: #f8f6f1;
  --surface: #ffffff;
  --muted: #5d706d;
  --faint: #879491;
  --ok: #2f6b4f;
  --ok-soft: #e4efe8;
  --warn: #8a5a16;
  --warn-soft: #f7edda;
  --danger: #8e2f26;
  --danger-soft: #f7e6e3;
  --serif: "Cormorant Infant", "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  /* Fills in the brand green (sidebar, solid buttons, active tabs): --green itself is also the text colour. */
  --brand: #223c39; --brand-deep: #182c2a; --brand-fill: #223c39; --side-bg: #223c39;
  --paper-2: #f1ede5; --hover: #fbfaf7; --green-soft: #eef2f1;
  --ok-line: #b9d6c6; --ok-ink: #1f4a36; --warn-line: #e6d2a8; --danger-line: #dcb9b4;
  --info: #1f5fa8; --info-soft: #e8f0fa; --info-line: #b9cfe8;
  --copper-soft: #f3e2d6; --copper-line: #e8cdb9; --copper-wash: #fbf6f1;
  --violet: #6a4a9c; --violet-soft: #efe9f7; --violet-line: #ddd0ee;
  --teal: #1f6f69; --teal-soft: #e3f1f0; --teal-line: #c4e0dd;
  --shadow-ink: 22, 29, 34;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--green);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--green);
  margin: 0;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.1rem); letter-spacing: 0.5px; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: 0.3px; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--copper); text-underline-offset: 3px; }
a:hover { color: var(--copper-deep); }
strong { font-weight: 600; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.kicker {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--copper);
  margin: 0 0 10px;
}

hr, .rule { border: 0; border-top: 1px solid var(--sand); margin: 0; }

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

/* ---------- staff shell: left sidebar ---------- */

.app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side-bg); color: #fff; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 22px 16px 16px; gap: 22px;
}
.side-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 6px; }
.side-brand .mark { width: 34px; height: 34px; }
.side-brand .word { height: 11px; width: auto; filter: brightness(0) invert(1); opacity: .92; }
.side-new { width: 100%; }
.side-new svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }
.side-nav { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.82); text-decoration: none;
  font: 500 12px var(--sans); letter-spacing: 2px; text-transform: uppercase; padding: 11px 10px;
  border-left: 2px solid transparent;
}
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-nav a.current { color: #fff; border-left-color: var(--copper); background: rgba(255,255,255,.08); }
.side-nav svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.badge { margin-left: auto; background: var(--copper); color: #fff; font-size: 10.5px; letter-spacing: 0; padding: 2px 7px; min-width: 20px; text-align: center; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 6px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; }
.side-user .who { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex: 1; min-width: 0; padding: 6px; }
.side-user .who:hover, .side-user .who.current { background: rgba(255,255,255,.08); }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--copper); color: #fff; font-family: var(--serif); font-size: 17px; }
.who-text { display: grid; min-width: 0; }
.who-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.6); }
.side-user form { margin: 0; }
.side-user button { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 8px; display: grid; }
.side-user button:hover { color: #fff; }
.side-user button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topline { display: flex; align-items: center; gap: 16px; padding: 12px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--sand-soft); }
.shell { width: 100%; max-width: 1280px; margin: 0 auto; padding: clamp(24px, 4vw, 44px) var(--gutter) 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }

.testmode {
  background: var(--warn-soft); color: var(--warn); text-align: center;
  font-size: 12.5px; padding: 7px var(--gutter); border-bottom: 1px solid var(--warn-line);
}

/* search + suggestions */
.search { position: relative; flex: 1 1 320px; max-width: 560px; margin: 0; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-linecap: round; pointer-events: none; }
.search input[type=search] {
  width: 100%; font: 400 14px var(--sans); border-radius: 0; padding: 10px 12px 10px 36px; appearance: none; -webkit-appearance: none;
  background: var(--paper); border: 1px solid var(--sand-soft); color: var(--green);
}
.search input[type=search]:focus { background: var(--surface); border-color: var(--green); box-shadow: none; outline: none; }
.search input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--sand); z-index: 40; box-shadow: 0 10px 30px -12px rgba(22,29,34,.35); }
.suggest a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 14px; text-decoration: none; color: var(--green); border-bottom: 1px solid var(--sand-soft); }
.suggest a:last-child { border-bottom: 0; }
.suggest a.on, .suggest a:hover { background: var(--paper); }
.suggest .s-name { font-family: var(--serif); font-size: 1.15rem; line-height: 1.1; }
.suggest .s-stage { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); align-self: center; white-space: nowrap; }
.suggest .s-hit { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .s-all { display: block; padding: 10px 14px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--copper); text-decoration: none; background: var(--paper); }
.suggest .s-none { padding: 12px 14px; color: var(--muted); font-size: 13.5px; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px var(--gutter); }
  .side-brand { margin-right: auto; }
  .side-brand .word { display: none; }
  .side-new { width: auto; order: 3; }
  .side-nav { order: 4; width: 100%; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .side-nav a { border-left: 0; border-bottom: 2px solid transparent; padding: 9px 10px; white-space: nowrap; }
  .side-nav a.current { border-bottom-color: var(--copper); background: none; }
  .badge { margin-left: 4px; }
  .side-user { margin: 0; border: 0; padding: 0; order: 2; }
  .who-text { display: none; }
  .search { max-width: none; }
}

/* ---------- buttons ---------- */

.btn {
  margin: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 12px var(--sans); letter-spacing: 2.5px; text-transform: uppercase; text-decoration: none;
  padding: 13px 22px; border: 1px solid var(--copper); background: var(--copper); color: #fff;
  cursor: pointer; border-radius: 0; transition: background .15s, color .15s, border-color .15s;
  line-height: 1.2;
}
.btn:hover { background: var(--copper-deep); border-color: var(--copper-deep); color: #fff; }
.btn.green { background: var(--brand); border-color: var(--brand); }
.btn.green:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn.ghost { background: transparent; color: var(--green); border-color: var(--sand); }
.btn.ghost:hover { border-color: var(--green); background: transparent; color: var(--green); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--copper); padding-left: 0; padding-right: 0; }
.btn.quiet:hover { color: var(--copper-deep); background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 9px 14px; font-size: 11px; letter-spacing: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */

label, .label {
  display: block; font-size: 11.5px; font-weight: 500; letter-spacing: 2px;
  text-transform: uppercase; color: var(--green); margin-bottom: 7px;
}
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; letter-spacing: 0; text-transform: none; font-weight: 400; }
.optional { color: var(--faint); letter-spacing: 1px; font-weight: 400; }

input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: 400 15px var(--sans); color: var(--green);
  background: var(--surface); border: 1px solid var(--sand); border-radius: 0;
  padding: 12px 14px; appearance: none; -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%), linear-gradient(135deg, var(--green) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 38px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
input::placeholder, textarea::placeholder { color: var(--faint); }

.field { margin-bottom: 22px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 22px; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; cursor: pointer;
  font-size: 15px; letter-spacing: 0; text-transform: none; font-weight: 400; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--green); flex: none; }

fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { padding: 0; }

.form-section { padding: 30px 0; border-top: 1px solid var(--sand); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section > h2 { margin-bottom: 6px; }
.form-section > .muted { margin-bottom: 22px; }

/* ---------- cards, banners, pills ---------- */

.card { background: var(--surface); border: 1px solid var(--sand-soft); padding: clamp(20px, 3vw, 30px); }
.card + .card { margin-top: 22px; }
.card > h2 { margin-bottom: 16px; }
.card.accent { border-left: 3px solid var(--copper); }
.card.narrow { max-width: 760px; }

.banner { padding: 13px 18px; margin-bottom: 24px; border-left: 3px solid var(--ok); background: var(--ok-soft); color: var(--ok-ink); }
.banner.error { border-left-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.banner.warn { border-left-color: var(--warn); background: var(--warn-soft); color: var(--warn); }

.pill {
  display: inline-block; font-size: 10.5px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 9px; border: 1px solid var(--sand); color: var(--muted); white-space: nowrap; line-height: 1.4;
}
.pill.ok { border-color: var(--ok-line); color: var(--ok); background: var(--ok-soft); }
.pill.warn { border-color: var(--warn-line); color: var(--warn); background: var(--warn-soft); }
.pill.danger { border-color: var(--danger-line); color: var(--danger); background: var(--danger-soft); }
.pill.solid { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- dashboard ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--sand-soft); background: var(--surface); margin-bottom: 26px; }
.stat { padding: 20px 22px; border-right: 1px solid var(--sand-soft); }
.stat:last-child { border-right: 0; }
.stat .n { font-family: var(--serif); font-size: 2.7rem; line-height: 1; font-weight: 500; }
.stat .l { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.stat.alert .n { color: var(--copper); }

.rail { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: thin; }
.rail a {
  flex: none; display: flex; align-items: baseline; gap: 9px; text-decoration: none; color: var(--green);
  border: 1px solid var(--sand-soft); background: var(--surface); padding: 9px 13px; font-size: 13px;
}
.rail a:hover { border-color: var(--green); }
.rail a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rail a .c { font-family: var(--serif); font-size: 1.25rem; line-height: 1; }
.rail a.empty { color: var(--faint); }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--sand); margin: 22px 0 0; flex-wrap: wrap; }
.tabs a {
  text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 2px;
  text-transform: uppercase; padding: 12px 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.on { color: var(--green); border-bottom-color: var(--copper); }
.tabs .push { margin-left: auto; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--sand-soft); border-top: 0; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th {
  text-align: left; font-size: 10.5px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--sand-soft); white-space: nowrap;
}
td { padding: 16px 18px; border-bottom: 1px solid var(--sand-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
td .name { font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; color: var(--green); text-decoration: none; }
td .name:hover { color: var(--copper); }
td .sub { font-size: 13px; color: var(--muted); }
.flag { color: var(--danger); font-size: 13px; display: block; }
.flag::before { content: "● "; font-size: 9px; vertical-align: 1px; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h2 { margin-bottom: 10px; }

progress {
  appearance: none; -webkit-appearance: none; width: 100%; height: 4px; border: 0; background: var(--sand-soft);
  display: block; border-radius: 0; overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--sand-soft); }
progress::-webkit-progress-value { background: var(--brand-fill); }
progress::-moz-progress-bar { background: var(--brand-fill); }
progress.done::-webkit-progress-value { background: var(--ok); }
progress.done::-moz-progress-bar { background: var(--ok); }
.docs-cell { min-width: 120px; }
.docs-cell progress { margin-top: 7px; }

/* ---------- prospect file ---------- */

.file-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .file-grid { grid-template-columns: minmax(0, 1fr); } }

.file-head { margin-bottom: 28px; }
.file-head .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

.stepper { display: flex; gap: 3px; margin-top: 22px; }
.stepper span { flex: 1; height: 4px; background: var(--sand-soft); }
.stepper span.past { background: var(--brand-fill); }
.stepper span.now { background: var(--copper); }

.next { display: grid; gap: 14px; }
.next h2 { font-size: 1.6rem; }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 240px; }

input[type=file] { font: 400 14px var(--sans); color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
  font: 500 11px var(--sans); letter-spacing: 2px; text-transform: uppercase; color: var(--green);
  background: transparent; border: 1px solid var(--sand); padding: 9px 14px; margin-right: 12px; cursor: pointer;
}

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 14px; justify-content: space-between; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--sand-soft); }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li:first-child { padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { overflow-wrap: anywhere; }
.tick { color: var(--ok); font-weight: 600; }
.wait { color: var(--faint); }

dl.facts { margin: 0; display: grid; gap: 14px; }
dl.facts dt { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Notes: compact tiles (date, who, two lines); a long note opens in place. */
.note-tile { border: 1px solid var(--sand-soft); background: var(--surface); margin-bottom: 10px; }
.note-tile > summary, .note-tile .nt-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 16px; gap: 4px 16px; align-items: start; padding: 14px 16px; }
.note-tile > summary { cursor: pointer; list-style: none; color: inherit; font-size: inherit; }
.note-tile > summary::-webkit-details-marker { display: none; }
.note-tile > summary::before, .note-tile[open] > summary::before { content: none; }
.note-tile[open] > summary { margin-bottom: 0; }
.note-tile > summary:hover, .note-tile[open] { border-color: var(--sand); }
.note-tile > summary:hover { background: var(--paper); }
.note-tile > summary:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }
.note-tile .nt-when { font-family: var(--serif); font-size: 1.08rem; color: var(--green); line-height: 1.3; }
.note-tile .nt-main { display: block; min-width: 0; }
.note-tile .nt-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.note-tile .nt-who { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.note-tile .nt-who .ic { width: 13px; height: 13px; color: var(--copper); flex: none; }
.note-tile .nt-sum { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 5px; overflow-wrap: anywhere; }
.note-tile.is-short .nt-sum { display: block; white-space: pre-wrap; }
.note-tile[open] .nt-sum.auto { display: none; }
.note-tile .nt-chev { color: var(--muted); margin-top: 3px; transition: transform .15s; }
.note-tile .nt-chev .ic { width: 14px; height: 14px; }
.note-tile[open] .nt-chev { transform: rotate(90deg); }
.note-tile .nt-full { padding: 2px 16px 14px 136px; }
.note-tile .nt-full .body { white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid var(--sand-soft); padding-top: 12px; }
.note-tile .nt-foot { display: flex; gap: 14px; align-items: center; font-size: 12.5px; margin-top: 12px; }
.note-tile.is-short > .nt-foot { padding: 0 16px 12px 136px; margin-top: -4px; }
@media (max-width: 640px) {
  .note-tile > summary, .note-tile .nt-row { grid-template-columns: minmax(0, 1fr) 16px; }
  .note-tile .nt-when { grid-column: 1 / -1; }
  .note-tile .nt-full, .note-tile.is-short > .nt-foot { padding-left: 16px; }
}

.timeline { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.timeline li { padding: 0 0 14px 18px; border-left: 1px solid var(--sand); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; background: var(--copper); }
.timeline li:last-child { padding-bottom: 0; }
.timeline .when { color: var(--faint); font-size: 12px; display: block; }

details > summary { cursor: pointer; color: var(--copper); font-size: 13.5px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+ "; }
details[open] > summary::before { content: "− "; }
details[open] > summary { margin-bottom: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.chips .check { margin: 0; }

/* ---------- centred pages: sign-in, portal ---------- */

.centre { min-height: 100vh; display: flex; flex-direction: column; }
.centre-head { padding: 34px var(--gutter) 0; text-align: center; display: grid; justify-items: center; gap: 14px; }
.centre-head .mark { width: 52px; height: 52px; }
.centre-head .word { height: 15px; width: auto; max-width: 80%; }
.centre-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(32px, 7vw, 72px) var(--gutter) 60px; }
.centre-main.slim { max-width: 520px; }
.centre-foot { text-align: center; font-size: 12.5px; color: var(--faint); padding: 26px var(--gutter) 34px; border-top: 1px solid var(--sand-soft); }
.centre-foot a { color: var(--muted); }

.hero { text-align: center; margin-bottom: 40px; }
.hero h1 { margin-bottom: 16px; }
.hero p { color: var(--muted); max-width: 54ch; margin-left: auto; margin-right: auto; font-size: 16px; }
.hero p.for-client { display: inline-block; font-size: 13px; color: var(--green); background: var(--copper-wash); border: 1px solid var(--copper-line); padding: 6px 14px; margin: 0 auto 18px; }

.lock { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.lock svg { width: 13px; height: 13px; }

/* questionnaire */
.q { padding: 24px 0; border-top: 1px solid var(--sand); display: flex; gap: 18px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.q:first-of-type { border-top: 0; }
.q .text { flex: 1 1 300px; font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; }
.yn { display: flex; gap: 0; flex: none; }
.yn label { margin: 0; cursor: pointer; }
.yn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yn span {
  display: block; min-width: 84px; text-align: center; padding: 12px 18px; border: 1px solid var(--sand);
  font-size: 12px; font-weight: 500; letter-spacing: 2.5px; text-transform: uppercase; color: var(--green); background: var(--surface);
}
.yn label + label span { border-left: 0; }
.yn input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.yn input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }

/* checklist */
.progress-block { margin-bottom: 30px; }
.progress-block .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; }
.progress-block .count { font-family: var(--serif); font-size: 1.5rem; }
.progress-block progress { height: 6px; }

.doc { background: var(--surface); border: 1px solid var(--sand-soft); padding: clamp(18px, 3vw, 26px); margin-bottom: 16px; }
.doc.received { border-left: 3px solid var(--ok); }
.doc.told { border-left: 3px solid var(--sand); }
.doc-choice { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--sand-soft); display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.doc-choice .linkish { font-size: 14px; }
.progress-block .told { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.doc-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.doc-head h3 { font-size: 1.45rem; }
.doc .help { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.doc .files { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--sand-soft); }
.doc .files li { display: flex; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--sand-soft); font-size: 14px; }
.doc .files .fname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.doc .files .fsize { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.doc .files li.err { color: var(--danger); }
.doc .files progress { width: 90px; flex: none; align-self: center; }
.doc-actions { margin-top: 18px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.doc-actions input[type=file].enhanced { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.doc details { margin-top: 14px; }
.doc details input { max-width: 340px; }

.drop.over { outline: 2px dashed var(--copper); outline-offset: 4px; }

.finish { text-align: center; padding: 34px 0 0; margin-top: 34px; border-top: 1px solid var(--sand); }
.finish p { color: var(--muted); max-width: 50ch; margin: 0 auto 20px; }

.contact { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--sand); font-size: 14px; color: var(--muted); text-align: center; }

@media (max-width: 640px) {
  .stat { border-right: 0; border-bottom: 1px solid var(--sand-soft); }
  .nav { gap: 18px; margin-left: 0; width: 100%; padding-bottom: 14px; }
  .yn { width: 100%; }
  .yn label { flex: 1; }
  .doc-head { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.gap { margin-top: 20px; }
.card details + details { margin-top: 14px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: var(--sand-soft); padding: 1px 5px; }

[hidden] { display: none !important; }
.pick[aria-disabled=true] { opacity: .5; pointer-events: none; }

/* ---------- search results page ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-search { display: flex; gap: 10px; flex: 1 1 420px; max-width: 620px; }
.page-search input[type=search] { width: 100%; font: 400 15px var(--sans); background: var(--surface); border: 1px solid var(--sand); color: var(--green); padding: 12px 14px; border-radius: 0; appearance: none; -webkit-appearance: none; }

/* ---------- toolbar ---------- */
.stat .d { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.toolbar { display: flex; gap: 14px; align-items: center; padding-bottom: 8px; flex-wrap: wrap; }
.inline-filter { margin: 0; }
.inline-filter select { padding: 8px 34px 8px 12px; font-size: 13px; width: auto; min-width: 170px; }
.seg { display: inline-flex; border: 1px solid var(--sand); }
.tabs .seg a { padding: 8px 14px; margin: 0; border: 0; letter-spacing: 2px; }
.tabs .seg a.on { background: var(--brand); color: #fff; }
.table-wrap.boxed { border-top: 1px solid var(--sand-soft); margin-top: 14px; }
.table-wrap.plain { border: 0; }
.table-wrap.plain table { min-width: 560px; }
.table-wrap.plain th:first-child, .table-wrap.plain td:first-child { padding-left: 0; }
.numcell { font-variant-numeric: tabular-nums; }
.flag-inline { color: var(--danger); font-weight: 600; }

/* ---------- board ---------- */
.board-help { margin: 16px 0 12px; }
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 14px; align-items: stretch; min-height: 340px; scrollbar-width: thin; }
.col { flex: 0 0 236px; display: flex; flex-direction: column; background: var(--paper-2); border: 1px solid var(--sand-soft); }
.col-head { padding: 12px 12px 10px; display: grid; gap: 3px; border-bottom: 1px solid var(--sand-soft); }
.col-head .phase { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--copper); font-weight: 500; }
.col-title { font-family: var(--serif); font-size: 1.12rem; line-height: 1.15; }
.col-title .num { color: var(--faint); }
.col-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.col-meta .count { font-weight: 600; }
.col-meta .auto { font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase; border: 1px solid var(--sand); padding: 1px 5px; color: var(--faint); }
.col-body { padding: 10px; display: grid; gap: 10px; align-content: start; flex: 1; min-height: 60px; }

/* An empty stage takes a sliver of room, so a quiet pipeline fits on one screen. */
.col.is-empty { flex-basis: 54px; }
.col.is-empty .col-head { border-bottom: 0; padding: 12px 6px; justify-items: center; }
.col.is-empty .phase, .col.is-empty .col-meta .auto { display: none; }
.col.is-empty .col-title { writing-mode: vertical-rl; font-size: .98rem; color: var(--muted); white-space: nowrap; }
.col.is-empty .col-meta { order: -1; }
.board.is-dragging .col.is-manual.is-empty { flex-basis: 236px; }
.board.is-dragging .col.is-manual.is-empty .col-title { writing-mode: horizontal-tb; white-space: normal; }
.board.is-dragging .col:not(.is-manual) { opacity: .45; }
.col.over { outline: 2px dashed var(--copper); outline-offset: -2px; background: var(--copper-wash); }

.kcard { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--sand-soft); border-left: 3px solid var(--brand-fill);
  padding: 12px 12px 12px 13px; text-decoration: none; color: var(--green); }
.kcard:hover { border-color: var(--green); color: var(--green); }
.kcard[draggable=true] { cursor: grab; }
.kcard.dragging { opacity: .4; }
.kcard.flagged { border-left-color: var(--danger); }
.kname { font-family: var(--serif); font-size: 1.22rem; line-height: 1.15; overflow-wrap: anywhere; }
.kmeta { font-size: 12.5px; color: var(--muted); }
.kdocs { font-size: 12.5px; color: var(--muted); display: grid; gap: 5px; margin-top: 2px; }
.kflag { font-size: 12.5px; color: var(--danger); margin-top: 2px; }
.board-status { min-height: 22px; font-size: 13.5px; color: var(--ok); margin: 4px 0 0; }
.board-status.error { color: var(--danger); }

/* ---------- tasks ---------- */
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; gap: 13px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--sand-soft); flex-wrap: wrap; }
.tasks li:first-child { padding-top: 0; }
.tasks li:last-child { border-bottom: 0; padding-bottom: 0; }
.tasks .grow { flex: 1 1 200px; min-width: 0; }
.tasks .title { overflow-wrap: anywhere; }
.tasks .pill { margin-right: 4px; }
.tick-form { margin: 2px 0 0; }
.tickbox { width: 22px; height: 22px; border: 1px solid var(--green); background: var(--surface); color: #fff; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0; display: grid; place-items: center; border-radius: 0; }
.tickbox:hover { background: var(--ok-soft); }
.tasks li.is-done .tickbox { background: var(--ok); border-color: var(--ok); }
.tasks li.is-done .title { color: var(--faint); text-decoration: line-through; }
.tasks li.is-overdue .title { color: var(--danger); }
.task-more { flex: 0 0 auto; }
.task-more[open] { flex: 1 0 100%; padding: 12px 0 0 35px; }
.task-more > summary::before, .task-more[open] > summary::before { content: ""; }

/* ---------- insights ---------- */
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; margin: 22px 0; }
.two-up .card + .card { margin-top: 0; }
.bignum { font-family: var(--serif); font-size: 1.7rem; line-height: 1; white-space: nowrap; }
.bignum small { font-family: var(--sans); font-size: 12px; color: var(--muted); }

@media (max-width: 760px) {
  .tabs .push { margin-left: 0; width: 100%; }
}

/* ---------- team: inline row editing ---------- */
.row-edit > summary { display: inline-flex; }
.row-edit > summary::before { content: none; }
.row-edit[open] > summary { margin-bottom: 12px; }
.row-edit-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; min-width: 460px; }
.row-edit-form .field { margin-bottom: 14px; }
.row-edit-form .btn-row { grid-column: 1 / -1; }
tr.is-inactive td { color: var(--faint); }
.row-edit-form .field.wide { grid-column: 1 / -1; }
li.is-inactive .title { color: var(--faint); }

/* ---------- dialogs ---------- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 32px)); width: 100%; }
dialog.modal::backdrop { background: rgba(22, 44, 42, .55); }
.modal-form { background: var(--surface); padding: clamp(22px, 4vw, 32px); border-top: 3px solid var(--copper); max-height: calc(100vh - 48px); overflow: auto; }
.modal-form .card-head { margin-bottom: 20px; }
.modal-form .close { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-form .close:hover { color: var(--green); }
.tpl-list li { padding: 8px 0; }

/* ---------- tasks: status, priority, "+" ---------- */
.with-plus { display: flex; gap: 8px; }
.with-plus select { flex: 1; }
.btn.plus { padding: 0 16px; font-size: 20px; line-height: 1; letter-spacing: 0; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; }
.pill.prio-urgent { border-color: var(--danger-line); color: var(--danger); background: var(--danger-soft); }
.pill.prio-high { border-color: var(--warn-line); color: var(--warn); background: var(--warn-soft); }
.pill.prio-normal { color: var(--green); }
.pill.prio-low { color: var(--faint); }
.inline-status { margin: 0; flex: 0 0 auto; }
.inline-status select { width: auto; padding: 7px 34px 7px 10px; font-size: 12.5px; }
.task-more[open] .row-edit-form { min-width: 0; }

/* ---------- team ---------- */
.divisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.divisions .card + .card { margin-top: 0; }
.head-form { margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--sand-soft); }
.head-form select { padding-top: 9px; padding-bottom: 9px; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--sand-soft); }
.people li:last-child { border-bottom: 0; padding-bottom: 0; }
.people li:first-child { padding-top: 0; }
.people .title { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.people .grow { min-width: 0; }

/* ---------- icons ---------- */
.ic { width: 1em; height: 1em; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
dl.facts dt .ic { color: var(--copper); margin-right: 3px; }
.btn .ic { width: 14px; height: 14px; }
.pill .ic { width: 12px; height: 12px; margin-right: 4px; vertical-align: -0.1em; }
.stat .l .ic { color: var(--copper); margin-right: 4px; }
.flag .ic, .kflag .ic, .banner.warn .ic { margin-right: 3px; }
.tick .ic { stroke-width: 2.2; }
.wait .ic { color: var(--faint); }

/* ---------- task status / priority colour ---------- */
.pill.tagged { display: inline-flex; align-items: center; gap: 0; }
.pr-urgent { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.pr-high { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.pr-normal { color: var(--green); border-color: var(--sand); background: var(--green-soft); }
.pr-low { color: var(--faint); }
.st-none { color: var(--faint); }
.st-todo { color: var(--muted); }
.st-doing { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.st-waiting { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.st-blocked { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.st-done { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }

.inline-status { margin: 0; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--sand); background: var(--surface); padding: 0 0 0 10px; flex: none; }
.inline-status.st-doing { border-color: var(--info-line); background: var(--info-soft); }
.inline-status.st-waiting { border-color: var(--warn-line); background: var(--warn-soft); }
.inline-status.st-blocked { border-color: var(--danger-line); background: var(--danger-soft); }
.inline-status.st-done { border-color: var(--ok-line); background: var(--ok-soft); }
.inline-status .st-ic { width: 14px; height: 14px; }
.inline-status select { width: auto; border: 0; background-color: transparent; padding: 8px 30px 8px 4px; font-size: 12.5px; font-weight: 500; color: inherit; letter-spacing: .3px; }
.inline-status select:focus { box-shadow: none; }
.st-ic-only { color: var(--faint); padding-top: 4px; }
.tasks li.is-done .title { color: var(--faint); text-decoration: line-through; }
.tasks .task-more > summary { font-size: 12.5px; }

/* ---------- team: clickable person cards ---------- */
.person { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 10px 8px; margin: 0 -8px; cursor: pointer; font: inherit; color: inherit; border-radius: 0; }
.person:hover { background: var(--paper); }
.person:hover .chev { color: var(--copper); }
.person .grow { display: grid; gap: 2px; min-width: 0; }
.person .line { display: block; }
.person .chev { color: var(--faint); display: grid; }
.people li { padding: 2px 0; }
.push-right { margin-left: auto; }

/* ---------- notes ---------- */
.note-edit { margin-top: 6px; }
.note-edit > summary { font-size: 12.5px; }
.note-edit textarea { margin-top: 8px; }

/* ---------- transcript viewer ---------- */
.transcript { max-width: 900px; }
.turns { list-style: none; margin: 0; padding: 0; }
.turns li { display: grid; grid-template-columns: 52px 160px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--sand-soft); align-items: baseline; }
.turns li:last-child { border-bottom: 0; }
.turns .stamp { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--faint); }
.turns .who { font-weight: 600; color: var(--green); overflow-wrap: anywhere; }
.turns .said { line-height: 1.6; overflow-wrap: anywhere; }
a.pill { text-decoration: none; }
a.pill:hover { border-color: var(--green); }
@media (max-width: 640px) { .turns li { grid-template-columns: 52px minmax(0, 1fr); } .turns .said { grid-column: 1 / -1; } }

/* ---------- files tab ---------- */
.subtabs { display: flex; gap: 18px; margin-top: 14px; }
.subtabs a { text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; padding: 6px 0; border-bottom: 2px solid transparent; }
.subtabs a.on, .subtabs a:hover { color: var(--green); border-bottom-color: var(--copper); }
.crumbs { font-size: 13.5px; margin-bottom: 10px; color: var(--muted); }
.crumbs a { color: var(--green); text-decoration: none; } .crumbs a:hover { color: var(--copper); }
.crumbs .sep { color: var(--faint); margin: 0 2px; }
.fitem { text-decoration: none; color: var(--green); font-weight: 500; overflow-wrap: anywhere; }
.fitem:hover { color: var(--copper); }
.fitem .ic { margin-right: 6px; color: var(--muted); } .fitem .ic.cop { color: var(--copper); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn.quiet { padding: 6px 8px; }
td.actions .row-edit-form { min-width: 320px; text-align: left; margin-top: 10px; }
.row-edit > summary.btn.quiet { display: inline-flex; }

/* ---------- client file: header, tabs, previews ---------- */
.file-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.file-head .meta a { text-decoration: none; }
.file-head .meta a:hover { color: var(--copper); }
.subtabs { display: flex; gap: 4px; margin-top: 22px; border-bottom: 1px solid var(--sand); overflow-x: auto; scrollbar-width: none; }
.subtabs a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs a.on { color: var(--green); border-bottom-color: var(--copper); }
.subtabs a:hover { color: var(--green); }
.subtabs .count { font-size: 10.5px; letter-spacing: 0; background: var(--sand-soft); color: var(--green); padding: 1px 7px; }
.subtabs a.on .count { background: var(--copper); color: #fff; }
.list.compact li { padding: 9px 0; }
.card-head a.small { text-decoration: none; color: var(--copper); }
.docs-top { margin-bottom: 22px; }
.linkish { background: none; border: 0; padding: 0; color: var(--copper); cursor: pointer; font: inherit; font-size: 12.5px; }
dialog.modal.wide { max-width: min(1100px, calc(100vw - 32px)); }
.modal-form.preview { padding: 16px 20px 20px; }
.preview-body { height: min(78vh, 900px); background: var(--paper); border: 1px solid var(--sand-soft); display: grid; place-items: center; overflow: auto; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-body img { max-width: 100%; max-height: 100%; }

/* ---------- task management page ---------- */
.filters { margin-top: 18px; }
.filters .tabs { margin-top: 0; }
.filters .seg a { display: inline-flex; align-items: center; gap: 6px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; align-items: center; }
.filter-row select, .filter-row input[type=search] { width: auto; min-width: 150px; padding: 8px 32px 8px 11px; font-size: 13px; background-color: var(--surface); }
.filter-row input[type=search] { padding-right: 11px; flex: 1 1 180px; }
.tasks-board .col { flex-basis: 260px; }
.tasks-board .col.is-empty { flex-basis: 200px; }
.tasks-board .col.is-empty .col-title { writing-mode: horizontal-tb; white-space: normal; color: var(--muted); }
.tasks-board .col.is-empty .col-head { justify-items: start; }
.tasks-board .col-head .ic { margin-right: 4px; }
.tasks-board .col-head.st-doing .col-title { color: var(--info); } .tasks-board .col-head.st-waiting .col-title { color: var(--warn); }
.tasks-board .col-head.st-blocked .col-title { color: var(--danger); } .tasks-board .col-head.st-done .col-title { color: var(--ok); }
.tcard .kname { font-family: var(--sans); font-size: 14px; font-weight: 500; line-height: 1.35; }
.tcard .kmeta a { color: inherit; text-decoration: none; } .tcard .kmeta a:hover { color: var(--copper); }
.tcard-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tcard-foot .btn.quiet { margin-left: auto; padding: 2px 4px; }
.tcard.is-done { opacity: .6; } .tcard.is-done .kname { text-decoration: line-through; }
.tasks-table td .title { font-weight: 500; }
.tasks-table tr.is-done td { color: var(--faint); } .tasks-table tr.is-done .title { text-decoration: line-through; }
.client-groups .card + .card { margin-top: 22px; }
.client-groups .card-head h2 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.client-groups .card-head h2 a { text-decoration: none; color: inherit; } .client-groups .card-head h2 a:hover { color: var(--copper); }
.client-groups .progress-block { margin-bottom: 16px; }

/* ---------- documents tab: Drive-style file manager ----------
   toolbar on top · folder tree (left) · folders + files (middle) · checklist panel (right, toggled) */
.drive-retry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drive-retry .btn { margin-left: auto; }
.drive { background: var(--surface); border: 1px solid var(--sand-soft); margin-top: 4px; }
.drive-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--sand-soft); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.drive-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drive-actions form { margin: 0; }
.drive-actions .btn .ic { width: 15px; height: 15px; }
.checklist-toggle .pill { padding: 1px 7px; margin-left: 2px; letter-spacing: .5px; }
.drive.show-checklist .checklist-toggle { border-color: var(--green); background: var(--paper); }
.seg { display: inline-flex; border: 1px solid var(--sand); }
.seg button { background: transparent; border: 0; padding: 7px 10px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.seg button + button { border-left: 1px solid var(--sand); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.seg button .ic { width: 16px; height: 16px; }

.drive-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 560px; }
.drive.show-checklist .drive-body { grid-template-columns: 250px minmax(0, 1fr) 280px; }

/* left: folder tree */
.drive-side { border-right: 1px solid var(--sand-soft); padding: 10px 8px 16px 0; }
.folder-tree { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; }
.folder-tree ul { list-style: none; margin: 0; padding: 0; }
.folder-tree .fnode > ul { display: none; padding-left: 16px; }
.folder-tree .fnode.is-open > ul { display: block; }
.frow { display: flex; align-items: center; padding-left: 6px; border-radius: 0 18px 18px 0; }
.frow:hover { background: var(--paper-2); }
.frow.on { background: var(--copper-soft); }
.frow.on a { color: var(--copper-deep, var(--copper)); font-weight: 600; }
.frow a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 2px; text-decoration: none; color: var(--green); font-size: 13.5px; }
.frow a > .ic { color: var(--muted); width: 16px; height: 16px; }
.frow.on a > .ic { color: var(--copper); }
.frow.root { margin-bottom: 2px; }
.frow .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .fcount { font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.ftoggle { width: 22px; height: 22px; flex: none; background: none; border: 0; padding: 0; display: grid; place-items: center; color: var(--muted); cursor: pointer; border-radius: 50%; }
.ftoggle:hover { background: var(--sand-soft); color: var(--green); }
.ftoggle .ic { width: 12px; height: 12px; transition: transform .15s; }
.fnode.is-open > .frow .ftoggle .ic { transform: rotate(90deg); }
.ftoggle.spacer { cursor: default; } .ftoggle.spacer:hover { background: none; }

/* middle: breadcrumb, folder chips, file list */
.drive-main { min-width: 0; padding: 14px 20px 28px; position: relative; }
.drive-main.is-loading { opacity: .5; }
.drive-main.over { outline: 2px dashed var(--copper); outline-offset: -8px; background: var(--paper); }
.drive-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 0 0 6px -8px; font-family: var(--serif); font-size: 1.35rem; line-height: 1.3; }
.drive-crumbs a { color: var(--muted); text-decoration: none; padding: 2px 8px; border-radius: 18px; }
.drive-crumbs a:hover { background: var(--paper-2); color: var(--green); }
.drive-crumbs a:last-child { color: var(--green); }
.drive-crumbs .sep { display: inline-grid; color: var(--faint); } .drive-crumbs .sep .ic { width: 13px; height: 13px; }
.drive-h { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; }

.folder-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.fchip { display: flex; align-items: center; background: var(--paper); border: 1px solid var(--sand-soft); border-radius: 10px; transition: background .12s, border-color .12s; }
.fchip:hover { background: var(--paper-2); border-color: var(--sand); }
.fchip a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 4px 12px 14px; text-decoration: none; color: var(--green); font-size: 13.5px; font-weight: 500; }
.fchip a .ic { color: var(--copper); width: 18px; height: 18px; fill: var(--copper-soft); }
.fchip .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip .dicon { margin-right: 6px; }

.drive-files { border-top: 1px solid var(--sand-soft); }
.drive-main { container-type: inline-size; }
.df-head, .df-row { display: grid; grid-template-columns: minmax(180px, 1fr) 130px 160px 70px 72px; align-items: center; gap: 12px; padding: 0 8px; }
.df-head { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--sand-soft); }
.df-row { border-bottom: 1px solid var(--sand-soft); font-size: 13.5px; color: var(--muted); min-height: 48px; }
.df-row:hover { background: var(--hover); }
.df-name { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 0; text-decoration: none; color: var(--green); font-weight: 500; }
.df-name:hover .fname { color: var(--copper); }
.df-name .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-by, .df-when { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-size { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.df-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity .12s; }
.df-row:hover .df-actions, .df-row:focus-within .df-actions { opacity: 1; }
@media (hover: none) { .df-actions { opacity: 1; } }
.dicon { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 50%; cursor: pointer; text-decoration: none; font-size: 20px; line-height: 1; flex: none; }
.dicon:hover { background: var(--sand-soft); color: var(--green); }
.dicon .ic { width: 16px; height: 16px; }
.ftype { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 6px; background: var(--sand-soft); color: var(--muted); }
.ftype .ic { width: 15px; height: 15px; }
.ftype.pdf { background: var(--danger-soft); color: var(--danger); }
.ftype.image { background: var(--info-soft); color: var(--info); }
.ftype.sheet { background: var(--ok-soft); color: var(--ok); }
.ftype.doc { background: var(--info-soft); color: var(--info); }
.ftype.slides { background: var(--warn-soft); color: var(--warn); }

/* grid view: files become cards */
.drive[data-view="grid"] .drive-files { border: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.drive[data-view="grid"] .df-head { display: none; }
.drive[data-view="grid"] .df-row { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: 1px solid var(--sand-soft); border-radius: 10px; background: var(--paper); overflow: hidden; position: relative; }
.drive[data-view="grid"] .df-name { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
.drive[data-view="grid"] .df-name .ftype { width: auto; height: 110px; border-radius: 0; }
.drive[data-view="grid"] .df-name .ftype .ic { width: 38px; height: 38px; }
.drive[data-view="grid"] .df-name .fname { padding: 10px 12px 2px; }
.drive[data-view="grid"] .df-by { display: none; }
.drive[data-view="grid"] .df-when { font-size: 12px; padding: 0 12px 10px; }
.drive[data-view="grid"] .df-size { display: none; }
.drive[data-view="grid"] .df-actions { position: absolute; top: 6px; right: 6px; background: var(--surface); border-radius: 18px; }

.drive-empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.drive-empty .big .ic { width: 56px; height: 56px; color: var(--sand); stroke-width: 1; }
.drive-empty h2 { font-size: 1.4rem; margin: 10px 0 6px; }

/* right: checklist panel (like Drive's details pane) */
.drive-details { display: none; border-left: 1px solid var(--sand-soft); padding: 14px 16px 20px; background: var(--paper); }
.drive.show-checklist .drive-details { display: block; }
.dd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dd-head h3 { font-size: 1.2rem; margin: 0; }
.dd-progress { margin-bottom: 12px; }
.dd-progress .bar { height: 6px; background: var(--sand-soft); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.dd-progress .bar span { display: block; height: 100%; background: var(--ok); width: 0; }
.dd-list { list-style: none; margin: 0; padding: 0; }
.dd-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--sand-soft); font-size: 13px; }
.dd-list li:last-child { border-bottom: 0; }
.dd-list .grow { flex: 1; min-width: 0; }
.dd-list .mark { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--sand); color: #fff; margin-top: 1px; background: var(--surface); }
.dd-list .mark .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.dd-list li.is-done .mark { background: var(--ok); border-color: var(--ok); }
.dd-list li.is-told .mark { color: var(--muted); border-style: dashed; }
.dd-list .cl-said { font-size: 12px; color: var(--copper); margin-top: 2px; }
.dd-list .cl-name { font-weight: 500; color: var(--green); overflow-wrap: anywhere; }
.dd-list li.is-done .label { color: var(--muted); font-weight: 400; }
.dd-list a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); text-decoration: none; margin-top: 3px; }
.dd-list a .ic { width: 12px; height: 12px; color: var(--copper); }
.dd-list a:hover { color: var(--copper); }

@container (max-width: 720px) { .df-head, .df-row { grid-template-columns: minmax(160px, 1fr) 150px 70px 72px; } .df-by { display: none; } }
@container (max-width: 520px) { .df-head, .df-row { grid-template-columns: minmax(0, 1fr) 64px 72px; } .df-when { display: none; } }
@media (max-width: 1100px) {
  .drive.show-checklist .drive-body { grid-template-columns: 240px minmax(0, 1fr); }
  .drive.show-checklist .drive-details { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--sand-soft); }
}
@media (max-width: 800px) {
  .drive-body, .drive.show-checklist .drive-body { grid-template-columns: minmax(0, 1fr); }
  .drive-side { display: none; }
  .drive-main { padding: 12px 14px 22px; }
}
.dd-progress .bar span.w0 { width: 0%; }
.dd-progress .bar span.w5 { width: 5%; }
.dd-progress .bar span.w10 { width: 10%; }
.dd-progress .bar span.w15 { width: 15%; }
.dd-progress .bar span.w20 { width: 20%; }
.dd-progress .bar span.w25 { width: 25%; }
.dd-progress .bar span.w30 { width: 30%; }
.dd-progress .bar span.w35 { width: 35%; }
.dd-progress .bar span.w40 { width: 40%; }
.dd-progress .bar span.w45 { width: 45%; }
.dd-progress .bar span.w50 { width: 50%; }
.dd-progress .bar span.w55 { width: 55%; }
.dd-progress .bar span.w60 { width: 60%; }
.dd-progress .bar span.w65 { width: 65%; }
.dd-progress .bar span.w70 { width: 70%; }
.dd-progress .bar span.w75 { width: 75%; }
.dd-progress .bar span.w80 { width: 80%; }
.dd-progress .bar span.w85 { width: 85%; }
.dd-progress .bar span.w90 { width: 90%; }
.dd-progress .bar span.w95 { width: 95%; }
.dd-progress .bar span.w100 { width: 100%; }
.fitem { display: inline-flex; align-items: center; }


/* ---------- send-for-signature popup ---------- */
.sign-order { margin: 4px 0 18px; padding-left: 22px; display: grid; gap: 8px; font-size: 14px; }
.sign-order li::marker { color: var(--copper); font-weight: 600; }
.sign-order .muted { margin-left: 6px; font-size: 13px; }
.sign-order .pill { margin-left: 6px; }

/* ---------- due date + time, meeting start/end ---------- */
.due-pair { display: flex; gap: 8px; }
.due-pair input { flex: 1.25; min-width: 0; }
.due-pair select { flex: 1; min-width: 0; }
.when-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto minmax(0, 1.4fr); gap: 10px; align-items: end; }
.when-row .field { margin-bottom: 0; }
.when-dash { padding-bottom: 12px; color: var(--muted); }
.when-tz { margin: 6px 0 16px; }
@media (max-width: 600px) { .when-row { grid-template-columns: 1fr 1fr; } .when-row .field:first-child { grid-column: 1 / -1; } .when-dash { display: none; } }

/* ---------- team: division cards (click to open the division page) ---------- */
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.team-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--sand-soft); padding: 22px 24px; text-decoration: none; color: var(--green); transition: border-color .15s, box-shadow .15s, transform .15s; }
.team-card:hover { border-color: var(--sand); box-shadow: 0 10px 28px -18px rgba(22,29,34,.45); transform: translateY(-1px); color: var(--green); }
.team-card:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.tc-top { display: flex; align-items: center; gap: 12px; }
.tc-top h2 { margin: 0; font-size: 1.5rem; flex: 1; min-width: 0; }
.tc-mark { width: 38px; height: 38px; border-radius: 50%; background: var(--copper-soft); color: var(--copper); display: grid; place-items: center; flex: none; }
.tc-mark .ic { width: 18px; height: 18px; }
.tc-go { color: var(--faint); } .team-card:hover .tc-go { color: var(--copper); }
.tc-desc { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.tc-stats { display: flex; gap: 22px; margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--sand-soft); flex-wrap: wrap; }
.tc-stats dt { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.tc-stats dd { margin: 2px 0 0; font-weight: 500; }
.people li form { margin: 0; flex: none; }

/* ---------- New task popup ---------- */
dialog.modal.newtask-modal { max-width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.newtask-modal .modal-form { max-height: none; overflow: visible; }
.newtask-modal .modal-form { padding: 0; display: flex; flex-direction: column; }
.newtask-modal .picker-list { max-height: 240px; }
.newtask-modal .tm-head { padding: 24px clamp(20px, 4vw, 30px) 6px; }
.newtask-modal .tm-head .card-head { margin-bottom: 2px; }
.newtask-modal .tm-lede { margin: 0; color: var(--muted); font-size: 13.5px; }
.newtask-modal .tm-body { padding: 14px clamp(20px, 4vw, 30px) 6px; display: grid; gap: 4px; }
.tm-section { border-top: 1px solid var(--sand-soft); padding-top: 16px; margin-top: 6px; }
.tm-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.tm-section-title { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.tm-section-title .ic { color: var(--copper); width: 14px; height: 14px; }
.tm-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.tm-grid .due-pair { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; }
.tm-grid .due-pair > * { min-width: 0; width: 100%; }
.newtask-modal .tm-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px clamp(20px, 4vw, 30px);
  background: var(--paper); border-top: 1px solid var(--sand-soft); margin-top: 8px; z-index: 1; }
.newtask-modal .tm-foot .btn { min-width: 120px; }
@media (max-width: 620px) {
  .tm-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tm-grid > .tm-due { grid-column: 1 / -1; }
  .newtask-modal .tm-foot .btn { flex: 1; min-width: 0; }
}

/* ---------- Document requests (doc_requests) ---------- */
.dr-strip { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px 10px; margin: 0 0 14px; }
.dr-strip-title { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.dr-strip-title .ic { color: var(--copper); }
.dr-chip { display: grid; gap: 1px; padding: 7px 12px; border: 1px solid var(--sand); background: var(--surface); text-decoration: none; color: var(--green); font-size: 13px; min-width: 0; max-width: 280px; }
.dr-chip strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-chip span { font-size: 11.5px; color: var(--muted); }
.dr-chip:hover { border-color: var(--green); }
.dr-chip.is-done { border-color: var(--ok-line); background: var(--ok-soft); }
.dr-chip.is-draft span { color: var(--copper); }
.dr-list { list-style: none; margin: 0; padding: 0; }
.dr-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--sand-soft); }
.dr-list li:first-child { border-top: 0; }
.dr-mark { width: 22px; height: 22px; flex: none; border: 1.5px solid var(--sand); border-radius: 50%; display: grid; place-items: center; margin-top: 2px; color: var(--surface); }
.dr-list li.is-in .dr-mark { background: var(--brand); border-color: var(--brand); }
.dr-mark .ic { width: 12px; height: 12px; }
.dr-label { font-weight: 500; }
.dr-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; font-size: 12.5px; }
.dr-folder { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); background: var(--paper); border: 1px solid var(--sand-soft); padding: 2px 8px; }
.dr-folder .ic, .dr-file .ic { width: 12px; height: 12px; }
.dr-file { display: inline-flex; align-items: center; gap: 5px; color: var(--green); }
.dr-list .grow { flex: 1; min-width: 0; }
.dr-actions { display: flex; gap: 4px; flex: none; }
.dr-actions form { margin: 0; }
.dr-files td { vertical-align: middle; }
.dr-files .ic { width: 13px; height: 13px; vertical-align: -0.12em; }
.dr-suggestions { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; }
.dr-sug { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(150px, 240px); gap: 10px 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--sand-soft); background: var(--surface); }
.dr-sug:has(input:checked) { border-color: var(--ok-line); background: var(--ok-soft); }
.dr-sug input[type=checkbox] { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; }
.dr-sug-text { display: grid; gap: 2px; cursor: pointer; }
.dr-why { font-size: 12px; color: var(--copper); }
.dr-sug-folder { font-size: 13px; padding: 6px 8px; }
@media (max-width: 620px) { .dr-sug { grid-template-columns: auto minmax(0, 1fr); } .dr-sug-folder { grid-column: 2; } }
.doc.dump { border-style: dashed; }

/* ---------- Meetings to link (past_meetings) ---------- */
.pm-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; }
.pm-card { margin: 0; }
.pm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 18px; flex-wrap: wrap; }
.pm-head h2 { margin: 0 0 4px; font-size: 1.45rem; }
.pm-head h2 a { color: var(--green); text-decoration: none; }
.pm-head h2 a:hover { color: var(--copper); }
.pm-head .ic { width: 13px; height: 13px; vertical-align: -0.12em; }
.pm-overview { margin: 12px 0 4px; line-height: 1.6; max-width: 80ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pm-working .ic { color: var(--copper); }
.pm-paste { margin: -4px 0 14px; }
.pm-paste summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 4px 0; }
.pm-paste textarea { margin-top: 8px; }
.pm-find { position: relative; }
.pm-results { border: 1px solid var(--sand); background: var(--surface); margin-top: 4px; max-height: 260px; overflow-y: auto; }
.pm-result { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--sand-soft); padding: 10px 12px; cursor: pointer; color: var(--green); font: inherit; }
.pm-result:hover, .pm-result:focus-visible { background: var(--copper-soft); outline: none; }
.pm-result .s-stage { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); white-space: nowrap; align-self: center; }
.pm-none { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 13.5px; }
.pm-chosen { margin: 8px 0 0; padding: 8px 12px; background: var(--ok-soft); border: 1px solid var(--ok-line); font-size: 14px; }

/* ---------- meeting page: AI summary + follow-up email ---------- */
.meeting-summary .card-head form { margin: 0; }
.ms-overview { font-size: 15.5px; line-height: 1.65; max-width: 75ch; margin: 0 0 22px; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px 32px; }
.ms-block h3 { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.ms-block h3 .ic { color: var(--copper); }
.ms-block ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.5; }
.ms-block ul.ms-actions { list-style: none; padding-left: 0; }
.ms-actions .pill { margin-right: 4px; }
.ms-actions li { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--sand-soft); }
.ms-actions li:last-child { border-bottom: 0; }
.ms-action-text { flex: 1 1 260px; min-width: 0; }
.ms-actions .btn, .ms-action-done { flex: none; white-space: nowrap; }
.ms-block-actions { grid-column: 1 / -1; }
.ms-block-actions .hint { margin-top: 8px; }
.meeting-summary > .hint { margin-top: 22px; }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
.email-to { margin: -6px 0 16px; }
.ai-ask { display: flex; gap: 8px; margin: 4px 0 10px; }
.ai-ask input { flex: 1; min-width: 0; }
.ai-status { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.ai-status.bad { color: var(--danger); }
.refine-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--sand); background: var(--surface); color: var(--green); border-radius: 16px; padding: 6px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--copper); color: var(--copper); }
.chip:disabled { opacity: .5; cursor: default; }
.chip .ic { width: 13px; height: 13px; color: var(--copper); }

/* ---------- in-app confirmation (replaces the browser's confirm/alert) ---------- */
dialog.modal.confirm-modal { width: min(440px, calc(100vw - 32px)); }
.confirm-msg { font-size: 15.5px; line-height: 1.55; margin: 4px 0 22px; color: var(--green); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { filter: brightness(.92); }

/* ---------- History: day-grouped timeline, newest first ---------- */
.history .card-head .small { display: inline-flex; align-items: center; gap: 6px; }
.hist-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.hist-day + .hist-day { margin-top: 22px; }
.hist-date { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--sand-soft); }
.hist-list { list-style: none; margin: 0; padding: 0; position: relative; }
.hist-list::before { content: ""; position: absolute; left: 15px; top: 14px; bottom: 14px; width: 1px; background: var(--sand-soft); }
.hist-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; position: relative; }
.hist-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--sand-soft); color: var(--muted); position: relative; }
.hist-ic .ic { width: 15px; height: 15px; }
.hist-label { font-size: 14.5px; color: var(--green); line-height: 1.4; }
.hist-detail { color: var(--muted); }
.hist-meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.hist-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tone-ok .hist-ic, .tone-ok .ml-ic { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.tone-warn .hist-ic, .tone-warn .ml-ic { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.tone-bad .hist-ic, .tone-bad .ml-ic { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.tone-mail .hist-ic, .tone-mail .ml-ic { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.tone-doc .hist-ic, .tone-doc .ml-ic { background: var(--copper-soft); border-color: var(--copper-line); color: var(--copper); }
.tone-task .hist-ic, .tone-task .ml-ic { background: var(--violet-soft); border-color: var(--violet-line); color: var(--violet); }
.tone-meet .hist-ic, .tone-meet .ml-ic { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal); }
.tone-stage .hist-ic, .tone-stage .ml-ic { background: var(--brand); border-color: var(--brand); color: #fff; }
.hist-empty { margin-top: 12px; }

/* ---------- per-meeting log on the Meetings tab ---------- */
.meeting-log { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--sand-soft); display: grid; gap: 6px; font-size: 13px; color: var(--green); }
.meeting-log li { display: flex; align-items: center; gap: 8px; }
.ml-ic { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--sand-soft); background: var(--paper); color: var(--muted); flex: none; }
.ml-ic .ic { width: 12px; height: 12px; }
.sent-email { margin-top: 22px; }
.sent-email h2 { display: flex; align-items: center; gap: 10px; }
.sent-subject { font-weight: 600; margin: 0 0 10px; }
.sent-body { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; color: var(--green); background: var(--paper); border: 1px solid var(--sand-soft); padding: 16px 18px; }
.list .meeting-log li { display: flex; justify-content: flex-start; align-items: center; gap: 8px; padding: 0; border: 0; }
.list .meeting-log li .muted { font-size: 12.5px; }

/* ---------- prospects before the analysis phase (Prospects page, interests card) ---------- */
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.two-col-text { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two-col-text .kicker { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.lead-intro { max-width: 860px; margin: -6px 0 18px; }
.leads .lead-interest { max-width: 320px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
@media (max-width: 700px) { .two-col-text { grid-template-columns: 1fr; gap: 14px; } }

/* ---------- custom fields on the New prospect / Edit form ---------- */
.custom-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 20px; margin-top: 6px; }
.cf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cf-remove { background: none; border: 0; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.cf-remove:hover { color: var(--danger); }

/* ---------- task popup: edit fields | Activity ---------- */
dialog.modal.task-modal { max-width: min(1040px, calc(100vw - 32px)); width: 100%; }
.task-modal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.task-modal-grid > form { padding-right: 28px; }
/* The Activity side is the GS Agent conversation look (agent.css, .ga-panel); it fills this box and scrolls inside it. */
.task-activity { position: relative; overflow: hidden; border-top: 3px solid var(--copper); border-left: 1px solid var(--sand-soft); background: var(--paper-2); min-height: min(600px, calc(100vh - 48px)); }
.task-activity > p { padding: 26px; margin: 0; }
@media (max-width: 820px) {
  .task-modal-grid { grid-template-columns: minmax(0, 1fr); max-height: calc(100vh - 32px); overflow-y: auto; }
  .task-modal-grid > form { padding-right: clamp(22px, 4vw, 32px); max-height: none; overflow: visible; }
  .task-activity { border-left: 0; border-top: 1px solid var(--sand-soft); height: min(560px, 78vh); min-height: 0; }
}

/* ---------- notification bell (top right) ---------- */
.topline { position: relative; }
.bell-wrap { margin-left: auto; position: relative; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--sand-soft); background: var(--surface); color: var(--green); display: grid; place-items: center; cursor: pointer; }
.bell:hover, .bell[aria-expanded="true"] { border-color: var(--sand); background: var(--paper); }
.bell .ic { width: 19px; height: 19px; }
.bell-count { position: absolute; top: -4px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--copper); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--surface); }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--sand); box-shadow: 0 18px 40px -18px rgba(22,29,34,.45); z-index: 50; }
.inbox-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--sand-soft); font-size: 14px; }
.inbox-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.inbox-list li + li { border-top: 1px solid var(--sand-soft); }
.inbox-list li { position: relative; }
.inbox-list li a { padding-right: 40px; }
.inbox-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--faint);
  font-size: 19px; line-height: 1; cursor: pointer; opacity: .55; transition: opacity .12s, background .12s, color .12s; }
.inbox-list li:hover .inbox-x, .inbox-x:focus-visible { opacity: 1; }
.inbox-x:hover { background: var(--paper); color: var(--green); }
@media (hover: none) { .inbox-x { opacity: 1; } }
.inbox-acts { display: flex; gap: 14px; }
.inbox-list a { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 11px 16px; text-decoration: none; color: var(--green); }
.inbox-list a:hover { background: var(--paper); }
.inbox-list li.unread a { background: var(--copper-wash); }
.inbox-list li.unread .inbox-title { font-weight: 600; }
.inbox-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--paper); border: 1px solid var(--sand-soft); display: grid; place-items: center; color: var(--copper); }
.inbox-ic .ic { width: 14px; height: 14px; }
.inbox-text { display: grid; gap: 2px; min-width: 0; }
.inbox-title { font-size: 13.5px; }
.inbox-body { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.inbox-when { font-size: 11.5px; color: var(--faint); }
.inbox-empty { padding: 24px 16px; text-align: center; margin: 0; }

/* ---- Investment onboarding: the Investments page, the client page's tab, the portal list ---- */
.inv-table { min-width: 1080px; }
.inv-table th.inv-col { padding: 10px 2px; width: 40px; text-align: center; vertical-align: bottom; }
.inv-table th.inv-col span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; letter-spacing: 1.5px; }
.inv-table td.inv-col { padding: 12px 2px; text-align: center; vertical-align: middle; }
.inv-table th.inv-name, .inv-table td.inv-name { min-width: 190px; }
.inv-table td.inv-name { vertical-align: middle; padding-left: 34px; }
.inv-table td.inv-name a { text-decoration: none; color: var(--green); font-weight: 500; }
.inv-table td.inv-name a:hover { color: var(--copper); }
.inv-table tr.inv-client td { background: var(--paper); padding: 12px 18px; border-top: 1px solid var(--sand); }
.inv-table tr.inv-client .sub { margin-left: 12px; }
.inv-table tr.inv-client .sub .ic, .inv-flagline .ic, .inv-attn .ic { width: 13px; height: 13px; vertical-align: -0.12em; }
.inv-table tr.inv-row.is-flagged td.inv-name { box-shadow: inset 3px 0 0 var(--copper); }
.inv-flagline { display: block; margin-top: 4px; font-size: 13px; color: var(--warn); }
.inv-attn { font-size: 13px; min-width: 240px; vertical-align: middle; }
.inv-attn div + div { margin-top: 4px; }
.inv-attn .bad { color: var(--danger); font-weight: 500; }
.inv-attn .late { color: var(--warn); }
.inv-attn .held { color: var(--muted); }
.inv-section { margin: 40px 0 6px; }

.inv-step, .inv-act { display: inline-flex; margin: 0; }
.inv-tick { width: 24px; height: 24px; padding: 0; display: inline-grid; place-items: center; border: 1.5px solid var(--sand); background: var(--surface); color: #fff; cursor: pointer; }
.inv-tick:hover { border-color: var(--green); }
.inv-tick.is-next { border-color: var(--copper); box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 12px var(--copper-soft); }
.inv-tick.is-done { background: var(--ok); border-color: var(--ok); }
.inv-tick.is-done:hover { background: var(--brand); border-color: var(--brand); }
.inv-tick .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.inv-tick[disabled] { opacity: .5; cursor: progress; }

.inv-acct { border-top: 1px solid var(--sand-soft); padding: 24px 0 6px; }
.inv-acct:first-of-type { border-top: 0; padding-top: 4px; }
.inv-acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.inv-acct-head h3 { font-size: 1.6rem; margin: 0; }
.inv-acct-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.inv-acct.is-complete .inv-track { opacity: .75; }
.inv-flag { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.inv-acct .banner { margin-bottom: 14px; }
.inv-track { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 2px 18px; }
.inv-track li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--sand-soft); font-size: 13.5px; }
.inv-track li.is-done .inv-step-label { color: var(--muted); }
.inv-track li.is-next .inv-step-label { font-weight: 600; }
.inv-step-when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.inv-sub { margin-top: 18px; }
.inv-sub h4 { font-family: var(--sans); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.inv-sub .list li { align-items: center; gap: 10px; }
.inv-committed { margin: 0 0 10px; padding: 10px 14px; border-left: 3px solid var(--copper); background: var(--copper-soft); color: var(--copper-deep); font-size: 13.5px; }
.inv-committed .ic { width: 13px; height: 13px; vertical-align: -0.12em; }

.inv-group { font-family: var(--sans); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 24px 0 4px; }
.inv-docs { list-style: none; margin: 0; padding: 0; }
.inv-docs li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--sand-soft); }
.inv-docs .grow { flex: 1; min-width: 0; }
.inv-docs .cl-name { font-weight: 500; overflow-wrap: anywhere; }
.inv-docs li.is-done .cl-name { color: var(--muted); font-weight: 400; }
.inv-docs .mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--sand); color: #fff; margin-top: 2px; background: var(--surface); }
.inv-docs .mark .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.inv-docs li.is-done .mark { background: var(--ok); border-color: var(--ok); }
.inv-docs li.is-told .mark { color: var(--muted); border-style: dashed; }
.inv-doc-meta { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.inv-doc-meta .ok { color: var(--ok); }
.inv-doc-meta .said { color: var(--copper); }
.inv-doc-meta a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.inv-doc-meta a:hover { color: var(--copper); }
.inv-doc-meta a .ic { width: 12px; height: 12px; color: var(--copper); }
.inv-doc-actions { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; justify-content: flex-end; max-width: 440px; }
.inv-doc-actions .btn.small { padding: 6px 12px; }
.inv-doc-actions .btn.quiet { padding: 4px; }
.inv-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 22px; }
.inv-funds li { align-items: center; }

.portal-info { margin-bottom: 30px; }
.portal-group { font-size: 1.5rem; margin: 34px 0 14px; }
.portal-next a { color: inherit; font-weight: 600; }

@media (max-width: 640px) {
  .inv-sub .list li { flex-wrap: wrap; }
  .inv-sub .list .grow { flex-basis: 100%; }
  .inv-docs li { flex-wrap: wrap; }
  .inv-doc-actions { max-width: none; justify-content: flex-start; padding-left: 32px; }
}

/* ---- Insurance (insure.py) ---------------------------------------------------- */
.ins-section { margin: 34px 0 12px; }
.ins-section:first-of-type { margin-top: 26px; }
.ins-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px 34px; }
.ins-person h3 { font-size: 1.45rem; margin: 0 0 6px; }
.ins-person-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--sand-soft); }
.ins-label { flex: 0 0 160px; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.ins-label .ic { width: 13px; height: 13px; color: var(--copper); }

.ins-pol { scroll-margin-top: 20px; }
.ins-pol-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.ins-pol-head h3 { font-size: 1.6rem; margin: 0; }
.ins-pol-meta { display: flex; gap: 6px 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.ins-pol-meta .ic { width: 13px; height: 13px; vertical-align: -0.12em; }
.ins-pol .banner { margin-bottom: 12px; }
.ins-pol-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px 34px; }
.ins-pol.has-lending .ins-pol-body { grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr); }

/* The insurance track: a dot per stage on a hairline. */
.ins-track { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); }
.ins-track li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; min-width: 0; }
.ins-track li::before { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 1.5px; background: var(--sand); z-index: 0; }
.ins-track li:first-child::before { display: none; }
.ins-track li.is-done::before, .ins-track li.is-skipped::before, .ins-track li.is-na::before { background: var(--ok); }
.ins-track .dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--sand); background: var(--surface); color: #fff; }
.ins-track .dot .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.ins-track .is-done .dot { background: var(--ok); border-color: var(--ok); }
.ins-track .is-now .dot { border-color: var(--copper); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 11px var(--copper); }
.ins-track .is-skipped .dot, .ins-track .is-na .dot { border-style: dashed; background: var(--paper); }
.ins-track .is-bad .dot { background: var(--danger); border-color: var(--danger); }
.ins-track .lab { font-size: 10.5px; color: var(--muted); line-height: 1.25; word-break: keep-all; white-space: nowrap; }
.ins-track .is-missing .dot { border-color: var(--danger); border-style: dashed; background: var(--danger-soft); }
.ins-track .is-missing .lab { color: var(--danger); }
.ins-track .is-now .lab { color: var(--copper-deep); font-weight: 600; }
.ins-track .is-skipped .lab, .ins-track .is-na .lab { color: var(--faint); text-decoration: line-through; }
.ins-track .when { font-size: 10.5px; color: var(--faint); }

.ins-next { border-left: 3px solid var(--copper); background: var(--copper-wash); padding: 14px 18px; }
.ins-next p { margin: 0 0 10px; }
.ins-next p:last-child { margin-bottom: 0; }
.ins-next .muted .ic { width: 13px; height: 13px; vertical-align: -0.12em; }
.ins-undo { margin-top: 10px !important; font-size: 13px; }
.ins-reqs { margin-top: 18px; }
.ins-history { margin-bottom: 14px; }
.ins-history summary { cursor: pointer; font-weight: 500; padding: 4px 0 8px; color: var(--muted); }
.ins-section-note { margin: -6px 0 14px; }
.ins-reqs summary { cursor: pointer; font-weight: 500; padding: 6px 0; }
.ins-reqs h4, .ins-lend h4 { font-family: var(--sans); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 16px 0 4px; font-weight: 600; }

.ins-lend { border-left: 1px solid var(--sand-soft); padding-left: 24px; }
.ins-lend h4 { margin-top: 0; display: flex; align-items: center; gap: 6px; }
.ins-lend h4 .ic { width: 14px; height: 14px; color: var(--copper); }
.ins-lend-track { grid-template-columns: 1fr; gap: 0; }
.ins-lend-decide { grid-template-columns: 1fr !important; display: flex !important; gap: 8px; padding-left: 34px !important; }
.ins-lend.is-empty { border-left: 0; padding-left: 0; }
.inv-tick.is-static { cursor: default; }
.inv-tick.is-bad { background: var(--danger); border-color: var(--danger); }

.ins-cell { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid var(--sand); color: #fff; background: var(--surface); }
.ins-cell .ic { width: 11px; height: 11px; stroke-width: 2.6; }
.ins-cell.is-done { background: var(--ok); border-color: var(--ok); }
.ins-cell.is-now { border-color: var(--copper); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 10px var(--copper); }
.ins-cell.is-skipped, .ins-cell.is-na { border-style: dashed; background: var(--paper); }
.ins-cell.is-bad { background: var(--danger); border-color: var(--danger); }
.ins-cell.is-missing { border-color: var(--danger); border-style: dashed; background: var(--danger-soft); }
.ins-table .inv-attn .where { font-weight: 500; margin-bottom: 3px; }
.ins-closed .list li { align-items: center; }

.ins-q { max-width: 680px; margin: 0 auto; }
.ins-q textarea { min-height: 76px; }
.ins-ready h2 { font-size: 1.5rem; margin: 22px 0 10px; }
.ins-ready h2:first-child { margin-top: 0; }
.ins-ready dl.facts { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ins-ready dl.facts dd { white-space: pre-line; }
.ins-ready-carrier select { min-width: 220px; }

@media (max-width: 900px) {
  .ins-pol.has-lending .ins-pol-body { grid-template-columns: minmax(0, 1fr); }
  .ins-lend { border-left: 0; padding-left: 0; border-top: 1px solid var(--sand-soft); padding-top: 16px; }
}
@media (max-width: 640px) {
  .ins-track { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 12px; }
  .ins-track li:nth-child(7)::before { display: none; }
  .ins-label { flex-basis: 100%; }
}
/* ---------- insurance part 2: GS AI drafts, illustration reading, e-signature ---------- */
.banner.info { border-left-color: var(--copper); background: var(--paper); color: var(--green); }
.banner .linkish, .banner .inv-act { vertical-align: baseline; }
.ins-draft { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.ins-draft .card + .card { margin-top: 0; }
.ins-draft-side { display: grid; gap: 22px; }
.ins-draft-side h3 { font-size: 1.15rem; margin: 18px 0 6px; }
.ins-draft-text { width: 100%; min-height: 560px; font-size: 14.5px; line-height: 1.6; resize: vertical; }
.ins-used { margin: 0 0 10px; padding-left: 18px; }
.ins-used li { margin: 3px 0; }
.ins-found { border-left: 3px solid var(--copper); background: var(--paper); padding: 12px 16px; margin: 4px 0 16px; }
.ins-found p { margin: 0 0 6px; }
.ins-found-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.ins-found-list li { margin: 3px 0; }
.ins-found-list span { color: var(--muted); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; margin-right: 6px; }
.field.is-filled input, .field.is-filled select { border-color: var(--copper); background: var(--copper-wash); }
.field.is-filled > label::after { content: " · from the illustration"; color: var(--copper); font-size: 11.5px; letter-spacing: .3px; text-transform: none; }
.ins-go { max-width: 640px; }
@media (max-width: 900px) {
  .ins-draft { grid-template-columns: 1fr; }
  .ins-draft-text { min-height: 380px; }
}

@media print {
  .side, .topline, .testmode, .noprint, .bell-wrap { display: none !important; }
  .app, .main { display: block; margin: 0; padding: 0; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; padding: 0; }
}

/* ---- people: photos, faces, the pick-several control (_people.html) ---------------------- */
.side-new-client { margin-top: -14px; display: flex; align-items: center; justify-content: center; gap: 8px; color: rgba(255,255,255,.72);
  text-decoration: none; font: 500 10.5px var(--sans); letter-spacing: 1.6px; text-transform: uppercase; padding: 8px 6px; border: 1px solid rgba(255,255,255,.18); }
.side-new-client:hover, .side-new-client.current { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.06); }
.side-new-client svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 900px) { .side-new-client { margin: 0; order: 3; } }

.av { width: 28px; height: 28px; flex: none; display: inline-grid; place-items: center; overflow: hidden; vertical-align: middle;
  background: var(--copper); color: #fff; font: 400 15px/1 var(--serif); }
.av { position: relative; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.av.xs { width: 20px; height: 20px; font-size: 11.5px; }
.av.sm { width: 24px; height: 24px; font-size: 13px; }
.av.lg { width: 40px; height: 40px; font-size: 20px; }
.av.xl { width: 96px; height: 96px; font-size: 44px; }
.av.me { width: 32px; height: 32px; font-size: 17px; }
.av.group-av { background: var(--sand-soft); color: var(--green); }
.av.group-av svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

.face { display: inline-flex; align-items: center; gap: 7px; min-width: 0; vertical-align: middle; }
.face-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.faces { display: inline-flex; align-items: center; gap: 7px; min-width: 0; vertical-align: middle; }
.faces.none { color: var(--muted); }
.av-stack { display: inline-flex; flex: none; }
.av-stack .av { box-shadow: 0 0 0 2px var(--surface); }
.av-stack .av + .av { margin-left: -6px; }
.kcard .faces, .tcard .faces { max-width: 100%; }
.advisor-list { display: grid; gap: 6px; }
a.plain { color: inherit; text-decoration: none; } a.plain:hover .face-name { color: var(--copper); }

.file-advisors { background: none; border: 0; padding: 2px 4px; margin: -2px 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.file-advisors:hover { color: var(--copper); }
.note-tile .nt-author { display: inline-flex; align-items: center; gap: 6px; }
.inbox-av.av { width: 30px; height: 30px; font-size: 15px; }

.page-actions { display: flex; gap: 8px; }

.picker { position: relative; width: 100%; min-width: 0; }
.picker-box { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--sand); color: var(--green); font: 400 14px var(--sans); padding: 6px 10px; }
.picker-box:hover, .picker.open .picker-box { border-color: var(--green); }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.picker-caret { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .15s; }
.picker.open .picker-caret { transform: rotate(180deg); }
.chip-p { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--sand-soft); padding: 2px 8px 2px 2px; font-size: 12.5px; max-width: 100%; }
.chip-p:not(:has(.av)) { padding-left: 8px; }
.picker-list { border: 1px solid var(--green); border-top: 0; background: var(--surface); max-height: 280px; overflow-y: auto; padding: 6px; }
/* The list floats over what's below instead of pushing the form apart (it used to stretch the popup's rows). */
.picker-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 40; box-shadow: 0 18px 34px -16px rgba(22, 29, 34, .45); }
/* In a popup it opens in place (on its own full-width row, so nothing beside it is stretched): a floating list
   would be cut off by the popup's edge. */
dialog .picker-list, .picker:has(.picker-save) .picker-list { position: static; box-shadow: none; }
.picker-search { width: 100%; font: 400 14px var(--sans); border: 1px solid var(--sand); padding: 8px 10px; margin-bottom: 4px; border-radius: 0; appearance: none; -webkit-appearance: none; }
.picker-group { margin: 8px 6px 2px; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); }
.picker-opt { display: flex; align-items: center; gap: 10px; padding: 6px; cursor: pointer; font: 400 14px/1.3 var(--sans);
  text-transform: none; letter-spacing: 0; color: var(--green); margin: 0; }
.picker-opt:hover { background: var(--paper); }
.picker-opt input { margin: 0; accent-color: var(--green); width: 16px; height: 16px; flex: none; }
.picker-opt:has(input:checked) { background: var(--ok-soft); }
.picker-label { display: grid; min-width: 0; }
.picker-label .sub { font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.picker-none { margin: 6px; }
.picker-save { margin-top: 8px; }

.photo-card { display: flex; gap: 22px; align-items: center; margin-bottom: 18px; }
.photo-card h2 { margin: 0 0 4px; }
.photo-card .btn-row { margin-top: 12px; }
.inline-upload { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
@media (max-width: 640px) { .photo-card { flex-direction: column; align-items: flex-start; } }

.advisor-cards { margin-top: 40px; }
.advisor-card-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; }
.advisor-card { display: flex; gap: 14px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--sand-soft);
  border-top: 2px solid var(--brand-fill); padding: 14px 18px; min-width: 260px; flex: 0 1 320px; }
.advisor-card .av.lg { width: 56px; height: 56px; font-size: 26px; }
.ac-name { font: 500 20px/1.1 var(--serif); color: var(--green); }
.ac-title { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ac-contact { font-size: 12.5px; margin-top: 6px; overflow-wrap: normal; word-break: normal; }
.advisor-cards > .kicker { text-align: center; }
.advisor-cards + .contact { margin-top: 26px; }

/* ---- rounded corners (2026-10-21, the user's trial; delete this block to go back to square) ----
   Small radius: 6px on boxes and popups, 4px on controls, full round on pills and chips. */
:root { --r: 6px; --r-sm: 4px; --r-pill: 999px; }

.card, .stats, .table-wrap.boxed, .note-tile, .doc, .col, .kcard, .team-card, .drive, .preview-body, .sent-body,
.banner, .suggest, .bell-panel, .advisor-card, .modal-form, dialog.modal { border-radius: var(--r); }
.stats, .col, .drive, .note-tile, .table-wrap.boxed, .team-card, dialog.modal, .preview-body { overflow: hidden; }
.table-wrap { border-radius: 0 0 var(--r) var(--r); }
.task-modal-grid { border-radius: var(--r); overflow: hidden; }
.task-modal-grid > .modal-form { border-radius: 0; }
.suggest a:first-child { border-radius: var(--r) var(--r) 0 0; }

.btn, input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea,
.search input, .page-search input[type=search], input[type=file]::file-selector-button, .yn span, .inline-status, .seg,
.picker-box, .picker-search, .rail a, .side-nav a, .side-new-client, .col-meta .auto { border-radius: var(--r-sm); }
.seg { overflow: hidden; }
.picker.open .picker-box { border-radius: var(--r-sm) var(--r-sm) 0 0; }
.picker-list { border-radius: 0 0 var(--r-sm) var(--r-sm); }
.picker-opt { border-radius: var(--r-sm); }

.pill, .chip-p, .badge { border-radius: var(--r-pill); }
.pill { padding-left: 10px; padding-right: 10px; }
progress, progress::-webkit-progress-bar, progress::-webkit-progress-value, progress::-moz-progress-bar { border-radius: var(--r-pill); }

.av { border-radius: var(--r-sm); }
.av.lg, .av.me, .inbox-av.av { border-radius: var(--r); }
.av.xl, .advisor-card .av.lg { border-radius: 10px; }

/* Client names in lists keep a readable width next to the advisors' faces. */
.table-wrap td:first-child { min-width: 170px; }

/* ---- appearance switch (beside the bell) ---------------------------------------------------- */
.theme-wrap { margin-left: auto; position: relative; }
.theme-wrap + .bell-wrap { margin-left: 0; }
.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--sand-soft); background: var(--surface); color: var(--green);
  display: grid; place-items: center; cursor: pointer; padding: 0; }
.theme-btn:hover { border-color: var(--sand); }
.theme-btn .ic { width: 18px; height: 18px; }
.theme-btn span { display: grid; } .theme-btn span[hidden] { display: none; }
.theme-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 200px; background: var(--surface); border: 1px solid var(--sand);
  border-radius: var(--r, 0); box-shadow: 0 18px 40px -18px rgba(22,29,34,.45); padding: 6px; display: grid; gap: 2px; }
.theme-menu[hidden] { display: none; }
.theme-menu button { display: grid; grid-template-columns: 18px 1fr; column-gap: 10px; align-items: center; text-align: left; width: 100%; padding: 9px 10px;
  background: none; border: 0; border-radius: var(--r-sm, 0); color: var(--green); font: 400 14px var(--sans); cursor: pointer; }
.theme-menu button small { grid-column: 2; font-size: 11.5px; color: var(--muted); }
.theme-menu button .ic { width: 16px; height: 16px; }
.theme-menu button:hover, .theme-menu button:focus-visible { background: var(--paper); outline: none; }
.theme-menu button[aria-checked="true"] { background: var(--paper-2); font-weight: 600; }
.theme-menu button[aria-checked="true"]::after { content: ""; }
@media print { .theme-wrap { display: none !important; } }

/* ---- Add an existing client → Import from HubSpot (_hubspot_dialog.html, clients_import.html) ---------- */
.hs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 16px 20px; margin-bottom: 24px; }
.hs-bar > div { flex: 1 1 260px; min-width: 0; }
dialog.modal.hs-modal { max-width: min(760px, calc(100vw - 32px)); }
.hs-form { display: flex; flex-direction: column; }
.hs-search input { width: 100%; }
.hs-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.hs-chosen[hidden] { display: none; }
.hs-chosen .label { margin: 0; }
.hs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-chip { display: inline-flex; align-items: center; gap: 4px; padding-right: 4px; }
.hs-unpick { background: none; border: 0; padding: 0 4px; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; }
.hs-unpick:hover { color: var(--danger); }
.hs-results { flex: none; margin: 14px 0 6px; min-height: 120px; max-height: min(46vh, 420px); overflow: auto; border: 1px solid var(--sand-soft); border-radius: var(--r-sm, 0); }
.hs-results.is-loading { opacity: .55; }
.hs-hint { margin: 0; padding: 22px 16px; text-align: center; }
.hs-more { margin: 0; padding: 10px 14px; border-top: 1px solid var(--sand-soft); }
.hs-item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 11px 14px;
  border-bottom: 1px solid var(--sand-soft); cursor: pointer; margin: 0; font: 400 15px/1.4 var(--sans); letter-spacing: normal; text-transform: none; color: var(--green); }
.hs-item:last-child { border-bottom: 0; }
.hs-item:hover { background: var(--paper); }
.hs-item:has(input:checked) { background: var(--paper-2); }
.hs-item.is-in-app { grid-template-columns: minmax(0, 1fr) auto; cursor: default; color: var(--muted); }
.hs-item.is-in-app:hover { background: none; }
.hs-item input[type=checkbox] { margin: 0; width: 16px; height: 16px; accent-color: var(--copper); }
.hs-who { display: grid; min-width: 0; }
.hs-name { font-weight: 600; overflow-wrap: anywhere; }
.hs-name.is-unnamed { font-weight: 400; font-style: italic; color: var(--muted); }
.hs-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.hs-side { display: grid; justify-items: end; gap: 3px; font-size: 13px; text-align: right; }
.hs-meta { font-size: 12px; color: var(--faint); }
.hs-couple { margin: 8px 0 4px; }
.hs-couple[hidden] { display: none; }
.hs-list-info { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--sand-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.hs-list-info p { margin: 0; flex: 1 1 260px; }
.hs-list-info .hint { flex-basis: 100%; }
.hs-upload { cursor: pointer; }
.hs-upload.is-busy { opacity: .5; pointer-events: none; }
@media (max-width: 560px) {
  .hs-item { grid-template-columns: 20px minmax(0, 1fr); }
  .hs-side { grid-column: 2; justify-items: start; text-align: left; }
  .hs-item.is-in-app .hs-side { grid-column: 1; }
}
.hs-rows { display: grid; gap: 14px; margin-bottom: 8px; }
.hs-row { border: 1px solid var(--sand-soft); border-radius: var(--r-sm, 0); padding: 14px 16px 2px; }
.hs-row.is-in-app { padding-bottom: 12px; background: var(--paper); }
.hs-row.is-in-app p { margin: 6px 0 0; }
.hs-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.hs-row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }

/* ---- someone's side panel: click a photo or name (static/person.js, _person_panel.html) ------------- */
[data-person] { cursor: pointer; }
[data-picker] [data-person], [data-no-person] [data-person] { cursor: inherit; }
.face[data-person]:hover .face-name, .face-name [data-person]:hover, [data-person-key]:focus-visible { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--copper); }
[data-person-key]:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
dialog.person-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; width: min(440px, 100vw); max-width: 100vw;
  height: 100%; max-height: none; background: var(--surface); color: var(--green); border-left: 3px solid var(--copper);
  box-shadow: -24px 0 60px -28px rgba(22, 29, 34, .55); transform: translateX(104%);
  transition: transform .32s cubic-bezier(.22, .8, .24, 1); overflow: hidden; }
dialog.person-drawer.is-in { transform: none; }
dialog.person-drawer::backdrop { background: rgba(22, 44, 42, 0); transition: background .32s ease; }
dialog.person-drawer.is-in::backdrop { background: rgba(22, 44, 42, .34); }
.pd-inner { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 26px clamp(18px, 4vw, 30px) 40px; position: relative; }
.pd-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; background: none; border-radius: 50%;
  font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.pd-close:hover { color: var(--green); background: var(--paper); }
.pd-body > * { animation: pd-in .28s ease both; }
.pd-body > *:nth-child(2) { animation-delay: .03s; } .pd-body > *:nth-child(3) { animation-delay: .06s; }
.pd-body > *:nth-child(n+4) { animation-delay: .09s; }
@keyframes pd-in { from { opacity: 0; transform: translateY(8px); } }
.pd-head { display: flex; gap: 18px; align-items: center; padding-right: 36px; margin-bottom: 18px; }
.pd-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -6px 0 18px; padding: 10px 12px; background: var(--paper); border: 1px dashed var(--sand); }
.pd-admin form { margin: 0; }
.pd-photo-pick { cursor: pointer; }
.pd-photo-pick:focus-within { outline: 2px solid var(--copper); outline-offset: 2px; }
.pd-who { min-width: 0; }
.pd-who h2 { margin: 0; font: 500 30px/1.1 var(--serif); overflow-wrap: anywhere; }
.pd-desig { margin: 3px 0 0; font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--copper); }
.pd-title { margin: 4px 0 0; color: var(--muted); }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.pd-section { border-top: 1px solid var(--sand-soft); padding-top: 16px; margin-top: 18px; }
.pd-section h3 { margin: 0 0 10px; font: 600 11px/1.3 var(--sans); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.pd-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pd-facts { margin: 0; display: grid; gap: 9px; }
.pd-facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; }
.pd-facts > div { display: grid; gap: 2px; min-width: 0; }
.pd-facts > div:first-child { grid-column: 1 / -1; }
.pd-facts dt { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.pd-facts dt .ic { width: 14px; height: 14px; }
.pd-facts dd { margin: 0; overflow-wrap: anywhere; }
.pd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.pd-stats > div { border-top: 2px solid var(--brand); background: var(--paper); padding: 10px 12px; display: grid; }
.pd-stats strong { font: 500 28px/1 var(--serif); }
.pd-stats span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pd-note { margin: 8px 0 0; }
.pd-list { list-style: none; margin: 0; padding: 0; }
.pd-list li + li { border-top: 1px solid var(--sand-soft); }
.pd-list a { display: grid; padding: 9px 4px; color: inherit; text-decoration: none; border-radius: var(--r-sm, 0); }
.pd-list a:hover { background: var(--paper); }
.pd-name { font-weight: 600; overflow-wrap: anywhere; }
.pd-sub { font-size: 13px; color: var(--muted); }
.pd-skeleton { display: grid; gap: 14px; padding-top: 8px; }
.pd-skeleton span { height: 18px; background: var(--paper-2); border-radius: var(--r-sm, 0); animation: pd-pulse 1.1s ease-in-out infinite alternate; }
.pd-skeleton span:first-child { height: 96px; width: 96px; }
.pd-skeleton span:nth-child(2) { width: 60%; height: 28px; }
@keyframes pd-pulse { to { opacity: .45; } }
.pd-error { margin-top: 40px; }
@media (max-width: 480px) { .pd-head { gap: 14px; } .pd-head .av.xl { width: 72px; height: 72px; font-size: 34px; } }
@media (prefers-reduced-motion: reduce) {
  dialog.person-drawer, dialog.person-drawer::backdrop { transition: none; }
  .pd-body > *, .pd-skeleton span { animation: none; }
}
@media print { dialog.person-drawer { display: none !important; } }

/* ---- dark theme ------------------------------------------------------------------------------
   html.dark is set by theme.js (the person's choice, or their device when they chose System).
   Screen only: printing stays light. Brand-led: deep green-black surfaces, warm ink, copper accents. */
@media screen {
  html.dark {
    color-scheme: dark;
    --green: #e6e1d6; --green-deep: #f4f0e8;
    --copper: #cf7a58; --copper-deep: #b9663f;
    --sand: #3b4744; --sand-soft: #2b3533;
    --paper: #111918; --paper-2: #1b2523; --surface: #18211f; --hover: #1e2927; --green-soft: #1e2b29;
    --muted: #a3b2ae; --faint: #77867f;
    --brand: #2e5a53; --brand-deep: #24483f; --brand-fill: #63a596; --side-bg: #0c1312;
    --ok: #79c79b; --ok-soft: #16291f; --ok-line: #2d5a42; --ok-ink: #b5e2c8;
    --warn: #e3b866; --warn-soft: #2c2414; --warn-line: #5d4a24;
    --danger: #ee8f81; --danger-soft: #311a17; --danger-line: #6b352d;
    --info: #92bcef; --info-soft: #172436; --info-line: #2f4c70;
    --copper-soft: #33231b; --copper-line: #5c3b2a; --copper-wash: #221b16;
    --violet: #c9aef0; --violet-soft: #241d32; --violet-line: #44365e;
    --teal: #84d0c7; --teal-soft: #142928; --teal-line: #2b504d;
  }
  html.dark body { background: var(--paper); color: var(--green); }
  html.dark .side { border-right: 1px solid #1d2826; }
  html.dark .btn:not(.ghost):not(.quiet):not(.danger):not(.green):not(.danger-solid) { background: #ad5e3f; border-color: #ad5e3f; color: #fff; }
  html.dark .btn:not(.ghost):not(.quiet):not(.danger):not(.green):not(.danger-solid):hover { background: #97502f; border-color: #97502f; }
  html.dark .btn.danger-solid { color: #1b0f0d; }
  html.dark .btn.ghost:hover { border-color: var(--green); }
  html.dark .avatar, html.dark .av:not(:has(img)):not(.group-av) { background: #8f4c34; }
  html.dark dialog.modal::backdrop { background: rgba(0, 0, 0, .62); }
  html.dark dialog.person-drawer.is-in::backdrop { background: rgba(0, 0, 0, .5); }
  html.dark dialog.person-drawer { box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .8); }
  html.dark .modal-form, html.dark .suggest, html.dark .bell-panel, html.dark .theme-menu { box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .7); }
  html.dark .search input[type=search] { background: var(--paper-2); border-color: var(--sand-soft); }
  html.dark input::placeholder, html.dark textarea::placeholder { color: var(--faint); }
  html.dark .preview-body { background: #0d1312; }
  html.dark img.word { opacity: .9; }
  html.dark .testmode { background: var(--warn-soft); color: var(--warn); }
  html.dark ::selection { background: rgba(207, 122, 88, .35); }
}

/* ===== Upload a folder (GS AI sorts it), 2026-11-16 ===== */
.fi-drop { display: grid; justify-items: center; gap: 4px; padding: 26px 16px; margin: 6px 0 12px; border: 1px dashed var(--sand); background: var(--copper-wash); cursor: pointer; text-align: center; color: var(--green); }
.fi-drop:hover, .fi-drop:focus-within { border-color: var(--copper); }
.fi-drop .ic { width: 28px; height: 28px; color: var(--copper); }
.fi-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fi-summary { padding: 10px 12px; border: 1px solid var(--sand); background: var(--surface); margin-bottom: 12px; display: grid; gap: 3px; }
.fi-warn { color: var(--warn); }
.fi-now { margin: 4px 0 8px; overflow-wrap: anywhere; }
[data-fi-run] progress { width: 100%; }
.fi-errors { margin: 10px 0 0; padding: 8px 12px 8px 28px; background: var(--warn-soft); color: var(--warn); font-size: 13px; max-height: 160px; overflow: auto; }
.fi-section { margin-bottom: 18px; }
.up-mode { display: flex; margin: 0 0 14px; }
.up-mode button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; font-size: 13px; }
.fi-drop.over { border-style: solid; border-color: var(--copper); background: var(--copper-soft); }
#upload-dialog.over .modal-form { outline: 2px dashed var(--copper); outline-offset: -6px; }
.fi-problems { margin: 6px 0 0; padding-left: 20px; text-align: left; }
.fi-list { list-style: none; margin: 8px 0 0; padding: 0; }
.fi-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--sand-soft); }
.fi-list li:first-child { border-top: 0; }
.fi-list li.is-unsure { background: var(--copper-wash); margin: 0 -12px; padding: 10px 12px; }
.fi-list .grow { min-width: 0; flex: 1; }
.fi-name { overflow-wrap: anywhere; }
.fi-name a { color: var(--green); text-decoration: none; }
.fi-name a:hover { text-decoration: underline; }
.fi-name .ic, .fi-guess .ic, .fi-list .muted .ic { width: 13px; height: 13px; vertical-align: -0.12em; }
.fi-from { overflow-wrap: anywhere; }
.fi-guess { color: var(--copper); margin-top: 2px; }
.fi-pick { flex: 0 0 400px; max-width: 50%; }
.fi-pick select { width: 100%; }
.fi-pick select.is-changed { border-color: var(--copper); box-shadow: 0 0 0 1px var(--copper); }
.fi-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 16px; background: var(--surface); border-top: 2px solid var(--copper); box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08); }
.fi-savebar[hidden] { display: none; }
@media (max-width: 640px) {
  .fi-list li { flex-direction: column; align-items: stretch; gap: 6px; }
  .fi-pick { flex: none; max-width: none; }
}

/* ===== Phone and tablet layout (mobile pass 2026-11) =====
   One block, kept last so it wins over the rules above it. Desktop (over 900px) is unchanged:
   everything here is inside a max-width query, except the few controls that only exist on small screens.
   - up to 900px: the sidebar becomes a slide-in menu behind a top bar (menu button, GS mark, search, theme, bell).
   - up to 640px (phones): compact headings and summary tiles, tables become stacked cards (labels come from
     the table's headings, set by staff.js), popups become sheets, controls are at least 40px to tap. */

.menu-btn, .top-mark, .side-close, .side-scrim { display: none; }

/* Wide tables scroll inside their box instead of being cut off by the rounded-corner clip. */
.table-wrap.boxed { overflow-x: auto; }

@media (max-width: 900px) {
  /* ---- the menu: slides in from the left ---- */
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(304px, 86vw); height: auto;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 16px; padding: 18px 16px 16px;
    overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(-102%); visibility: hidden; transition: transform .24s ease, visibility 0s linear .24s;
  }
  html.menu-open .side { transform: none; visibility: visible; transition: transform .24s ease; box-shadow: 18px 0 48px -12px rgba(var(--shadow-ink), .45); }
  .side-brand { margin-right: 0; padding-right: 48px; }
  .side-brand .word { display: block; }
  .side-new, .side-new-client, .side-nav, .side-user { order: 0; }
  .side-new { width: 100%; }
  .side-new-client { margin: -8px 0 0; padding: 11px 6px; }
  .side-nav { width: auto; display: grid; overflow: visible; gap: 2px; }
  .side-nav a { border-left: 2px solid transparent; border-bottom: 0; padding: 13px 10px; white-space: normal; }
  .side-nav a.current { border-left-color: var(--copper); border-bottom-color: transparent; background: rgba(255,255,255,.08); }
  .side-nav .badge { margin-left: auto; }
  .side-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; }
  .who-text { display: grid; }
  .side-user button { padding: 12px; }
  .side-close {
    display: grid; place-items: center; position: absolute; top: 14px; right: 10px; width: 42px; height: 42px;
    background: none; border: 0; color: rgba(255,255,255,.8); cursor: pointer; padding: 0;
  }
  .side-close:hover { color: #fff; }
  .side-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
  .side-scrim {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(22, 44, 42, .5);
    opacity: 0; visibility: hidden; transition: opacity .24s ease, visibility 0s linear .24s;
  }
  html.menu-open .side-scrim { opacity: 1; visibility: visible; transition: opacity .24s ease; }
  html.menu-open, html.menu-open body { overflow: hidden; }

  /* ---- the top bar: stays at the top while the page scrolls ---- */
  .topline { position: sticky; top: 0; z-index: 30; gap: 8px; padding: 8px 12px; }
  .menu-btn {
    display: grid; place-items: center; position: relative; flex: none; width: 42px; height: 42px; margin-left: -4px;
    background: none; border: 0; color: var(--green); cursor: pointer; padding: 0;
  }
  .menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
  .menu-dot { position: absolute; top: 9px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--copper); border: 2px solid var(--surface); }
  .top-mark { display: grid; place-items: center; flex: none; }
  .top-mark img { width: 30px; height: 30px; display: block; }
  .search { flex: 1 1 auto; min-width: 0; max-width: none; }
  .search input[type=search] { padding-top: 9px; padding-bottom: 9px; }
  .theme-wrap { margin-left: 0; }
  .bell-wrap { margin-left: 0; }
  .theme-btn, .bell { width: 40px; height: 40px; flex: none; }
  /* The bell list and the search suggestions open as panels under the bar, the width of the screen. */
  .bell-panel, .suggest {
    position: fixed; top: calc(var(--topbar-bottom, 58px) + 6px); left: 8px; right: 8px; width: auto;
    max-height: calc(100vh - var(--topbar-bottom, 58px) - 20px); max-height: calc(100dvh - var(--topbar-bottom, 58px) - 20px); overflow-y: auto;
  }
  .suggest a { grid-template-columns: minmax(0, 1fr) auto; }
  .suggest .s-stage { white-space: normal; text-align: right; max-width: 42vw; letter-spacing: 1px; }

  /* GS Agent fills the screen below the bar (the menu no longer takes a row). */
  .agent-page .app { grid-template-rows: minmax(0, 1fr); }

  /* Wide content scrolls sideways inside its own box, never the page. */
  .main, .shell { min-width: 0; }
  .shell { overflow-x: clip; }
}

@media (max-width: 640px) {
  .shell { padding: 20px 16px 64px; }
  h1 { font-size: 2rem; letter-spacing: .2px; }
  h2 { font-size: 1.5rem; }
  .kicker { letter-spacing: 2.5px; margin-bottom: 8px; }
  .page-head { margin-bottom: 20px; gap: 14px; align-items: flex-start; }
  .page-head > div:first-child { min-width: 0; }
  .page-actions, .page-head .btn-row { flex-wrap: wrap; }
  .page-search { flex: 1 1 100%; }
  .card { padding: 18px 16px; }
  .card + .card { margin-top: 16px; }
  .card-head { flex-wrap: wrap; align-items: center; row-gap: 8px; }
  .card-head > .btn-row { width: 100%; gap: 8px; }
  .banner { font-size: 14px; }

  /* iOS zooms into any field with text under 16px: keep fields at 16px on phones. */
  input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=search],
  select, textarea, .search input[type=search], .page-search input[type=search] { font-size: 16px; }

  /* Tap targets: at least 40px high. */
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding: 9px 14px; }
  .btn.quiet.small { min-height: 40px; min-width: 40px; }
  .btn-row { gap: 8px; }

  /* Summary tiles: one row that scrolls sideways, instead of a tall stack. */
  .stats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-bottom: 18px; }
  .stats::-webkit-scrollbar { display: none; }
  .stats .stat { flex: 0 0 auto; min-width: 128px; max-width: 168px; padding: 14px 16px 12px; border-right: 1px solid var(--sand-soft); border-bottom: 0; scroll-snap-align: start; }
  .stats .stat:last-child { border-right: 0; }
  .stat .n { font-size: 2.1rem; }
  .stat .l { font-size: 10px; letter-spacing: 1.6px; margin-top: 6px; }
  .stat .d { font-size: 12px; line-height: 1.35; }

  /* View tabs: tighter; the view switch and filters wrap below them at full width. */
  .tabs { gap: 0 20px; margin-top: 16px; }
  .tabs > a { padding: 12px 0; white-space: nowrap; }
  /* A row of views with nothing else in it scrolls sideways instead of wrapping into several rows. */
  .tabs:not(:has(> .push)) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .tabs:not(:has(> .push))::-webkit-scrollbar { display: none; }
  .tabs .push { margin-left: 0; width: 100%; padding: 8px 0 10px; }
  .tabs .push.seg { padding: 0; margin: 8px 0 10px; }
  .toolbar { gap: 8px; }
  .inline-filter, .inline-filter select { width: 100%; min-width: 0; }
  .tabs .seg { display: flex; width: 100%; }
  .tabs .seg a { flex: 1 1 0; justify-content: center; text-align: center; padding: 10px 6px; letter-spacing: 1.5px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
  .filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filter-row select, .filter-row input[type=search] { width: 100%; min-width: 0; }
  .filter-row input[type=search], .filter-row select[name=client] { grid-column: 1 / -1; }
  .rail { margin-left: -16px; margin-right: -16px; padding: 0 16px 6px; scrollbar-width: none; }
  .rail a { padding: 10px 13px; }

  /* Boards: each column is most of the screen wide and snaps into place. */
  .board { scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin: 0 -16px; padding: 0 16px 14px; gap: 10px; min-height: 0; }
  .board .col { flex-basis: min(82vw, 320px); scroll-snap-align: start; }
  .board .col.is-empty { flex-basis: 48px; }
  .kname { font-size: 1.15rem; }

  /* Client file: header, stage bar and section tabs. */
  .file-head { margin-bottom: 18px; }
  .file-head h1 { font-size: 1.85rem; }
  .file-title { gap: 10px; }
  .file-head .meta { gap: 8px 12px; margin-top: 10px; }
  .file-head .meta a { overflow-wrap: anywhere; }
  .stepper { margin-top: 16px; }
  .subtabs { margin: 16px -16px 0; padding: 0 8px; gap: 0; }
  .subtabs a { padding: 12px 10px; letter-spacing: 1.5px; }

  /* Tables: stacked cards. staff.js copies each column heading onto its cells (data-label). */
  .table-wrap.stacks { overflow: visible; border: 0; background: transparent; }
  .table-wrap.stacks.boxed { border-top: 0; }
  .table-wrap.stacks table, .table-wrap.stacks tbody { display: block; min-width: 0; width: 100%; }
  .table-wrap.stacks thead { display: none; }
  .table-wrap.stacks tbody tr {
    display: flex; flex-direction: column; position: relative; background: var(--surface);
    border: 1px solid var(--sand-soft); border-radius: var(--r, 0); padding: 12px 14px; margin-bottom: 10px;
  }
  .table-wrap.stacks tbody tr:hover { background: var(--surface); }
  .table-wrap.stacks td {
    display: block; position: relative; padding: 5px 0 5px 108px; border: 0; min-width: 0 !important; min-height: 30px;
    white-space: normal; overflow-wrap: anywhere; text-align: left;
  }
  .table-wrap.stacks td::before {
    content: attr(data-label); position: absolute; left: 0; top: 9px; width: 98px; line-height: 1.3;
    font-size: 10px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
  }
  .table-wrap.stacks td.is-primary { order: -1; padding: 0 44px 6px 0; }
  .table-wrap.stacks td.is-primary::before, .table-wrap.stacks td.no-label::before { content: none; }
  .table-wrap.stacks td.no-label { padding-left: 0; }
  .table-wrap.stacks td.is-blank { display: none; }
  .table-wrap.stacks td.actions { position: absolute; top: 6px; right: 6px; padding: 0; display: block; }
  .table-wrap.stacks td .name { font-size: 1.3rem; }
  .table-wrap.stacks td progress { margin-top: 6px; }
  .table-wrap.stacks tr.is-group { background: transparent; border: 0; padding: 14px 2px 4px; margin: 0; }
  .table-wrap.stacks tr.is-group td { display: block; padding: 0; }
  .table-wrap.stacks tr.is-group td::before { content: none; }
  /* Step trackers (Investments, Insurance): the steps sit in a grid of small tiles under the name. */
  .table-wrap.stacks .inv-table tbody tr.inv-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .table-wrap.stacks .inv-table td.inv-name, .table-wrap.stacks .inv-table td.inv-attn { grid-column: 1 / -1; }
  .table-wrap.stacks .inv-table td.inv-attn { order: 1; }
  .table-wrap.stacks .inv-table td.inv-col {
    display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; text-align: center;
    padding: 7px 2px 8px; border: 1px solid var(--sand-soft); border-radius: var(--r-sm, 0); min-height: 0;
  }
  .table-wrap.stacks .inv-table td.inv-col::before { position: static; width: auto; font-size: 9px; letter-spacing: 1px; line-height: 1.2; }
  .table-wrap.stacks .inv-table tr.inv-client td { padding: 0; border: 0; background: transparent; }
  .table-wrap.stacks .inv-table tr.inv-client .sub { display: block; margin: 2px 0 0; }
  .table-wrap.stacks .empty { background: var(--surface); border: 1px solid var(--sand-soft); border-radius: var(--r, 0); }

  /* Popups: a sheet that fills the width and rises from the bottom; the title row stays in view. */
  dialog.modal, dialog.modal.wide, dialog.modal.task-modal, dialog.modal.hs-modal {
    width: 100%; max-width: 100vw; margin: auto 0 0; max-height: 100dvh;
  }
  dialog.modal { border-radius: var(--r, 0) var(--r, 0) 0 0; }
  dialog.modal.confirm-modal { width: calc(100vw - 32px); margin: auto; border-radius: var(--r, 0); }
  .modal-form { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 0 16px 20px; border-radius: var(--r, 0) var(--r, 0) 0 0; }
  .modal-form > .card-head {
    position: sticky; top: 0; z-index: 3; background: var(--surface); margin: 0 -16px 14px; padding: 16px 16px 12px;
    border-bottom: 1px solid var(--sand-soft); flex-wrap: nowrap;
  }
  .modal-form .card-head h2 { font-size: 1.45rem; min-width: 0; }
  .modal-form .close { width: 40px; height: 40px; flex: none; margin-right: -8px; }
  .task-modal-grid { max-height: calc(100dvh - 24px); border-radius: var(--r, 0) var(--r, 0) 0 0; }
  .task-modal-grid > form { padding: 0 16px 20px; }
  .confirm-modal .modal-form { padding: 20px; border-radius: var(--r, 0); max-height: none; }

  /* Lists of people (team pages): the Remove button goes under the person. */
  .people li { flex-wrap: wrap; }
  .people li > form { margin: -6px 0 0 68px; }
  .people li > form .btn.quiet { padding-left: 0; }
  .people .person { min-width: 0; flex: 1 1 100%; }
  .people .line { overflow-wrap: anywhere; }

  /* Documents (Drive): toolbar, and file names that wrap onto two lines instead of being cut short. */
  .drive-bar { position: static; padding: 10px 12px; }
  .drive[data-view="list"] .df-name .fname, .drive:not([data-view="grid"]) .df-name .fname {
    white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35;
  }
  .df-row { padding: 0 4px; gap: 8px; }

  /* Lists with buttons at the side (meetings, invitations…): the buttons wrap under the text when it gets narrow. */
  .list li { flex-wrap: wrap; row-gap: 8px; }
  .list li > .grow { flex: 1 1 210px; }
  .hist-body { overflow-wrap: anywhere; }

  /* Document and requirement lists: the buttons go under the name rather than squeezing it. */
  .inv-docs li > .grow { flex: 1 1 calc(100% - 40px); }

  .note-tile .nt-foot { flex-wrap: wrap; }
  dl.facts dd a { overflow-wrap: anywhere; }
  .empty { padding: 36px 16px; }
}

@media (max-width: 380px) {
  .top-mark { display: none; }
  .stats .stat { min-width: 116px; }
  .table-wrap.stacks td { padding-left: 96px; }
  .table-wrap.stacks td::before { width: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .side, .side-scrim { transition: none !important; }
}
@media print { .menu-btn, .top-mark, .side-scrim, .side-close { display: none !important; } }
@media screen {
  html.dark .side-scrim { background: rgba(0, 0, 0, .6); }
}

/* "Send to" on the portal-link and document-request popups (_recipients.html) */
.recipients .check .small { display: block; margin-top: 2px; }
.recipients .add-helper { margin: 4px 0 14px; }
.recipients .add-helper .field { margin-bottom: 14px; }
.recipients .consent { font-size: 13.5px; color: var(--muted); padding: 10px 12px; border: 1px solid transparent; margin-bottom: 8px; }
.recipients .consent.needed { color: var(--green); background: var(--copper-wash); border-color: var(--copper-line); }
.helper-list { list-style: none; margin: 0 0 12px; padding: 0; }
.helper-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--sand-soft); }
.helper-list li:last-child { border-bottom: 0; }
.helper-list .who { min-width: 0; overflow-wrap: anywhere; }


/* ---- Accounting (accounting.html, accounting_engagement.html, _acct_tab.html) ---- */
.acc-page form.inline { display: inline-flex; margin: 0; }
.acc-steps { list-style: none; display: flex; gap: 3px; margin: -8px 0 26px; padding: 0; counter-reset: accstep; }
.acc-steps li { flex: 1; font-size: 11.5px; letter-spacing: .04em; color: var(--faint); padding-top: 9px; border-top: 4px solid var(--sand-soft); }
.acc-steps li.past { border-top-color: var(--brand-fill); color: var(--muted); }
.acc-steps li.now { border-top-color: var(--copper); color: var(--green); font-weight: 600; }
.acc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.acc-facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.acc-facts dt { color: var(--muted); font-size: 12.5px; letter-spacing: .03em; padding-top: 2px; }
.acc-facts dd { margin: 0; }
.acc-scope { margin: 0; padding-left: 18px; }
.acc-preview { margin-top: 16px; border: 1px solid var(--sand-soft); background: var(--sand-soft); }
.acc-preview iframe { display: block; width: 100%; height: 720px; border: 0; }
.acc-env { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.acc-list { list-style: none; margin: 16px 0 0; padding: 0; }
.acc-list li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--sand-soft); }
.acc-invoice { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--sand-soft); }
.acc-invoice:first-of-type { border-top: 0; }
.acc-lines { display: grid; gap: 8px; margin-bottom: 10px; }
.acc-line { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; align-items: center; }
.acc-ai { border: 1px solid var(--sand-soft); background: var(--copper-soft); padding: 12px 16px; margin-bottom: 22px; }
.acc-ai summary { cursor: pointer; font-weight: 600; }
.acc-ai .field { margin: 12px 0; }
.acc-table td { vertical-align: middle; }
.acc-owner { display: inline-flex; }
.acc-watch { gap: 8px 18px; }
.acc-tab-list { list-style: none; margin: 0; padding: 0; }
.acc-tab-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--sand-soft); }
.acc-tab-list li:first-child { border-top: 0; }
@media (max-width: 900px) {
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
  .acc-steps { flex-wrap: wrap; }
  .acc-steps li { flex: 1 1 30%; }
  .acc-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .acc-facts dd { margin-bottom: 8px; }
  .acc-preview iframe { height: 480px; }
  .acc-line { grid-template-columns: minmax(0, 1fr) 96px auto; }
}
.acc-page [data-acc-new] { margin-bottom: 22px; }

/* ---- Address boxes: any number of To / Cc / Bcc / guests, one chip each (static/addrchips.js) ---- */
.addr-box { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--sand); background: var(--surface); cursor: text; }
.addr-box:focus-within { border-color: var(--green); }
.addr-list { display: contents; list-style: none; margin: 0; padding: 0; }
.addr-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 10px; font-size: 13px;
  background: var(--sand-soft); color: var(--green); }
.addr-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-chip.bad { background: var(--danger-soft); color: var(--danger); }
.addr-x { border: 0; background: transparent; color: inherit; font-size: 16px; line-height: 1; padding: 0 4px; cursor: pointer; }
.addr-box .addr-entry { flex: 1 1 160px; min-width: 120px; width: auto; border: 0; outline: 0; padding: 4px; background: transparent; box-shadow: none; }
.addr-menu { position: absolute; left: -1px; right: -1px; top: 100%; z-index: 30; list-style: none; margin: 0; padding: 4px 0;
  background: var(--surface); border: 1px solid var(--sand); max-height: 240px; overflow-y: auto; }
dialog .addr-menu { position: static; flex-basis: 100%; border-width: 1px 0 0; margin: 4px -8px -6px; }
.addr-opt { padding: 8px 12px; cursor: pointer; }
.addr-opt:hover { background: var(--sand-soft); }
.addr-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---- Client emails: the Emails tab, a conversation, the Write popup (comms.py) ---- */
.subtabs .count.new { background: var(--copper); color: #fff; }
.mail-refresh { display: inline-flex; margin: 0; }
.mail-filter { margin: 0 0 14px; }
.mail-filter a { padding: 7px 14px; font-size: 12px; text-decoration: none; color: var(--muted); }
.mail-filter a.on { background: var(--brand); color: #fff; }
.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-list li { border-top: 1px solid var(--sand-soft); }
.mail-list li:first-child { border-top: 0; }
.mail-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 4px; text-decoration: none; color: inherit; }
.mail-list a:hover { background: var(--hover, var(--sand-soft)); }
.mail-list li.unread .mail-subject { font-weight: 700; }
.mail-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mail-main > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subject { color: var(--green); }
.mail-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mail-app, .mail-them { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--sand-soft); color: var(--copper); font-weight: 600; }
.mail-title { font-size: clamp(1.6rem, 3vw, 2.2rem); overflow-wrap: anywhere; }
.mail-thread { display: grid; gap: 16px; max-width: 900px; }
.mail-msg.in { border-left: 3px solid var(--copper); }
.mail-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; margin-bottom: 14px; }
.mail-meta { min-width: 0; overflow-wrap: anywhere; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 14.5px; }
.mail-files { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--sand-soft); display: flex; flex-wrap: wrap; gap: 8px 18px; }
.compose-picker summary { cursor: pointer; font-size: 13.5px; margin-bottom: 8px; }
.compose-filter { margin-bottom: 8px; }
.compose-files { list-style: none; margin: 0; padding: 4px 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--sand-soft); }
.compose-files li { padding: 2px 10px; }
.compose-files .check { margin: 4px 0; }
[data-compose-size].over { color: var(--danger); }
.mt-guests-label { display: block; margin: 12px 0 6px; }
@media (max-width: 700px) {
  .mail-list a { grid-template-columns: auto minmax(0, 1fr); }
  .mail-side { grid-column: 2; justify-content: flex-start; }
  .mail-head { grid-template-columns: auto minmax(0, 1fr); }
  .mail-head time { grid-column: 2; }
}
