/* ----------------------------------------------------------------
   Tidy Index — dashboard styles

   Shares the exact design tokens from the landing page. Adds
   dashboard-specific components (tabs, cards, badges, toasts,
   form inputs, danger variants).
---------------------------------------------------------------- */

/* ---------- self-hosted webfonts ---------- */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --c-bg:           #ffffff;
  --c-bg-soft:      #f7f9fc;
  --c-bg-tint:      #eef4fb;

  --c-rule:         #e3ecf5;
  --c-rule-strong:  #cbd6e6;

  --c-ink:          #0b1f3a;
  --c-ink-soft:     #3b4f6b;
  --c-ink-mute:     #6b7c93;

  --c-blue:         #2563eb;
  --c-blue-deep:    #1d4ed8;
  --c-blue-soft:    #dbeafe;
  --c-blue-tint:    #eef4ff;

  --c-danger:       #dc2626;
  --c-danger-deep:  #b91c1c;
  --c-danger-soft:  #fee2e2;
  --c-danger-tint:  #fef2f2;

  --c-success:      #059669;
  --c-success-soft: #d1fae5;

  --c-warn:         #b45309;
  --c-warn-soft:    #fef3c7;

  --shadow-sm:      0 1px 2px rgba(15, 38, 73, 0.04);
  --shadow-md:      0 8px 28px -10px rgba(37, 99, 235, 0.18),
                    0 2px 6px rgba(15, 38, 73, 0.05);
  --shadow-lg:      0 24px 60px -20px rgba(37, 99, 235, 0.25),
                    0 6px 16px rgba(15, 38, 73, 0.06);

  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      18px;

  --font-serif:     'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-sans:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                    Helvetica, Arial, sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo,
                    Consolas, monospace;

  --max-w:          960px;
  --max-w-wide:     1080px;
  --gutter:         clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--c-blue);
  text-decoration: none;
  transition: color 160ms ease;
}
a:hover { color: var(--c-blue-deep); }

img, svg { display: block; max-width: 100%; }

::selection {
  background: var(--c-blue-soft);
  color: var(--c-ink);
}

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- typographic primitives (match landing) ---------- */

.serif {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 400;
  letter-spacing: -0.018em;
  color: var(--c-ink);
}

.serif-italic {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.section-marker {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-blue);
  text-transform: lowercase;
}

.page-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}

.page-subtitle {
  margin: 0 0 32px;
  font-size: 16px;
  color: var(--c-ink-soft);
  max-width: 60ch;
}

/* ---------- dashboard app shell ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--c-rule);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 24;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.005em;
  color: var(--c-ink);
}
.brand:hover { color: var(--c-blue); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--c-blue);
}
.brand-mark svg { width: 22px; height: 22px; }

.app-header-meta {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-ink-mute);
}

.app-header-meta .plan-chip {
  padding: 5px 10px;
  border: 1px solid var(--c-rule);
  border-radius: 999px;
  color: var(--c-ink-soft);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.app-header-meta .plan-chip strong {
  color: var(--c-blue);
  font-weight: 500;
}

.app-header-meta .pending-chip {
  padding: 5px 10px;
  border: 1px solid #fde68a;
  background: var(--c-warn-soft);
  border-radius: 999px;
  color: var(--c-warn);
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
  font-size: 11px;
}

.app-header-meta a {
  color: var(--c-ink-soft);
  border-bottom: 1px solid transparent;
}
.app-header-meta a:hover {
  color: var(--c-blue);
  border-color: var(--c-blue);
}

/* ---------- tab nav ---------- */

.tabs {
  border-bottom: 1px solid var(--c-rule);
  margin-bottom: 48px;
}

.tabs-inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tabs-inner::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 18px 18px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-ink-mute);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 160ms ease, border-color 160ms ease;
}

.tab:hover { color: var(--c-ink-soft); }

.tab.active {
  color: var(--c-ink);
  border-bottom-color: var(--c-blue);
}

.tab-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-blue);
  font-weight: 500;
}

/* ---------- main content ---------- */

main.app-main {
  padding: 56px 0 120px;
  min-height: calc(100vh - 66px - 64px);
}

.entry-main {
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- cards ---------- */

.card {
  background: #fff;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.card + .card { margin-top: 14px; }

.card.card-feature {
  border-color: var(--c-blue-soft);
  background: linear-gradient(180deg, #ffffff 0%, var(--c-blue-tint) 140%);
  box-shadow: var(--shadow-md);
}

.card.card-accent {
  border-left: 3px solid var(--c-blue);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 30;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--c-ink);
}

.card-sub {
  margin: 0;
  font-size: 14px;
  color: var(--c-ink-mute);
  line-height: 1.55;
}

.card-body { font-size: 15px; color: var(--c-ink-soft); }

.card-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--c-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-ink-mute);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 180ms ease;
  letter-spacing: -0.005em;
  text-decoration: none;
  background: transparent;
  color: inherit;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--c-ink);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(11, 31, 58, 0.5);
}
.btn-primary:hover {
  background: var(--c-blue);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px rgba(37, 99, 235, 0.5);
}

.btn-accent {
  background: var(--c-blue);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(37, 99, 235, 0.5);
}
.btn-accent:hover {
  background: var(--c-blue-deep);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-rule);
}
.btn-ghost:hover {
  background: var(--c-bg-soft);
  border-color: var(--c-blue-soft);
  color: var(--c-blue-deep);
}

.btn-danger {
  background: transparent;
  color: var(--c-danger);
  border-color: var(--c-danger-soft);
}
.btn-danger:hover {
  background: var(--c-danger-tint);
  border-color: var(--c-danger);
  color: var(--c-danger-deep);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}
.btn-lg {
  padding: 14px 26px;
  font-size: 15px;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-ink-soft);
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid var(--c-rule-strong);
}
.btn-link:hover {
  color: var(--c-blue);
  border-color: var(--c-blue);
}

/* ---------- form inputs ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--c-ink-mute);
}

.input, .select, .textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--c-ink);
  background: #fff;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px var(--c-blue-tint);
}

.input.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.input.input-lg {
  padding: 14px 18px;
  font-size: 16px;
}

.help {
  font-size: 13px;
  color: var(--c-ink-mute);
  line-height: 1.5;
}

/* ---------- chips / scope toggles ---------- */

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--c-rule);
  background: #fff;
  color: var(--c-ink-soft);
  cursor: pointer;
  transition: all 140ms ease;
  user-select: none;
}
.chip:hover {
  border-color: var(--c-blue-soft);
  color: var(--c-ink);
}
.chip.active {
  background: var(--c-blue-tint);
  border-color: var(--c-blue);
  color: var(--c-blue-deep);
}

.chip-all {
  font-weight: 500;
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--c-blue-tint);
  color: var(--c-blue-deep);
  border: 1px solid var(--c-blue-soft);
}

.badge-success {
  background: var(--c-success-soft);
  color: var(--c-success);
  border-color: #a7f3d0;
}

.badge-muted {
  background: var(--c-bg-soft);
  color: var(--c-ink-mute);
  border-color: var(--c-rule);
}

.badge-danger {
  background: var(--c-danger-soft);
  color: var(--c-danger-deep);
  border-color: #fecaca;
}

.badge-warn {
  background: var(--c-warn-soft);
  color: var(--c-warn);
  border-color: #fde68a;
}

/* ---------- banner ---------- */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  background: var(--c-warn-soft);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--c-warn);
  margin-bottom: 28px;
}
.banner strong { color: #78350f; font-weight: 500; }

/* ---------- toasts ---------- */

.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--c-rule-strong);
  border-radius: 999px;
  padding: 11px 22px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--c-ink);
  box-shadow: var(--shadow-md);
  animation: toast-in 220ms ease-out;
}

.toast.toast-success {
  border-color: #a7f3d0;
  background: linear-gradient(180deg, #ffffff 0%, var(--c-success-soft) 180%);
}
.toast.toast-success .toast-dot { background: var(--c-success); }

.toast.toast-error {
  border-color: #fecaca;
  background: linear-gradient(180deg, #ffffff 0%, var(--c-danger-soft) 180%);
}
.toast.toast-error .toast-dot { background: var(--c-danger); }

.toast-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-blue);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- key reveal banner ---------- */

.key-reveal {
  background: linear-gradient(180deg, #ffffff 0%, var(--c-blue-tint) 140%);
  border: 1px solid var(--c-blue-soft);
  border-left: 3px solid var(--c-blue);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.key-reveal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.key-reveal-head strong {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 30;
  font-size: 17px;
  font-weight: 500;
  color: var(--c-ink);
}

.key-reveal-value {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-ink);
  word-break: break-all;
}

.key-reveal-warn {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--c-warn);
}

/* ---------- key list ---------- */

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.key-row-main {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.key-name {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 30;
  font-weight: 500;
  font-size: 18px;
  color: var(--c-ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-mask {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-ink-soft);
  letter-spacing: 0.02em;
}

.key-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-ink-mute);
  margin-top: 6px;
}

.key-meta .meta-label {
  color: var(--c-blue);
  text-transform: lowercase;
  margin-right: 4px;
}

.scope-summary {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-ink-mute);
}

.scope-summary code {
  background: var(--c-bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

/* ---------- plan grid ---------- */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 8px;
}

.plan-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-md);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
  display: flex;
  flex-direction: column;
}
.plan-card:hover {
  border-color: var(--c-blue-soft);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.plan-card.current {
  border-color: var(--c-blue);
  box-shadow: 0 10px 30px -12px rgba(37, 99, 235, 0.25);
  background: linear-gradient(180deg, #ffffff 0%, var(--c-blue-tint) 160%);
}

.plan-card .badge {
  position: absolute;
  top: 20px;
  right: 20px;
}

.plan-name {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 30;
  font-weight: 500;
  font-size: 22px;
  color: var(--c-ink);
  margin: 0 0 4px;
}

.plan-price {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
  color: var(--c-ink);
  margin: 8px 0 14px;
}
.plan-price small {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--c-ink-mute);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-features li {
  font-size: 14px;
  color: var(--c-ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-features li::before {
  content: "·";
  color: var(--c-blue);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}

.plan-cta {
  margin-top: auto;
}

/* ---------- usage ---------- */

.usage-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 14px;
}

.usage-count {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: 44px;
  line-height: 1;
  font-weight: 400;
  color: var(--c-ink);
}
.usage-count small {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--c-ink-mute);
}

.usage-bar {
  width: 100%;
  height: 6px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-rule);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
}

.usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-blue) 0%, #60a5fa 100%);
  border-radius: 999px;
  transition: width 300ms ease;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 12px;
}

.usage-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--c-ink-mute);
  padding: 12px 0;
  border-bottom: 1px solid var(--c-rule);
  font-weight: 500;
}

.usage-table td {
  padding: 14px 0;
  border-bottom: 1px solid var(--c-rule);
  color: var(--c-ink-soft);
}
.usage-table tr:last-child td { border-bottom: 0; }
.usage-table td:first-child {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-ink);
}
.usage-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink);
}

/* ---------- entry / landing page of dashboard ---------- */

.entry-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-lg);
  padding: 48px 44px 40px;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.entry-brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--c-blue);
  margin-bottom: 16px;
}

.entry-tagline {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--c-ink);
  margin: 0 0 32px;
}

.entry-tagline em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  color: var(--c-blue);
}

.entry-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-ink-mute);
  text-transform: lowercase;
  letter-spacing: 0.06em;
}
.entry-divider::before,
.entry-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-rule);
}

.entry-magic-note {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--c-blue-tint);
  border: 1px solid var(--c-blue-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-ink-soft);
  word-break: break-all;
}
.entry-magic-note strong {
  display: block;
  color: var(--c-blue);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 500;
}
.entry-magic-note a { color: var(--c-blue-deep); }

/* ---------- footer ---------- */

.app-footer {
  border-top: 1px solid var(--c-rule);
  background: var(--c-bg);
  padding: 28px 0;
  margin-top: auto;
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-ink-mute);
}

.app-footer-line {
  margin: 0;
  letter-spacing: 0.02em;
}

.app-footer-line a {
  color: var(--c-ink-soft);
  border-bottom: 1px solid var(--c-rule-strong);
  padding-bottom: 1px;
  transition: color 160ms ease, border-color 160ms ease;
}
.app-footer-line a:hover {
  color: var(--c-blue);
  border-color: var(--c-blue);
}

/* ---------- inline flex helpers ---------- */

.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }

.stack-sm > * + * { margin-top: 8px; }
.stack > * + *    { margin-top: 14px; }
.stack-lg > * + * { margin-top: 22px; }

.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }

.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.text-mute { color: var(--c-ink-mute); }
.text-soft { color: var(--c-ink-soft); }
.text-mono { font-family: var(--font-mono); font-size: 13px; }

/* ---------- code blocks ---------- */

code, pre {
  font-family: var(--font-mono);
}

.code-block {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--c-ink);
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}

/* ---------- empty state ---------- */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--c-rule-strong);
  border-radius: var(--radius-md);
  color: var(--c-ink-mute);
}
.empty-state p { margin: 0 0 8px; font-size: 15px; }
.empty-state p.empty-title {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 30;
  font-weight: 500;
  font-size: 18px;
  color: var(--c-ink-soft);
}

/* ---------- danger zone ---------- */

.danger-zone {
  margin-top: 40px;
  border: 1px solid var(--c-danger-soft);
  background: var(--c-danger-tint);
  border-radius: var(--radius-md);
  padding: 22px 26px;
}
.danger-zone-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-danger);
  margin: 0 0 8px;
}
.danger-zone-body {
  font-size: 14px;
  color: var(--c-ink-soft);
  margin: 0 0 16px;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .plan-grid { grid-template-columns: 1fr; }
  .usage-summary { grid-template-columns: 1fr; }
  .app-header-meta .plan-chip { display: none; }
  main.app-main { padding: 40px 0 80px; }
  .tabs { margin-bottom: 32px; }
  .card { padding: 22px 20px; }
  .entry-card { padding: 36px 28px 32px; }
}

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