/* cracklenut home. Token names follow packages/theme/TOKENS.md. The palette is
   warm paper and hazelnut in light, midnight navy with hazelnut in dark, with each
   app wearing its own colour on its tile. Light by default; dark from the theme
   cookie (data-theme) or, with no choice saved, the system setting. */

:root {
  color-scheme: light;
  --font: 'Instrument Sans Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque Variable', var(--font);
  --app-bg: #f7f1e6;
  --bg: #fffcf6;
  --elevated: #ffffff;
  --input-bg: #ffffff;
  --surface-alt: #f0e8da;
  --border: #e8dccb;
  --border-strong: #d6c6ae;
  --text: #24170c;
  --muted: #6e5f4e;
  --faint: #9a8a76;
  --hover: #f3eadc;
  --accent: #a3530f;
  --accent-bg: #b85c12;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(184, 92, 18, 0.1);
  --focus-ring: rgba(184, 92, 18, 0.38);
  --pos: #2f7a3e;
  --pos-bg: #e5f2e6;
  --warn: #8a6100;
  --warn-bg: #fbf0d4;
  --neg: #b8322a;
  --neg-bg: #fbe7e4;
  --panel-shadow: 0 1px 2px rgba(60, 35, 10, 0.06), 0 6px 20px -8px rgba(60, 35, 10, 0.12);
  --pop-shadow: 0 24px 60px -12px rgba(60, 35, 10, 0.28);
  /* Home only. */
  --glow-1: rgba(244, 158, 66, 0.42);
  --glow-2: rgba(222, 110, 60, 0.22);
  --glow-3: rgba(250, 205, 120, 0.40);
  --grain: 0.05;
  --title-from: #3a1d08;
  --title-to: #b85c12;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --app-bg: #0a0e1a;
    --bg: #111729;
    --elevated: #172036;
    --input-bg: #0c1120;
    --surface-alt: #141b30;
    --border: #222c45;
    --border-strong: #323e5c;
    --text: #ecedf3;
    --muted: #9aa2b8;
    --faint: #6b7389;
    --hover: #1a2238;
    --accent: #f2a65a;
    --accent-bg: #c8691b;
    --accent-contrast: #ffffff;
    --accent-soft: rgba(242, 166, 90, 0.13);
    --focus-ring: rgba(242, 166, 90, 0.45);
    --pos: #6cc27b;
    --pos-bg: rgba(108, 194, 123, 0.12);
    --warn: #e3b341;
    --warn-bg: rgba(227, 179, 65, 0.12);
    --neg: #f08070;
    --neg-bg: rgba(240, 128, 112, 0.12);
    --panel-shadow: 0 0 0 1px rgba(180, 200, 255, 0.03), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --pop-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.7);
    --glow-1: rgba(242, 150, 60, 0.22);
    --glow-2: rgba(80, 100, 200, 0.24);
    --glow-3: rgba(240, 170, 80, 0.10);
    --grain: 0.07;
    --title-from: #ffffff;
    --title-to: #f2a65a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #0a0e1a;
  --bg: #111729;
  --elevated: #172036;
  --input-bg: #0c1120;
  --surface-alt: #141b30;
  --border: #222c45;
  --border-strong: #323e5c;
  --text: #ecedf3;
  --muted: #9aa2b8;
  --faint: #6b7389;
  --hover: #1a2238;
  --accent: #f2a65a;
  --accent-bg: #c8691b;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(242, 166, 90, 0.13);
  --focus-ring: rgba(242, 166, 90, 0.45);
  --pos: #6cc27b;
  --pos-bg: rgba(108, 194, 123, 0.12);
  --warn: #e3b341;
  --warn-bg: rgba(227, 179, 65, 0.12);
  --neg: #f08070;
  --neg-bg: rgba(240, 128, 112, 0.12);
  --panel-shadow: 0 0 0 1px rgba(180, 200, 255, 0.03), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --pop-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.7);
  --glow-1: rgba(242, 150, 60, 0.22);
  --glow-2: rgba(80, 100, 200, 0.24);
  --glow-3: rgba(240, 170, 80, 0.10);
  --grain: 0.07;
  --title-from: #ffffff;
  --title-to: #f2a65a;
}

/* Each app's own colour, from its own palette. */
[data-app="finance"] { --app: #3f63e6; --app-soft: rgba(63, 99, 230, 0.12); }
[data-app="tasks"] { --app: #0f7f5f; --app-soft: rgba(15, 127, 95, 0.12); }
[data-app="workouts"] { --app: #d9480f; --app-soft: rgba(217, 72, 15, 0.1); }
[data-app="nutrition"] { --app: #5c8a12; --app-soft: rgba(92, 138, 18, 0.12); }
[data-app="goals"] { --app: #7048e8; --app-soft: rgba(112, 72, 232, 0.1); }
:root[data-theme="dark"] [data-app="finance"] { --app: #7b97ff; --app-soft: rgba(123, 151, 255, 0.14); }
:root[data-theme="dark"] [data-app="tasks"] { --app: #3fc79a; --app-soft: rgba(63, 199, 154, 0.14); }
:root[data-theme="dark"] [data-app="workouts"] { --app: #ff8a5c; --app-soft: rgba(255, 138, 92, 0.12); }
:root[data-theme="dark"] [data-app="nutrition"] { --app: #a3d65c; --app-soft: rgba(163, 214, 92, 0.12); }
:root[data-theme="dark"] [data-app="goals"] { --app: #a990ff; --app-soft: rgba(169, 144, 255, 0.12); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) [data-app="finance"] { --app: #7b97ff; --app-soft: rgba(123, 151, 255, 0.14); }
  :root:not([data-theme]) [data-app="tasks"] { --app: #3fc79a; --app-soft: rgba(63, 199, 154, 0.14); }
  :root:not([data-theme]) [data-app="workouts"] { --app: #ff8a5c; --app-soft: rgba(255, 138, 92, 0.12); }
  :root:not([data-theme]) [data-app="nutrition"] { --app: #a3d65c; --app-soft: rgba(163, 214, 92, 0.12); }
  :root:not([data-theme]) [data-app="goals"] { --app: #a990ff; --app-soft: rgba(169, 144, 255, 0.12); }
}

/* ---- Base ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--app-bg); }
body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--app-bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2 { margin: 0; }

/* Warm light pooling behind the page, with a little paper grain. */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(42% 38% at 18% 12%, var(--glow-1), transparent 70%),
    radial-gradient(36% 40% at 88% 22%, var(--glow-2), transparent 70%),
    radial-gradient(50% 45% at 60% 105%, var(--glow-3), transparent 70%);
  filter: blur(10px);
  animation: drift 26s ease-in-out infinite alternate;
}
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.35 0 0 0 0 0.2 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .backdrop::after { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .backdrop::after { mix-blend-mode: screen; } }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--hover); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.primary { border-color: transparent; background: linear-gradient(180deg, color-mix(in srgb, var(--accent-bg) 88%, white), var(--accent-bg)); color: var(--accent-contrast); box-shadow: 0 6px 18px -6px var(--accent-bg); }
.btn.primary:hover { filter: brightness(1.06); }
.btn:focus-visible, .icon-btn:focus-visible, .tile:focus-visible, .wordmark:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
/* The toggle shows where it will take you. */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .icon-sun { display: block; }
  :root:not([data-theme]) .icon-moon { display: none; }
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  color: var(--text);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.wordmark img { border-radius: 8px; box-shadow: 0 4px 12px -4px rgba(90, 40, 10, 0.5); transition: transform 0.3s cubic-bezier(.3, 1.6, .5, 1); }
.wordmark:hover img { transform: rotate(-8deg) scale(1.06); }

/* ---- Home ---- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 28px;
}
.top-actions { display: flex; align-items: center; gap: 6px; }
.top-actions form { margin: 0; }
.page { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 28px 56px; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin: 12px 0 44px; }
.hero-text { min-width: 0; }
.hero-art { position: relative; flex: none; width: 260px; height: 260px; margin-right: 24px; }
.hero-art::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-1), transparent);
  filter: blur(18px);
}
.hero-nut {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 26px 34px rgba(120, 55, 10, 0.32));
  transform: rotate(-10deg);
  animation: bob 6s ease-in-out infinite;
}
/* The halves sit a little apart, as in the logo, and part further on hover. */
.nut-half { transform-box: view-box; transform-origin: 32px 53px; transition: transform 0.5s cubic-bezier(.3, 1.5, .5, 1); }
.nut-half.left { transform: rotate(-3deg); }
.nut-half.right { transform: translate(2.4px, -0.4px) rotate(7deg); }
.hero-art:hover .nut-half.left { transform: translate(-1px, 0) rotate(-7deg); }
.hero-art:hover .nut-half.right { transform: translate(4px, -1px) rotate(13deg); }
@keyframes bob {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50% { transform: rotate(-6deg) translateY(-10px); }
}
@media (max-width: 760px) {
  .hero-art { display: none; }
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-title {
  font-family: var(--display);
  font-size: clamp(44px, 8vw, 84px);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.045em;
  background: linear-gradient(100deg, var(--title-from) 30%, var(--title-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-dot { color: var(--accent-bg); -webkit-text-fill-color: var(--accent-bg); }
.hero-sub { margin: 16px 0 0; color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); }

.section-label {
  margin-bottom: 14px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.tiles li, .soon-list li { animation: rise 0.6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 210px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--panel-shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), border-color 0.25s, box-shadow 0.25s;
}
.tile-glow {
  position: absolute;
  inset: auto -30% -60% auto;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--app-soft), transparent);
  opacity: 0.7;
  transition: opacity 0.3s, transform 0.4s;
  pointer-events: none;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--app) 45%, var(--border));
  box-shadow: 0 20px 44px -18px color-mix(in srgb, var(--app) 55%, transparent), var(--panel-shadow);
}
.tile:hover .tile-glow { opacity: 1; transform: scale(1.25); }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: auto; }
.tile-badge {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--app) 82%, white), var(--app));
  color: #fff;
  box-shadow: 0 10px 22px -10px var(--app), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.3s cubic-bezier(.3, 1.6, .5, 1);
}
.tile:hover .tile-badge { transform: rotate(-6deg) scale(1.06); }
.tile-key {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 7px;
  color: var(--faint);
  font: 600 12px var(--font);
}
.tile-name { margin-top: 26px; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.tile-blurb { margin-top: 2px; color: var(--muted); }
.tile-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--faint);
  font-size: 13px;
}
.tile-go svg { color: var(--app); transition: transform 0.25s; }
.tile:hover .tile-go svg { transform: translateX(4px); }
.tile-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.workbench { margin-top: 44px; }
.soon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.soon-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--muted);
}
.soon-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--app-soft);
  color: var(--app);
}
.soon-text { display: flex; flex-direction: column; min-width: 0; }
.soon-name { color: var(--text); font-weight: 620; }
.soon-blurb { font-size: 13.5px; }

.foot {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px 36px;
  color: var(--faint);
  font-size: 13px;
}
.foot span:first-child { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }

/* ---- Sign in ---- */
.signin { display: grid; flex: 1; place-items: center; padding: 24px 16px; }
.signin-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(400px, 100%);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--pop-shadow);
  animation: rise 0.6s cubic-bezier(.2, .8, .2, 1) both;
}
.signin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.signin-card h1 { font-family: var(--display); font-size: 32px; font-weight: 750; letter-spacing: -0.035em; }
.signin-card p { margin: -8px 0 4px; }
.muted { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.field input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }
.signin-card .btn.primary { height: 44px; border-radius: 12px; font-size: 15px; }
.error { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--neg-bg); color: var(--neg); font-size: 14px; }

@media (max-width: 560px) {
  .top { padding: 16px; }
  .page { padding: 12px 16px 40px; }
  .hero { margin: 16px 0 32px; }
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Today: a card from each app ---- */

.today { margin: -12px 0 44px; }
.day-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.day-cards li { animation: rise 0.6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 60ms); }
.day-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--panel-shadow);
}
.day-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; }
.day-card-app { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.day-card-app:hover { color: var(--text); }
.day-card-badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--app-soft); color: var(--app); }
.day-card .btn.small { height: 32px; padding: 0 13px; font-size: 13.5px; text-decoration: none; }
.day-card-headline { margin: 2px 0 0; font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.day-card-bar { height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-alt); }
.day-card-bar span { display: block; height: 100%; border-radius: inherit; background: var(--app); }
.day-card-detail { margin: 0; color: var(--muted); font-size: 14px; }
.day-card-items { display: flex; flex-direction: column; margin: 4px 0 0; padding: 0; list-style: none; }
.day-card-items li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14.5px; }
.day-card-items a, .day-card-items li > span:first-child { min-width: 0; overflow: hidden; color: var(--text); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.day-card-items a:hover { color: var(--app); }
.day-card-meta { flex: none; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .today { margin-top: -20px; }
  .day-cards { grid-template-columns: 1fr; }
  .day-card { padding: 16px; }
}

/* ---- Connections ---- */

.narrow-page { max-width: 760px; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 14px; text-decoration: none; }
.back-link:hover { color: var(--text); }
.page-head h1 { font-family: var(--display); font-size: 36px; font-weight: 750; letter-spacing: -0.035em; }
.page-head p { margin: 6px 0 24px; }
.notice { margin: 0 0 16px; padding: 9px 12px; border-radius: 10px; background: var(--pos-bg); color: var(--pos); font-size: 14px; }
.page .error { margin-bottom: 16px; }
.accounts { display: flex; flex-direction: column; gap: 10px; margin: 0 0 36px; padding: 0; list-style: none; }
.account { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); box-shadow: var(--panel-shadow); }
.account-main { display: flex; align-items: center; gap: 12px; }
.account-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--acct, var(--accent)); }
.account-text { display: flex; flex: 1; flex-direction: column; min-width: 0; font-size: 14px; }
.account-name { color: var(--text); font-size: 16px; font-weight: 650; }
.badge-warn { flex: none; padding: 2px 10px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: 12.5px; font-weight: 650; }
.account .error { margin: 10px 0 0; }
.account-edit { margin-top: 8px; }
.account-edit summary { color: var(--muted); font-size: 13.5px; cursor: pointer; }
.account-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.account-form .field { flex: 1; min-width: 160px; }
.account-form select { height: 40px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--input-bg); color: var(--text); font: inherit; }
.account-actions { display: flex; gap: 8px; margin-top: 12px; }
.account-actions form { margin: 0; }
.btn.danger { border-color: transparent; background: var(--neg-bg); color: var(--neg); }
.empty-note { margin: 0 0 32px; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.provider-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); box-shadow: var(--panel-shadow); }
.provider-card h3 { margin: 0; font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }
.provider-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.provider-card code { font-size: 12.5px; }
.purpose-pick { display: flex; gap: 16px; margin: 0; padding: 0; border: none; font-size: 14.5px; }
.purpose-pick legend { margin-bottom: 6px; font-size: 13px; }
.purpose-pick label { display: inline-flex; align-items: center; gap: 6px; }
.account[data-color="blue"] { --acct: #2f6fe4; }
.account[data-color="green"] { --acct: #1f9d55; }
.account[data-color="orange"] { --acct: #f2711c; }
.account[data-color="purple"] { --acct: #8b5cf6; }
.account[data-color="red"] { --acct: #e5484d; }
.account[data-color="teal"] { --acct: #0d9e9e; }
.account[data-color="pink"] { --acct: #e2468f; }
.account[data-color="grey"] { --acct: #958b7a; }

/* ---- Capture: one line in, proposals out ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.capture { margin: -12px 0 40px; }
.capture-form { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg); box-shadow: var(--panel-shadow); }
.capture-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring), var(--panel-shadow); }
.capture-input { flex: 1; min-width: 0; height: 48px; padding: 0 12px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 17px; }
.capture-input:focus { outline: none; }
.capture-input::placeholder { color: var(--faint); text-overflow: ellipsis; }
.capture-go { height: 48px; padding: 0 22px; border-radius: 12px; }
.capture-go[disabled] { opacity: 0.6; }
.capture-out:empty { display: none; }
.capture-out { margin-top: 12px; }
.capture-note { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.capture-list { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.capture-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); cursor: pointer; }
.capture-item.off { opacity: 0.55; }
.capture-item.error { cursor: default; border-style: dashed; }
.capture-item input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--app, var(--accent-bg)); }
.capture-item-body { display: grid; flex: 1; gap: 3px; min-width: 0; }
.capture-item-app { justify-self: start; padding: 1px 8px; border-radius: 99px; background: var(--app-soft, var(--surface-alt)); color: var(--app, var(--muted)); font-size: 12px; font-weight: 700; }
.capture-item-summary { font-weight: 650; overflow-wrap: anywhere; }
.capture-item-detail { color: var(--muted); font-size: 14px; }
.capture-item.error .capture-item-summary { color: var(--neg); font-weight: 600; }
.capture-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.capture-done { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.capture-done li { display: flex; align-items: center; gap: 8px; }
.capture-done .ok::before { content: '✓'; color: var(--pos); font-weight: 800; }
.capture-done .bad { color: var(--neg); }
.capture-done a { color: var(--app, var(--accent)); font-weight: 650; }
.capture-page { max-width: 720px; }
.capture-title { margin: 8px 0 6px; font-family: var(--display); font-size: clamp(32px, 6vw, 44px); letter-spacing: -0.03em; }
.capture-sub { margin: 0 0 28px; color: var(--muted); }
.capture-page .capture { margin: 0; }
@media (max-width: 560px) {
  .capture-input { font-size: 16px; }
  .capture-go { padding: 0 16px; }
}

/* ---- Setting up sign-in, from a one-time link ---- */
.setup-card { width: min(440px, 100%); }
.setup-step { margin: 8px 0 0; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
/* Dark on white whatever the theme, so it scans. */
.setup-qr { align-self: center; width: 200px; padding: 8px; border-radius: 14px; background: #fff; line-height: 0; }
.setup-qr svg { width: 100%; height: auto; }
.setup-key { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.setup-key code {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  user-select: all;
}
.setup-open { align-self: flex-start; color: var(--accent); font-size: 14px; font-weight: 600; }
