/* Licence Desk – Care My Website
   A calm care chart: cool mist ground, white sheets, slate ink, one care blue,
   and three health signals. Bitter (slab) for titles and figures, DM Sans for everything else. */

@font-face { font-family: "Bitter"; src: url("fonts/Bitter.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/DMSans.woff") format("woff"); font-weight: 100 1000; font-display: swap; }

:root {
  --mist: #E9EDF1;
  --mist-deep: #DCE2E8;
  --paper: #FFFFFF;
  --ink: #1D2733;
  --steel: #5B6878;
  --line: #D9DFE6;
  --care: #1F5FBF;
  --care-deep: #184C99;
  --care-tint: #E6EEFA;
  --well: #2F8F5B;  --well-tint: #E3F2EA;
  --watch: #B87D0E; --watch-tint: #FBF0DA;
  --alert: #C2412D; --alert-tint: #FBE7E3;
  --idle: #8A96A5;

  --serif: "Bitter", "Rockwell", "Roboto Slab", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --r-sheet: 14px;
  --r-ctrl: 8px;
  --gap: 24px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 400 15px/1.55 var(--sans); font-feature-settings: "ss01"; }
a { color: var(--care); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--care-deep); }
:focus-visible { outline: 3px solid var(--care); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0 0 12px; }
small { display: block; color: var(--steel); font-size: 12.5px; }
code { font-family: var(--mono); font-size: 13px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--steel); font-size: 13.5px; margin: 0; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--paper) 247px, var(--line) 247px, var(--line) 248px, var(--mist) 248px); }
.rail { background: var(--paper); border-right: 1px solid var(--line); align-self: start; display: flex; flex-direction: column; padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); padding: 0 8px 22px; }
.brand b { display: block; font: 600 18px/1.1 var(--serif); }
.brand small { font-size: 12px; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px 9px 12px; border-radius: var(--r-ctrl); color: var(--ink); text-decoration: none; font-weight: 500; border-left: 3px solid transparent; }
.rail nav a:hover { background: var(--mist); }
.rail nav a[aria-current="page"] { background: var(--care-tint); border-left-color: var(--care); color: var(--care-deep); }
.rail nav em { font-style: normal; font-size: 12px; color: var(--steel); font-variant-numeric: tabular-nums; }
.rail-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.me { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); padding: 6px 8px; border-radius: var(--r-ctrl); font-weight: 500; }
.me:hover { background: var(--mist); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 14px var(--serif); flex: none; }
.link { background: none; border: 0; color: var(--steel); font: inherit; font-size: 13.5px; cursor: pointer; padding: 4px 8px; text-align: left; }
.link:hover { color: var(--alert); }

.main { padding: 30px 40px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 30px; line-height: 1.15; }
.summary { font-size: 17px; line-height: 1.5; max-width: 62ch; margin: 0 0 22px; color: var(--ink); }
.summary strong { font-weight: 600; color: var(--watch); }

/* ---------- Sheets ---------- */
.panel { background: var(--paper); border-radius: var(--r-sheet); padding: 22px 24px; margin-bottom: var(--gap); box-shadow: 0 1px 0 var(--mist-deep); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head.padded { padding: 20px 24px 6px; }
.panel h2 { font-size: 19px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.two-col > .panel { margin-bottom: var(--gap); }
.empty { padding: 26px 24px; color: var(--steel); margin: 0; }

/* ---------- Lifeline (the one bold element) ---------- */
.lifeline { padding-bottom: 16px; }
.lifeline-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.lifeline-svg { display: block; width: 100%; min-width: 760px; height: auto; font-family: var(--sans); }
.lifeline-svg .grid { stroke: var(--line); stroke-width: 1; }
.lifeline-svg .month { font-size: 11px; fill: var(--steel); }
.lifeline-svg .who { font: 600 13px var(--sans); fill: var(--ink); }
.lifeline-svg .where { font-size: 11px; fill: var(--steel); }
.lifeline-svg a:hover .who, .lifeline-svg a:focus .who { fill: var(--care); text-decoration: underline; }
.lifeline-svg .bar { fill: var(--care); }
.lifeline-svg .bar.tone-well { fill: var(--well); }
.lifeline-svg .bar.tone-watch { fill: var(--watch); }
.lifeline-svg .bar.tone-alert { fill: var(--alert); opacity: .55; }
.lifeline-svg .bar.tone-idle { fill: var(--idle); opacity: .6; }
.lifeline-svg .bar.open { mask: none; opacity: .75; }
.lifeline-svg .credit-track { fill: var(--mist-deep); }
.lifeline-svg .credit-fill { fill: var(--care); }
.lifeline-svg .credit-fill.hot { fill: var(--alert); }
.lifeline-svg .today { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.lifeline-svg .today-label { font: 600 11px var(--sans); fill: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12.5px; color: var(--steel); margin: 12px 0 0; }
.swatch { display: inline-block; width: 18px; height: 8px; border-radius: 4px; margin-right: -10px; vertical-align: middle; }
.swatch.tone-well { background: var(--well); } .swatch.tone-watch { background: var(--watch); } .swatch.tone-alert { background: var(--alert); opacity: .55; }
.swatch.credit { background: var(--care); height: 3px; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 10px 16px; border-top: 1px solid var(--line); position: relative; }
.list li:first-child { border-top: 0; }
.list li::before { content: ""; position: absolute; left: 0; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.list li.tone-well::before { background: var(--well); }
.list li.tone-watch::before { background: var(--watch); }
.list li.tone-alert::before { background: var(--alert); }
.list li span { color: var(--steel); font-size: 13.5px; text-align: right; }
.list.activity li { padding-left: 0; }
.list.activity li::before { display: none; }
.list.activity li span { color: var(--ink); text-align: left; }
.list.activity time { color: var(--steel); font-size: 12.5px; white-space: nowrap; }
.list.checks li { flex-direction: column; gap: 2px; }
.list.checks li span { color: var(--ink); text-align: left; font-size: 14.5px; }

/* ---------- Status ---------- */
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.state i { width: 8px; height: 8px; border-radius: 2px; background: var(--idle); transform: rotate(45deg); }
.state-well i { background: var(--well); } .state-watch i { background: var(--watch); } .state-alert i { background: var(--alert); }
.state-well { color: var(--well); } .state-watch { color: var(--watch); } .state-alert { color: var(--alert); } .state-idle { color: var(--steel); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { text-align: left; font-weight: 500; color: var(--steel); font-size: 12.5px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #F7F9FB; white-space: nowrap; }
.ledger td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover { background: #F7F9FB; }
.ledger.compact td, .ledger.compact th { padding: 9px 16px; }
.ledger .right { text-align: right; }
.row-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.row-link:hover { color: var(--care); text-decoration: underline; }
.row-alert td { background: var(--alert-tint); }
code.key { background: var(--mist); padding: 3px 7px; border-radius: 6px; cursor: copy; white-space: nowrap; font-size: 12.5px; }
code.key.big { font-size: 16px; padding: 6px 10px; display: inline-block; margin-top: 4px; }
code.key.copied, [data-copy].copied { background: var(--well-tint); color: var(--well); }
progress { display: block; width: 120px; height: 5px; margin-top: 6px; border: 0; border-radius: 3px; background: var(--mist-deep); appearance: none; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--mist-deep); }
progress::-webkit-progress-value { background: var(--care); }
progress::-moz-progress-bar { background: var(--care); }
progress.hot::-webkit-progress-value { background: var(--alert); }
progress.hot::-moz-progress-bar { background: var(--alert); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; font-size: 13.5px; margin: 0 0 6px; }
.opt { font-weight: 400; color: var(--steel); margin-left: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid #C5CED8; border-radius: var(--r-ctrl); padding: 9px 12px; min-height: 42px; }
textarea { min-height: 0; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #9FAAB7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--care); box-shadow: 0 0 0 3px var(--care-tint); }
input[readonly] { background: var(--mist); color: var(--steel); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--alert); }
.mono { font-family: var(--mono); font-size: 13px; }
.hint { color: var(--steel); font-size: 12.5px; margin: 6px 0 0; }
.field-error { color: var(--alert); font-size: 13px; margin: 6px 0 0; font-weight: 500; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-top: 8px; }
.check input { width: auto; min-height: 0; }
.sheet { background: var(--paper); border-radius: var(--r-sheet); padding: 6px 24px 22px; margin-bottom: var(--gap); }
.sheet.plain { padding: 0; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 20px 0 6px; }
.sheet > fieldset:first-of-type, .sheet > input + fieldset { border-top: 0; }
legend { font: 600 16px var(--serif); padding: 0 0 12px; float: left; width: 100%; }
legend + * { clear: both; }
fieldset.dim { opacity: .62; }
fieldset.dim:focus-within { opacity: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 22px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.stack > label:not(:first-of-type) { margin-top: 10px; }
.stack > div { margin-top: 12px; }
.actions { display: flex; gap: 10px; padding-top: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-row form { margin: 0; }
.inline-form { display: flex; gap: 10px; align-items: center; max-width: 340px; }
.code-input { font: 600 22px var(--mono); letter-spacing: .25em; text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: var(--r-ctrl); border: 1px solid var(--care); background: var(--care); color: #fff; font: 600 14px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--care-deep); border-color: var(--care-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: #C5CED8; }
.btn-quiet:hover { background: var(--mist); color: var(--ink); border-color: #9FAAB7; }
.btn-danger { background: var(--paper); color: var(--alert); border-color: #E7B5AC; }
.btn-danger:hover { background: var(--alert); color: #fff; border-color: var(--alert); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-wide { width: 100%; margin-top: 18px; }

.flash { padding: 12px 16px; border-radius: var(--r-ctrl); margin: 0 0 18px; font-weight: 500; border-left: 4px solid; }
.flash-well { background: var(--well-tint); border-color: var(--well); color: #1F5E3C; }
.flash-warn { background: var(--watch-tint); border-color: var(--watch); color: #7A530A; }
.flash-alert { background: var(--alert-tint); border-color: var(--alert); color: #8E2E1F; }

/* ---------- Licence detail ---------- */
.key-strip { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-end; background: var(--paper); border-radius: var(--r-sheet); padding: 18px 24px; margin-bottom: 18px; border-left: 5px solid var(--care); }
.key-strip > div > span { display: block; font-size: 12.5px; margin-bottom: 4px; }
.danger-zone .zone-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.danger-zone .zone-row:first-of-type { border-top: 0; }
.danger-zone p { margin: 2px 0 0; }
.danger-zone form { margin: 0; flex: none; }
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input[type="search"] { flex: 1 1 260px; max-width: 380px; }
.filters select { width: auto; min-width: 170px; }
.filters.slim { margin: 0; }
.confirm-pw { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-pw input { width: 150px; min-height: 34px; padding: 5px 10px; font-size: 13px; }

/* ---------- Account ---------- */
.steps { padding-left: 20px; margin: 0 0 16px; }
.steps li { margin-bottom: 10px; }
.setup-key { display: block; margin-top: 8px; font-size: 17px; letter-spacing: .08em; background: var(--mist); padding: 10px 12px; border-radius: var(--r-ctrl); cursor: copy; word-break: break-all; }
.codes { columns: 2; padding-left: 22px; font-size: 15px; margin: 10px 0 16px; }
.codes li { margin-bottom: 6px; }
.pairs { display: grid; grid-template-columns: 220px 1fr; gap: 14px 20px; margin: 0; }
.pairs dt { font-weight: 500; color: var(--steel); font-size: 13.5px; }
.pairs dd { margin: 0; }
.pairs code { background: var(--mist); padding: 3px 7px; border-radius: 6px; cursor: copy; }
.pairs code.wrap { word-break: break-all; white-space: normal; display: inline-block; }
.findings dt { font-weight: 600; margin-top: 12px; }
.findings dt.tone-alert { color: var(--alert); } .findings dt.tone-watch { color: var(--watch); }
.findings dd { margin: 4px 0 0 0; font-size: 13px; }

/* ---------- Sign-in ---------- */
.gate { background: var(--mist); }
.gate-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px); align-items: center; gap: 6vw; max-width: 1080px; margin: 0 auto; padding: 40px 32px; }
.gate-intro h1 { font: 700 clamp(44px, 6.4vw, 78px)/0.98 var(--serif); letter-spacing: -0.03em; margin: 22px 0 18px; color: var(--ink); }
.gate-intro p { font-size: 19px; line-height: 1.5; color: var(--steel); max-width: 30ch; }
.gate-form { background: var(--paper); border-radius: 18px; padding: 34px 32px 26px; box-shadow: 0 1px 0 var(--mist-deep), 0 24px 48px -28px rgba(29, 39, 51, .35); }
.gate-form h2 { font-size: 22px; margin-bottom: 18px; }
.gate-form label { margin-top: 14px; }
.gate-form .fine { font-size: 12.5px; color: var(--steel); margin: 16px 0 0; }
.pw { position: relative; }
.pw input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 6px; height: 30px; border: 0; background: var(--mist); border-radius: 6px; font: 500 12.5px var(--sans); color: var(--ink); padding: 0 10px; cursor: pointer; }
.solo { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.solo-card { background: var(--paper); border-radius: 18px; padding: 34px; max-width: 460px; }
.solo-card h1 { font-size: 26px; margin: 16px 0 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .two-col, .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: var(--mist); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 14px; gap: 8px; }
  .brand { padding: 0 6px 0 0; }
  .rail nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; }
  .rail nav a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
  .rail nav a[aria-current="page"] { border-bottom-color: var(--care); }
  .rail nav em { display: none; }
  .rail-foot { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; align-items: center; }
  .me small, .me > span:last-child { display: none; }
  .main { padding: 22px 16px 48px; }
  .grid2, .pairs { grid-template-columns: 1fr; }
  .gate-wrap { grid-template-columns: 1fr; gap: 24px; padding: 28px 18px; }
  .gate-intro h1 { font-size: 46px; }
  .page-head h1 { font-size: 25px; }
  .danger-zone .zone-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.nowrap { white-space: nowrap; }
