/* Memorial Mastery - Family Continuity System. Committed light/cream brand theme. */
:root {
  color-scheme: light;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ground: #f2ece3;
  --ground-glow: #f7f2ea;
  --surface: #ffffff;
  --surface-2: #f4f1e9;
  --ink: #232c27;
  --ink-soft: #57615a;
  --ink-faint: #8b9188;
  --line: #e3ded2;
  --line-soft: #eee9dd;
  --green: #1e3d32;
  --green-hover: #2a5445;
  --green-soft: #dde8e1;
  --green-ink: #1c3a30;
  --gold: #a97f30;
  --gold-soft: #f0e5cb;
  --blocker: #a8503f;
  --blocker-soft: #f2ddd6;
  --done: #2f6b52;
  --shadow-sm: 0 1px 2px rgba(31,47,42,.05), 0 4px 14px rgba(31,47,42,.05);
  --shadow: 0 1px 2px rgba(31,47,42,.05), 0 10px 30px rgba(31,47,42,.08);
}

* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); font-family: var(--font-sans);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  background: radial-gradient(120% 60% at 50% -8%, var(--ground-glow), transparent 60%), var(--ground);
  min-height: 100vh;
}
.wrap { max-width: 940px; margin: 0 auto; padding: 0 20px 96px; }
[hidden] { display: none !important; }
a { color: var(--green); }

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  border-radius: 10px; padding: 11px 17px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--green); color: var(--green); }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); box-shadow: var(--shadow-sm); }
.btn-primary:hover { color: #fff; background: var(--green-hover); border-color: var(--green-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--green); }
.btn-danger { color: var(--blocker); border-color: var(--line); }
.btn-danger:hover { background: var(--blocker-soft); border-color: var(--blocker); color: var(--blocker); }
.btn-add::before { content: "+"; font-size: 17px; margin-right: 7px; font-weight: 500; vertical-align: -1px; }

/* ---- Logo block ---- */
.logo-block {
  background: var(--green); border-radius: 16px; padding: 14px 22px;
  display: inline-flex; align-items: center; box-shadow: var(--shadow-sm);
}
.logo-block .lb-logo { height: 44px; width: auto; display: block; }

/* ---- App bar (top of the dashboard) ---- */
.appbar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ground) 92%, transparent); }
.appbar-inner {
  max-width: 940px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.account { display: flex; align-items: center; gap: 6px; }
.acct-name { font-size: 13px; color: var(--ink-soft); font-weight: 600; margin-right: 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-name .role { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; margin-left: 6px; }

/* ---- Dashboard head ---- */
.dash-head { padding: 30px 0 4px; }
.eyebrow { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin: 0 0 10px; }
.dash-head h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(28px, 4.6vw, 40px); line-height: 1.1; margin: 0 0 10px; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.dash-head .lede { font-size: 16px; color: var(--ink-soft); max-width: 60ch; margin: 0; }

.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 24px 0 18px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 15px; box-shadow: var(--shadow-sm); min-width: 96px; }
.stat b { display: block; font-family: var(--font-serif); font-size: 25px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.stat.ready b { color: var(--green-ink); }
.stat.prog b { color: var(--gold); }
.stat.done b { color: var(--done); }

/* client list */
.clients { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
.client-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .16s, border-color .16s;
}
.client-row:hover { box-shadow: var(--shadow); border-color: var(--line); }
.client-row:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.cr-main { min-width: 0; }
.cr-name { font-family: var(--font-serif); font-size: 19px; font-weight: 600; color: var(--ink); margin: 0 0 3px; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-faint); }
.cr-meta .kick { color: var(--gold); font-weight: 600; }
.cr-prog { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; min-width: 168px; }
.cr-prog-top { display: flex; align-items: baseline; gap: 8px; }
.cr-prog-pct { font-family: var(--font-serif); font-size: 17px; font-weight: 600; color: var(--green-ink); font-variant-numeric: tabular-nums; }
.cr-prog-step { font-size: 12px; color: var(--ink-faint); }
.cr-track { width: 168px; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line-soft); }
.cr-fill { height: 100%; width: 0%; background: var(--green); border-radius: 99px; transition: width .35s ease; }
.cr-fill.full { background: var(--done); }
.cr-side { display: flex; align-items: center; gap: 12px; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill.s-idle { background: var(--surface-2); color: var(--ink-faint); border: 1px solid var(--line); }
.pill.s-prog { background: var(--gold-soft); color: var(--gold); }
.pill.s-ready { background: var(--green-soft); color: var(--green-ink); }
.pill.s-done { background: var(--green); color: #fff; }
.cr-del { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background .14s, color .14s; }
.cr-del:hover { background: var(--blocker-soft); color: var(--blocker); }
.cr-del:focus-visible { outline: 2px solid var(--blocker); outline-offset: 1px; }
.chev { color: var(--ink-faint); flex: 0 0 auto; }

.empty { text-align: center; padding: 54px 24px; background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); margin-top: 4px; }
.empty .emoji { font-size: 30px; }
.empty h3 { font-family: var(--font-serif); font-size: 20px; font-weight: 600; margin: 12px 0 6px; color: var(--ink); }
.empty p { font-size: 14px; color: var(--ink-soft); margin: 0 auto 18px; max-width: 40ch; }

/* ---- Detail view ---- */
.backbar { padding: 20px 0 0; }
.back { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; cursor: pointer; font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; color: var(--ink-soft); padding: 6px 2px; }
.back:hover { color: var(--green); }
.back:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

.detailbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--ground) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); margin: 8px -20px 26px; padding: 13px 20px; }
.detailbar-inner { max-width: 940px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.db-name { flex: 1 1 220px; min-width: 0; }
.db-name .lab { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.db-name h2 { font-family: var(--font-serif); font-size: 21px; font-weight: 600; margin: 1px 0 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-prog { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.db-track { width: 150px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line-soft); }
.db-fill { height: 100%; width: 0%; background: var(--green); border-radius: 99px; transition: width .35s ease; }
.db-fill.full { background: var(--done); }
.db-num { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; min-width: 90px; }
.db-num b { color: var(--green-ink); }
.note-lead { margin: 0 0 28px; }

/* step sections */
.phase { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; margin-bottom: 18px; box-shadow: var(--shadow-sm); overflow: hidden; }
.phase-head { display: flex; align-items: flex-start; gap: 16px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line-soft); }
.phase-marker { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; background: var(--green-soft); color: var(--green-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-serif); line-height: 1; }
.phase-marker .pm-lab { font-size: 8px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; margin-bottom: 2px; font-family: var(--font-sans); font-weight: 700; }
.phase-marker .pm-num { font-size: 21px; font-weight: 600; }
.phase-titles { flex: 1; min-width: 0; }
.phase-titles h3 { font-family: var(--font-serif); font-weight: 600; font-size: 20px; margin: 3px 0 5px; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.phase-purpose { font-size: 14px; color: var(--ink-soft); margin: 0; line-height: 1.5; }
.phase-count { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; color: var(--ink-faint); background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 99px; padding: 3px 11px; white-space: nowrap; }
.phase-call .phase-marker { background: var(--gold-soft); color: var(--gold); }
.phase.complete .phase-marker { background: var(--green); color: #fff; }
.phase.complete .phase-count { color: var(--done); border-color: var(--done); }
.phase.complete .phase-count::before { content: "\2713 "; }
.phase-body { padding: 8px 22px 20px; }

.grp { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-faint); margin: 18px 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line-soft); }
.grp:first-child { margin-top: 6px; }

ul.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: flex-start; gap: 11px; padding: 8px 4px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.item:hover { background: var(--surface-2); }
.item input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 19px; height: 19px; margin: 1px 0 0; border: 1.5px solid var(--ink-faint); border-radius: 5px; background: var(--surface); cursor: pointer; position: relative; transition: background .12s, border-color .12s; }
.item input[type="checkbox"]:hover { border-color: var(--green); }
.item input[type="checkbox"]:checked { background: var(--green); border-color: var(--green); }
.item input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 5.5px; top: 2px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg); }
.item input[type="checkbox"]:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.item .txt { font-size: 14.5px; line-height: 1.5; color: var(--ink); flex: 1; }
.item input:checked ~ .txt { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--line); }
.item .txt code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 4px; padding: 1px 5px; }

.chip { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1.5px 7px; border-radius: 5px; margin-left: 7px; vertical-align: 1.5px; white-space: nowrap; }
.chip-client { background: var(--gold-soft); color: var(--gold); }

.gate, .note { display: flex; gap: 11px; align-items: flex-start; border-radius: 10px; padding: 12px 15px; margin: 16px 0 2px; font-size: 13.5px; line-height: 1.5; }
.gate { background: var(--green-soft); color: var(--green-ink); }
.note { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line-soft); }
.gate b, .note b { display: block; font-weight: 700; margin-bottom: 2px; letter-spacing: .02em; }
.callout-ico { flex: 0 0 auto; font-size: 15px; line-height: 1.4; }
.note .callout-ico { color: var(--green); }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.note ul li { margin: 2px 0; }

.ref { margin-top: 40px; }
.ref-h { font-family: var(--font-serif); font-size: 13px; letter-spacing: .04em; color: var(--ink-faint); text-transform: uppercase; margin: 0 0 16px; display: flex; align-items: center; gap: 12px; }
.ref-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.handoff { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--green); }
.handoff h4 { font-family: var(--font-serif); font-size: 18px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.handoff .sub { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 14px; }
.handoff ol { margin: 0; padding-left: 20px; }
.handoff li { font-size: 13.5px; color: var(--ink-soft); padding: 4px 0; line-height: 1.45; }
.handoff li b { color: var(--ink); font-weight: 600; }

.foot-legend { margin-top: 32px; text-align: center; font-size: 12.5px; color: var(--ink-faint); }
.foot-legend .legend { display: inline-flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.foot-legend .legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }

/* ---- Modals ---- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(23,32,26,.42); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.28); width: 100%; max-width: 440px; padding: 26px 26px 24px; border: 1px solid var(--line-soft); max-height: 88vh; overflow-y: auto; }
.modal h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.modal p.msub { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 18px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; margin-bottom: 6px; }
.field .opt { text-transform: none; letter-spacing: 0; color: var(--ink-faint); font-weight: 400; }
.field input, .field select { width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.field input::placeholder { color: var(--ink-faint); }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.modal-err { background: var(--blocker-soft); color: var(--blocker); border-radius: 9px; padding: 9px 12px; font-size: 13px; font-weight: 600; margin: 0 0 14px; }

/* users list */
.users { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 22px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--surface-2); }
.user-row .u-main { flex: 1; min-width: 0; }
.user-row .u-email { font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .u-sub { font-size: 12px; color: var(--ink-faint); }
.user-row .u-role { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); }
.user-row .u-role.owner { background: var(--green-soft); color: var(--green-ink); border-color: transparent; }
.user-row .u-act { font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; color: var(--green-ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; cursor: pointer; white-space: nowrap; }
.user-row .u-act:hover { border-color: var(--green); color: var(--green); }
.user-row .u-del { width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 14px; flex: 0 0 auto; }
.user-row .u-del:hover { background: var(--blocker-soft); color: var(--blocker); }
.divider { height: 1px; background: var(--line-soft); margin: 4px 0 18px; }
.section-lab { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink-faint); margin: 0 0 10px; }

/* ---- Login page ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border-radius: 22px; box-shadow: 0 24px 60px rgba(31,47,42,.10); width: 100%; max-width: 420px; padding: 30px 34px 34px; text-align: center; }
.login-card .logo-block { padding: 22px 30px; border-radius: 16px; margin: 0 auto 22px; }
.login-card .logo-block .lb-logo { height: 66px; }
.login-eyebrow { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin: 0 0 10px; }
.login-card h1 { font-family: var(--font-serif); font-weight: 600; font-size: 30px; line-height: 1.12; margin: 0 0 12px; color: var(--ink); letter-spacing: -.01em; }
.login-card .sub { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 24px; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.login-form input { width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; }
.login-form input::placeholder { color: var(--ink-faint); }
.login-form input:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.login-form button { margin-top: 4px; width: 100%; font-size: 15px; padding: 14px; }
.login-error { background: var(--blocker-soft); color: var(--blocker); border-radius: 10px; padding: 10px 13px; font-size: 13.5px; font-weight: 600; margin: 0 0 4px; text-align: center; }
.login-foot { margin-top: 20px; font-size: 13px; color: var(--ink-soft); }
.login-foot a { color: var(--ink-soft); }

/* ---- Phase tabs ---- */
.phase-tabs { display: flex; gap: 8px; margin: 0 0 20px; }
.ptab { flex: 1; text-align: center; font-family: var(--font-sans); font-size: 14px; font-weight: 600; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line-soft); background: var(--surface); color: var(--ink-soft); cursor: pointer; box-shadow: var(--shadow-sm); transition: background .15s, color .15s, border-color .15s; }
.ptab:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.ptab.active { border-color: var(--green); color: var(--green-ink); background: var(--green-soft); }
.ptab:disabled, .ptab.locked { opacity: .55; cursor: not-allowed; box-shadow: none; }
.ptab .plock { margin-left: 6px; display: none; }
.ptab.locked .plock { display: inline; }

/* ---- Phase summary line ---- */
.phase-summary { display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 22px 2px; }
.phase-summary .sm { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.phase-summary .sm.ok { color: var(--done); }
.phase-summary .sm.warn { color: var(--gold); }
.phase-summary .sm.todo { color: var(--ink-faint); }

/* ---- Tri-state check items ---- */
.check-item { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px; border-radius: 9px; margin: 2px 8px; transition: background .12s, box-shadow .12s; }
.check-item .ci-text { flex: 1 1 60%; min-width: 200px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.check-item .ci-text code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 4px; padding: 1px 5px; }
.check-item[data-state="done"] .ci-text { color: var(--ink-faint); }
.check-item[data-state="na"] { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); box-shadow: inset 3px 0 0 var(--gold); }

.tri { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tri-btn { font-family: var(--font-sans); font-size: 12px; font-weight: 600; padding: 6px 12px; border: none; background: var(--surface); color: var(--ink-faint); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.tri-btn + .tri-btn { border-left: 1px solid var(--line); }
.tri-btn:hover { background: var(--surface-2); }
.tri-btn:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.tri-btn.active.b-done { background: var(--green); color: #fff; }
.tri-btn.active.b-na { background: var(--gold); color: #fff; }

/* ---- Drag handle ---- */
.drag-handle { flex: 0 0 auto; cursor: grab; color: var(--ink-faint); font-size: 16px; line-height: 1; letter-spacing: -2px; user-select: none; touch-action: none; opacity: .4; transition: opacity .12s; padding: 6px 6px; margin-left: -6px; }
.drag-handle:active { cursor: grabbing; }
.check-item:hover .drag-handle, .check-item:focus-within .drag-handle { opacity: .75; }
.check-item .ci-text { user-select: none; }
.check-item.dragging { opacity: .6; background: var(--surface-2); box-shadow: var(--shadow); border-radius: 9px; }

/* ---- Task tools (edit / delete) ---- */
.task-tools { display: inline-flex; gap: 2px; flex: 0 0 auto; opacity: 0; transition: opacity .12s; }
.check-item:hover .task-tools, .check-item:focus-within .task-tools { opacity: 1; }
.tk-edit, .tk-del { width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 13px; line-height: 1; }
.tk-edit:hover { background: var(--green-soft); color: var(--green-ink); }
.tk-del:hover { background: var(--blocker-soft); color: var(--blocker); }
.no-tasks { color: var(--ink-faint); font-size: 14px; padding: 6px 12px; margin: 0; font-style: italic; }

/* ---- Add task ---- */
.add-task-row { padding: 6px 22px 2px; }
.btn-soft { background: var(--surface-2); border: 1px dashed var(--line); color: var(--ink-soft); font-weight: 600; }
.btn-soft:hover { border-color: var(--green); color: var(--green); border-style: solid; }

/* ---- Modal checkbox line ---- */
.check-line { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; margin: 4px 0 2px; line-height: 1.45; }
.check-line input[type="checkbox"] { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--green); }

/* ---- Phase footer / unlock ---- */
.phase-foot { padding: 6px 22px 20px; }
.foot-hint { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 11px 14px; }
.foot-hint .callout-ico { color: var(--ink-faint); }
.foot-done #go-phase2, .foot-done .btn { margin-top: 14px; }
.back.sub { margin: 0 0 4px; }

.cr-meta .warn { color: var(--gold); font-weight: 600; }

@media (max-width: 680px) {
  .client-row { grid-template-columns: 1fr; gap: 12px; }
  .cr-prog { align-items: flex-start; }
  .cr-track, .cr-prog { width: 100%; min-width: 0; }
  .cr-side { justify-content: space-between; }
  .db-prog { order: 3; width: 100%; }
  .phase-count { display: none; }
  .acct-name { max-width: 120px; }
  .task-tools { opacity: 1; }
  .drag-handle { opacity: .55; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  .appbar, .backbar, .detailbar .db-prog, .btns-print, .foot-legend .legend, #view-dashboard { display: none !important; }
  .detailbar { position: static; border: none; margin: 0 0 12px; padding: 0; }
  .wrap { max-width: 100%; padding: 0; }
  .phase, .handoff { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .phase-head { break-after: avoid; }
  .item { break-inside: avoid; }
  .item input[type="checkbox"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; border-color: #444; }
}
