:root {
  --ground: #F4F5F7; --surface: #FFFFFF; --ink: #16202A; --ink2: #3A4550; --muted: #55606B;
  --line: #E1E4E8; --line2: #C9CED4; --accent: #0F6B62; --accent-dark: #0B4F49; --accent-soft: #E3F1EF;
  --danger: #B42318; --danger-dark: #9A1C12; --danger-line: #E5A9A2; --warn: #6B4500;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 14px/1.45 'DM Sans', system-ui, sans-serif; }
h1, h2, h3 { margin: 0; }
h1 { font-size: 28px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
.muted { color: var(--muted); }
.danger-text { color: var(--danger-dark); font-weight: 600; }
.ok-text { color: var(--accent-dark); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
[hidden] { display: none !important; }

/* layout */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 0 208px; background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { font-size: 18px; font-weight: 700; padding: 4px 12px 20px; }
.side a { padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--ink2); }
.side a:hover { background: var(--ground); }
.side a[aria-current="page"] { font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); }
main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.page-head .push { margin-left: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .wide { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.cols > .narrow { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* controls */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { min-height: 44px; padding: 0 16px; border: 1px solid #8A939C; border-radius: 8px; background: var(--surface); font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--ground); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { border-color: var(--danger-line); color: var(--danger-dark); }
.btn.small { min-height: 36px; padding: 0 10px; font-size: 13px; }
.link-btn { border: 0; background: none; padding: 8px 4px; color: var(--accent); font-weight: 500; cursor: pointer; }
.link-btn.danger { color: var(--danger-dark); }
input[type=text], input[type=password], input[type=url], input[type=search], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); min-width: 0; }
textarea { height: auto; min-height: 76px; padding: 12px; resize: vertical; width: 100%; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1 1 160px; min-width: 0; }
label.inline { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.search { flex: 1 1 280px; max-width: 440px; position: relative; }
.search svg { position: absolute; left: 14px; top: 13px; }
.search input { width: 100%; padding-left: 40px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink2); }
.chips span { border: 1px solid var(--line2); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.bar i { display: block; background: var(--accent); }
.bar i.late { background: var(--danger); }
.error { color: var(--danger-dark); font-weight: 600; min-height: 20px; }

/* timeline */
.tl-scroll { overflow-x: auto; }
.tl { position: relative; height: 144px; min-width: 760px; margin: 0 40px; }
.tl .line { position: absolute; left: 0; right: 0; top: 68px; height: 2px; background: var(--line2); }
.tl .today-line { position: absolute; top: 20px; width: 2px; height: 96px; margin-left: -1px; background: var(--ink); }
.tl .today-pill { position: absolute; top: 0; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; line-height: 20px; padding: 0 8px; border-radius: 10px; }
.tl .dot { position: absolute; top: 62px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); }
.tl .dot:hover { transform: scale(1.3); }
.tl .dot.past { background: var(--surface); border: 3px solid #8A939C; }
.tl .lbl { position: absolute; white-space: nowrap; font-size: 12px; line-height: 16px; text-align: center; transform: translateX(-50%); color: var(--ink); }
.tl .lbl.up { top: 26px; } .tl .lbl.down { top: 82px; }
.tl .lbl b { display: block; font-weight: 600; }
.tl .lbl span { color: var(--muted); }
.tl .lbl.past, .tl .lbl.past b { color: var(--muted); }
.tl .tick { position: absolute; top: 124px; border-left: 1px solid var(--line2); padding-left: 6px; font-size: 11px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.tl .empty { position: absolute; left: 0; right: 0; top: 26px; text-align: center; color: var(--muted); font-size: 13px; }

/* board */
.board-scroll { overflow-x: auto; padding-bottom: 8px; }
.board { display: flex; align-items: flex-start; gap: 12px; }
.column { flex: 1 0 232px; min-width: 0; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.column-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; }
.column-head h2 { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-head button { border: 0; background: none; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.column-head button:hover { background: var(--line); }
.cards { display: flex; flex-direction: column; gap: 10px; min-height: 80px; border-radius: 12px; }
.cards.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.cards .drop-hint { border: 1px dashed var(--line2); border-radius: 12px; padding: 24px 16px; font-size: 13px; color: var(--muted); text-align: center; }
.card > * { flex-shrink: 0; }
.card { height: 248px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); overflow: hidden; }
.card:hover { border-color: #8A939C; color: var(--ink); }
.card.late { border-color: var(--danger-line); }
.card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.card-title { min-width: 0; }
.card h3 { font-size: 16px; font-weight: 600; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card .chips { height: 84px; overflow: hidden; align-content: flex-start; flex: 0 0 auto; }
.card .chips span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; height: 24px; line-height: 18px; }
.card .chips .cover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.card .next { font-size: 13px; }
.card .fin { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.add-column { flex: 0 0 116px; min-height: 44px; border: 1px dashed #8A939C; border-radius: 8px; background: transparent; color: var(--ink2); font-weight: 600; cursor: pointer; }
.add-column:hover { background: var(--line); }

/* lists */
.list { display: flex; flex-direction: column; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 48px; padding: 4px 0; border-top: 1px solid var(--line); }
.item .grow { flex: 1 1 200px; min-width: 0; }
.item .when { flex: 0 0 96px; color: var(--muted); }
.item .who { flex: 0 0 56px; color: var(--muted); }
.item.done .grow { text-decoration: line-through; color: var(--muted); }
.note { border-top: 1px solid var(--line); padding-top: 4px; }
.note p { margin: 0; white-space: pre-wrap; }
.note .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.kv b { font-weight: 600; }
.hero { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; }
.hero .photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.hero .info { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.group-title { font-size: 14px; font-weight: 600; }
.panel.late { border-color: var(--danger-line); }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(520px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(22, 32, 42, .45); }
dialog form { display: flex; flex-direction: column; gap: 14px; }
dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
dialog .actions .left { margin-right: auto; }

@media (max-width: 700px) {
  main { padding: 20px 16px; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { flex: 1 0 100%; padding: 4px 12px 8px; }
}

/* project page (payments / documents / details layout) */
.stats { display: flex; flex-wrap: wrap; gap: 16px 48px; padding: 4px 0 8px; }
.stat .label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink2); }
.stat .label i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.stat.upcoming .label i { background: #C98A00; }
.stat.late .label i { background: var(--danger); }
.stat .value { font-size: 26px; font-weight: 500; margin-top: 6px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 12px; white-space: nowrap; background: #E8EAED; color: var(--ink2); }
.pill.green { background: var(--accent-soft); color: var(--accent-dark); }
.pill.amber { background: #FFF1CC; color: var(--warn); }
.pill.red { background: #FDE7E4; color: var(--danger-dark); }
.pill.blue { background: #E6ECFA; color: #2A4590; }
.table-scroll { overflow-x: auto; }
table.pay { width: 100%; border-collapse: collapse; min-width: 520px; }
table.pay th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 10px 0; border-bottom: 1px solid var(--line); }
table.pay td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.pay td.amount { font-weight: 600; white-space: nowrap; }
table.pay td.actions { text-align: right; white-space: nowrap; padding-right: 0; }
.doc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.doc-icon { flex: 0 0 40px; height: 48px; border: 1px solid var(--line2); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.doc .grow { flex: 1 1 180px; min-width: 0; }
.doc .name { font-weight: 600; font-size: 15px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 8px; background: none; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--ground); }
.drawer { border-top: 1px solid var(--line); padding-top: 14px; }
.details { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 14px 12px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }

/* row menus */
.menu { display: inline-flex; }
.icon-btn.dots { color: var(--muted); font-size: 22px; line-height: 1; }
.menu-list { position: fixed; z-index: 20; min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(22, 32, 42, .14); padding: 6px; display: flex; flex-direction: column; }
.menu-list button, .menu-list a { text-align: left; border: 0; background: none; padding: 10px 12px; min-height: 40px; border-radius: 6px; cursor: pointer; color: var(--ink); font-weight: 500; }
.menu-list button:hover, .menu-list a:hover { background: var(--ground); color: var(--ink); }
.menu-list .danger { color: var(--danger-dark); }

/* notifications */
.bell-badge { flex: 0 0 auto; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 12px; background: #FFF1CC; color: var(--warn); font-size: 12px; font-weight: 700; align-self: flex-start; }
.bell-badge.urgent { background: #FDE7E4; color: var(--danger-dark); }
.bell-badge svg { width: 16px; height: 16px; }
.bell-wrap { position: relative; }
.bell-btn { position: relative; width: 48px; height: 48px; border: 1px solid #8A939C; border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bell-btn:hover { background: var(--ground); }
.bell-btn svg { width: 24px; height: 24px; }
.bell-btn .count { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #8A5A00; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.bell-btn .count.urgent { background: var(--danger); }
.bell-panel { position: absolute; z-index: 15; top: 58px; right: 0; width: min(400px, calc(100vw - 48px)); background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 12px 32px rgba(22, 32, 42, .18); padding: 16px 16px 8px; }
.bell-panel h2 { font-size: 15px; margin-bottom: 6px; }
.bell-list { max-height: 320px; overflow-y: auto; padding-right: 8px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.notif i { flex: 0 0 10px; height: 10px; border-radius: 50%; background: #C98A00; margin-top: 5px; }
.notif.urgent i { background: var(--danger); }
.notif.event i { background: var(--accent); }
.notif.email i { background: #2A4590; }
.notif .body { flex: 1; min-width: 0; }
.notif .title { font-weight: 600; }
.notif .sub { font-size: 13px; color: var(--muted); }
.notif.urgent .sub { color: var(--danger-dark); font-weight: 600; }
.notif .when { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* tasks page: view switch, filters, kanban, sprints */
.seg { display: flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { min-height: 44px; padding: 0 16px; border: 0; background: var(--surface); color: var(--ink2); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.filters { padding: 12px 16px; gap: 10px; }
.filter { position: relative; }
.filter summary { list-style: none; display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; }
.filter summary::-webkit-details-marker { display: none; }
.filter summary.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.filter-panel { position: absolute; z-index: 15; top: 50px; left: 0; min-width: 220px; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 8px 24px rgba(22, 32, 42, .14); padding: 6px; }
.filter-panel label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 6px; cursor: pointer; }
.filter-panel label:hover { background: var(--ground); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.chip button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.chip button:hover { background: rgba(15, 107, 98, .15); }
.kanban { display: flex; align-items: flex-start; gap: 16px; }
.kcol { flex: 1 0 260px; min-width: 0; background: #E9ECEF; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 140px; }
.kcol.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.kcol h2 { font-size: 14px; padding: 4px; display: flex; justify-content: space-between; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 8px 12px 14px; display: flex; flex-direction: column; gap: 6px; cursor: grab; }
.kcard.late { border-color: var(--danger-line); }
.kcard .top { display: flex; align-items: flex-start; gap: 4px; }
.kcard .title { flex: 1; min-width: 0; font-weight: 600; padding-top: 4px; overflow-wrap: anywhere; }
.kcard.done .title { text-decoration: line-through; color: var(--muted); }
.kcard .icon-btn { width: 32px; height: 32px; margin-top: -2px; }
.kcard .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); padding-right: 6px; }
.sprint-block.current { border: 2px solid var(--ink); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sprint-block.current .eyebrow { color: var(--accent-dark); }
.sprint-block h2 { font-size: 18px; margin-top: 2px; }
.item .state { flex: 0 0 104px; }
.bar i.doing { background: #C98A00; }
.kcol h2 { align-items: center; padding: 0 0 0 4px; }
.kcol h2 .icon-btn { width: 36px; height: 36px; }
.kanban .add-column { flex: 0 0 130px; }

/* timeline: engagement shoots are amber diamonds, weddings are teal dots */
.tl .dot.eng { width: 12px; height: 12px; margin-left: -6px; top: 63px; border-radius: 2px; background: #C98A00; transform: rotate(45deg); }
.tl .dot.eng:hover { transform: rotate(45deg) scale(1.3); }
.tl .dot.eng.past { background: var(--surface); border: 3px solid #8A939C; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.key.eng { border-radius: 2px; background: #C98A00; transform: rotate(45deg); }
.key.past { background: var(--surface); border: 2px solid #8A939C; }
.card .fin { flex-direction: row; align-items: center; }

/* settings page and price breakdowns */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 28px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 12px 0; min-height: 44px; font-size: 16px; font-weight: 500; color: var(--ink2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.price-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px 16px; align-items: center; max-width: 560px; }
.price-grid input { width: 100%; text-align: right; }
.breakdown { margin-top: 6px; font-size: 13px; }
.breakdown summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 4px 0; }
.breakdown-lines { display: flex; flex-direction: column; gap: 4px; max-width: 420px; padding: 8px 12px; background: var(--ground); border-radius: 8px; font-size: 13px; }

/* invoice panel */
.inv-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(22, 32, 42, .45); }
.inv-panel { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(820px, 100%); overflow-y: auto; background: var(--surface); box-shadow: -12px 0 32px rgba(22, 32, 42, .18); padding: 20px 32px 48px; display: flex; flex-direction: column; gap: 18px; }
.inv-panel > * { flex-shrink: 0; }
.inv-panel h2 { margin-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 18px; }
.inv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; position: sticky; top: -20px; background: var(--surface); padding: 12px 0; z-index: 2; border-bottom: 1px solid var(--line); }
.stat .label { color: var(--muted); }
table.pay th.num, table.pay td.num { text-align: right; padding-right: 0; padding-left: 12px; white-space: nowrap; }
table.inv-items td { vertical-align: top; padding-top: 14px; padding-bottom: 14px; }
.inv-totals { align-self: flex-end; width: min(340px, 100%); display: flex; flex-direction: column; gap: 8px; }
.inv-edit-rows { display: flex; flex-direction: column; gap: 10px; }
/* each item is a grey block: name with its description underneath, quantity, price, and the line amount */
.inv-edit-item { display: grid; grid-template-columns: minmax(0, 1fr) 76px 128px 110px; gap: 12px; align-items: start; background: var(--ground); border-radius: 8px; padding: 16px; }
.inv-name { display: flex; flex-direction: column; }
.inv-name input { border-radius: 8px 8px 0 0; font-weight: 500; }
.inv-name textarea { border-top: 0; border-radius: 0 0 8px 8px; min-height: 44px; padding: 10px 12px; color: var(--ink2); }
.inv-edit-item > input { width: 100%; }
.inv-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-top: 11px; color: var(--ink2); white-space: nowrap; }
.inv-edit-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.inv-edit-foot .inv-totals { align-self: auto; }
.inv-add { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.inv-notes { margin: 0; white-space: pre-wrap; color: var(--ink2); max-width: 620px; }
@media (max-width: 700px) { .inv-panel { padding: 16px; } .inv-edit-item { grid-template-columns: minmax(0, 1fr) 64px 96px; } .inv-edit-item .inv-name { grid-column: 1 / -1; } .inv-amount { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; padding-top: 0; } }

/* contacts */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 700; vertical-align: middle; }
.contact-pick { display: flex; flex-direction: column; gap: 8px; }
.contact-pick select { width: 100%; }

/* project header photo, edit form sections */
.photo-wrap { position: relative; flex: 0 0 auto; }
.photo-wrap .menu { position: absolute; right: -4px; bottom: -4px; }
.photo-pen { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(22, 32, 42, .15); }
.photo-pen:hover { background: var(--ground); }
.photo-add { flex: 0 0 auto; width: 96px; height: 96px; border-radius: 50%; border: 1px dashed #8A939C; background: var(--ground); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-add:hover { background: var(--line); color: var(--ink); }
.form-section { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.form-section h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field-grid input, .field-grid select { width: 100%; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; }
.check-grid label { min-height: 36px; color: var(--ink); }
.check-grid:empty, #second-shooters:not(:has(label:not([hidden]))) { display: none; }
dialog.wide { max-height: calc(100vh - 48px); overflow-y: auto; }
#form-details { gap: 18px; }

/* rows you can click: soft highlight and a small slide on hover */
/* the slide uses padding, not transform: a transformed row would misplace the "..." menu inside it */
.clickable { cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; transition: background-color .16s ease, padding-left .16s ease, box-shadow .16s ease; }
.clickable:hover, .clickable:focus-within { background: var(--ground); padding-left: 14px; box-shadow: inset 3px 0 0 var(--accent); }
.clickable:hover .name { color: var(--accent-dark) !important; }
@media (prefers-reduced-motion: reduce) { .clickable { transition: none; } .clickable:hover, .clickable:focus-within { padding-left: 10px; } }

/* contacts in Project Details: clickable, with initials and an arrow on hover */
.contact-chip { display: flex; align-items: center; gap: 4px; width: calc(100% + 20px); text-align: left; border: 0; background: none; padding-top: 6px; padding-bottom: 6px; font: inherit; color: inherit; }
.contact-chip .go { font-size: 22px; color: var(--accent); opacity: 0; transition: opacity .16s ease; }
.contact-chip:hover .go, .contact-chip:focus-visible .go { opacity: 1; }

/* action items on the project page: same hover highlight as the document rows */
#tasks .item { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; transition: background-color .16s ease, padding-left .16s ease, box-shadow .16s ease; }
#tasks .item:hover, #tasks .item:focus-within { background: var(--ground); padding-left: 14px; box-shadow: inset 3px 0 0 var(--accent); }
@media (prefers-reduced-motion: reduce) { #tasks .item { transition: none; } #tasks .item:hover, #tasks .item:focus-within { padding-left: 10px; } }

/* project header: back arrow and column badge */
.back-arrow { flex: 0 0 auto; width: 44px; height: 44px; margin: 0 -8px 0 -6px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink); }
.back-arrow:hover { background: var(--ground); color: var(--ink); }
.col-badge { border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.col-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.col-badge.lead { background: #E6ECFA; color: #2A4590; }
.col-badge.lead i { background: #2A4590; }
.col-badge:hover { filter: brightness(.96); }

/* sub-pages in the side menu, finance pages */
.side a.sub { padding: 9px 12px 9px 30px; font-size: 14px; }
table.pay tr.clickable-row { cursor: pointer; transition: background-color .16s ease; }
table.pay tr.clickable-row:hover { background: var(--ground); }
@media (max-width: 700px) { .side a.sub { padding-left: 12px; } }

/* project cards: clickable block with a "..." menu that shows on hover */
.card { cursor: pointer; }
.card h3 a { color: inherit; }
.card-menu { flex: 0 0 auto; margin: -8px -8px -8px auto; opacity: 0; transition: opacity .16s ease; }
.card-menu .icon-btn { width: 36px; height: 36px; }
.card:hover .card-menu, .card:focus-within .card-menu, .card-menu:has([aria-expanded="true"]) { opacity: 1; }
@media (hover: none) { .card-menu { opacity: 1; } }

/* conversations on the project page */
.msg { display: flex; align-items: flex-start; gap: 8px; border-top: 1px solid var(--line); padding: 6px 0; }
.msg details { flex: 1 1 auto; min-width: 0; }
.msg summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; cursor: pointer; list-style: none; border-radius: 8px; }
.msg summary::-webkit-details-marker { display: none; }
.msg summary .subject { flex: 1 1 200px; min-width: 0; font-weight: 600; }
.msg summary .when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.msg .body { margin: 4px 0 10px; padding: 12px 14px; background: var(--ground); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .to { font-size: 13px; color: var(--muted); }
#form-email label.field { flex: 0 0 auto; }

/* task reports */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.report-cards .panel { min-width: 0; }
.avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.report-nums { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.report-nums b { display: block; font-size: 22px; font-weight: 500; }
.report-nums span { font-size: 12px; color: var(--muted); }
.report-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.report-line .what { min-width: 0; overflow-wrap: anywhere; }
.segmented { display: flex; border: 1px solid var(--line-strong, #C9CED4); border-radius: 8px; overflow: hidden; background: #fff; }
.segmented button { border: 0; background: none; min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }

/* team */
.member-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.member-card { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; transition: border-color .16s ease, box-shadow .16s ease; }
.member-card:hover, .member-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); color: inherit; }
.member-card .foot { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.avatar.big { flex-basis: 64px; width: 64px; height: 64px; font-size: 22px; margin-right: 0; }
dl.member-info { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; margin: 0; }
dl.member-info dt { color: var(--muted); }
dl.member-info dd { margin: 0; overflow-wrap: anywhere; }

/* task panel and history */
.inv-panel.task-panel { width: min(480px, 100%); }
/* invoice on the whole page (opened from the Invoices list, or with the expand button) */
.inv-panel.full { left: 0; width: 100%; box-shadow: none; padding: 20px max(32px, calc((100% - 1000px) / 2)) 48px; }
body.inv-full-open { overflow: hidden; }
.inv-details { display: flex; flex-direction: column; gap: 12px; background: var(--ground); border-radius: 8px; padding: 16px; }
.inv-details-head { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 700px) { .inv-panel.full { padding: 16px; } .inv-size { display: none; } }
.inv-name textarea { resize: none; overflow: hidden; }
.task-open { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: inherit; overflow-wrap: anywhere; }
.task-open:hover, .task-open:focus-visible { color: var(--accent); text-decoration: underline; }
.history { display: flex; flex-direction: column; }
.history-line { position: relative; display: flex; gap: 12px; padding-bottom: 16px; font-size: 14px; }
.history-line::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.history-line:last-child::before { display: none; }
.history-line i { flex: 0 0 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #8A939C; z-index: 1; }
.history-line i.green { background: var(--accent); }
.history-line i.amber { background: #C98A00; }
.history-line small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* tasks page: rows and cards react to the pointer and open the task */
.task-row { cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; transition: background-color .16s ease, padding-left .16s ease, box-shadow .16s ease; }
.task-row:hover, .task-row:focus-within { background: var(--ground); padding-left: 14px; box-shadow: inset 3px 0 0 var(--accent); }
.kcard[data-open-task] { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.kcard[data-open-task]:hover, .kcard[data-open-task]:focus-within { border-color: var(--accent); box-shadow: 0 4px 14px rgba(22, 32, 42, .12); }
@media (prefers-reduced-motion: reduce) { .task-row, .kcard[data-open-task] { transition: none; } .task-row:hover, .task-row:focus-within { padding-left: 10px; } }
#form-task-edit > label.field { flex: 0 0 auto; }

/* KPIs */
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.kpi-card:hover, .kpi-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); outline: none; }
.kpi-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-card .name { font-weight: 600; overflow-wrap: anywhere; }
.kpi-card .figure, .kpi-figure { font-size: 26px; font-weight: 500; }
.kpi-card .figure small, .kpi-figure small { font-size: 14px; font-weight: 400; color: var(--muted); }
.kpi-card .foot, .kpi-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink2); }
.kpi-foot { margin-top: 8px; }
.kpi-figure { font-size: 30px; margin-bottom: 10px; }
.kpi-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.kpi-bar i.amber { background: #C98A00; }
.kpi-bar i.red { background: var(--danger); }
.kpi-ms { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kpi-ms:first-child { border-top: 0; }
.kpi-ms input[type=checkbox] { margin-top: 3px; }
.kpi-ms .grow { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.kpi-ms small { display: block; font-size: 12px; color: var(--muted); }
.kpi-ms small.danger-text { color: var(--danger-dark); }
.kpi-add { margin-top: 10px; }
label.field.kpi-field { flex: 0 0 auto; }
.kpi-nums { display: flex; flex-wrap: wrap; gap: 16px 44px; }
.kpi-nums b { display: block; font-size: 26px; font-weight: 500; }
.kpi-nums span { font-size: 13px; color: var(--muted); }
.kpi-chart { position: relative; }
.kpi-chart svg { display: block; width: 100%; height: auto; }
.kpi-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--ink2); }
.kpi-legend span { display: inline-flex; align-items: center; gap: 8px; }
.kpi-legend svg { width: 28px; height: 8px; }
.kpi-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.5; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -12px; z-index: 2; }
.kpi-report-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .kpi-report-cols { grid-template-columns: minmax(0, 1fr); } }
.kpi-step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; vertical-align: 2px; }
.kpi-note { border-top: 1px solid var(--line); padding: 10px 0; display: flex; gap: 8px; align-items: flex-start; }
.kpi-note:first-child { border-top: 0; padding-top: 0; }
.kpi-note small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }

/* menu: icons and section titles */
.side a { display: flex; align-items: center; gap: 12px; }
.side a svg { flex: 0 0 20px; }
.side a.sub { padding-left: 44px; }
.side .nav-section { margin-top: 14px; padding: 14px 12px 6px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 700px) { .side a.sub { padding-left: 12px; } .side .nav-section { flex: 1 0 100%; margin-top: 6px; padding-top: 10px; } }

/* task tags */
.tag-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #EEF0F3; color: var(--ink2); font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: 1px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pick legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.tag-pick label { cursor: pointer; }
.tag-pick label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag-pick label span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line2, #C9CED4); border-radius: 17px; font-size: 13px; font-weight: 500; }
.tag-pick label input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.tag-pick label input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.task-row .tag-chip { margin-right: 3px; }

/* leads */
.lead-cols { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .lead-cols { grid-template-columns: minmax(0, 1fr); } }
.lead-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lead-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 12px 10px; margin: 0 -10px; border-top: 1px solid var(--line); border-radius: 10px; font-size: 14px; cursor: pointer; transition: background-color .16s ease, box-shadow .16s ease; }
.lead-row:hover, .lead-row:focus-visible { background: var(--ground); box-shadow: inset 3px 0 0 var(--accent); outline: none; }
.lead-row .who { flex: 1 1 160px; min-width: 0; }
.lead-row .who b { font-weight: 600; }
.lead-row .said { flex: 2 1 220px; min-width: 0; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-row .wait { flex: 0 0 auto; white-space: nowrap; color: var(--ink2); }
.lead-said-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.lead-bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 32px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.lead-bar .track { display: block; }
.lead-bar .track i { display: block; height: 8px; min-width: 2px; border-radius: 4px; background: var(--accent); }
.lead-bar b { text-align: right; font-weight: 600; }
.history-line .menu { margin-left: auto; }

/* sections that fold */
.fold-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fold-btn svg { flex: 0 0 16px; color: var(--muted); transition: transform .16s ease; }
.fold-btn[aria-expanded="true"] svg { transform: rotate(90deg); }
.fold-btn:hover svg { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .fold-btn svg { transition: none; } }

/* column titles that sort the table */
.sort-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.sort-btn span { font-size: 9px; opacity: .45; }
.sort-btn:hover, th[aria-sort] .sort-btn { color: var(--ink); }
th[aria-sort] .sort-btn span { opacity: 1; color: var(--accent); }

/* who is signed in, at the bottom of the menu */
.side .who { margin-top: auto; padding: 16px 12px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.side .who-name { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 700px) { .side .who { flex: 1 0 100%; flex-direction: row; align-items: center; justify-content: space-between; margin-top: 6px; padding-top: 10px; } }

/* sign-in page */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; }
.login-card .brand { font-size: 18px; font-weight: 700; }
.login-legal { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.login-legal a { color: inherit; }
.login-card h1 { font-size: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label.field { flex: 0 0 auto; }
.login-card .btn { justify-content: center; text-align: center; }
.login-card .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.login-card .or::before, .login-card .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-note { background: var(--accent-soft); color: var(--accent-dark); border-radius: 8px; padding: 12px 14px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }

/* the menu stays in view while the page scrolls, so "Sign out" is always reachable */
@media (min-width: 701px) {
  .side { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
  /* on a short screen the menu scrolls, and "Sign out" stays pinned at its bottom */
  .side .who { position: sticky; bottom: -24px; background: var(--surface); padding-bottom: 24px; }
}

/* hidden for the roles that cannot use them (the server refuses them anyway) */
html[data-role="employee"] [data-owner-only], html[data-role="contractor"] [data-owner-only],
html[data-role="contractor"] [data-not-contractor] { display: none !important; }

/* ---------- messages with a couple (Messages page and project page) ---------- */
.chat-box { display: flex; flex-direction: column; gap: 10px; height: 420px; }
.chat-box.tall { height: 100%; }
.chat-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; min-height: 0; }
.chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 78%; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-msg.them { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 9px 13px; border-radius: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.me .chat-bubble { background: var(--accent, #0F6B5C); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.them .chat-bubble { background: var(--ground); border-bottom-left-radius: 4px; }
.chat-meta { font-size: 12px; color: var(--muted, #55606B); margin: 0 4px; }
.chat-pic { display: block; max-width: 220px; max-height: 220px; border-radius: 12px; border: 1px solid var(--line); }
.chat-file { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.chat-compose { display: flex; align-items: flex-end; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.chat-compose:focus-within { border-color: #0F6B5C; }
.chat-compose textarea { flex: 1; border: 0; resize: none; font: inherit; padding: 7px 4px; max-height: 160px; outline: none; background: transparent; min-height: 0; }
.chat-attach { width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; color: var(--muted, #55606B); }
.chat-attach:hover { background: var(--ground); }
.chat-send { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #0F6B5C; color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.chat-send:disabled { opacity: .5; }
.inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; padding: 0; min-height: calc(100vh - 150px); overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.inbox-item { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.inbox-item:hover { background: var(--ground); }
.inbox-item[aria-current="true"] { background: #E6F2EF; }
.inbox-item .grow { flex: 1; min-width: 0; }
.inbox-item .snippet { color: var(--muted, #55606B); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item.unread .snippet { color: var(--ink); font-weight: 600; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #C0392B; color: #fff; font-size: 11px; font-weight: 700; }
nav.side a .count { margin-left: 8px; vertical-align: 1px; }
.inbox-thread { display: flex; flex-direction: column; padding: 16px 20px; gap: 10px; min-height: 0; }
.inbox-thread .chat-box { flex: 1; height: auto; min-height: 0; }
@media (max-width: 800px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.showing .inbox-list { display: none; }
  .inbox:not(.showing) .inbox-thread { display: none; }
  .inbox-thread { height: calc(100vh - 140px); }
}
@media (min-width: 801px) { .mobile-only { display: none !important; } }
.chat-email { align-self: center; max-width: 92%; font-size: 12px; color: var(--muted, #55606B); background: var(--ground); border-radius: 10px; padding: 4px 10px; }
.chat-email summary { cursor: pointer; }
.chat-email[open] { align-self: stretch; padding: 8px 12px; }
.chat-email-body { white-space: pre-wrap; color: var(--ink2); margin: 6px 0; font-size: 13px; }
#couple-panel .chat-box { height: 380px; }
.fold-head { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.fold-head h2 { margin: 0; }
.fold-chev { color: var(--muted, #55606B); font-size: 13px; font-weight: 600; white-space: nowrap; }
#couple-panel.has-new { border: 1.5px solid #0F6B5C; }
.new-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #C0392B; color: #A3271B; background: #FDF1EF; border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.folded-line { color: var(--muted, #55606B); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the copy on a computer: emails go to the studio only */
.test-banner{background:#fff4d6;border:1px solid #e8c66a;color:#5c4400;border-radius:10px;padding:8px 14px;margin:0 0 16px;font-size:14px}
.chat-in-email{white-space:pre-wrap}
.chat-email-subject{font-weight:600;margin-bottom:4px;white-space:normal}
.plain-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:14px}
.wants-box{border:1px solid var(--line);border-radius:12px;padding:12px 16px 16px;margin:0;display:flex;flex-direction:column;gap:12px;min-width:0}
.wants-box legend{font-weight:600;padding:0 6px}
nav.side a .nav-chev{margin-left:auto;color:var(--muted);flex:0 0 auto}
th.pick,td.pick{width:36px;padding-right:0}
td.pick input,th.pick input{width:18px;height:18px;cursor:pointer;vertical-align:middle}
.bulk-bar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:10px 12px;margin:8px 0;background:var(--accent-soft);border-radius:10px}
.bulk-bar b{margin-right:auto}
.check-note{background:#fff4d6;border:1px solid #e8c66a;color:#5c4400;border-radius:10px;padding:8px 12px;font-size:14px}
.form-original{border:1px solid var(--line);border-radius:10px;padding:8px 12px;font-size:14px}
.form-original summary,.inbox-more summary{cursor:pointer;font-weight:600;min-height:32px;display:flex;align-items:center}
.inbox-more{border-top:1px solid var(--line);padding-top:8px}
.label-grid{display:grid;grid-template-columns:minmax(120px,180px) 1fr;gap:8px 12px;align-items:center}
.label-grid input{width:100%}
@media (max-width:700px){.label-grid{grid-template-columns:1fr}}
.preview-table{width:100%;border-collapse:collapse;font-size:14px}
.preview-table td{padding:6px 8px;border-bottom:1px solid var(--line);vertical-align:top}
.preview-table td:first-child{color:var(--muted);white-space:nowrap;width:1%}
.inbox-more>summary,.form-original>summary{list-style:none;gap:8px}
.inbox-more>summary::-webkit-details-marker,.form-original>summary::-webkit-details-marker{display:none}
.inbox-more>summary::before,.form-original>summary::before{content:"";width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);margin:0 4px 0 2px;transition:transform .15s;color:var(--muted)}
.inbox-more[open]>summary::before,.form-original[open]>summary::before{transform:rotate(45deg)}
.draft-box{border:1px solid var(--accent);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:10px;background:var(--accent-soft)}
.draft-box .draft-head{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline}
.draft-box textarea{width:100%;font:inherit;line-height:1.45;background:var(--surface)}
.draft-box input{background:var(--surface)}
.draft-box label.field, #form-reply > label.field { flex: 0 0 auto; }
/* Settings: folding boxes (every tab) */
.panel.folded > :not(.fold-title) { display: none !important; }
.fold-title { cursor: pointer; display: flex; align-items: center; gap: 10px; user-select: none; }
.fold-title::before, #smtp-card > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 4px 4px 2px; transition: transform .15s; color: var(--muted); flex: 0 0 auto; }
.panel.folded > .fold-title::before, #smtp-card:not([open]) > summary::before { transform: rotate(-45deg); margin-bottom: 0; }
.panel-head.fold-title > h2, h2.fold-title { margin: 0; }
.panel-head.fold-title { justify-content: flex-start; }
.panel-head.fold-title > .pill { margin-left: auto; }
#smtp-card > summary { list-style: none; gap: 10px; }
#smtp-card > summary::-webkit-details-marker { display: none; }
#smtp-card:not([open]) { gap: 0; } #smtp-card > summary { min-height: 0 !important; }
/* folded emails: lead history and conversation */
.ex-fold { margin-top: 2px; }
.ex-fold > summary { cursor: pointer; list-style: none; display: flex; gap: 6px; align-items: baseline; color: var(--ink2); overflow-wrap: anywhere; }
.ex-fold > summary::-webkit-details-marker, .chat-in-email > summary::-webkit-details-marker { display: none; }
.ex-fold > summary::before, .chat-in-email > summary::before { content: "▸"; color: var(--muted); flex: 0 0 auto; }
.ex-fold[open] > summary::before, .chat-in-email[open] > summary::before { content: "▾"; }
.ex-fold[open] > summary { margin-bottom: 6px; font-weight: 600; }
.chat-in-email > summary { cursor: pointer; list-style: none; display: flex; gap: 6px; margin-bottom: 0; }
.chat-in-email[open] > summary { margin-bottom: 6px; }

/* ================= phone: bottom tabs, ＋, sheets, cards instead of tables ================= */
.tabbar, .sheet, .sheet-backdrop, .filters-toggle { display: none; }
@media (max-width: 700px) {
  nav.side { display: none; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  main { padding: 16px 14px 20px; gap: 16px; }
  h1 { font-size: 24px; }
  /* no zoom when a field is tapped (iPhone zooms on text under 16px) */
  input, select, textarea { font-size: 16px !important; }

  .tabbar { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; align-items: flex-end; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar .tab { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center;
    border: 0; background: none; color: var(--muted); font: 600 11px/1.2 inherit; cursor: pointer; text-decoration: none; }
  .tabbar .tab[aria-current="page"] { color: var(--accent); }
  .tabbar .tab .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .tab-add { flex: 0 0 auto; width: 56px; height: 56px; margin: -24px 6px 0; border-radius: 50%; border: 4px solid var(--surface); background: var(--accent); color: #fff;
    display: grid; place-items: center; box-shadow: 0 6px 16px rgba(15, 107, 98, .35); cursor: pointer; }
  .sheet-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 38; background: rgba(22, 32, 42, .35); }
  .sheet:not([hidden]) { display: block; position: fixed; z-index: 39; left: 0; right: 0; bottom: calc(70px + env(safe-area-inset-bottom)); max-height: 70vh; overflow-y: auto;
    background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px 16px 16px; box-shadow: 0 -8px 30px rgba(22, 32, 42, .18); }
  .sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line2); margin: 0 auto 12px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .sheet-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 12px;
    color: var(--ink2); font-size: 13px; font-weight: 600; text-align: center; }
  .sheet-item.on { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
  .sheet-who { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 600; }
  .sheet-list { display: flex; flex-direction: column; gap: 8px; }
  .sheet-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 15px; font-weight: 600; }

  /* headers: title, then search and buttons on their own lines, nothing stranded */
  .page-head { gap: 10px; }
  .page-head > div:first-child { flex: 1 1 100%; }
  .page-head .search { flex: 1 1 100%; max-width: none; }
  .page-head .push { margin-left: 0; }
  .test-banner { font-size: 12px; padding: 5px 10px; margin: 0; border-radius: 8px; }
  .panel { padding: 16px; }

  /* tabs and chips on one line that slides sideways */
  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 22px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; font-size: 15px; }

  /* filters folded behind one button */
  .panel.filters .filters-toggle { display: inline-flex; align-items: center; align-self: flex-start; }
  .panel.filters:not(.open) > :not(.filters-toggle) { display: none !important; }

  /* tables become cards */
  .table-scroll { overflow: visible; }
  table.pay { min-width: 0 !important; width: 100%; border-collapse: separate; }
  table.pay thead { display: none; }
  table.pay tbody, table.pay tfoot { display: block; }
  table.pay tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); position: relative; }
  table.pay td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex: 1 1 100%; padding: 2px 0 !important; border: 0 !important;
    text-align: right; min-width: 0; max-width: none !important; white-space: normal !important; overflow-wrap: anywhere; }
  table.pay td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: left; flex: 0 0 auto; }
  table.pay td[data-label=""]::before { content: none; }
  table.pay td[data-label=""] { justify-content: flex-start; text-align: left; }
  /* first real column: the name, in bold, without a label */
  table.pay td:first-child:not(.pick), table.pay td.pick + td { font-size: 15px; font-weight: 600; justify-content: flex-start; text-align: left; flex: 1 1 0; }
  table.pay td:first-child:not(.pick)::before, table.pay td.pick + td::before { content: none; }
  table.pay td.pick { flex: 0 0 auto; }
  table.pay td.actions, table.pay td:last-child:has(.menu) { flex: 0 0 auto; position: absolute; top: 8px; right: 0; }
  table.pay td.actions::before, table.pay td:last-child:has(.menu)::before { content: none; }
  table.pay tr.clickable-row { cursor: pointer; }

  /* project board: one column at a time, sliding */
  .board-scroll { scroll-snap-type: x mandatory; }
  .board > * { scroll-snap-align: start; }

  /* project page: what you need first */
  .hero { gap: 12px; }
  .hero .photo, .hero .photo-add { width: 64px; height: 64px; }
  .hero .back-arrow { display: none; }
  .cols { display: flex; flex-direction: column; gap: 16px; }
  .cols > .wide, .cols > .narrow { display: contents; }
  /* money and the facts first, then what to answer and do, then reference, then history */
  #sec-payments { order: 1; } #sec-details { order: 2; } #couple-panel { order: 3; } #sec-tasks { order: 4; }
  #sec-questionnaire { order: 5; } #sec-crew { order: 6; } #sec-documents { order: 7; } #sec-notes { order: 8; } #sec-galleries { order: 9; }
  #sec-activity { order: 10; }

  /* windows and side panels use the whole screen */
  dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; padding: 20px 16px; }
  .inv-panel { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  dialog, dialog.wide { width: 100% !important; max-width: 100% !important; left: 0; right: 0; margin: auto 0 0 !important; box-sizing: border-box; }
  /* project header: photo and name side by side, bell in the corner */
  .hero { position: relative; flex-wrap: nowrap; align-items: center; padding-right: 64px; }
  .hero .info { flex: 1 1 auto; gap: 4px; }
  .hero .info h1 { font-size: 22px; }
  .hero > .menu:last-child, .hero .bell-wrap, .hero > .notif-menu { position: absolute; top: 14px; right: 14px; }
  /* a task: its menu in the corner, not on a line of its own */
  .task-row { position: relative; padding-right: 40px; }
  .task-row > .menu:last-child { position: absolute; top: 8px; right: 4px; }
}

/* ---------- Today (layout F): cards that open bigger in place ---------- */
.today-head h1 { font-size: 28px; }
.safe-chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.safe-chip.bad { background: #FDE7E4; color: var(--danger-dark); }
.today-open { display: flex; flex-direction: column; gap: 16px; }
.today-open:empty { display: none; }
.today { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 18px; align-items: start; }
.today-main, .today-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.today-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.today-cards.single { grid-template-columns: minmax(0, 1fr); }
.today-cards:empty { display: none; }
.t-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 16px; }
.t-card.hot { border-color: var(--danger-line); }
.t-card.big { padding: 18px 22px; gap: 4px; }
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.t-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.t-title .muted { font-size: 13px; }
.t-title a { color: inherit; }
.t-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.t-count { font-size: 22px; font-weight: 700; }
.t-count.hot { color: var(--danger-dark); }
.t-expand { width: 32px; height: 32px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); display: grid; place-items: center; color: var(--ink2); cursor: pointer; }
.t-expand:hover { background: var(--ground); }
.t-expand.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.t-line { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.t-line:last-of-type { border-bottom: 0; }
.t-line.done { opacity: .45; text-decoration: line-through; }
.t-line input[type=checkbox] { width: 20px; height: 20px; margin: 1px 0 0; }
.t-line .btn { flex: 0 0 auto; }
.t-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; margin-top: 6px; display: inline-block; }
.t-dot.red { background: var(--danger); } .t-dot.amber { background: #B07A00; } .t-dot.grey { background: #8A939C; } .t-dot.none { background: transparent; border: 1.5px solid var(--line2); }
.t-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-text b { font-size: 15px; font-weight: 600; }
.t-text .pill { align-self: flex-start; margin: 2px 0; font-size: 10px; padding: 3px 8px; }
.t-text .muted { font-size: 13px; }
.t-link { color: inherit; } .t-link:hover b { text-decoration: underline; }
.t-empty { margin: 10px 0 4px; font-size: 14px; }
.t-more { align-self: flex-start; border: 0; background: none; padding: 10px 0 2px; color: var(--accent); font-weight: 600; cursor: pointer; margin-top: auto; }
.t-more:hover { color: var(--accent-dark); }
.t-seg { align-self: flex-start; margin: 10px 0 4px; }
.t-seg button { min-height: 34px; padding: 0 12px; font-size: 13px; }
.t-table { min-width: 720px; }
.t-table td.right { text-align: right; }
.t-wed { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; flex-wrap: wrap; }
.t-wed:last-of-type { border-bottom: 0; }
.t-wed:hover b { text-decoration: underline; }
.t-date { width: 40px; text-align: center; flex: 0 0 auto; }
.t-date small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.t-date b { font-size: 22px; line-height: 1.1; }
.w-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.w-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); white-space: nowrap; }
.w-chip.bad { background: #FDE7E4; color: var(--danger-dark); font-weight: 600; }
.w-chip.warn { background: #FFF1CC; color: var(--warn); }
.ag-cap { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 12px 0 2px; text-transform: uppercase; }
.ag-line { display: flex; gap: 10px; padding: 5px 0; font-size: 14px; }
.ag-time { width: 64px; flex: 0 0 auto; font-weight: 600; font-size: 13px; padding-top: 1px; }
.ag-bar { border-left: 3px solid var(--accent); padding-left: 10px; display: flex; flex-direction: column; color: inherit; min-width: 0; }
.ag-bar .muted { font-size: 12.5px; }
.ag-bar.gc { border-color: #3550A8; } .ag-bar.amber { border-color: #B07A00; } .ag-bar.crm { border-color: #5BA89E; }
.ag-bar.conflict { border-color: var(--danger); } .ag-bar.conflict b { color: var(--danger-dark); }
a.ag-bar:hover b { text-decoration: underline; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.month .wd { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.md { border: 1px solid var(--line); border-radius: 8px; min-height: 92px; padding: 6px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.md b { font-size: 12px; } .md.past { background: #F7F8FA; color: #8A939C; } .md.now { border: 2px solid var(--ink); }
.ag-ev { border-radius: 6px; padding: 3px 6px; background: #E6F2EF; color: var(--ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.ag-ev.wed { background: var(--accent); color: #fff; } .ag-ev.gc { background: #E6ECFA; } .ag-ev.amber { background: #FFF1CC; }
.ag-ev.conflict { background: #FDE7E4; color: var(--danger-dark); font-weight: 600; }
a.ag-ev:hover { filter: brightness(.95); }
.ag-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ag-legend .ag-ev { display: inline-block; }
.s-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.s-row:last-of-type { border-bottom: 0; }
@media (max-width: 1100px) { .today { grid-template-columns: minmax(0, 1fr); } .today-side { order: -1; } }
@media (max-width: 700px) {
  .today-cards { grid-template-columns: minmax(0, 1fr); }
  .today-head .safe-chip { margin-left: 0; }
  .t-line { flex-wrap: wrap; }
  .t-line .btn { margin-left: 20px; }
  .w-chips { margin-left: 54px; justify-content: flex-start; }
  .t-card.big { padding: 14px 16px; }
}
@media (max-width: 700px) {
  .tabbar .tab[data-sheet] { position: relative; }
  .tabbar .tab[data-sheet] .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .sheet-item { position: relative; } .sheet-item .count { position: absolute; top: 6px; right: 8px; }
}
.cal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cal-box { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cal-box h3 { font-size: 14px; font-weight: 600; }
.cal-link input { flex: 1 1 200px; font-size: 13px; }
@media (max-width: 900px) { .cal-grid { grid-template-columns: minmax(0, 1fr); } }
.t-card a.btn, .t-table a.btn { display: inline-flex; align-items: center; justify-content: center; }
.ag-time { width: 76px; }
@media (max-width: 1100px) { .today-side { display: contents; } #slot-agenda { order: -1; } #slot-safety { order: 2; } #slot-agenda:empty, #slot-safety:empty { display: none; } }

/* ---------- Messages: one conversation per person (layout A) ---------- */
main.msg-main { padding: 0; gap: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
main.msg-main .test-banner { margin: 12px 16px 0; }
.msg { display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); flex: 1; min-height: 0; background: var(--surface); }  /* the list and the conversation scroll on their own */
.msg-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.msg-list-head { padding: 20px 16px 10px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.msg-list-head h1 { font-size: 24px; }
.msg-list-head input { width: 100%; height: 38px; }
.msg-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-filters .f { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); cursor: pointer; }
.msg-filters .f.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.msg-item { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: inherit; }
.msg-item:hover { background: var(--ground); }
.msg-item.on { background: #E6F2EF; }
.msg-av { width: 36px; height: 36px; border-radius: 50%; background: #D7E4F5; color: #2A4590; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.msg-item-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-item-n { display: flex; justify-content: space-between; gap: 8px; }
.msg-item-n .muted { font-size: 12px; white-space: nowrap; }
.msg-snip { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item.unread .msg-snip { color: var(--ink); font-weight: 600; }
.msg-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; align-items: center; }
.kind { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px; text-transform: uppercase; background: #EEF0F3; color: var(--ink2); vertical-align: middle; }
.kind.client { background: var(--accent-soft); color: var(--accent-dark); } .kind.lead { background: #FFF1CC; color: var(--warn); } .kind.keep { background: #E6ECFA; color: #2A4590; }
.ch { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #EEF0F3; color: var(--ink2); white-space: nowrap; line-height: 1.6; }
.ch-email { background: #FDE7E4; color: #9A1C12; } .ch-portal { background: var(--accent-soft); color: var(--accent-dark); } .ch-form { background: #FFF1CC; color: var(--warn); }
.ch-instagram { background: #F3E4FA; color: #7A2A93; } .ch-facebook { background: #E6ECFA; color: #2A4590; }
.unk { margin: 4px 12px 10px; border: 1px dashed var(--danger-line); background: #FFF8F7; border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.unk > b { color: var(--danger-dark); }
.unk-row { border-top: 1px solid #F3D3CF; padding-top: 8px; }
.unk select { height: 34px; font-size: 13px; max-width: 200px; }
.msg-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ground); }
.thread-top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.thread-top h2 { font-size: 18px; display: flex; gap: 8px; align-items: center; }
.thread-top .muted { font-size: 13px; }
.keep-box { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; }
.keep-box .link-btn { font-size: 13px; padding: 2px 0; }
.thread { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.stage { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .05em; margin-top: 6px; }
.stage::before, .stage::after { content: ""; flex: 1; border-top: 1px dashed var(--line2); }
.bub { max-width: 76%; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.bub.me { align-self: flex-end; background: #E6F2EF; border-color: #BFDDD7; }
.bub.memo { align-self: center; background: #FFF8E6; border-color: #F0D58A; font-size: 13px; }
.bub-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.small-link { font-size: 12px; padding: 0 0 0 4px; }
.bub-subj { font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.bub .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.bub details summary { cursor: pointer; white-space: pre-wrap; }
.msg-img { max-width: 220px; max-height: 220px; border-radius: 8px; margin-top: 8px; display: block; }
.att { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; border: 1px solid var(--line2); border-radius: 8px; padding: 4px 8px; background: var(--surface); margin: 8px 6px 0 0; color: var(--ink); }
.comp { background: var(--surface); border-top: 1px solid var(--line); padding: 12px 22px 14px; display: flex; flex-direction: column; gap: 8px; }
.comp-row { gap: 10px; }
.comp .hint { font-size: 12px; color: var(--muted); }
.comp textarea { min-height: 84px; }
.comp details input { width: 100%; margin-top: 6px; }
.small-seg button { min-height: 34px; padding: 0 12px; font-size: 13px; }
.mobile-only { display: none; }
@media (max-width: 800px) {
  main.msg-main { height: auto; overflow: visible; display: block; }
  .msg { grid-template-columns: minmax(0, 1fr); height: auto; min-height: calc(100vh - 80px); }
  .msg.showing .msg-list { display: none; }
  .msg:not(.showing) .msg-thread { display: none; }
  .msg-thread { min-height: calc(100vh - 140px); }
  .mobile-only { display: inline-block; }
  .bub { max-width: 92%; }
  .thread-top, .thread, .comp { padding-left: 14px; padding-right: 14px; }
  .keep-box { align-items: flex-start; }
}
.ret-grid { display: flex; flex-direction: column; gap: 4px; }
.ret-row { display: grid; grid-template-columns: 1.2fr 1.3fr 1.6fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ret-row select { height: 38px; }
.ret-head { border-top: 0; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); padding-bottom: 0; }
.warn-box { background: #FFF8E6; border: 1px solid #F0D58A; border-radius: 12px; padding: 14px 18px; }
.warn-box ul { margin: 8px 0 0; padding-left: 18px; }
@media (max-width: 800px) { .ret-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } .ret-head { display: none; } }
a.warn-box { color: var(--ink); display: block; }
.msg > .msg-list, .msg > .msg-thread { min-height: 0; max-height: 100%; }
.msg > .msg-thread { overflow: hidden; }
@media (max-width: 800px) { .msg > .msg-list, .msg > .msg-thread { max-height: none; } .msg > .msg-thread { overflow: visible; } }
/* the title, search and filters stay put; only the people scroll */
.msg > .msg-list { overflow: hidden; }
.msg-list-head { position: static; }
#msg-unmatched { flex: 0 0 auto; max-height: 40%; overflow-y: auto; }
#msg-items { flex: 1; min-height: 0; overflow-y: auto; }
@media (max-width: 800px) { .msg > .msg-list { overflow: visible; } #msg-items, #msg-unmatched { max-height: none; overflow: visible; } }
/* Messages: the side panel about the couple */
.msg { grid-template-columns: 340px minmax(0, 1fr) 300px; }
.msg-panel { border-left: 1px solid var(--line); background: var(--surface); padding: 18px 18px 24px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.msg-panel h3 { font-size: 11px; font-weight: 700; letter-spacing: .07em; color: var(--muted); margin: 10px 0 2px; }
.msg-panel h3:first-of-type { margin-top: 0; }
.msg-panel .kv { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.msg-panel .kv span:last-child { text-align: right; }
.panel-acts { display: flex; flex-direction: column; gap: 6px; }
.panel-acts .btn { display: flex; align-items: center; justify-content: flex-start; }
.panel-task { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.panel-task input { margin-top: 2px; }
.panel-task .muted { font-size: 12px; }
.panel-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-top: 4px; }
.panel-add input[type=text] { grid-column: 1 / -1; height: 36px; font-size: 13px; }
.panel-add input[type=date] { height: 36px; font-size: 13px; }
.panel-money { border-top: 1px solid var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.panel-keep { margin-top: auto; padding-top: 12px; font-size: 12px; }
.panel-close, .panel-toggle { display: none; }
.keep-box { gap: 4px; }
@media (max-width: 1250px) {
  .msg { grid-template-columns: 320px minmax(0, 1fr); position: relative; }
  .msg-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 320px; box-shadow: -12px 0 30px rgba(0,0,0,.12); z-index: 5; transform: translateX(105%); transition: transform .2s; }
  .msg.panel-open .msg-panel { transform: none; }
  .panel-toggle, .panel-close { display: inline-flex; align-items: center; }
  .panel-close { align-self: flex-end; padding: 0; }
}
@media (max-width: 800px) {
  .msg { grid-template-columns: minmax(0, 1fr); }
  .msg-panel { position: fixed; top: 0; bottom: 0; width: min(340px, 90vw); z-index: 45; }
}

/* New project: the tasks it will get (Settings > Task templates) */
#dlg-project { max-height: calc(100vh - 48px); overflow-y: auto; }
.np-tasks-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 4px; }
.np-tasks { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px 8px; }
.np-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 2px; }
.np-task { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; cursor: pointer; }
.np-task .np-title { flex: 1; }
.np-task .np-when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.np-tasks .small, .tt-help { font-size: 13px; }

/* Settings > Task templates */
.tt-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.tt-row { display: grid; grid-template-columns: minmax(170px, 1fr) 72px 205px 165px 165px 34px; gap: 8px; align-items: center; }
.tt-row input, .tt-row select { width: 100%; box-sizing: border-box; }
.tt-row .tt-days { padding-left: 12px; padding-right: 6px; }
.tt-row .tt-when, .tt-row .tt-who { text-overflow: ellipsis; }
.tt-row .tt-tags input[type=checkbox] { width: auto; }
.tt-tags { position: relative; }
.tt-tags summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 36px;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; box-sizing: border-box; }
.tt-tags summary::-webkit-details-marker { display: none; }
.tt-tags[open] summary { border-color: var(--accent, currentColor); }
.tt-tag-menu { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); min-width: 190px; max-height: 260px; overflow-y: auto;
  background: var(--panel, var(--surface)); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.tt-tag-menu label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 13.5px; cursor: pointer; }
.tt-tag-menu label:hover { background: var(--accent-soft); }
@media (max-width: 760px) {
  .tt-row { grid-template-columns: 70px 1fr 34px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .tt-row .tt-title { grid-column: 1 / -1; }
  .tt-row .tt-who { grid-column: 1 / -1; grid-row: 3; }
  .tt-row .tt-tags { grid-column: 1 / -1; grid-row: 4; }
  .tt-tag-menu { left: 0; right: auto; }
}

/* Project page: the client journey under the couple's name */
.pj-steps { flex: 1 1 100%; list-style: none; margin: 6px 0 0; padding: 0; display: flex; }
.pj-steps li { flex: 1; position: relative; text-align: center; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.pj-steps li::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.pj-steps li:first-child::before { display: none; }
.pj-steps li.done::before, .pj-steps li.now::before { background: var(--projects, var(--accent)); }
.pj-dot { position: relative; z-index: 1; width: 24px; height: 24px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--line2);
  background: var(--panel, var(--surface)); display: grid; place-items: center; font-size: 12px; margin-bottom: 6px; }
.pj-steps li.done .pj-dot { background: var(--projects, var(--accent)); border-color: var(--projects, var(--accent)); color: #000; }
.pj-steps li.now .pj-dot { border-color: var(--money, var(--warn)); box-shadow: 0 0 0 4px rgba(248, 234, 59, .18); }
.pj-steps li b { font-weight: 600; }
.pj-steps li.now b { color: var(--money, var(--warn)); }
.pj-steps li.next b { color: var(--muted); font-weight: 500; }
.pj-sub { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .hero { flex-wrap: wrap; }
  .pj-steps li { font-size: 11px; }
  .pj-steps li b { line-height: 1.2; }
  .pj-steps .pj-sub { display: none; }
  .pj-steps li.now .pj-sub { display: block; font-size: 10.5px; }
}

/* did the couple open the document */
.opened-yes { color: var(--ink2); font-weight: 600; }
.opened-yes::before { content: "● "; color: var(--projects, #4C9A5A); font-size: 10px; }
.opened-no { font-style: italic; }

/* project bell: remove a notification once seen */
.bell-head { display: flex; justify-content: space-between; align-items: center; }
.notif-x { flex: 0 0 auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 6px; line-height: 1; }
.notif-x:hover, .notif-x:focus-visible { color: var(--ink); background: var(--accent-soft); }

/* Today › Customize: hide cards and chart bands */
#customize { margin-left: 8px; align-self: center; }
.safe-chip[hidden] + #customize { margin-left: auto; }
.hidden-bar { margin-top: 18px; border: 1px dashed var(--line2); border-radius: 16px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.hidden-bar .link-btn { padding: 0; font-weight: 600; text-decoration: underline; color: var(--ink); }
.ag-cap { display: flex; justify-content: space-between; align-items: center; }
.layout-form #layout-list { max-height: 60vh; overflow-y: auto; }
.sw-cap { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 0 2px; }
.sw-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; }
input[type=checkbox].switch { appearance: none; -webkit-appearance: none; width: 40px; height: 23px; padding: 0; border: 0; border-radius: 12px; background: var(--line2); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .15s; }
input[type=checkbox].switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--surface, #fff); transition: transform .15s; }
input[type=checkbox].switch:checked { background: var(--accent); }
input[type=checkbox].switch:checked::after { transform: translateX(17px); background: var(--canvas, #fff); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 700px) { #customize { margin-left: 0; } }

/* Settings › Backups › Off-site copy */
.off-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 12px; }
.off-grid .off-wide { grid-column: 1 / -1; }
.off-help { margin-top: 10px; font-size: 14px; }
.off-help summary { cursor: pointer; font-weight: 600; }
.off-help ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink2); }
.off-status { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin-top: 10px; color: var(--ink2); }
@media (max-width: 700px) { .off-grid { grid-template-columns: 1fr; } }
#offsite .btn:disabled { opacity: .4; cursor: not-allowed; }

/* Activity card (project page, lead panel) */
.act-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.act-chip { border: 1px solid var(--line2); background: none; color: var(--ink2); border-radius: 14px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.act-chip[aria-pressed="true"] { background: var(--ink); color: var(--canvas, #fff); border-color: var(--ink); }
.act-day { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 12px 0 2px; }
.act-ev { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.act-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; flex: none; color: #000; background: var(--line2); }
.act-ic.area-money { background: var(--money, #F8EA3B); }
.act-ic.area-clients { background: var(--clients, #FF5128); }
.act-ic.area-tasks { background: var(--tasks, #9B8DB0); }
.act-ic.area-projects { background: var(--projects, #DAE5D8); }
.act-ic.auto { background: var(--line); color: var(--ink); }
.act-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.act-text b { font-weight: 600; }
.act-text span:not(.act-auto) { display: block; color: var(--muted); font-size: 12.5px; }
.act-auto { font-size: 11px; border: 1px dashed var(--insight, #8F8200); color: var(--ink2); border-radius: 10px; padding: 0 7px; white-space: nowrap; }
.act-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.act-more { margin-top: 10px; padding: 0; text-decoration: underline; }
.lead-activity { margin-top: 18px; }
.lead-activity .panel-head h2 { margin: 0; }

/* a contract waiting for signature, shown on the project page */
.contract-text { max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.55; }
.contract-text h2 { font-size: 17px; margin: 0 0 8px; }
.contract-text h3 { font-size: 14px; margin: 14px 0 4px; }
.contract-text p { margin: 0 0 6px; }
.contract-text p.li { padding-left: 14px; position: relative; }
.contract-text p.li::before { content: "•"; position: absolute; left: 2px; }

/* Templates page */
.tpl-panel { display: flex; flex-direction: column; gap: 20px; }
.ct-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ct-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: none; color: var(--ink); border-radius: 12px; padding: 10px 14px; cursor: pointer; font: inherit; }
.ct-item.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ct-fields { font-size: 13px; line-height: 2; }
.ct-chip { border: 1px solid var(--line2); background: none; color: var(--ink2); border-radius: 10px; padding: 1px 8px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; cursor: pointer; margin: 0 2px; }
.ct-chip:hover { border-color: var(--ink); color: var(--ink); }
.ct-body { width: 100%; box-sizing: border-box; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; border-radius: 12px; min-height: 420px; resize: vertical; }
.ct-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ct-services textarea { width: 100%; box-sizing: border-box; font-size: 13px; }
.doc-tpl-list h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.doc-tpl { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc-tpl-form { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line2); border-radius: 14px; padding: 14px; margin: 8px 0; }
.doc-lines { display: flex; flex-direction: column; gap: 8px; }
.doc-line { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(140px, 1.6fr) 80px 110px auto; gap: 8px; align-items: center; }
.doc-line input { width: 100%; box-sizing: border-box; }
.tpl-pick { margin-bottom: 4px; }
.tpl-save { margin: 6px 0 4px; }
.tpl-save .row { margin-top: 6px; }
@media (max-width: 760px) {
  .doc-line { grid-template-columns: 1fr 1fr; }
  .doc-line [data-k=name], .doc-line [data-k=description] { grid-column: 1 / -1; }
}

/* Project › Questionnaire & timeline (js/project-questionnaire.js) */
#sec-questionnaire { display: flex; flex-direction: column; gap: 12px; }
.qa-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-pills .pill { margin: 0; }
.qa-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 14px; }
.qa-tl li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.qa-tl li:last-child { border-bottom: 0; }
.qa-tl .t { font-variant-numeric: tabular-nums; color: var(--ink2); }
.qa-tl .t small { color: var(--muted); font-size: 12px; margin-left: 2px; }
.qa-tl li.qa-key { font-weight: 600; }
.qa-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-tabs button { font: inherit; font-size: 13.5px; border: 1px solid var(--line2, var(--line)); background: transparent; color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.qa-tabs button[aria-selected="true"] { background: var(--projects, var(--accent-soft)); border-color: var(--projects, var(--accent-soft)); color: #000; }
.qa-count { font-size: 12px; opacity: .7; }
.qa-pane { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.qa-scroll { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.qa-scroll.has-more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
.qa-scroll .qa-sec h3 { position: sticky; top: -12px; background: var(--canvas, var(--surface)); padding: 4px 0; z-index: 1; }
.qa-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.qa-bar i { display: block; height: 100%; background: var(--projects, var(--accent)); }
.qa-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qa-kv div { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qa-kv span { font-size: 12.5px; color: var(--muted); }
.qa-kv b { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-keys { font-size: 13px; }
.qa-keys b { font-weight: 500; color: var(--ink); }
.qa-full { align-self: flex-start; font-size: 13px; text-align: left; }
.qa-answers { display: flex; flex-direction: column; gap: 14px; }
.qa-pane .qa-sec + .qa-sec { margin-top: 12px; }
.qa-dialog { width: min(1100px, 94vw); max-height: 88vh; border: 1px solid var(--line2, var(--line)); border-radius: 22px; padding: 20px 22px; background: var(--panel, var(--surface)); color: var(--ink); }
.qa-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.qa-dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.qa-dlg-head h2 { margin: 0; }
.qa-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.qa-side h3 { font-size: 15px; margin: 0 0 8px; }
.qa-side .qa-sec h3 { font-size: 14px; margin: 12px 0 6px; }
@media (max-width: 760px) { .qa-tl .t small { display: none; } .qa-tl li { grid-template-columns: 86px minmax(0, 1fr) !important; } .qa-side { grid-template-columns: minmax(0, 1fr); } .qa-kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .qa-dialog { width: 100vw; max-width: 100vw; } }
.qa-sec h3 { font-size: 15px; margin: 0 0 6px; }
.qa { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
.qa dt { color: var(--muted); }
.qa dd { margin: 0; }
.qa-text { white-space: pre-wrap; }
.qa-list { margin: 0; padding-left: 18px; }
@media (max-width: 700px) { .qa { grid-template-columns: minmax(0, 1fr); } .qa dd { margin-bottom: 6px; } .qa-tl li { grid-template-columns: 118px minmax(0, 1fr); } }

/* Templates › Questionnaire and Timelines */
.qt-sec, .dt-day { display: flex; flex-direction: column; gap: 10px; }
.qt-sec .panel-head, .dt-day .panel-head { gap: 10px; }
.qt-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line2, var(--line)); font-size: 13px; }
.qt-title, .dt-name { flex: 1 1 auto; font-weight: 600; }
.qt-intro { width: 100%; }
.qt-qs { display: flex; flex-direction: column; gap: 10px; }
.qt-q { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto auto; gap: 6px 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.qt-q .qt-help { grid-column: 1 / -1; font-size: 13px; }
.qt-moves { display: inline-flex; gap: 2px; }
.qt-moves .icon-btn { width: 32px; height: 32px; }
.dt-rows { display: flex; flex-direction: column; gap: 8px; }
.dt-row { display: grid; grid-template-columns: minmax(160px, 1fr) 80px 220px auto auto 34px; gap: 8px; align-items: center; }
.dt-row input[type=text], .dt-row select, .dt-off { width: 100%; box-sizing: border-box; }
@media (max-width: 760px) {
  .qt-q { grid-template-columns: minmax(0, 1fr) auto; }
  .qt-q .qt-label { grid-column: 1 / -1; }
  .dt-row { grid-template-columns: 76px minmax(0, 1fr) 34px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .dt-row .dt-title { grid-column: 1 / -1; }
  .dt-row label.inline { grid-column: span 1; }
}

/* lists that show a few rows then scroll (fitRows in common.js): Activity, Action items */
.fit-rows { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.fit-rows.has-more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
.fit-rows:focus-visible { outline: 2px solid var(--line2, var(--line)); outline-offset: 2px; }

/* Project › Team (js/project-crew.js): one line per role, like Action items */
#sec-crew { display: flex; flex-direction: column; gap: 10px; }
.crew-list { display: flex; flex-direction: column; }
.crew-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; min-height: 48px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.crew-row:last-child { border-bottom: 0; }
.crew-row .pill { margin: 0; white-space: nowrap; }
.crew-row .dots { width: 32px; height: 32px; }
.crew-row:not(:has(.menu)) { grid-template-columns: 32px minmax(0, 1fr) auto; }
.crew-mid { min-width: 0; }
.crew-main { display: flex; flex-direction: column; min-width: 0; font-size: 14.5px; line-height: 1.25; }
.crew-main b, .crew-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-main small { font-size: 12.5px; color: var(--muted); }
.crew-main b { font-weight: 500; }
.crew-main .link-btn { padding: 0; font-size: 14.5px; text-decoration: underline; align-self: flex-start; min-height: 0; text-align: left; white-space: nowrap; }
.crew-mid select, .crew-mid input { width: 100%; font-size: 14px; }
.crew-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--line); color: var(--muted); }
.crew-av.ok { background: var(--projects, var(--accent-soft)); color: #000; }
.crew-av.wait { background: transparent; border: 1.5px dashed var(--money, #C98A00); color: var(--money, #C98A00); }
.crew-av.no { background: transparent; border: 1.5px solid var(--clients, #B42318); color: var(--clients, #B42318); }
:root[data-theme="light"] .crew-av.wait { border-color: #B8A500; color: #6E6000; }
.crew-note { font-size: 12.5px; margin-top: 2px; }
.crew-warn { margin: 0; font-size: 13px; color: var(--danger-dark, #B42318); }
.crew-msg:empty { display: none; }

/* Today › You're needed / Your weddings (js/today-crew.js): one line per wedding */
#crew-ask { margin-bottom: 16px; }
.crew-ask-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.crew-ask-row:last-child { border-bottom: 0; }
.crew-ask-row .grow { flex: 1 1 200px; min-width: 0; line-height: 1.3; }
.crew-ask-row .grow small { display: block; font-size: 12.5px; }
.crew-ask-row:not(.wait) { flex-wrap: nowrap; }
.crew-ask-row b { font-weight: 500; }
.crew-dayof { font-size: 13.5px; text-decoration: underline; color: var(--ink); }
.crew-why { display: flex; gap: 6px; margin-top: 6px; }
.crew-why input { flex: 1; min-width: 0; }
.crew-why[hidden] { display: none; }

/* Day-of sheet (dayof.html) */
.dayof { max-width: 760px; }
.dof-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.dof-head h1 { font-size: clamp(26px, 6vw, 44px); }
.dof-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.dof-tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; background: var(--canvas, var(--ground)); scrollbar-width: none; }
.dof-tabs button { flex: none; font: inherit; font-size: 14px; border: 1px solid var(--line2, var(--line)); background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.dof-tabs button[aria-selected="true"] { background: var(--projects, var(--accent-soft)); border-color: var(--projects, var(--accent-soft)); color: #000; }
.dof-pane { display: flex; flex-direction: column; gap: 12px; }
.dof-pane[hidden] { display: none; }
.dof-print-title { display: none; }
.dof-card { border: 1px solid var(--line2, var(--line)); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.dof-card h3 { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.dof-q { display: flex; flex-direction: column; gap: 3px; }
.dof-label { font-size: 13px; color: var(--muted); }
.dof-val { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dof-val > span:first-child { white-space: pre-wrap; min-width: 0; }
.dof-acts { display: inline-flex; gap: 6px; flex: none; }
.dof-btn { display: inline-flex; align-items: center; border: 1px solid var(--line2, var(--line)); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--ink); text-decoration: none; }
.dof-ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.dof-tl { list-style: none; margin: 0; padding: 0; }
.dof-tl li { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; padding: 7px 6px; border-bottom: 1px solid var(--line); }
.dof-tl li:last-child { border-bottom: 0; }
.dof-tl li.k { font-weight: 600; }
.dof-tl li.now { background: var(--money, #F8EA3B); color: #000; border-radius: 10px; }
.dof-tl li.now .muted { color: rgba(0, 0, 0, .6); }
.dof-tl .t { font-variant-numeric: tabular-nums; }
.dof-place { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.dof-now { background: var(--money, #F8EA3B); color: #000; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.dof-now small { font-size: 12px; letter-spacing: .06em; }
.dof-now b { font-size: 20px; font-weight: 600; }
@media print {
  .side, .dof-tabs, .dof-top, .tabbar, .bottom-tabs { display: none !important; }
  .dof-pane[hidden] { display: flex !important; }
  .dof-print-title { display: block; margin: 16px 0 6px; }
  .dof-card { break-inside: avoid; }
}
#couple-profile { gap: 12px; } #couple-profile .field { display: flex; flex-direction: column; gap: 6px; height: auto; }

/* askChoice (common.js): a question with a few answers */
.ask-dialog { width: min(460px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; }
.ask-dialog:not([open]) { display: none; }
.ask-dialog h2 { margin: 0; }
.draft-box .draft-lang { margin-left: auto; display: inline-flex; gap: 6px; }
.draft-box .draft-lang .btn.on { background: var(--accent); color: var(--surface, #fff); border-color: var(--accent); }
.ct-french { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ct-french label.inline { align-items: flex-start; gap: 10px; }
.ct-french label.inline input { margin-top: 3px; }
.ct-accept { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ct-accept select { max-width: 460px; }
.ct-service-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
[data-reply-box] > label.field { flex: 0 0 auto; }
.date-clash { font-size: 13.5px; font-weight: 600; color: var(--warn, #B45309); }
.date-clash a { color: inherit; text-decoration: underline; }
.promise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.inline-num { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); font-size: 14px; }
.inline-num input { width: 90px; flex: none; }

/* ---------- Automations (option A+) and the "Ready to send" card on Today ---------- */
.au-intro { margin: -4px 0 14px; max-width: 900px; }
.au-top { gap: 10px; margin-bottom: 14px; }
.au-top-row, .au-quiet { gap: 8px 12px; }
.au-master b { font-size: 16px; }
.au-quiet select { width: auto; min-height: 36px; }
.au-review { flex: 0 1 340px; }
.au-pending { text-decoration: none; background: transparent; border: 1px solid var(--money, #F8EA3B); color: var(--money, #8a6d00); }
.au-tabs { margin-bottom: 6px; }
.au-tabs .au-newpb { color: var(--muted); font-weight: 500; }
.au-applies { margin: 4px 0 14px; font-size: 13px; }
.au-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.au-stage { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.au-stage:first-child { margin-top: 0; }
.au-rule { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 6px; cursor: pointer; }
.au-rule:hover { border-color: var(--line2); }
.au-rule.sel { border-color: var(--money, #F8EA3B); }
.au-rule b { font-weight: 600; }
.au-sum { grid-column: 1 / -1; font-size: 12.5px; }
.au-none { margin: 0 0 6px; font-size: 13px; }
.au-seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 20px; overflow: hidden; flex: none; }
.au-seg button { border: 0; background: none; color: var(--muted); padding: 5px 11px; font-size: 12.5px; cursor: pointer; min-height: 30px; font-weight: 500; }
.au-seg button[aria-checked="true"].m-off { background: var(--canvas-ink, #E8E8DF); color: var(--canvas, #000); font-weight: 600; }
.au-seg button[aria-checked="true"].m-approve { background: var(--money, #F8EA3B); color: #000; font-weight: 600; }
.au-seg button[aria-checked="true"].m-auto { background: var(--projects, #DAE5D8); color: #000; font-weight: 600; }
.au-editor { position: sticky; top: 12px; }
.au-editor label.field, .auto-item label.field { flex: none; }
.au-editor .link-btn, .au-blk > .link-btn { align-self: flex-start; }
.au-name { font-size: 18px; font-weight: 600; flex: 1 1 200px; }
.au-stagesel { flex: none; max-width: 260px; }
.au-blk { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.au-k { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--money, #8a6d00); font-weight: 600; }
.au-line { gap: 6px 8px; }
.au-line select { width: auto; max-width: 100%; min-height: 36px; }
.au-num { width: 80px; flex: none; }
.au-tip { margin: 0; font-size: 12.5px; }
.au-act { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.au-act:first-of-type { border-top: 0; padding-top: 0; }
.au-langs { display: flex; gap: 6px; }
.au-langs button { border: 1px solid var(--line2); background: none; color: var(--ink2); border-radius: 16px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.au-langs button[aria-selected="true"] { background: var(--canvas-ink, #E8E8DF); color: var(--canvas, #000); border-color: transparent; font-weight: 600; }
.au-fields { font-size: 12px; line-height: 2; }
.au-chip { border: 0; background: var(--line); color: var(--money, #8a6d00); border-radius: 6px; padding: 1px 6px; font-size: 12px; cursor: pointer; font-family: inherit; }
.au-save { gap: 8px; }
.au-prev ul { margin: 4px 0 8px; padding-left: 18px; font-size: 13.5px; }
.au-prev .au-k { color: var(--muted); }
.au-fieldset { border: 0; padding: 0; margin: 0; }
.au-log-dlg { width: min(860px, calc(100vw - 32px)); }
.au-logt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.au-logt td, .au-logt th { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.au-logt th { color: var(--muted); font-weight: 500; font-size: 12px; }
.au-st-sent, .au-st-done { background: transparent !important; border: 1px solid var(--projects, #2f7a4f); color: var(--projects, #2f7a4f) !important; }
.au-st-failed { background: transparent !important; border: 1px solid var(--danger); color: var(--danger) !important; }
.au-st-skipped, .au-st-withdrawn { background: transparent !important; border: 1px solid var(--line2); color: var(--muted) !important; }
@media (max-width: 900px) {
  .au-grid { grid-template-columns: 1fr; }
  .au-editor { position: static; }
  .au-review { flex: 1 1 100%; }
}

.auto-ready { margin-bottom: 16px; }
.auto-ready a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.auto-item { border-top: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.auto-item:first-of-type { border-top: 0; }
.auto-item .snip { font-size: 13px; }
.auto-item textarea { min-height: 160px; }
.auto-item .row { gap: 6px; }
table.pay tr.open-row { background: var(--ground); }
/* an agency's lead: services grouped by family */
.biz-family { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.biz-family + .biz-family { border-top: 1px solid var(--line); }
/* Settings › Pricing: the add-on services, a row each */
.addon-list { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.addon-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; align-items: center; }
.addon-row [data-addon-price] { text-align: right; }
.plan-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.plan-sum b { font-size: 20px; }
.svc-pick { align-items: flex-start; }
.svc-pick > input[type=checkbox] { margin-top: 3px; }
.svc-pick > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.svc-pick small { font-size: 12px; }
.svc-pick input[type=number] { width: 140px; margin-top: 4px; }

/* Settings › Integrations: a step by step that folds (Gmail with an app password) */
.tuto { border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.tuto > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.tuto[open] { padding-bottom: 14px; }
.tuto ol { margin: 6px 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.tuto p { margin: 6px 0; }
