/* ARIAH · 20261121-editable24 · "Daylight Glass" (default) + "Evening Glass" (dark) */
:root {
  color-scheme: light;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --ink: #16251d; --ink2: #4d5c53; --ink3: #7c887f;
  --accent: #1f5a40; --accent-2: #3f8a63; --on-accent: #fff;
  --mint: #d9ecdf; --mint-ink: #1f5a40;
  --warn-bg: #f6e8d3; --warn-ink: #8a5a1c;
  --bad-bg: #f7dfd8; --bad-ink: #9a3b22;
  --bg: #f3f2ec;
  --bg-a: #dcecdf; --bg-b: #f2e4d0; --bg-c: #d9e9e3;
  --glass: rgba(255, 255, 255, 0.6); --glass-strong: rgba(255, 255, 255, 0.82);
  --edge: rgba(255, 255, 255, 0.85); --hair: rgba(22, 37, 29, 0.08); --hair2: rgba(22, 37, 29, 0.14);
  --field: rgba(255, 255, 255, 0.75);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 12px 32px rgba(31, 60, 45, 0.08);
  --ring-a: #2f7a55; --ring-b: #14432f; --ring-track: rgba(31, 90, 64, 0.11);
  --bar-a: #7fb596; --bar-b: #3f8a63; --bar-cur: #1f5a40;
  --fab-a: #2f7a55; --fab-b: #163f2c;
  --avatar-a: #5b8c72; --avatar-b: #244a37;
  --ok: #3f9a68; --warn: #d39a2c; --err: #c4553a;
  --finish: #dcebd5;
  --tab-on: rgba(31, 90, 64, 0.09);
  --scrim: rgba(22, 37, 29, 0.28);
  --blur: blur(26px) saturate(170%);
}
[data-mode="dark"] {
  color-scheme: dark;
  --ink: #edf3ee; --ink2: #b4c3b9; --ink3: #7f9086;
  --accent: #74e0a8; --accent-2: #4cc28a; --on-accent: #062014;
  --mint: rgba(116, 224, 168, 0.14); --mint-ink: #9cebc2;
  --warn-bg: rgba(231, 196, 126, 0.16); --warn-ink: #e7c47e;
  --bad-bg: rgba(232, 120, 96, 0.16); --bad-ink: #f0a08c;
  --bg: #07110d;
  --bg-a: rgba(30, 110, 78, 0.55); --bg-b: rgba(160, 120, 50, 0.32); --bg-c: rgba(20, 100, 110, 0.45);
  --glass: rgba(22, 36, 30, 0.55); --glass-strong: rgba(18, 30, 25, 0.9);
  --edge: rgba(255, 255, 255, 0.1); --hair: rgba(255, 255, 255, 0.08); --hair2: rgba(255, 255, 255, 0.14);
  --field: rgba(255, 255, 255, 0.06);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 16px 40px rgba(0, 0, 0, 0.35);
  --ring-a: #8ff0bd; --ring-b: #3fbf86; --ring-track: rgba(255, 255, 255, 0.08);
  --bar-a: rgba(116, 224, 168, 0.35); --bar-b: rgba(116, 224, 168, 0.75); --bar-cur: #e7c47e;
  --fab-a: #74e0a8; --fab-b: #3aa874;
  --avatar-a: #e7c47e; --avatar-b: #a5813d;
  --ok: #74e0a8; --warn: #e7c47e; --err: #f08c72;
  --finish: rgba(116, 224, 168, 0.18);
  --tab-on: rgba(116, 224, 168, 0.12);
  --scrim: rgba(0, 0, 0, 0.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    color-scheme: dark;
    --ink: #edf3ee; --ink2: #b4c3b9; --ink3: #7f9086;
    --accent: #74e0a8; --accent-2: #4cc28a; --on-accent: #062014;
    --mint: rgba(116, 224, 168, 0.14); --mint-ink: #9cebc2;
    --warn-bg: rgba(231, 196, 126, 0.16); --warn-ink: #e7c47e;
    --bad-bg: rgba(232, 120, 96, 0.16); --bad-ink: #f0a08c;
    --bg: #07110d;
    --bg-a: rgba(30, 110, 78, 0.55); --bg-b: rgba(160, 120, 50, 0.32); --bg-c: rgba(20, 100, 110, 0.45);
    --glass: rgba(22, 36, 30, 0.55); --glass-strong: rgba(18, 30, 25, 0.9);
    --edge: rgba(255, 255, 255, 0.1); --hair: rgba(255, 255, 255, 0.08); --hair2: rgba(255, 255, 255, 0.14);
    --field: rgba(255, 255, 255, 0.06);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 16px 40px rgba(0, 0, 0, 0.35);
    --ring-a: #8ff0bd; --ring-b: #3fbf86; --ring-track: rgba(255, 255, 255, 0.08);
    --bar-a: rgba(116, 224, 168, 0.35); --bar-b: rgba(116, 224, 168, 0.75); --bar-cur: #e7c47e;
    --fab-a: #74e0a8; --fab-b: #3aa874;
    --avatar-a: #e7c47e; --avatar-b: #a5813d;
    --ok: #74e0a8; --warn: #e7c47e; --err: #f08c72;
    --finish: rgba(116, 224, 168, 0.18);
    --tab-on: rgba(116, 224, 168, 0.12);
    --scrim: rgba(0, 0, 0, 0.5);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; font: 15px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% 0%, var(--bg-a), transparent 60%),
    radial-gradient(800px 600px at 100% 10%, var(--bg-b), transparent 60%),
    radial-gradient(900px 700px at 60% 100%, var(--bg-c), transparent 60%),
    var(--bg); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.muted { color: var(--ink3); }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--hair2); background: var(--field); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin: 14px 0 6px; }
button.primary, .primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 600; color: var(--on-accent); background: linear-gradient(180deg, var(--fab-a), var(--fab-b)); box-shadow: 0 6px 16px rgba(20, 67, 47, 0.22); }
button.primary:disabled, button:disabled { opacity: 0.55; cursor: default; }
button.secondary, .secondary, .activity-actions button, .ref-filters button, .seg button, .directory-controls .quiet, .mercury-panel-box button, .lenders-workspace button, .import-tabs button, .attention-card button:not(.primary) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--accent); background: var(--mint); }
button.quiet, .quiet { min-height: 40px; padding: 0 6px; color: var(--accent); font-weight: 600; font-size: 14px; }
button.danger { min-height: 44px; width: 100%; border-radius: 12px; font-weight: 600; color: var(--bad-ink); background: var(--bad-bg); }
button.icon { width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--ink2); background: var(--hair); }
.link-button { color: var(--accent); font-weight: 600; font-size: 14px; padding: 10px; }
.hint { font-size: 13px; color: var(--ink3); margin: 8px 0; }
.warning { font-size: 13px; color: var(--warn-ink); margin: 8px 0; }
.eyebrow { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--mint-ink); background: var(--mint); white-space: nowrap; }
.tag.w, .tag.t-app, .tag.t-unc { color: var(--warn-ink); background: var(--warn-bg); }
.tag.t-late, .tag.outcome-not_proceeded { color: var(--bad-ink); background: var(--bad-bg); }
.tag.outcome-unknown { color: var(--ink2); background: var(--hair); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--ring-track); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Boot + login ---------- */
body.booting #sign-in, body.booting #app { visibility: hidden; }
body.signed-in .login { display: none; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); padding: 36px 30px 26px; border-radius: 28px; text-align: center; }
.mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(145deg, var(--fab-a), var(--fab-b)); box-shadow: 0 6px 16px rgba(20, 67, 47, 0.25); }
[data-mode="dark"] .mark { color: var(--on-accent); }
.login-card .mark { width: 60px; height: 60px; border-radius: 18px; font-size: 28px; margin-bottom: 18px; }
.login-card h1 { font-size: 28px; font-weight: 700; }
.login-sub { color: var(--ink3); margin: 6px 0 22px; }
.login-card form { display: grid; gap: 10px; text-align: left; }
.check-row { display: flex; align-items: center; gap: 10px; margin: 4px 2px; font-weight: 500; color: var(--ink2); }
.wide { width: 100%; min-height: 48px !important; margin-top: 4px; font-size: 16px; }
.login-status { margin-top: 10px; font-size: 13px; color: var(--ink2); min-height: 1em; }

/* ---------- Account bar, sync dot, avatar ---------- */
.account-bar { position: fixed; z-index: 30; top: 22px; right: 28px; display: flex; align-items: center; gap: 10px; }
.sync-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.sync-pill[data-state="warn"] .sync-dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.sync-pill[data-state="error"] .sync-dot { background: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 25%, transparent); }
.sync-pill[data-state="error"] { color: var(--bad-ink); }
.sync-pill[data-state="busy"] .sync-dot { animation: pulse 1.2s ease-in-out infinite; }
.sync-pill[data-state="warn"] { color: color-mix(in srgb, var(--warn) 55%, var(--ink)); }
.sync-card-row { display: flex; gap: 12px; align-items: flex-start; }
.sync-card-row .sync-dot { flex: none; margin-top: 6px; }
.sync-card-row strong { display: block; font-size: 14px; }
.sync-card-row p { margin: 2px 0 0; font-size: 13px; line-height: 1.4; }
.sync-card[data-state="warn"] { border-color: color-mix(in srgb, var(--warn) 45%, var(--hair)); background: color-mix(in srgb, var(--warn) 9%, var(--field)); }
.sync-card[data-state="warn"] .sync-dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.sync-card[data-state="busy"] .sync-dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(145deg, var(--avatar-a), var(--avatar-b)); box-shadow: 0 4px 12px rgba(20, 50, 35, 0.2), inset 0 0 0 1.5px rgba(255, 255, 255, 0.5); overflow: hidden; padding: 0; }
.avatar.big { width: 52px; height: 52px; font-size: 18px; flex: 0 0 52px; }
.avatar.has-photo { background: #d7e3d8; color: transparent; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.profile-photo-actions .quiet { min-height: 32px; padding: 0 12px; font-size: 13px; }
.photo-status { margin: 6px 0 0; font-size: 13px; color: var(--ink2); min-height: 0; }
.photo-status:empty { display: none; }
.photo-status.is-error { color: var(--bad-ink); }
#avatar-button { border: 0; cursor: pointer; }
.partner-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; }
.partner-card { position: relative; }
.partner-card .directory-portrait { border: 0; cursor: pointer; }
.partner-card-photo { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.partner-card-photo .quiet { min-height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- Attention (conflicts / partner review) ---------- */
.attention { position: fixed; z-index: 40; right: 24px; bottom: 24px; width: min(400px, calc(100vw - 32px)); display: grid; gap: 12px; pointer-events: none; }
.attention-card { pointer-events: auto; max-height: 60vh; overflow: auto; padding: 18px 18px 14px; border-radius: 22px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: 0 20px 50px rgba(20, 40, 30, 0.22); }
.attention-card h3 { font-size: 16px; margin-bottom: 4px; }
.attention-card p { font-size: 13px; color: var(--ink2); margin-bottom: 10px; }
.attention-card details { border-top: 1px solid var(--hair); padding: 8px 0; }
.attention-card summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.attention-card pre { font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--hair); padding: 8px; border-radius: 10px; max-height: 160px; overflow: auto; }
.attention-card select { margin: 6px 0; }
.attention-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }

/* ---------- Settings sheet ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet { width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--edge); border-radius: 26px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 30px 80px rgba(10, 30, 20, 0.3); }
.sheet-inner { padding: 22px 20px 18px; }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: 19px; }
.sheet-head p { font-size: 13px; overflow-wrap: anywhere; }
.settings-status { font-size: 13px; color: var(--accent); margin: 0 4px 10px; }
.settings-status:empty { display: none; }
.group { border-radius: 16px; background: var(--field); border: 1px solid var(--hair); margin-bottom: 14px; overflow: hidden; }
.group.pad { padding: 14px; display: grid; gap: 10px; }
.group-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink3); margin: 4px 6px 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 13px 16px; font-size: 15px; font-weight: 500; color: var(--ink); min-height: 50px; }
.row + .row { border-top: 1px solid var(--hair); }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 50px !important; height: 30px !important; flex: 0 0 50px; border-radius: 999px; background: var(--hair2); border: 0; cursor: pointer; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch:checked { background: var(--accent-2); }
.switch:checked::after { transform: translateX(20px); }
.stack label:first-child { margin-top: 0; }
.inline-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.version { text-align: center; font-size: 12px; color: var(--ink3); margin-top: 6px; }
.mercury-panel-box { display: grid; gap: 8px; font-size: 13px; color: var(--ink2); }
.mercury-panel-box h3 { font-size: 15px; color: var(--ink); }
.mercury-panel-box details { font-size: 13px; }
.mercury-panel-box summary { cursor: pointer; font-weight: 600; color: var(--ink2); }
.mercury-panel-box dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; }
.mercury-panel-box dd { margin: 0; overflow-wrap: anywhere; }
.mercury-panel-box button { justify-self: start; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 16px; margin: 16px 0 16px 16px; height: calc(100vh - 32px); border-radius: 26px; padding: 22px 14px 18px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; font-size: 17px; letter-spacing: 0.04em; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 500; color: var(--ink2); text-align: left; }
.nav-item:hover { background: var(--hair); }
.nav-item.active { color: var(--accent); background: var(--tab-on); font-weight: 600; }
.nav-item b { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink3); }
.nav-item.active b { color: var(--accent); }
.ico { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-section { margin: 18px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3); }
.side-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--hair); font-size: 13px; color: var(--ink3); }
.side-foot b { display: block; color: var(--ink2); font-weight: 600; margin-bottom: 2px; }
.workspace { min-width: 0; }
.content { max-width: 1120px; margin: 0 auto; padding: 26px 40px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; min-height: 56px; margin-bottom: 22px; padding-right: 230px; }
.page-head h1 { font-size: 32px; font-weight: 700; line-height: 1.15; }
.page-head .eyebrow { margin-bottom: 2px; }
.subtitle { color: var(--ink3); font-size: 15px; margin-top: 4px; }
.page-head .primary { flex: 0 0 auto; }
.page-head .plus { font-size: 18px; line-height: 1; }
.dock { display: none; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 4px 10px; }
.section-title h2, .section-title h3 { font-size: 18px; font-weight: 700; }
.section-title > span { font-size: 13px; color: var(--ink3); }
details > summary.section-title { cursor: pointer; list-style: none; color: var(--ink2); font-weight: 600; }
details > summary.section-title::-webkit-details-marker { display: none; }
.empty, .directory-empty { padding: 34px 20px; text-align: center; color: var(--ink3); border-radius: 22px; background: var(--glass); border: 1px dashed var(--hair2); }
.state-card { padding: 40px 24px; text-align: center; border-radius: 24px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: var(--shadow); display: grid; gap: 10px; justify-items: center; color: var(--ink2); }
.state-card h2 { font-size: 18px; color: var(--ink); }

/* ---------- Today summary ---------- */
.today-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 8px; }
.summary-card, .daily-note { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 24px; text-align: left; width: 100%; min-width: 0; }
.mini-ring { position: relative; flex: 0 0 66px; width: 66px; height: 66px; display: grid; place-items: center; }
.mini-ring svg { position: absolute; inset: 0; }
.mini-ring b { font-size: 15px; font-weight: 700; }
.summary-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.summary-copy .t { font-size: 13px; color: var(--ink3); font-weight: 600; }
.summary-copy .v { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.summary-copy .v small { font-size: 14px; font-weight: 500; color: var(--ink3); }
.summary-copy .s { font-size: 13px; color: var(--ink2); }
.chev { font-size: 26px; color: var(--ink3); }
.daily-note > div:first-child { flex: 1; min-width: 0; }
.daily-note h3 { font-size: 15px; }
.daily-note p { font-size: 13px; color: var(--ink3); }
.count-box { text-align: center; }
.big-count { display: block; font-size: 34px; font-weight: 700; line-height: 1; color: var(--accent); }
.progress { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.progress i { flex: 1 1 14px; max-width: 96px; height: 6px; border-radius: 3px; background: var(--ring-track); }
.progress i.done { background: var(--accent-2); }

/* ---------- Tasks ---------- */
.task-list { border-radius: 22px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--hair); }
.task:last-child { border-bottom: 0; }
.check { flex: 0 0 24px; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 1.8px solid var(--hair2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--on-accent); }
[data-mode="dark"] .check { border-color: rgba(255, 255, 255, 0.28); }
.check:hover { border-color: var(--accent-2); }
.task.completed .check { background: var(--accent-2); border-color: var(--accent-2); }
.task-body { flex: 1; min-width: 0; text-align: left; display: grid; gap: 4px; }
.task-title { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.task.completed .task-title { color: var(--ink3); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--ink3); }
.task-meta span:not(.tag) { white-space: nowrap; }
.task-edit { font-size: 13px; color: var(--ink3); }
.capture-inline { display: flex; gap: 10px; margin-bottom: 14px; }
.capture-inline input { flex: 1; min-height: 48px; border-radius: 14px; background: var(--glass); }
.task-note { font-size: 13px; padding: 10px 12px; border-radius: 12px; background: var(--hair); margin: 6px 0; }
.task-note small { color: var(--ink3); }
.notes-heading { font-size: 15px; margin: 18px 0 6px; }

/* ---------- Projects ---------- */
.activity-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.area-section { margin-bottom: 8px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.project-card { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 16px 18px; border-radius: 20px; background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); min-width: 0; }
.project-card h3 { font-size: 15px; }
.project-card p { font-size: 13px; color: var(--ink3); }

/* ---------- Partners ---------- */
.directory-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.directory-controls label { margin: 0; }
.search-label { flex: 1 1 260px; }
.directory-controls input[type="search"], .directory-controls select { background: var(--glass); }
.directory-controls select { width: auto; }
.needs-followup { display: flex !important; align-items: center; gap: 8px; font-weight: 500; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--hair); }
.seg button { min-height: 34px; background: transparent; color: var(--ink2); }
.seg button[aria-pressed="true"] { background: var(--glass-strong); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }
.count-line, .directory-count { font-size: 13px; color: var(--ink3); margin: 0 4px 10px; }
.partner-directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.partner-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; text-align: left; padding: 20px; border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: var(--shadow); min-width: 0; transition: transform 0.15s; width: 100%; color: inherit; font: inherit; }
.partner-card-open { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.partner-card:hover { transform: translateY(-1px); }
.directory-portrait { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 18px; display: grid; place-items: center; overflow: hidden; font-size: 22px; font-weight: 700; color: var(--mint-ink); background: var(--mint); }
.directory-portrait img, .partner-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tone-1 { background: #eadfd2; color: #7b513b; } .tone-2 { background: #dbe6e9; color: #3d5e69; } .tone-3 { background: #e9e4cf; color: #6b6338; } .tone-4 { background: #e5e0ea; color: #655471; } .tone-5 { background: #dbe9df; color: #3c6951; }
.partner-card-main { display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0; }
.partner-card-main strong { font-size: 16px; overflow-wrap: anywhere; }
.partner-business { font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }
.partner-specialty { font-size: 12px; font-weight: 600; color: var(--accent); margin: 2px 0 6px; }
.partner-specialty:empty { display: none; }
.partner-contact, .partner-next, .partner-ref-counts { font-size: 12px; color: var(--ink3); overflow-wrap: anywhere; }
.partner-next.overdue { color: var(--warn-ink); font-weight: 600; }
.partner-ref-counts { border-top: 1px solid var(--hair); padding-top: 8px; margin-top: 4px; }
.directory-list { grid-template-columns: 1fr; gap: 8px; }
.directory-list .partner-card { flex-direction: row; align-items: center; padding: 14px 18px; }
.directory-list .directory-portrait { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; font-size: 17px; }
.partner-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.identity { padding: 22px; border-radius: 24px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: var(--shadow); min-width: 0; }
.identity h2 { font-size: 20px; }
.identity > p { color: var(--ink3); font-size: 13px; margin: 2px 0 14px; }
.identity dl { margin: 0; font-size: 13px; }
.identity dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink3); margin-top: 10px; }
.identity dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.partner-portrait { width: 112px; height: 112px; border-radius: 26px; overflow: hidden; display: grid; place-items: center; font-size: 36px; font-weight: 700; color: var(--mint-ink); background: var(--mint); margin-bottom: 16px; box-shadow: 0 6px 18px rgba(20, 50, 35, 0.12); }
.photo-editor { text-align: center; }
.photo-editor .partner-portrait { margin: 0 auto 12px; }
.profile-error { color: var(--bad-ink); font-size: 13px; white-space: pre-wrap; }
.profile-error:empty { display: none; }
.linkedin-action { display: block; color: var(--accent); font-size: 13px; font-weight: 600; padding: 12px 0; }
.divider { border-top: 1px solid var(--hair); margin-top: 16px; padding-top: 14px; }
.divider h2 { font-size: 28px; }
.divider p { font-size: 13px; color: var(--ink3); }
.partner-followup { padding: 16px 18px; border-radius: 18px; background: var(--mint); margin-bottom: 8px; display: grid; gap: 4px; justify-items: start; }
.partner-followup p { font-size: 14px; color: var(--ink2); }
#partner-heading:focus { outline: none; }
.timeline { display: grid; gap: 10px; }
.event, .referral { padding: 14px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); min-width: 0; }
.event-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.event-top time { color: var(--ink3); font-size: 12px; white-space: nowrap; }
.activity-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--ink2); margin: 6px 0; }
.note-disclosure summary { cursor: pointer; list-style: none; }
.note-disclosure summary::-webkit-details-marker { display: none; }
.note-preview { display: block; white-space: pre-wrap; font-size: 14px; color: var(--ink2); margin: 6px 0; }
.more-label, .less-label { color: var(--accent); font-size: 13px; font-weight: 600; }
.note-disclosure[open] .more-label, .note-disclosure:not([open]) .less-label, .note-disclosure[open] .note-preview { display: none; }
.ref-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ref-filters button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.outcome-filter { display: flex; align-items: center; gap: 10px; }
.outcome-filter select { width: auto; }
.referral { margin-bottom: 8px; }
.referral-open { text-align: left; display: grid; gap: 4px; width: 100%; }
.referral-client { font-weight: 600; }
.referral small { color: var(--ink3); font-size: 12px; }
.referral-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.outcome-note { font-size: 13px; margin-top: 6px; }

/* ---------- Lenders (logos stay on a white tile for legibility) ---------- */
.lenders-workspace { min-width: 0; }
.lenders-workspace input[type="search"], .lenders-workspace input:not([type]) { background: var(--glass); margin-bottom: 12px; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.import-card { padding: 18px; border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: var(--shadow); min-width: 0; display: grid; gap: 8px; align-content: start; }
.import-card > p { font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }
.import-card a { font-weight: 600; font-size: 14px; }
.import-card .lender-card-actions, .import-card div:has(> button) { display: flex; flex-wrap: wrap; gap: 6px; }
.import-note, .import-note-body { font-size: 13px; color: var(--ink2); }
.import-initials { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--mint); color: var(--mint-ink); font-weight: 700; }
.lender-brand { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lender-logo-slot { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 96px; padding: 16px; background: #fff; border: 1px solid rgba(54, 72, 60, 0.12); border-radius: 16px; overflow: hidden; }
.lender-logo { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 200px; height: 64px; object-fit: contain; }
.lender-logo-fallback { font-weight: 600; font-size: 14px; color: #4c5d51; text-align: center; overflow-wrap: anywhere; }
.lender-logo-dark { background: #152e42; }
.lender-logo-dark .lender-logo-fallback { color: #fff; }
.lender-brand h3 { font-size: 16px; overflow-wrap: anywhere; }
.lender-niches { display: flex; gap: 6px; flex-wrap: wrap; }
.lender-niches .tag { white-space: normal; }
.lenders-workspace button { min-height: 40px; }

/* ---------- Performance dashboard ---------- */
.perf { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.card { position: relative; padding: 22px 24px; border-radius: 26px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: var(--shadow); min-width: 0; }
.card h3 { font-size: 15px; font-weight: 600; color: var(--ink2); }
.label { font-size: 13px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.06em; }
.sub { font-size: 13px; color: var(--ink3); }
.card.hero { grid-column: 1 / -1; display: flex; align-items: center; gap: 34px; padding: 26px 32px; }
.card.hero.loading, .card.hero.is-error { justify-content: center; min-height: 260px; }
.state { text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--ink2); }
.ring-wrap { position: relative; flex: 0 0 auto; display: grid; place-items: center; }
.ring-wrap svg { display: block; }
.ring-stop-a { stop-color: var(--ring-a); }
.ring-stop-b { stop-color: var(--ring-b); }
.ring-track { stroke: var(--ring-track); }
.ring-centre { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-centre b { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.ring-centre span { font-size: 13px; color: var(--ink3); margin-top: 4px; }
.hero-copy { flex: 1; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; flex-wrap: wrap; }
.month-step { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hair); }
.month-step .step { width: 30px; height: 30px; border-radius: 50%; font-size: 18px; color: var(--ink2); }
.month-step .step:hover:not(:disabled) { background: var(--glass-strong); }
.step-label { font-size: 13px; font-weight: 600; min-width: 74px; text-align: center; }
.big { font-size: 48px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.muted-big { font-size: 32px; color: var(--ink3); }
.of { font-size: 15px; color: var(--ink2); }
.of b { color: var(--ink); }
.chip { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip.up { color: var(--mint-ink); background: var(--mint); }
.chip.down { color: var(--warn-ink); background: var(--warn-bg); }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 6px; }
.stats div { display: grid; }
.stats b { font-size: 18px; font-weight: 700; }
.stats span { font-size: 12px; color: var(--ink3); }
.basis { margin-top: 4px; }
.basis-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink3); }
.info-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.3px solid currentColor; font-size: 10px; font-weight: 700; font-style: italic; }
.basis-info { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--hair); font-size: 13px; color: var(--ink2); display: grid; gap: 4px; max-width: 520px; }
.card.ontrack { display: grid; gap: 12px; align-content: start; }
.countdown { display: flex; align-items: baseline; gap: 8px; }
.countdown b { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.countdown span { color: var(--ink3); font-size: 14px; }
.bar-track { position: relative; display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--ring-track); }
.bar-track i { display: block; height: 100%; width: 0; }
.fill-settled { background: linear-gradient(90deg, var(--ring-a), var(--accent)); }
.fill-expected { background: repeating-linear-gradient(135deg, var(--bar-a) 0 6px, color-mix(in srgb, var(--bar-a) 55%, transparent) 6px 12px); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.lg-settled::before { background: var(--accent); }
.lg-expected::before { background: var(--bar-a); }
.gap { font-size: 14px; color: var(--ink2); }
.gap b { color: var(--ink); }
.card.trend { display: grid; gap: 10px; grid-template-rows: auto 1fr; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.chart { min-height: 200px; height: 220px; color: var(--bar-cur); }
.chart svg { display: block; overflow: visible; }
.chart-empty { display: grid; place-items: center; text-align: center; color: var(--ink3); font-size: 14px; padding: 20px; border-radius: 16px; border: 1px dashed var(--hair2); height: auto; min-height: 160px; }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .axis { fill: var(--ink3); font-size: 11px; font-family: var(--font); }
.chart .axis-cur { fill: var(--ink); font-weight: 700; }
.chart .bar-stop-a { stop-color: var(--bar-b); }
.chart .bar-stop-b { stop-color: var(--bar-a); }
.chart .target { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 5 5; }
.chart .target-label { fill: var(--warn-ink); font-size: 11px; font-weight: 600; font-family: var(--font); }
.card.soon { display: grid; gap: 10px; align-content: start; }
.loan-list { list-style: none; margin: 0; padding: 0; display: grid; }
.loan-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); min-width: 0; }
.loan-list li:last-child { border-bottom: 0; }
.ini { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--mint-ink); background: var(--mint); }
.who { flex: 1; min-width: 0; display: grid; }
.who b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 12px; color: var(--ink3); }
.amt { display: grid; justify-items: end; gap: 3px; }
.amt b { font-size: 14px; }
.empty-note { color: var(--ink3); font-size: 14px; padding: 8px 0; }
.card.all-loans { grid-column: 1 / -1; }
.card.all-loans summary { cursor: pointer; font-weight: 600; color: var(--ink2); }
.card.all-loans .search { margin: 12px 0 6px; }
.fine { font-size: 12px; color: var(--ink3); }

/* ---------- Editor dialog ---------- */
#editor { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--edge); border-radius: 26px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 30px 80px rgba(10, 30, 20, 0.3); }
#editor.expanded-editor { width: min(900px, calc(100vw - 24px)); }
#edit-form { display: flex; flex-direction: column; max-height: calc(100vh - 42px); }
#edit-form header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
#edit-form header h2 { font-size: 21px; }
#fields { padding: 0 22px 10px; overflow: auto; }
#fields > label:first-child, #fields > input[type="hidden"] + label { margin-top: 4px; }
#edit-form footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 18px; border-top: 1px solid var(--hair); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.inline-checkbox { margin-right: 8px; vertical-align: -3px; }
label:has(> .inline-checkbox) { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.meeting-notes { min-height: 200px; }
.expanded-editor .meeting-notes { min-height: 50vh; }
.expand-editor { float: right; margin-top: -32px; }

/* ---------- Toast ---------- */
#toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translate(-50%, 20px); max-width: min(480px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: 0 16px 40px rgba(10, 30, 20, 0.2); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast:empty { display: none; }

/* ---------- Phone ---------- */
@media (max-width: 820px) {
  body { font-size: 15px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .content { padding: calc(18px + env(safe-area-inset-top)) 18px 130px; }
  .account-bar { top: calc(14px + env(safe-area-inset-top)); right: 16px; gap: 8px; }
  .sync-pill { width: 36px; padding: 0; justify-content: center; }
  .sync-pill #sync-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .page-head { padding-right: 92px; align-items: flex-end; min-height: 64px; }
  .page-head h1 { font-size: 32px; }
  .page-head .subtitle { font-size: 14px; }
  .page-head .add-btn, .page-head [data-new-partner] { position: fixed; z-index: 35; right: 20px; bottom: calc(104px + env(safe-area-inset-bottom)); width: 54px; height: 54px; padding: 0; border-radius: 50%; box-shadow: 0 10px 24px rgba(20, 67, 47, 0.35); }
  .page-head .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .page-head .plus { font-size: 26px; font-weight: 400; }
  .dock { display: flex; position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); height: 68px; padding: 6px; border-radius: 34px; justify-content: space-between; align-items: center; }
  .tab { flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; height: 56px; min-width: 0; border-radius: 28px; font-size: 10.5px; font-weight: 600; color: var(--ink3); list-style: none; cursor: pointer; }
  .tab::-webkit-details-marker { display: none; }
  .tab .ico { width: 22px; height: 22px; }
  .tab.on { color: var(--accent); background: var(--tab-on); }
  .dock-more { flex: 1; position: relative; }
  .dock-menu { position: absolute; right: 0; bottom: 70px; width: 200px; padding: 6px; border-radius: 20px; display: grid; background: var(--glass-strong); }
  .dock-menu button { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border-radius: 14px; font-weight: 500; text-align: left; }
  .dock-menu button.active { color: var(--accent); background: var(--tab-on); }
  .attention { right: 12px; left: 12px; width: auto; bottom: calc(96px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(100px + env(safe-area-inset-bottom)); }
  .today-cards { grid-template-columns: 1fr; gap: 12px; }
  .perf { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 18px; border-radius: 24px; }
  .card.hero { flex-direction: column; align-items: stretch; gap: 18px; padding: 22px 18px; }
  .card.hero .ring-wrap { align-self: center; }
  .big { font-size: 38px; }
  .partner-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .directory-controls select { flex: 1 1 140px; }
  .directory-list .partner-card-main { display: flex; }
  .capture-inline { flex-direction: column; }
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 26px 26px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .lenders-workspace .import-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Completion feedback (ported from editable18) ---------- */

/* Completion is saved before this optional visual feedback begins. */
.task.task-finishing {
  pointer-events: none;
  overflow: hidden;
  transform-origin: top;
}
.task-finishing .check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  animation: tick-pop 380ms ease-out;
}
.task-finishing .task-title {
  text-decoration: line-through;
}
.count-updated {
  display: inline-block;
  animation: count-settle 420ms ease-out;
}
#toast.today-celebration {
  background: var(--accent);
  box-shadow:
    0 0 0 5px #91ad8a33,
    0 8px 30px #34452e26;
  animation: today-finish 750ms ease-out;
}
@keyframes tick-pop {
  0% {
    transform: scale(0.7);
  }
  60% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes count-settle {
  from {
    opacity: 0.4;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes today-finish {
  0% {
    opacity: 0.7;
    transform: translateX(-50%) scale(0.96);
  }
  55% {
    transform: translateX(-50%) scale(1.025);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .task.task-finishing,
  .task-finishing .check,
  .count-updated,
  #toast.today-celebration {
    animation: none;
  }
}

/* A visible, nonmodal completion reward. All decoration is local CSS/SVG. */
.completion-reward {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 34%;
  width: min(420px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  border-radius: 26px;
  color: var(--ink);
  background: var(--glass-strong);
  border: 1px solid #fff;
  box-shadow:
    inset 0 2px 0 #fff,
    0 18px 70px #243a3040,
    0 0 0 7px #ffffff35;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: reward-arrive 1800ms ease both;
}
.reward-medallion {
  position: relative;
  flex: 0 0 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fab-a), var(--fab-b));
  box-shadow:
    inset 0 2px 0 #ffffff80,
    0 5px 18px #34533c30;
  animation: reward-tick-pop 650ms cubic-bezier(0.2, 0.8, 0.25, 1.3) both;
}
.reward-medallion svg {
  width: 100%;
  height: 100%;
}
.reward-medallion path {
  fill: none;
  stroke: #fffdf4;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 55;
  stroke-dashoffset: 0;
  animation: reward-draw 500ms 120ms ease both;
}
.reward-copy {
  min-width: 0;
  position: relative;
}
.reward-copy strong {
  display: block;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.reward-copy span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.reward-copy small {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 7px;
  font-size: 11px;
  color: var(--ink2);
}
.reward-burst {
  position: absolute;
  left: 68px;
  top: 50%;
  width: 1px;
  height: 1px;
}
.reward-burst i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-2);
  animation: reward-particle 1100ms ease-out both;
}
.reward-burst i:nth-child(even) {
  background: var(--warn);
  width: 6px;
  height: 11px;
}
.milestone-reward {
  width: min(480px, calc(100vw - 40px));
  padding: 32px;
  box-shadow:
    inset 0 2px 0 #fff,
    0 20px 85px #24432c50,
    0 0 0 12px #dce8cb66;
}
.milestone-reward .reward-medallion {
  flex-basis: 94px;
  height: 94px;
}
.milestone-reward .reward-copy strong {
  font-size: 30px;
}
.milestone-reward .reward-burst {
  left: 80px;
}
.milestone-reward .reward-burst i {
  width: 10px;
  height: 10px;
  animation-duration: 1400ms;
}
@keyframes reward-arrive {
  0% {
    opacity: 0;
    transform: translate(-50%, -42%) scale(0.88);
  }
  15%,
  86% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -54%) scale(0.98);
  }
}
@keyframes reward-tick-pop {
  0% {
    transform: scale(0.35);
  }
  55% {
    transform: scale(1.14);
  }
  80% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes reward-draw {
  from {
    stroke-dashoffset: 55;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes reward-particle {
  0%,
  12% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4);
  }
  24% {
    opacity: 1;
  }
  75% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(var(--burst-x), var(--burst-y))
      rotate(var(--burst-rotate)) scale(0.65);
  }
}
@media (max-width: 620px) {
  .completion-reward {
    top: 38%;
    gap: 16px;
    padding: 23px 20px;
  }
  .reward-medallion {
    flex-basis: 68px;
    height: 68px;
  }
  .reward-copy strong {
    font-size: 23px;
  }
  .milestone-reward .reward-medallion {
    flex-basis: 78px;
    height: 78px;
  }
  .milestone-reward .reward-copy strong {
    font-size: 26px;
  }
}
.completion-reward.static-reward,
.static-reward * {
  animation: none !important;
}
.static-reward .reward-burst {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .completion-reward,
  .completion-reward * {
    animation: none !important;
  }
  .reward-burst {
    display: none;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .completion-reward {
    background: var(--glass-strong);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
.reward-burst i:nth-child(1) {
  --burst-x: 115px;
  --burst-y: 0px;
  --burst-rotate: 0deg;
}
.reward-burst i:nth-child(2) {
  --burst-x: 100px;
  --burst-y: 57px;
  --burst-rotate: 43deg;
}
.reward-burst i:nth-child(3) {
  --burst-x: 58px;
  --burst-y: 100px;
  --burst-rotate: 86deg;
}
.reward-burst i:nth-child(4) {
  --burst-x: 0px;
  --burst-y: 115px;
  --burst-rotate: 129deg;
}
.reward-burst i:nth-child(5) {
  --burst-x: -57px;
  --burst-y: 100px;
  --burst-rotate: 172deg;
}
.reward-burst i:nth-child(6) {
  --burst-x: -100px;
  --burst-y: 57px;
  --burst-rotate: 215deg;
}
.reward-burst i:nth-child(7) {
  --burst-x: -115px;
  --burst-y: 0px;
  --burst-rotate: 258deg;
}
.reward-burst i:nth-child(8) {
  --burst-x: -100px;
  --burst-y: -57px;
  --burst-rotate: 301deg;
}
.reward-burst i:nth-child(9) {
  --burst-x: -58px;
  --burst-y: -100px;
  --burst-rotate: 344deg;
}
.reward-burst i:nth-child(10) {
  --burst-x: -0px;
  --burst-y: -115px;
  --burst-rotate: 387deg;
}
.reward-burst i:nth-child(11) {
  --burst-x: 58px;
  --burst-y: -100px;
  --burst-rotate: 430deg;
}
.reward-burst i:nth-child(12) {
  --burst-x: 100px;
  --burst-y: -58px;
  --burst-rotate: 473deg;
}

.partner-portrait {
  width: 128px;
  height: 128px;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--accent);
  font: 42px var(--font);
  margin-bottom: 20px;
  border: 2px solid var(--edge);
  box-shadow: 0 5px 18px #34452e18;
}
.partner-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.import-card dl { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 10px 0 6px; }
.import-card dt { font-size: 12px; color: var(--ink3); }
.import-card dd { margin: 0; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.card.trend { grid-row: span 2; grid-template-rows: auto auto 1fr; }
.card.trend .chart { height: 100%; min-height: 220px; }
.trend-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.target-key { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--warn-ink); }
.target-key::before { content: ""; width: 18px; border-top: 2px dashed var(--warn); }
.card.ontrack, .card.soon { align-self: start; }
@media (max-width: 820px) { .card.trend { grid-row: auto; } .card.trend .chart { height: 220px; } }
.login-card .app-icon { display: block; width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 18px; box-shadow: 0 10px 26px rgba(8, 19, 15, 0.28); }
.brand-icon { display: block; width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 4px 12px rgba(8, 19, 15, 0.22); }

/* ---------- editable20: projects & areas archive / delete ---------- */
.area-section .section-title { justify-content: flex-start; }
.section-title .manage-link { margin-left: auto; min-height: 32px; font-size: 13px; }
.project-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.archived-note { margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: var(--hair); color: var(--ink2); font-size: 14px; }
.archived-note .quiet { min-height: 28px; }
.archived-block { margin-top: 26px; padding: 14px 18px; border-radius: 22px; border: 1px solid var(--edge); background: var(--glass); }
.archived-block > summary { cursor: pointer; font-weight: 600; color: var(--ink2); display: flex; align-items: center; gap: 8px; min-height: 32px; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: 12px; background: var(--hair); color: var(--ink2); }
.archived-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.archived-row > div:first-child { display: grid; min-width: 0; }
.archived-row b { font-weight: 600; overflow-wrap: anywhere; }
.archived-row span { font-size: 12px; color: var(--ink3); }
.row-actions { display: flex; gap: 6px; align-items: center; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.confirm-copy { font-size: 14px; color: var(--ink2); margin: 4px 0 6px; }
button.danger-text, .danger-text { color: var(--bad-ink); }
#save-editor.danger-action { color: var(--bad-ink); background: var(--bad-bg); }
#save-editor:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- editable20: performance ---------- */
.chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; margin: 0 -4px; padding: 0 4px; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible { fill: var(--hair); }
.chart .axis-year { font-size: 10px; font-weight: 600; }
.chart-hint { margin-top: -2px; }
.trend-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.range-total { font-size: 14px; color: var(--ink2); }
.range-total b { color: var(--ink); font-size: 16px; }
.range-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.range-seg button { min-height: 30px; padding: 0 11px; font-size: 13px; white-space: nowrap; }
.switch-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-weight: 500; color: var(--ink); }
.switch-row input { width: 18px; min-height: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--accent); }
.card.awaiting, .card.stages { display: grid; gap: 10px; align-content: start; }
.stage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stage-row { display: grid; grid-template-columns: minmax(118px, 1.2fr) minmax(40px, 1fr) 28px 58px; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 4px 8px; margin: 0 -8px; border-radius: 10px; text-align: left; font-size: 13.5px; }
.stage-row:hover:not(:disabled) { background: var(--hair); }
.stage-row:disabled { cursor: default; color: var(--ink3); }
.stage-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-meter { height: 8px; border-radius: 4px; background: var(--ring-track); overflow: hidden; }
.stage-fill { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--warn); }
.stage-fill.t-set { background: linear-gradient(90deg, var(--ring-a), var(--accent)); }
.stage-fill.t-unc { background: var(--bar-a); }
.stage-count { text-align: right; }
.stage-vol { text-align: right; color: var(--ink3); font-size: 12.5px; }
.loan-list li:has(> .loan-row) { padding: 0; }
.loan-row { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 10px 0; text-align: left; }
button.loan-row { padding: 10px 8px; margin: 0 -8px; border-radius: 12px; }
button.loan-row:hover { background: var(--hair); }
.edit-link { font-size: 13px; font-weight: 600; color: var(--accent); }
.card.partners { grid-column: 1 / -1; display: grid; gap: 14px; }
.partner-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.partner-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.partner-tiles .tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--hair); }
.partner-tiles b { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.partner-tiles span { font-size: 12px; color: var(--ink3); }
.warn-chip { justify-self: start; color: var(--warn-ink); background: var(--warn-bg); font-weight: 500; line-height: 1.4; border-radius: 14px; padding: 8px 12px; }
.needs-tag { color: var(--warn-ink) !important; font-weight: 600; }
.partner-table { display: grid; }
.p-row { display: grid; grid-template-columns: minmax(170px, 2fr) repeat(3, minmax(44px, 0.5fr)) minmax(96px, 1fr) minmax(80px, 0.9fr) minmax(120px, 1.2fr) minmax(56px, 0.6fr); align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.p-row:last-child { border-bottom: 0; }
.p-head { padding-top: 0; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink3); }
.p-cell { min-width: 0; font-size: 14px; }
.p-cell b { font-weight: 600; }
.p-label { display: none; }
.p-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-last { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.p-cell.pos b { color: var(--mint-ink); }
.p-cell.neg b { color: var(--warn-ink); }
.referral-log > summary { cursor: pointer; font-weight: 600; color: var(--ink2); min-height: 32px; display: flex; align-items: center; }
.ref-log .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perf-sheet { width: min(520px, calc(100vw - 24px)); }
.perf-sheet .sheet-inner { max-height: calc(100vh - 50px); overflow: auto; }
.perf-sheet .sheet-head { align-items: flex-start; }
.perf-sheet h3 { font-size: 15px; font-weight: 600; color: var(--ink2); margin: 16px 0 8px; }
.loan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0; }
.loan-facts div { padding: 10px 12px; border-radius: 14px; background: var(--hair); }
.loan-facts dt { font-size: 12px; color: var(--ink3); }
.loan-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.tag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tag-row { display: grid; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid var(--hair2); }
.tag-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.outcome-seg { display: flex; width: 100%; }
.outcome-seg button { flex: 1; min-width: 0; padding: 0 8px; font-size: 13px; white-space: nowrap; }
.add-partner { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.add-partner select { flex: 1; min-width: 0; }
.form-error { color: var(--bad-ink); font-size: 13px; min-height: 0; margin: 6px 0 0; }
.form-error:empty { display: none; }
.sheet-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); }
.sheet-actions .spacer { flex: 1; }
.new-partner { padding: 2px 14px 12px; margin-top: 10px; border-radius: 16px; background: var(--hair); }
.new-partner[hidden] { display: none; }
@media (max-width: 820px) {
  .partner-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-head { display: none; }
  .p-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 0; }
  .p-cell.p-partner { grid-column: 1 / -1; }
  .p-label { display: block; font-size: 11.5px; color: var(--ink3); }
  .stage-row { grid-template-columns: minmax(0, 1.4fr) minmax(30px, 1fr) 24px 52px; gap: 8px; }
  .card-head .partner-actions { width: 100%; }
  .outcome-seg button { font-size: 12.5px; padding: 0 4px; }
}
.card.trend .chart-scroll { display: flex; min-height: 220px; overflow-y: hidden; }
.card.trend .chart-scroll > .chart { flex: 1 1 0; min-width: 0; height: auto; min-height: 220px; }
.card.trend .chart-scroll > .chart.chart-empty { min-height: 160px; }

/* ---------- editable21: past settlements & stage groups ---------- */
.stage-extra-title { margin: 6px 0 -4px; }
.stage-extra .stage-row { color: var(--ink2); }
.stage-extra .stage-meter { visibility: hidden; }
.history-import { display: grid; gap: 10px; font-size: 13px; color: var(--ink2); min-width: 0; }
.history-import h3 { font-size: 15px; color: var(--ink); margin: 0; }
.history-import > button { justify-self: start; }
.hi-note { margin: 0; font-size: 13px; color: var(--ink2); }
.hi-status { margin: 0; font-size: 13px; color: var(--accent); font-weight: 500; }
.hi-status:empty { display: none; }
.history-import details { border-top: 1px solid var(--hair); padding-top: 10px; }
.history-import summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.hi-body { display: grid; gap: 10px; margin-top: 10px; min-width: 0; }
.hi-file { display: grid; gap: 6px; font-weight: 500; color: var(--ink); }
.hi-file input { font-size: 13px; max-width: 100%; }
.hi-map { display: grid; gap: 8px; }
.hi-map-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; gap: 10px; color: var(--ink); }
.hi-map-row select { min-height: 36px; width: 100%; min-width: 0; }
.hi-sum { margin: 0; font-weight: 600; color: var(--ink); }
.hi-table-wrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: 12px; }
.hi-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.hi-table th, .hi-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.hi-table th { color: var(--ink3); font-weight: 600; }
.hi-table tr:last-child td { border-bottom: 0; }
.hi-h4 { margin: 4px 0 0; font-size: 13px; color: var(--ink); }
.hi-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hi-list li { display: flex; justify-content: space-between; gap: 12px; }
.hi-list li span { overflow-wrap: anywhere; min-width: 0; }
.hi-list li b { white-space: nowrap; color: var(--ink); }
#history-import-host { grid-template-columns: minmax(0, 1fr); }
.history-import, .hi-body { grid-template-columns: minmax(0, 1fr); }
.history-import > *, .hi-body > * { min-width: 0; }
@media (max-width: 560px) { .hi-table th, .hi-table td { white-space: normal; overflow-wrap: anywhere; } }
