/* Account Intelligence: cool paper, cobalt for evidence, Power Platform plum for opportunities */
:root {
  color-scheme: light;
  --paper: #F4F6F9;
  --surface: #FFFFFF;
  --ink: #18202E;
  --ink-soft: #4B5568;
  --rule: #D6DCE5;
  --cobalt: #2D4FB3;
  --cobalt-tint: #E7ECF9;
  --plum: #742774;
  --plum-tint: #F5EAF5;
  --amber: #A86A0B;
  --green: #217346;
  --red: #B42318;
  --radius-s: 4px;
  --radius-m: 8px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #12161E;
    --surface: #1A2029;
    --ink: #E6EAF0;
    --ink-soft: #A3ADBD;
    --rule: #2E3644;
    --cobalt: #8FA8F0;
    --cobalt-tint: #1F2A45;
    --plum: #D89BD8;
    --plum-tint: #2D1E2E;
    --amber: #E3A94A;
    --green: #6CC48F;
    --red: #F08A80;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--font); }
a { color: var(--cobalt); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }
ul, ol { padding-left: 1.2em; margin: 0 0 1em; }
li { margin: .25em 0; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.sep { margin: 0 .5em; color: var(--rule); }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 2.5rem); background: var(--surface); border-bottom: 1px solid var(--rule); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.topbar { flex-wrap: wrap; }
.topbar nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.topbar nav a { color: var(--ink-soft); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--cobalt); font-weight: 600; }
.whoami { display: flex; align-items: center; gap: .6rem; }
.whoami select { margin: 0; width: auto; padding: .35rem .5rem; font-size: .85rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.page { max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.lede { color: var(--ink-soft); margin-top: -.3rem; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; font: 600 .9rem var(--font);
  padding: .55rem 1rem; border-radius: var(--radius-s); border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink-soft); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0E1424; } }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--cobalt); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-small { padding: .3rem .7rem; font-size: .82rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius-s); padding: .55rem .65rem; margin-top: .3rem; }
input:disabled { background: var(--paper); }
input[type="checkbox"] { width: auto; margin: 0 .3rem 0 0; }
.search input { min-width: 260px; margin: 0; }

.flash { padding: .7rem 1rem; border-left: 3px solid var(--cobalt); background: var(--cobalt-tint); border-radius: var(--radius-s); }
.flash-error { border-color: var(--red); }

/* Forms */
.form { max-width: 720px; display: grid; gap: 1.1rem; }
.form label { display: block; font-weight: 600; font-size: .9rem; }
.form .hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: .82rem; margin-top: .3rem; }
.form .req { font-weight: 400; color: var(--ink-soft); font-size: .8rem; margin-left: .3rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.1rem 1.2rem 1.3rem; display: grid; gap: 1rem; background: var(--surface); }
legend { font-weight: 700; padding: 0 .4rem; }

/* Client list */
.clients { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; }
.clients th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--ink-soft); padding: .7rem 1rem; border-bottom: 1px solid var(--rule); }
.clients td { padding: .85rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.clients tr:last-child td { border-bottom: 0; }
.client-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.client-name:hover { color: var(--cobalt); }
.row-actions { text-align: right; }
.running { color: var(--cobalt); font-weight: 600; }
.failed { color: var(--red); }
@media (max-width: 720px) {
  .clients thead { display: none; }
  .clients tr { display: grid; grid-template-columns: 1fr auto; padding: .5rem 0; border-bottom: 1px solid var(--rule); }
  .clients td { border: 0; padding: .3rem 1rem; }
}

.empty { max-width: 560px; padding: 2.5rem 0; }
.empty p { color: var(--ink-soft); }

/* Power Platform status chip */
.pp-status { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pp-in_use { color: var(--green); }
.pp-likely { color: var(--cobalt); }
.pp-unclear { color: var(--amber); }
.pp-no_evidence { color: var(--plum); }

/* Client detail */
.client-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.one-line { font-size: 1.1rem; max-width: 70ch; margin: 0 0 .3rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.run-panel { border: 1px solid var(--rule); border-left: 4px solid var(--cobalt); border-radius: var(--radius-s); background: var(--surface); padding: 1rem 1.2rem; margin-bottom: 1.5rem; }
.run-failed { border-left-color: var(--red); }
.run-stage { display: flex; align-items: center; gap: .6rem; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--cobalt); animation: pulse 1.4s ease-in-out infinite; }
.run-failed .pulse { background: var(--red); animation: none; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.run-error { color: var(--red); margin: .6rem 0 0; }
.run-panel pre { font-size: .8rem; color: var(--ink-soft); max-height: 220px; overflow: auto; white-space: pre-wrap; margin: .5rem 0 0; }
.run-panel summary { cursor: pointer; color: var(--ink-soft); font-size: .85rem; margin-top: .6rem; }

.dossier { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
@media (max-width: 960px) { .dossier { grid-template-columns: 1fr; } }
.main-col > section { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; }
.prose { max-width: 75ch; white-space: pre-line; }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.facts { display: grid; grid-template-columns: 9rem 1fr; gap: .45rem 1rem; margin: 0; }
.facts dt { color: var(--ink-soft); font-size: .88rem; }
.facts dd { margin: 0; }
table.plain { width: 100%; border-collapse: collapse; }
table.plain th { text-align: left; font-size: .8rem; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--rule); padding: .4rem .5rem .4rem 0; }
table.plain td { padding: .45rem .5rem .45rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.people { list-style: none; padding: 0; columns: 2 240px; }

/* Citations: the evidence trail is the point of the product */
sup { line-height: 0; }
a.cite { font-size: .72rem; font-weight: 600; text-decoration: none; padding: 0 .15em; border-radius: 3px; background: var(--cobalt-tint); }
a.cite:hover { text-decoration: underline; }
.sources li:target { background: var(--cobalt-tint); border-radius: var(--radius-s); }

/* Power Platform section */
.main-col > section.pp { border-color: var(--plum); border-width: 1px 1px 1px 5px; }
.pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pp h2 { color: var(--plum); }
.evidence { font-size: .9rem; color: var(--ink-soft); }
.quick-win { background: var(--plum-tint); border-radius: var(--radius-s); padding: 1rem 1.2rem; margin: 1.2rem 0; }
.quick-win h3 { color: var(--plum); margin-bottom: .3rem; }
.quick-win p { margin: 0; }
.opps { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; gap: 1rem; counter-reset: opp; }
.opp { border-top: 1px solid var(--rule); padding-top: 1rem; counter-increment: opp; }
.opp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.opp-top h3::before { content: counter(opp) ". "; color: var(--plum); }
.opp.prio-1 .opp-top h3 { font-size: 1.08rem; }
.effort { font-size: .8rem; color: var(--ink-soft); white-space: nowrap; }
.components { display: flex; flex-wrap: wrap; gap: .35rem; margin: .3rem 0 .7rem; }
.components span { font-size: .78rem; font-weight: 600; color: var(--plum); background: var(--plum-tint); padding: .1rem .5rem; border-radius: 3px; }
.opp dl { display: grid; grid-template-columns: 5.5rem 1fr; gap: .35rem .8rem; margin: 0; font-size: .93rem; }
.opp dt { color: var(--ink-soft); }
.opp dd { margin: 0; }

/* Rail */
.rail { position: sticky; top: 1rem; display: grid; gap: 1.2rem; }
.rail section { border-top: 2px solid var(--ink); padding-top: .8rem; }
.rail h2 { font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.rail h3 { font-size: .85rem; color: var(--ink-soft); font-weight: 600; margin-top: .8rem; }
.count { font-size: .8rem; color: var(--ink-soft); font-weight: 500; }
.signals { list-style: none; padding: 0; }
.signals li { display: flex; flex-direction: column; padding: .3rem 0; border-bottom: 1px solid var(--rule); }
.sources { list-style: none; padding: 0; max-height: 50vh; overflow: auto; font-size: .87rem; }
.sources li { display: grid; grid-template-columns: 2.4rem 1fr; padding: .3rem .3rem; }
.sources li .small { grid-column: 2; }
.ref { font-weight: 700; color: var(--cobalt); }
.history { list-style: none; padding: 0; font-size: .88rem; }
.history a[aria-current] { font-weight: 700; color: var(--ink); }


/* ---------------- tracker additions ---------------- */
:root { --green-tint: #E4F2EA; --red-tint: #FBE9E7; --amber-tint: #FBF0DC; }
@media (prefers-color-scheme: dark) { :root { --green-tint: #1A2E23; --red-tint: #33201E; --amber-tint: #30261A; } }

.meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .2rem 0 0; font-size: .85rem; color: var(--ink-soft); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs { display: flex; gap: .2rem; border: 1px solid var(--rule); border-radius: var(--radius-s); padding: .2rem; background: var(--surface); }
.tabs a { padding: .3rem .8rem; border-radius: 3px; color: var(--ink-soft); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--cobalt-tint); color: var(--ink); font-weight: 600; }
.tabs.small a { padding: .15rem .6rem; }

/* status language: one look on every screen */
.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; }
.st-done { background: var(--green-tint); color: var(--green); }
.st-behind { background: var(--red-tint); color: var(--red); }
.st-soon { background: var(--amber-tint); color: var(--amber); }
.st-replanned { background: var(--plum-tint); color: var(--plum); }
.st-ontrack { background: var(--cobalt-tint); color: var(--cobalt); }
.st-none { background: transparent; color: var(--ink-soft); border: 1px solid var(--rule); }

.flag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .05rem .45rem; border-radius: 3px; margin: .25rem .3rem 0 0; }
.flag-renewal { background: var(--amber-tint); color: var(--amber); }
.flag-freeze { background: var(--red-tint); color: var(--red); }
.flag-opp { background: var(--green-tint); color: var(--green); }
.flag-new { background: var(--cobalt-tint); color: var(--cobalt); }
.tbc { font-size: .78rem; color: var(--amber); font-style: italic; }
.lockmark { font-weight: 400; font-size: .75rem; color: var(--plum); margin-left: .3rem; }

/* accounts list: the score bar is the signature element */
.accounts { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; }
.accounts th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--ink-soft); padding: .7rem 1rem; border-bottom: 1px solid var(--rule); }
.accounts td { padding: .9rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.accounts tr:last-child td { border-bottom: 0; }
.accounts .num { width: 7.5rem; }
.accounts .why { font-size: .85rem; max-width: 38ch; }
.acct-name { font-weight: 600; color: var(--ink); text-decoration: none; font-size: 1.02rem; }
.acct-name:hover { color: var(--cobalt); }
.score { font-weight: 700; font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1; display: block; }
.score.big { font-size: 2.6rem; display: inline; margin-right: .3rem; }
.scorebar { display: flex; gap: 2px; width: 100%; max-width: 160px; height: 8px; margin-top: .4rem; }
.scorebar .seg { border-radius: 2px; background: var(--rule); }
.scorebar .r-high { background: var(--cobalt); }
.scorebar .r-medium { background: color-mix(in srgb, var(--cobalt) 45%, var(--rule)); }
.scorebar .r-low { background: var(--rule); }
.scorebar .tbc { background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--surface) 3px 5px); }
.rating { font-size: .78rem; font-weight: 700; }
.rating.r-high { color: var(--cobalt); }
.rating.r-medium { color: var(--ink-soft); }
.rating.r-low { color: var(--red); }
.owner-controls { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.owner-controls select { width: auto; margin: 0; padding: .3rem .4rem; font-size: .82rem; }
.inline-form { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) {
  .accounts thead { display: none; }
  .accounts tr { display: grid; grid-template-columns: 6rem 1fr; border-bottom: 1px solid var(--rule); }
  .accounts td { border: 0; padding: .5rem .8rem; }
  .accounts td.why, .accounts td:nth-child(4), .accounts td:nth-child(5) { grid-column: 2; }
}

/* account page */
.summary-strip { display: grid; grid-template-columns: auto 1fr 1fr; gap: 1.5rem 2.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.2rem 1.5rem; margin-bottom: 1.5rem; align-items: start; }
.summary-strip p { margin: 0 0 .4rem; }
.strip-score .scorebar { max-width: 220px; height: 10px; }
@media (max-width: 760px) { .summary-strip { grid-template-columns: 1fr; } }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.lead-proof { border-left: 3px solid var(--cobalt); padding: .2rem 0 .2rem 1rem; margin: 1rem 0; }
.lead-proof h3 { margin-bottom: .2rem; }
.lead-proof p { margin: .2rem 0; }
.proof-number span { font-size: 1.5rem; font-weight: 700; color: var(--cobalt); margin-right: .3rem; }
.gaps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.gap { border-top: 1px solid var(--rule); padding-top: 1rem; }
.gap-rejected h3 { color: var(--ink-soft); text-decoration: line-through; }
.gap-top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.gap dl { display: grid; grid-template-columns: 6.5rem 1fr; gap: .35rem .9rem; margin: .5rem 0; font-size: .93rem; }
.gap dt { color: var(--ink-soft); }
.gap dd { margin: 0; }
.fit { margin: .3rem 0; font-size: .92rem; }
.fit-tag { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--plum); background: var(--plum-tint); padding: .1rem .5rem; border-radius: 3px; margin-right: .3rem; }
.gap-actions, .intel-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.gap-actions input { width: auto; flex: 1 1 180px; margin: 0; padding: .3rem .5rem; font-size: .85rem; }
.excluded { margin-top: 1.2rem; font-size: .9rem; }
.excluded summary, details summary { cursor: pointer; }
.intel { list-style: none; padding: 0; margin: 0; }
.intel-item { border-top: 1px solid var(--rule); padding: .9rem 0; }
.intel-item h3 { font-size: .98rem; margin: .3rem 0; }
.intel-item.is-verified { border-left: 3px solid var(--green); padding-left: .8rem; }
.intel-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .78rem; color: var(--ink-soft); }
.intel-meta .flag { margin: 0; }
.kind { font-weight: 700; color: var(--ink); }
.flabel { font-size: .75rem; font-weight: 600; padding: .05rem .4rem; border-radius: 3px; white-space: nowrap; }
.fl-published { background: var(--green-tint); color: var(--green); }
.fl-calculated { background: var(--cobalt-tint); color: var(--cobalt); }
.fl-assumption { background: var(--amber-tint); color: var(--amber); }
.fl-not_known { border: 1px solid var(--rule); color: var(--ink-soft); }
.table-wrap { overflow-x: auto; }
.contracts tr.renewal td { background: var(--amber-tint); }
.suppliers { list-style: none; padding: 0; }
.suppliers li { padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.h2-summary { font-size: 1.2rem; font-weight: 700; }
.main-col > section h3 { margin-top: 1rem; }
.factors { list-style: none; padding: 0; margin: 0; }
.factors li { padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.factors p { margin: .2rem 0; }
.f-top { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.deadlines { list-style: none; padding: 0; margin: 0; }
.deadline { padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.dl-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.stack { display: grid; gap: .45rem; margin: .5rem 0; }
.stack input, .stack select { margin-top: .15rem; padding: .35rem .5rem; font-size: .85rem; }
.rail label { display: block; }
.internal { background: var(--plum-tint); border-radius: var(--radius-s); padding: .8rem; border-top: 0 !important; }

/* plan */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.3rem 1.5rem; margin-bottom: 1.3rem; }
.dayline { height: 4px; background: var(--rule); border-radius: 2px; margin: -.2rem 0 1rem; }
.dayline span { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.progress { width: 100%; border-collapse: collapse; }
.progress th { text-align: left; font-size: .8rem; color: var(--ink-soft); font-weight: 600; padding: .4rem .6rem .4rem 0; border-bottom: 1px solid var(--rule); }
.progress td { padding: .7rem .6rem .7rem 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.progress .num { text-align: right; width: 4rem; font-variant-numeric: tabular-nums; }
.count-big { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { display: block; height: 6px; background: var(--rule); border-radius: 3px; margin-top: .3rem; max-width: 220px; }
.bar span { display: block; height: 100%; background: var(--cobalt); border-radius: 3px; }
.board, .tasks { list-style: none; padding: 0; margin: 0; }
.board-row { padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.board-row p { margin: .2rem 0; }
.board-top { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.board-top .btn { margin-left: auto; }
.task { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.task.is-done span { color: var(--ink-soft); text-decoration: line-through; }
.check { width: 1.25rem; height: 1.25rem; border: 2px solid var(--ink-soft); border-radius: 4px; background: var(--surface); cursor: pointer; flex: none; margin-top: .1rem; }
.check[aria-pressed="true"] { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px var(--surface); }
.weekly { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.2rem; white-space: pre-wrap; font-size: .88rem; max-width: 80ch; }
.form.wide { max-width: 900px; }
input.narrow { width: 6rem; }
label.checkbox { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.danger-zone, .inline-add { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* data, library, my accounts */
.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.import-grid .panel { margin: 0; }
.library tr.unusable td { color: var(--ink-soft); }
.my-list { list-style: none; padding: 0; display: grid; gap: .9rem; }
.my-item { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 1rem 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem 1.3rem; align-items: start; }
.my-item h2 { margin: 0; font-size: 1.1rem; }
.my-item h2 a { color: var(--ink); text-decoration: none; }
.my-item p { margin: .3rem 0 0; }
.my-check { display: grid; gap: .25rem; }
@media (max-width: 760px) { .my-item { grid-template-columns: 1fr; } }

/* download menu */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; margin: 4px 0 0 .45rem; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 250px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius-s); padding: .4rem; display: grid; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.menu-panel a { padding: .45rem .6rem; border-radius: 3px; text-decoration: none; color: var(--ink); }
.menu-panel a:hover, .menu-panel a:focus-visible { background: var(--cobalt-tint); }
.menu-panel p { margin: .3rem .6rem; }

/* account page tabs */
.tabbar { display: flex; gap: .15rem; border-bottom: 1px solid var(--rule); margin: 0 0 1.4rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; position: sticky; top: 0; background: var(--paper); z-index: 4; }
.tabbar[hidden] { display: none; }
.tabbar [role="tab"] { appearance: none; background: none; border: 0; box-shadow: inset 0 -3px 0 transparent;
  padding: .75rem .95rem .6rem; font: 500 .95rem var(--font); color: var(--ink-soft); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .45rem; }
.tabbar [role="tab"]:hover { color: var(--ink); }
.tabbar [role="tab"][aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--cobalt); font-weight: 600; }
.tabbar [role="tab"]:focus-visible { outline-offset: -3px; }
.tab-count { font-size: .72rem; font-weight: 700; min-width: 1.4rem; padding: .05rem .4rem; border-radius: 999px; background: var(--cobalt-tint); color: var(--cobalt); text-align: center; font-variant-numeric: tabular-nums; }
.tab-count.tab-alert { background: var(--red-tint); color: var(--red); }
.tabpanel:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 6px; border-radius: var(--radius-s); }
.tabpanel > section, .tabpanel > div > section, .tabpanel .two-up > section, .tab-grid section {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; }
.tabpanel .two-up { gap: 1.2rem; }
.tabpanel .two-up > section { margin-bottom: 0; }
.tabpanel .two-up + section, .tabpanel > .two-up { margin-bottom: 1.2rem; }
.tab-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.2rem; align-items: start; }
@media (max-width: 960px) { .tab-grid { grid-template-columns: 1fr; } }
.tabpanel section.internal { background: var(--plum-tint); border-color: transparent; }
/* without JS, panels stack with a little space; with JS only one shows */
body:not(.has-tabs) .tabpanel { margin-bottom: 1.5rem; }
/* score tab: the four factors side by side */
#panel-score .factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1.6rem; }
#panel-score .factors li { padding: .9rem 0; }
.stack label { display: block; }
.flash-target { background: var(--cobalt-tint); transition: background 1.2s; border-radius: 3px; }
.stack > .btn, .stack > button { justify-self: start; }
@media (max-width: 640px) {
  .tabbar { flex-wrap: wrap; overflow: visible; column-gap: 0; }
  .tabbar [role="tab"] { padding: .6rem .7rem .5rem; font-size: .9rem; }
}

/* sign-in and account */
.auth-wrap { min-height: calc(100vh - 160px); display: grid; place-items: start center; padding-top: 6vh; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 2rem 2rem 1.6rem; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 1.1rem; }
.auth-brand { font-weight: 700; color: var(--cobalt); margin: 0 0 1.4rem; font-size: .95rem; }
.auth-form { gap: .9rem; }
.btn-block { width: 100%; padding: .7rem 1rem; }
.auth-or { display: flex; align-items: center; gap: .8rem; color: var(--ink-soft); font-size: .85rem; margin: 1.2rem 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
pre.code { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: .7rem; font-size: .82rem; white-space: pre-wrap; }
.usermenu > summary { gap: .5rem; padding: .3rem .6rem; font-weight: 500; }
.avatar { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--cobalt); color: #fff; display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; }
@media (prefers-color-scheme: dark) { .avatar { color: #0E1424; } }
.menu-item { appearance: none; background: none; border: 0; width: 100%; text-align: left; font: inherit; color: var(--ink); padding: .45rem .6rem; border-radius: 3px; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--cobalt-tint); }
.users td { vertical-align: top; }
.users input, .users select { margin: 0 0 .3rem; padding: .35rem .5rem; font-size: .88rem; }
.pending { border-color: var(--amber); }
.pending-list { list-style: none; padding: 0; margin: 0; }
.pending-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .7rem 0; border-top: 1px solid var(--rule); }
.section-gap { margin-top: 2rem; }
.steps { padding-left: 1.2rem; }
.entra-setup { border-top: 1px solid var(--rule); padding-top: .8rem; display: grid; gap: 1.15rem; }
.entra-setup[open] { display: grid; }
.entra-setup summary { font-weight: 600; }
code.copyable { user-select: all; background: var(--paper); padding: .1rem .3rem; border-radius: 3px; word-break: break-all; }
.account-grid .panel { margin: 0; }
.users select[name="role"] { min-width: 150px; }
.users select[name="active"] { min-width: 72px; }
.users tr.unusable input, .users tr.unusable select { opacity: .55; }

/* users table: fits without sideways scrolling at desktop widths; sign-in actions in their own row */
.users { table-layout: auto; }
.users td:first-child { width: auto; min-width: 200px; }
.users td:nth-child(5) { min-width: 150px; }
.user-actions { white-space: nowrap; width: 1%; }
.user-actions form { display: inline-block; vertical-align: top; }
.users tr.user-more td { padding-top: 0; }
.user-more-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: .9rem 1rem; }
.temp-pw { display: grid; gap: .3rem; min-width: min(420px, 100%); }
.temp-pw-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.temp-pw-row input { flex: 1 1 220px; margin: 0; }
.more-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.more-toggle[aria-expanded="true"] { background: var(--cobalt-tint); }

/* pagination */
.pager { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1.2rem; flex-wrap: wrap; margin: 1rem 0 .4rem; }
.pager-count { margin: 0; }
.pager ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.pager li { margin: 0; }
.pager a, .pager-off, .pager-gap { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .65rem;
  border-radius: var(--radius-s); font-size: .88rem; font-variant-numeric: tabular-nums; }
.pager a { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); text-decoration: none; }
.pager a:hover { border-color: var(--ink-soft); }
.pager a[aria-current="page"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .pager a[aria-current="page"] { color: #0E1424; } }
.pager-off { color: var(--ink-soft); opacity: .55; }
.pager-gap { min-width: 1.2rem; padding: 0; color: var(--ink-soft); }

/* other sites to research */
.seed-rows { display: grid; gap: .7rem; }
.seed-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; grid-template-areas: "kind url url" "label follow remove";
  gap: .55rem .9rem; align-items: end; padding: .75rem .9rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--paper); }
.seed-kind { grid-area: kind; } .seed-url { grid-area: url; } .seed-label { grid-area: label; }
.seed-follow { grid-area: follow; white-space: nowrap; padding-bottom: .55rem; font-size: .85rem; }
.seed-remove { grid-area: remove; margin-bottom: .3rem; }
.seed-row label { font-size: .85rem; }
.seed-row input, .seed-row select { margin-top: .25rem; }
[data-seed-add] { justify-self: start; }
@media (max-width: 640px) {
  .seed-row { grid-template-columns: 1fr auto; grid-template-areas: "kind kind" "url url" "label label" "follow remove"; }
}
.sites { list-style: none; padding: 0; margin: 0; }
.sites li { padding: .55rem 0; border-top: 1px solid var(--rule); }
.sites li:first-child { border-top: 0; }
