/* The account page continues clankie.bot: same tokens, type and components as the
   landing site (clankie-landing/index.html). Keep the two in step. */
:root {
  --ground: #242a2e;
  --ground-deep: #1b2125;
  --panel: #2a3136;
  --line: #39424799;
  --line-solid: #3a4247;
  --ink: #ece6d7;
  --muted: #aaa394;
  --faint: #9a9384;
  --leaf: #97c37c;
  --leaf-deep: #6f9d57;
  --gold: #e7b45c;
  --gold-ink: #2a1d06;
  --error: #ff9b8a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, monospace;
  --maxw: 1080px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
/* Display rules below must never un-hide a hidden element. */
[hidden] {
  display: none !important;
}
html {
  background: var(--ground-deep);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 12% 0%, #97c37c0d, transparent 60%),
    radial-gradient(90% 50% at 100% 10%, #e7b45c0a, transparent 55%), var(--ground-deep);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
main,
.bar,
.foot {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 26px;
}
main {
  flex: 1;
  padding-bottom: 56px;
}
main > section {
  max-width: 760px;
}

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--leaf-deep);
  margin: 56px 0 0;
}
h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 12px 0 18px;
  text-wrap: balance;
}
#view-loading h1 {
  margin-top: 56px;
  color: var(--muted);
}
h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.2;
  margin: 0 0 6px;
}
h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.08rem;
  color: var(--muted);
}
h1:focus,
h2:focus {
  outline: none;
}
p {
  margin: 0 0 12px;
}
.lede {
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 56ch;
  margin: 0 0 28px;
}
.muted {
  color: var(--faint);
  font-size: 0.88rem;
}
strong,
b {
  color: var(--ink);
  font-weight: 550;
}

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--ground-deep);
}
.skip:focus {
  top: 12px;
}

/* ---------- header (the landing site's hero-top) ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.98rem;
  color: var(--ink);
  text-decoration: none;
  margin: 0;
}
.brand .seed {
  width: 9px;
  height: 9px;
  border-radius: 2px 6px 2px 6px;
  background: var(--leaf);
  transform: rotate(8deg);
  box-shadow: 0 0 10px -1px var(--leaf);
}
nav.top {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--mono);
  font-size: 0.9rem;
}
nav.top a,
.navlink {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
nav.top a:hover,
.navlink:hover {
  color: var(--ink);
}
.navlink {
  font: inherit;
  background: none;
  border: 0;
  padding: 10px 0;
  min-height: 44px;
  cursor: pointer;
}
@media (max-width: 560px) {
  nav.top a.hide-sm {
    display: none;
  }
}

/* ---------- status line ---------- */
.announce:empty {
  display: none;
}
.announce {
  display: inline-block;
  color: var(--gold);
  font-size: 0.88rem;
  border: 1px solid #e7b45c55;
  border-radius: 20px;
  padding: 6px 14px;
  margin: 24px 0 0;
}

/* ---------- cards and forms (the landing site's .plan panel) ---------- */
form,
.card {
  display: grid;
  gap: 10px;
  align-content: start;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line-solid);
  border-radius: 20px;
  padding: 28px 30px;
  margin: 0 0 18px;
}
.card p {
  color: var(--muted);
}
#view-signin form {
  max-width: 440px;
  margin-bottom: 16px;
}
label {
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink);
}
input[type="email"],
input[type="number"],
input:not([type]),
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--ground-deep);
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  max-width: 24rem;
  transition: border-color 0.15s;
}
input:hover,
textarea:hover {
  border-color: var(--muted);
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
}
.check input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--gold);
}

/* ---------- buttons (the landing site's .btn) ---------- */
button,
.button {
  font-family: var(--sans);
  font-size: 0.96rem;
  font-weight: 560;
  padding: 12px 20px;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line-solid);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  justify-self: start;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition:
    transform 0.1s,
    background 0.15s,
    border-color 0.15s;
}
button:hover,
.button:hover {
  border-color: var(--muted);
  background: #ffffff09;
}
button:active,
.button:active {
  transform: translateY(1px);
}
.primary,
.primary:hover {
  color: var(--gold-ink);
}
.primary {
  background: var(--gold);
  border-color: var(--gold);
}
.primary:hover {
  background: #f0c479;
  border-color: #f0c479;
}
.ghost {
  background: transparent;
}
.quiet {
  border-color: transparent;
  color: var(--muted);
  padding-inline: 2px;
}
.quiet:hover {
  border-color: transparent;
  background: none;
  color: var(--leaf);
}
.link {
  background: none;
  border: none;
  padding: 0;
  min-height: 0;
  display: inline;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.link:hover {
  color: var(--leaf);
  background: none;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.error:empty {
  display: none;
}
.error {
  color: var(--error);
  font-weight: 550;
}

/* ---------- plans (matches the landing site's plan cards) ---------- */
#view-plans {
  max-width: none;
}
#view-plans .lede,
#view-plans .facts {
  max-width: 76ch;
}
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 8px 0 30px;
}
.plan {
  padding: 30px;
  margin: 0;
}
.plan h2 {
  font-size: 1.65rem;
  margin: 0;
}
.price {
  font-size: 2.7rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
  margin: 12px 0 8px;
  color: var(--ink) !important;
}
.price span {
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--muted);
}
/* monthly AI credits, ticked, or your own key (VUH-1403) */
.price-note {
  margin: -4px 0 8px;
  color: var(--muted);
}
.pack-choice {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 8px 0 4px;
  min-width: 0;
  position: relative;
}
.pack-choice legend {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.pack-choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.pack-choice label {
  display: grid;
  gap: 2px;
  padding: 12px 14px 12px 44px;
  min-height: 48px;
  border: 1px solid var(--line-solid);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.pack-choice label::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--muted);
}
.pack-choice label strong {
  color: var(--ink);
  font-weight: 550;
}
.pack-choice label span {
  font-size: 0.88rem;
  color: var(--muted);
}
.pack-choice input:checked + label {
  border-color: var(--gold);
  background: var(--ground-deep);
}
.pack-choice input:checked + label::before {
  border-color: var(--gold);
  background: radial-gradient(circle, var(--gold) 45%, transparent 50%);
}
.pack-choice input:focus-visible + label {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.credit-total {
  font-size: 1.6rem;
  color: var(--ink) !important;
  margin: 0;
}
.scheduled {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
  border: 1px solid #e7b45c55;
  background: #e7b45c0f;
  border-radius: 14px;
  padding: 10px 16px;
}
.scheduled p {
  margin: 0;
  color: var(--ink);
}
.plan ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 18px;
}
.plan li {
  padding: 12px 0;
  border-top: 1px solid var(--line-solid);
  color: var(--muted);
}
.facts {
  color: var(--muted);
}
.facts h2 {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.facts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.facts li {
  margin: 0 0 14px;
}

/* ---------- account ---------- */
.runtime {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink) !important;
}
.progress,
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 6px 0 4px;
}
.progress li,
.steps li {
  counter-increment: step;
  position: relative;
  padding: 6px 0 6px 34px;
  color: var(--muted);
}
.progress li::before,
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 7px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--leaf-deep);
  font-variant-numeric: tabular-nums;
}
.progress li[data-state="done"] {
  color: var(--ink);
}
.progress li[data-state="done"]::before {
  content: "✓";
  font-style: normal;
  color: var(--leaf);
}
.progress li[data-state="current"] {
  color: var(--ink);
  font-weight: 550;
}
.progress li[data-state="current"]::before {
  color: var(--gold);
}
.progress li[data-state="todo"] {
  color: var(--faint);
}
progress {
  width: 100%;
  height: 8px;
  margin-bottom: 8px;
  accent-color: var(--leaf);
}
.qr {
  background: #fff;
  padding: 12px;
  border-radius: 16px;
  width: min(100%, 22rem);
  margin: 6px 0;
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.card h3 {
  margin: 12px 0 0;
}
.providers {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
}
.providers a {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.15s;
}
.providers a:hover {
  color: var(--leaf);
}

/* ---------- footer (the landing site's footer) ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 30px 44px;
  justify-content: space-between;
  align-items: flex-start;
  border-top: 1px solid var(--line);
  padding-top: 46px;
  padding-bottom: 64px;
}
.foot .colophon {
  max-width: 46ch;
}
.foot .colophon .m {
  font-family: var(--mono);
  color: var(--muted);
  margin: 0;
}
.foot .colophon p {
  color: var(--faint);
  font-size: 0.88rem;
  margin: 6px 0 0;
}
.foot .col h2 {
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.foot .col a {
  display: block;
  color: var(--muted);
  font-size: 0.94rem;
  padding: 4px 0;
  text-decoration: none;
  transition: color 0.15s;
}
.foot .col a:hover {
  color: var(--leaf);
}

@media (max-width: 720px) {
  .plans {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .card,
  .plan {
    padding: 24px;
  }
  .eyebrow {
    margin-top: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Read by screen readers, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.channel-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.75rem;
}
.channel-list li {
  padding: 2px 0;
  overflow-wrap: anywhere;
}

/* ---------- dashboard (VUH-1389): the landing site's chapter rhythm ---------- */
#view-account {
  max-width: none;
}
.dash {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 56px;
}
.dash-main {
  max-width: 720px;
  min-width: 0;
}
.sections {
  position: sticky;
  top: 24px;
  align-self: start;
  margin-top: 104px;
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 0.86rem;
}
.sections a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 0 9px 14px;
  border-left: 1px solid var(--line-solid);
  transition:
    color 0.15s,
    border-color 0.15s;
}
.sections a:hover,
.sections a[aria-current] {
  color: var(--ink);
}
.sections a[aria-current] {
  border-left-color: var(--leaf);
}
.chapter {
  border-top: 1px solid var(--line);
  padding-top: 44px;
  margin-top: 44px;
  scroll-margin-top: 16px;
}
.chapter > h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.1;
  margin-bottom: 6px;
}
.lede-sm {
  color: var(--muted);
  margin: 0 0 20px;
}
.lede-sm:empty {
  display: none;
}
.card h3 {
  margin: 0;
  font-size: 1.15rem;
}
h4 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--muted);
  margin: 12px 0 0;
}
#overview h1 {
  margin-bottom: 24px;
}

/* status */
.state-card {
  gap: 16px;
}
.state-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.state-dot {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 11px;
  border-radius: 4px 9px 4px 9px;
  transform: rotate(8deg);
  background: var(--faint);
}
.state-dot[data-state="running"] {
  background: var(--leaf);
  box-shadow: 0 0 14px -1px var(--leaf);
  animation: breathe 2.8s ease-in-out infinite;
}
.state-dot[data-state="waking"] {
  background: var(--gold);
  box-shadow: 0 0 14px -1px var(--gold);
  animation: breathe 1.2s ease-in-out infinite;
}
.state-dot[data-state="paused"] {
  background: var(--error);
}
@keyframes breathe {
  50% {
    opacity: 0.55;
  }
}
.state {
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1.2;
  color: var(--ink) !important;
  margin: 0;
}
.card p.state-detail {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--muted) !important;
  margin: 2px 0 0;
}
.facts-row,
.kv {
  display: grid;
  gap: 12px 24px;
  margin: 0;
}
.facts-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-block: 14px;
  border-block: 1px solid var(--line-solid);
}
dt {
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--faint);
}
dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.kv div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-solid);
}
.kv div:last-child {
  border-bottom: 0;
}

/* one notice at most: gold near a limit, red at it */
.notice {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: baseline;
  border: 1px solid #e7b45c55;
  background: #e7b45c0f;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 0 0 18px;
}
.notice p {
  margin: 0;
  color: var(--ink);
}
.notice[data-level="stop"] {
  border-color: #ff9b8a66;
  background: #ff9b8a10;
}
/* the same stop, kept in the Model section (VUH-1403) */
.notice-inline {
  border: 1px solid #ff9b8a66;
  background: #ff9b8a10;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 0 0 18px;
  color: var(--ink);
}
.stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 14px;
}
.stats li {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line-solid);
  border-radius: 14px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
}
.stat {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.2;
}
.stat small {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}
.bar-track {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--line-solid);
  overflow: hidden;
  margin-top: 6px;
}
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--leaf);
}
.bar-fill[data-level="near"] {
  background: var(--gold);
}
.bar-fill[data-level="full"] {
  background: var(--error);
}

/* usage */
.meter {
  display: grid;
  gap: 4px;
}
.meter + .meter {
  border-top: 1px solid var(--line-solid);
  padding-top: 14px;
}
.meter p,
.meter progress {
  margin: 0;
}
.meter p:empty {
  display: none;
}
.row-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.row-card p {
  margin: 4px 0 0;
}

/* lists of settings and connections */
.list {
  list-style: none;
  padding: 6px 30px;
  gap: 0;
}
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-solid);
}
.list li:last-child {
  border-bottom: 0;
}
.list li > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
input[role="switch"] {
  appearance: none;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--line-solid);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  margin: 0;
}
input[role="switch"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.15s;
}
input[role="switch"]:checked {
  background: var(--leaf-deep);
}
input[role="switch"]:checked::after {
  transform: translateX(18px);
}

/* plan */
.plan-head {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 16px;
}
.plan-head > div {
  flex: 1 1 14rem;
  min-width: 0;
}
.card p.plan-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0 0 4px;
}
.pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--leaf);
  border: 1px solid #97c37c66;
  border-radius: 20px;
  padding: 3px 12px;
  white-space: nowrap;
}
.pill:empty {
  display: none;
}
.pill[data-tone="warn"] {
  color: var(--gold);
  border-color: #e7b45c66;
}
.consequence {
  border-top: 1px solid var(--line-solid);
  padding-top: 16px;
  margin-top: 6px;
}
.consequence ul {
  color: var(--muted);
  padding-left: 1.1rem;
  margin: 8px 0 4px;
}
.consequence li {
  margin-bottom: 6px;
}
.danger {
  color: var(--error);
}
.quiet.danger:hover {
  color: var(--error);
  text-decoration: underline;
}
.ghost.danger:hover {
  border-color: var(--error);
}
.danger-fill,
.danger-fill:hover {
  background: var(--error);
  border-color: var(--error);
  color: #2b0d08;
}
.danger-card {
  border-color: #ff9b8a33;
}
.danger-card #delete-status {
  color: var(--ink);
}

@media (max-width: 860px) {
  .dash {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .sections {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 -26px;
    padding: 0 26px;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    background: #1b2125f2;
    border-bottom: 1px solid var(--line-solid);
  }
  .sections a {
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 12px;
    min-height: 44px;
  }
  .sections a[aria-current] {
    border-bottom-color: var(--leaf);
  }
  .chapter,
  #overview {
    scroll-margin-top: 64px;
  }
}
@media (max-width: 560px) {
  .stats {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stats li {
    grid-template-columns: 1fr auto;
    align-items: baseline;
  }
  .stats .bar-track {
    grid-column: 1 / -1;
  }
  .facts-row {
    grid-template-columns: 1fr 1fr;
  }
  .facts-row div:last-child {
    grid-column: 1 / -1;
  }
  .list {
    padding-inline: 20px;
  }
  .row-card {
    grid-template-columns: 1fr;
  }
  .kv div {
    grid-template-columns: 5.5rem 1fr;
  }
  .state {
    font-size: 1.45rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .state-dot {
    animation: none !important;
  }
}
