/* FakeWatch app styles. One accent (blue), slate neutrals, light and dark from the OS setting.
   Radius rule: controls 8px, cards 12px. No inline styles anywhere (strict CSP). */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #1e293b;
  --muted: #475569;
  --subtle: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-soft-border: #bfdbfe;
  --link: #1d4ed8;
  --on-accent: #ffffff;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;
  --danger: #dc2626;
  --danger-text: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 1px 3px rgb(15 23 42 / 0.07);
  --shadow-lg: 0 4px 12px rgb(15 23 42 / 0.08), 0 1px 3px rgb(15 23 42 / 0.06);

  --radius-sm: 8px;
  --radius: 12px;
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1220;
    --surface: #111a2e;
    --surface-2: #17223a;
    --border: #243049;
    --border-strong: #33415e;
    --text: #e2e8f0;
    --text-2: #cbd5e1;
    --muted: #94a3b8;
    --subtle: #8a98ad;
    --accent: #2563eb;
    /* Darker on hover, as in light mode: white on #3b82f6 is only 3.7:1. */
    --accent-hover: #1d4ed8;
    --accent-soft: rgb(37 99 235 / 0.16);
    --accent-soft-border: rgb(96 165 250 / 0.35);
    --link: #93c5fd;
    --success: #4ade80;
    --success-soft: rgb(34 197 94 / 0.12);
    --success-border: rgb(74 222 128 / 0.3);
    --warning: #fbbf24;
    --warning-soft: rgb(245 158 11 / 0.12);
    --warning-border: rgb(251 191 36 / 0.3);
    --danger: #dc2626;
    --danger-text: #fca5a5;
    --danger-soft: rgb(239 68 68 / 0.12);
    --danger-border: rgb(248 113 113 / 0.35);
    --focus: #60a5fa;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 6px 16px rgb(0 0 0 / 0.35);
  }
}

/* --- Base ----------------------------------------------------------------------------- */

[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: 1.625rem;
  font-weight: 700;
}

h2 {
  font-size: 1.125rem;
  font-weight: 650;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

img,
svg {
  display: block;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon {
  flex-shrink: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.skip-link:focus {
  top: 12px;
}

.muted {
  color: var(--muted);
}

.subtle {
  color: var(--subtle);
  font-size: 0.875rem;
}

.small {
  font-size: 0.875rem;
}

.stack > * + * {
  margin-top: 16px;
}

.stack-sm > * + * {
  margin-top: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

/* --- Buttons -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease),
    transform 100ms var(--ease);
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.btn-danger-outline:hover {
  background: var(--danger-soft);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.875rem;
}

/* Square icon-only button, 44px hit area. */
.btn-icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: var(--subtle);
  border-color: transparent;
}

.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-icon.danger:hover {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.htmx-request .btn[type="submit"],
.btn.htmx-request {
  cursor: progress;
}

/* --- Forms ---------------------------------------------------------------------------- */

.form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .form-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid .span-all {
    grid-column: 1 / -1;
  }
}

.field {
  display: grid;
  /* Keep rows compact when a grid neighbour is taller. */
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.field label,
.label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
}

.optional {
  font-weight: 400;
  color: var(--subtle);
}

.input,
.field input:not([type="checkbox"], [type="radio"], [type="file"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition:
    border-color 150ms var(--ease),
    box-shadow 150ms var(--ease);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--subtle) 50%),
    linear-gradient(135deg, var(--subtle) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 55%,
    calc(100% - 15px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--subtle);
  opacity: 1;
}

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.25);
}

.field input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
}

.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}

.hint {
  font-size: 0.8125rem;
  color: var(--subtle);
}

.field-error {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--danger-text);
}

.field-error .icon {
  margin-top: 2px;
}

.code-input {
  font-family: var(--mono);
  font-size: 1.25rem !important;
  letter-spacing: 0.2em;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Line the button up with the input, not with the hint or error under it. */
.inline-form .btn {
  margin-top: calc(0.875rem * 1.55 + 6px);
}

.inline-form .field {
  flex: 1 1 220px;
}

/* Status badge and row buttons in a table cell: each button is its own form. */
.cell-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Alerts, flash, badges ------------------------------------------------------------ */

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.9375rem;
}

.alert .icon {
  margin-top: 2px;
}

.alert-success {
  background: var(--success-soft);
  border-color: var(--success-border);
}

.alert-success .icon {
  color: var(--success);
}

.alert-error {
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.alert-error .icon {
  color: var(--danger-text);
}

.alert-info {
  background: var(--accent-soft);
  border-color: var(--accent-soft-border);
}

.alert-info .icon {
  color: var(--link);
}

.alert-warning {
  background: var(--warning-soft);
  border-color: var(--warning-border);
}

.alert-warning .icon {
  color: var(--warning);
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert form {
  display: inline;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning);
}

.badge-accent {
  background: var(--accent-soft);
  border-color: var(--accent-soft-border);
  color: var(--link);
}

.notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 0.875rem;
  font-weight: 600;
}

/* --- Cards and sections --------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-body {
  padding: 20px;
}

@media (min-width: 720px) {
  .card-body {
    padding: 24px;
  }
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card-header .titles {
  flex: 1 1 240px;
  min-width: 0;
}

.card-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.divider {
  height: 1px;
  margin: 20px 0;
  background: var(--border);
  border: 0;
}

.section-anchor {
  scroll-margin-top: 80px;
}

.danger-card {
  border-color: var(--danger-border);
}

/* --- Lists ---------------------------------------------------------------------------- */

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list > li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.list > li:first-child {
  border-top: 0;
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.list-meta {
  color: var(--subtle);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.list-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table th {
  padding: 8px 12px 8px 0;
  color: var(--subtle);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Auth layout ---------------------------------------------------------------------- */

.auth {
  display: grid;
  min-height: 100dvh;
}

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 24px 16px 40px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}

.auth-content {
  width: 100%;
  max-width: 400px;
  margin: 48px auto 0;
}

.auth-content h1 {
  margin-bottom: 8px;
}

.auth-content .lead {
  margin-bottom: 24px;
  color: var(--muted);
}

/* Error pages have one message, so the heading can carry more weight than on forms. */
.error-content h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.auth-foot {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.auth-panel {
  display: none;
}

@media (min-width: 960px) {
  .auth {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .auth-main {
    padding: 32px 48px;
  }

  .auth-content {
    margin-top: 12vh;
  }

  .auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px;
    background: var(--accent-soft);
    border-left: 1px solid var(--accent-soft-border);
  }
}

.panel-inner {
  max-width: 460px;
}

.panel-inner h2 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.panel-inner > p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.0625rem;
}

.panel-points {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 20px;
}

.panel-points li {
  display: flex;
  gap: 14px;
}

.panel-points .list-icon {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent-soft-border);
}

.panel-points strong {
  display: block;
  color: var(--text);
}

.panel-points span {
  color: var(--muted);
  font-size: 0.9375rem;
}

.brand-mark {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* --- App shell ------------------------------------------------------------------------ */

.app {
  min-height: 100dvh;
}

.sidebar {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 8px 8px 16px;
}

.mobile-nav summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text);
  list-style: none;
  cursor: pointer;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav summary:hover {
  background: var(--surface-2);
}

.mobile-nav[open] .icon-open,
.mobile-nav:not([open]) .icon-close {
  display: none;
}

.mobile-nav-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
  padding: 12px 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

@media (min-width: 1024px) {
  .app {
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr);
  }

  .topbar {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow-y: auto;
    padding: 20px 16px;
    background: var(--surface);
    border-right: 1px solid var(--border);
  }

  .main {
    padding: 32px 40px 80px;
  }
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar .brand-row {
  padding-bottom: 16px;
}

.sidebar .auth-brand {
  padding: 4px 8px;
}

.workspace {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.workspace-name {
  font-weight: 600;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.workspace-switch summary {
  margin-top: 6px;
  color: var(--link);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.workspace-switch ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.workspace-switch button {
  width: 100%;
  min-height: 40px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.workspace-switch button:hover {
  background: var(--surface-2);
}

.nav {
  display: grid;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms var(--ease);
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 600;
}

.nav-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mobile-nav-panel .nav-foot {
  margin-top: 12px;
}

.user-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  color: var(--muted);
  font-size: 0.875rem;
}

.user-line span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-alert {
  margin-bottom: 24px;
}

.page-head .titles {
  flex: 1 1 280px;
  min-width: 0;
}

.page-head p {
  margin-top: 6px;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.flash-area {
  margin-bottom: 20px;
}

.banner {
  margin-bottom: 20px;
}

/* --- Projects ------------------------------------------------------------------------- */

.project-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 150ms var(--ease),
    box-shadow 150ms var(--ease);
}

.project-card:hover {
  border-color: var(--accent-soft-border);
  box-shadow: var(--shadow-lg);
}

.project-card .row {
  flex-wrap: nowrap;
}

.project-card h2 {
  overflow-wrap: anywhere;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.25rem;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 1.5rem;
}

.avatar-round {
  border-radius: 50%;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}

.empty-state .list-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-soft);
  color: var(--link);
}

.empty-state p {
  max-width: 46ch;
  color: var(--muted);
}

.project-layout {
  display: grid;
  gap: 20px;
  align-items: start;
}

.project-sections {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.managed-project {
  gap: 24px;
  max-width: 960px;
}

/* Managed: every setting the client rarely needs, folded away (plan.md 17l). */
.advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.advanced > summary::-webkit-details-marker {
  display: none;
}

.advanced > summary .icon {
  flex: none;
  transition: transform 150ms ease-out;
}

.advanced[open] > summary .icon {
  transform: rotate(180deg);
}

.advanced-body {
  margin-top: 20px;
  gap: 20px;
}

@media (min-width: 1200px) {
  .project-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .project-aside {
    position: sticky;
    top: 32px;
    order: 2;
  }
}

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.checklist a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.checklist a:hover {
  background: var(--surface-2);
}

.checklist .icon {
  margin-top: 1px;
  color: var(--subtle);
}

.checklist .done .icon {
  color: var(--success);
}

.checklist .done .step-label {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--border-strong);
}

.step-label {
  font-weight: 600;
  font-size: 0.9375rem;
}

.step-hint {
  display: block;
  color: var(--subtle);
  font-size: 0.8125rem;
}

.progress {
  width: 100%;
  height: 8px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress::-webkit-progress-bar {
  background: var(--surface-2);
  border-radius: 999px;
}

.progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

.progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.progress.full::-webkit-progress-value {
  background: var(--warning);
}

.progress.full::-moz-progress-bar {
  background: var(--warning);
}

.usage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.kw-grid {
  display: grid;
  gap: 0 24px;
}

@media (min-width: 720px) {
  .kw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kw-grid > li:nth-child(2) {
    border-top: 0;
  }
}

.kw-off .list-title {
  color: var(--subtle);
  text-decoration: line-through;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.switch:hover {
  background: var(--surface-2);
}

.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background-color 150ms var(--ease);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  transition: transform 150ms var(--ease);
}

.switch[aria-pressed="true"] .switch-track {
  background: var(--accent);
}

.switch[aria-pressed="true"] .switch-track::after {
  transform: translateX(16px);
}

.switch:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.switch:disabled:hover {
  background: transparent;
}

.tg-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin: 4px 0 0 -8px;
}

.tg-switches .switch {
  text-align: left;
}

.tg-switches .switch-track {
  flex-shrink: 0;
}

.timeout-length {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.timeout-length .label,
.timeout-length .hint {
  margin: 0;
}

.timeout-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeout-option {
  min-width: 72px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease);
}

.timeout-option:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.timeout-option:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.timeout-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 600;
}

.timeout-option:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.tg-off-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--warning);
}

.tg-off-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.list > li.tg-row {
  align-items: flex-start;
}

.tg-trusted {
  margin-top: 4px;
}

.tg-trusted-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.tg-trusted-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.tg-trusted-name {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}

.alert .btn .icon {
  margin-top: 0;
  color: currentColor;
}

.alert-body > p + .btn {
  margin-top: 8px;
}

.tg-notice {
  margin-bottom: 8px;
}

.tg-steps {
  margin: 0 0 12px;
  padding-left: 20px;
}

.tg-steps li + li {
  margin-top: 4px;
}

.dc-setup {
  margin-bottom: 16px;
  padding: 4px 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.dc-setup:not([open]) {
  padding-bottom: 4px;
}

.dc-setup summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.dc-setup summary::-webkit-details-marker {
  display: none;
}

.dc-setup summary .icon {
  transition: transform 150ms ease-out;
}

.dc-setup[open] summary .icon {
  transform: rotate(180deg);
}

.dc-steps {
  display: grid;
  gap: 12px;
  margin: 4px 0 12px;
  padding: 0;
  list-style: none;
}

.dc-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.dc-steps li > .icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--subtle);
}

.dc-steps li.done > .icon {
  color: var(--success);
}

.dc-steps p {
  margin: 0;
}

.dc-steps .step-hint {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.dc-steps .done .step-label {
  color: var(--muted);
}

.dc-commands {
  margin-top: 8px;
}

.dc-commands summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}

.dc-commands dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 4px 0 0;
}

.dc-commands dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 480px) {
  .dc-commands dl {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dc-commands dd {
    margin-bottom: 8px;
  }
}

.logo-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.logo-row form {
  flex: 1 1 260px;
}

.handles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.handles span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

details.danger summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--danger-text);
}

/* --- Settings ------------------------------------------------------------------------- */

.settings-grid {
  display: grid;
  gap: 20px;
}

.qr {
  width: 200px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.setup-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 720px) {
  .setup-grid {
    grid-template-columns: 216px minmax(0, 1fr);
  }
}

.secret {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.secret code {
  flex: 1 1 200px;
}

.codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 1rem;
  list-style: none;
}

.stat-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .stat-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.stat .label {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.stat .value {
  display: block;
  margin: 4px 0 10px;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat .value small {
  color: var(--subtle);
  font-size: 0.9375rem;
  font-weight: 500;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 900px) {
  .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.activity-time {
  white-space: nowrap;
  color: var(--subtle);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.section-status:empty {
  display: none;
}

.inline-form > form.inline-form {
  flex: 1 1 320px;
}

.stat-grid + .two-col,
.stat-grid + .page-section,
.two-col + .card,
.settings-grid + .card,
.page-cards > .card + .card {
  margin-top: 20px;
}

/* Page-level sections with their own h2 (admin lists). */
.page-section + .page-section {
  margin-top: 32px;
}

.card-body.row {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.card-body.row p {
  margin-top: 4px;
}

/* htmx: dim the section while its request is in flight. */
.htmx-request.card,
.card:has(form.htmx-request) {
  opacity: 0.7;
}

.card {
  transition: opacity 150ms var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

/* --- Domain findings ------------------------------------------------------------------ */

.findings > li.finding {
  align-items: flex-start;
  padding: 12px 0;
}

.finding.is-gone .finding-domain span:first-child {
  color: var(--muted);
}

.verdict {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.findings > li.finding-closed {
  align-items: center;
  gap: 12px;
}

.finding-closed-text {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.finding-domain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Store icon of an app finding (our WebP copy); the placeholder keeps the title aligned. */
.app-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  object-fit: cover;
}

.score {
  display: grid;
  place-items: center;
  align-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.score-value {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.score-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.score-high {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.score-medium {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning);
}

.why summary::-webkit-details-marker,
.report-text summary::-webkit-details-marker {
  display: none;
}

.why summary,
.report-text summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  gap: 4px;
  list-style: none;
}

.why summary .icon,
.report-text summary .icon {
  transition: transform 150ms ease-out;
}

.why[open] summary .icon,
.report-text[open] summary .icon {
  transform: rotate(180deg);
}

.reasons {
  display: grid;
  gap: 4px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.reasons li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 4px;
}

.reasons .points {
  color: var(--danger-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.reasons .points.minus {
  color: var(--success);
}

.site-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

/* Text link with a trailing icon, full touch height (DEX pool page). */
.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
}

/* Icon sits on the first line when the text wraps (14 px icons). */
.site-line .icon {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 3px;
  margin-top: calc((1lh - 14px) / 2);
}

.site-snapshot {
  margin-top: -8px;
}

.snapshot {
  display: grid;
  gap: 12px;
  max-width: 560px;
  padding-bottom: 8px;
}

.snapshot-shot {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.snapshot-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1366 / 768;
  object-fit: cover;
  object-position: top;
}

.snapshot-shot:hover {
  border-color: var(--border-strong);
}

.snapshot-shot:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.snapshot-empty,
.snapshot-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--subtle);
  font-size: 0.8125rem;
}

.snapshot-empty .icon,
.snapshot-note .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.snapshot-facts {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 0.875rem;
}

.snapshot-facts dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.snapshot-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.plain-url {
  font-family: var(--mono);
  font-size: 0.8125rem;
  word-break: break-all;
}

/* --- Alerts page: one collapsible group per tool ------------------------------------------ */

.project-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.project-switch a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.project-switch a:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.project-switch a[aria-current="page"] {
  border-color: var(--accent-soft-border);
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 600;
}

/* Text-only pills (no avatar): even padding. */
.period-switch a {
  padding-inline: 16px;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
}

.alert-groups {
  display: grid;
  gap: 12px;
}

.alert-group {
  scroll-margin-top: 80px;
}

.alert-group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "icon title count chevron"
    "icon hint count chevron";
  align-items: center;
  column-gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  list-style: none;
  transition: background-color 150ms var(--ease);
}

.alert-group-head::-webkit-details-marker {
  display: none;
}

.alert-group-head:hover {
  background: var(--surface-2);
}

.alert-group[open] > .alert-group-head {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.alert-group-head .list-icon {
  grid-area: icon;
}

.alert-group-title {
  grid-area: title;
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.35;
}

.alert-group-hint {
  grid-area: hint;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.alert-group-count {
  grid-area: count;
  min-width: 32px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.alert-group-chevron {
  grid-area: chevron;
  display: grid;
  color: var(--subtle);
  transition: transform 200ms var(--ease);
}

.alert-group[open] .alert-group-chevron {
  transform: rotate(180deg);
}

.alert-group-body {
  padding: 4px 16px 20px;
}

.alert-group-body .empty-state {
  padding: 32px 8px;
}

.account-group.is-problem {
  border-color: var(--danger-border);
}

.account-group.is-waiting {
  border-color: var(--warning-border);
}

.account-group .alert-group-count {
  white-space: nowrap;
}

.account-group .alert-group-body {
  padding-top: 16px;
}

.group-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.group-more-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Sort and score floor of a scored alert group. */
.view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 8px 0 16px;
}

.view-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.view-label {
  min-width: 40px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.view-options a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease),
    color 150ms var(--ease);
}

.view-options a:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.view-options a[aria-current="true"] {
  border-color: var(--accent-soft-border);
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 600;
}

@media (min-width: 720px) {
  .alert-group-head {
    padding: 16px 24px;
  }

  .alert-group-body {
    padding: 4px 24px 24px;
  }
}

@media (max-width: 480px) {
  .alert-group-hint {
    display: none;
  }

  .alert-group-head {
    grid-template-areas: "icon title count chevron";
    min-height: 60px;
  }
}

.checks-title {
  margin-bottom: 12px;
}

.checks {
  display: grid;
  gap: 8px 24px;
  margin: 0;
  font-size: 0.875rem;
}

.checks > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
}

.checks dt {
  color: var(--muted);
}

.checks dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 720px) {
  .checks {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Project page: email spoofing (DMARC) ------------------------------------------- */

.mail-domains {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.mail-domains > li {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.mail-domains > li:first-child {
  padding-top: 0;
  border-top: 0;
}

.mail-domain-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.mail-domain-head h3 {
  margin: 0;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.mail-domains h4 {
  margin: 0;
}

.dns-record {
  display: grid;
  gap: 8px;
  margin: 0;
}

.dns-record dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.dns-record dd {
  margin: 0;
}

.dns-record + .dns-record {
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.dns-record .dns-type {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.dns-record .dns-type dt {
  margin: 0;
}

/* "What we found in DNS": label above value on phones, beside it on wider screens. */
.dns-found {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 0.875rem;
}

.dns-found dt {
  color: var(--muted);
}

.dns-found dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  .dns-found > div {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
  }
}

.mail-later,
.mail-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 24px;
  font-size: 0.9375rem;
}

.mail-check {
  display: grid;
  gap: 8px;
  justify-items: start;
}

/* --- Admin: spend --------------------------------------------------------------------- */

.badge-danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.spend-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.spend-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 16px;
}

.spend-facts dt {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.spend-facts dd {
  margin: 2px 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.spend-big {
  font-size: 1.5rem;
  font-weight: 700;
}

.spend-note {
  margin-top: 12px;
  font-size: 0.875rem;
}

.spend-details {
  margin-top: 12px;
}

.spend-details summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer;
}

.spend-details summary::-webkit-details-marker {
  display: none;
}

.spend-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin-top: 12px;
}

.spend-scenario {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.spend-scenario .field {
  flex: 1 1 96px;
  min-width: 96px;
}

.spend-chart {
  display: block;
  width: 100%;
  height: 120px;
}

.spend-chart rect {
  fill: var(--accent);
}

.spend-chart-llm rect {
  fill: var(--warning);
}

.spend-chart-note {
  margin-top: 8px;
  font-size: 0.875rem;
}

.spend-stack .table th[scope="row"] {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  border-bottom: 1px solid var(--border);
}

.spend-stack .table tr:last-child th[scope="row"] {
  border-bottom: 0;
}

.spend-stack .table th[scope="row"],
.spend-stack .table td {
  padding-top: 12px;
}

/* Report Center */
.report-target,
.report-alert,
#sender,
#targets {
  margin-bottom: 16px;
}

.report-fake {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.report-fake .plain-url {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.report-sender {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.report-sender dt {
  font-size: 0.8125rem;
  color: var(--subtle);
}

.report-sender dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  .report-sender {
    grid-template-columns: repeat(3, 1fr);
  }
}

.report-form {
  margin-top: 16px;
}

.check-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.check-group legend {
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  font-size: 0.9375rem;
  color: var(--text-2);
  cursor: pointer;
}

.check-field input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.check-field input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.report-cards {
  display: grid;
  gap: 16px;
}

.list.report-cards > li.report-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.list.report-cards > li.report-card:first-child {
  padding-top: 16px;
}

.report-card.is-sent {
  border-color: var(--success-border);
}

.report-card.is-problem {
  border-color: var(--danger-border);
}

.report-card.is-waiting {
  border-color: var(--warning-border);
}

.report-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.report-card-head h3,
.report-card-head h4 {
  margin: 0;
  font-size: 1rem;
}

.report-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.report-to {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.report-card textarea {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.report-card textarea[readonly] {
  background: var(--surface-2);
}

.report-text > textarea {
  margin-top: 4px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.report-failure {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
}

.report-failure .icon {
  flex-shrink: 0;
  margin-top: 3px;
}

.report-card .why {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.report-card .why > form {
  margin-top: 12px;
}

.report-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8125rem;
}

.report-note .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Plan page: paid plan options */
.plan-options {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .plan-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.plan-option {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.plan-option.is-current {
  border-color: var(--accent);
}

.plan-option form {
  margin-top: auto;
}

.plan-price {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.verify-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
}

/* Click-to-copy address fields (plan page, /payments). The whole row is the copy button. */
.token-addresses {
  display: grid;
  gap: 16px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}

.copy-field:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.copy-field code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* Invoice page: network chooser. The current network is a plain label, the others submit. */
.network-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .network-choice {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.network-option {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
}

button.network-option {
  cursor: pointer;
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease);
}

button.network-option:hover {
  border-color: var(--border-strong);
}

button.network-option:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.network-option[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.network-token {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* "Verified links" badge kit in the Public page card. */
.badge-preview {
  display: block;
  max-width: 100%;
  height: auto;
}

.field textarea.badge-code {
  min-height: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  resize: vertical;
}

/* Reports journal: what was sent, when, to whom. Actions drop under the text on phones. */
.list > li.journal-row {
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 12px 0;
}

.journal-row .list-main {
  flex-basis: calc(100% - 48px);
}

.journal-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-left: 48px;
}

@media (min-width: 720px) {
  .journal-row .list-main {
    flex-basis: 0;
  }

  .journal-side {
    width: auto;
    padding-left: 0;
    justify-content: flex-end;
  }
}

/* Links to every way of getting alerts, on the project's Alerts card. */
.alert-ways {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
}

.alert-ways + .hint {
  margin: 0 0 16px;
}

.alert-ways .btn {
  border: 1px solid var(--border);
}

/* Alert rules and "Send test alert" under the personal alert switches in account settings. */
.alert-rules {
  margin-top: 8px;
}

.alert-test {
  margin-top: 16px;
}

/* --- Site review: one look-alike site next to the official one (plan.md 7.7.1) ------------ */
.review-domain {
  overflow-wrap: anywhere;
}

.fresh-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.fresh-text {
  display: grid;
  flex: 1 1 320px;
  gap: 8px;
  min-width: 0;
}

.fresh-text p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.fresh-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.fresh-status .icon {
  flex-shrink: 0;
  margin-top: 3px;
}

.fresh-action {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.fresh-action .btn {
  min-height: 44px;
}

.fresh-next {
  max-width: 240px;
  color: var(--subtle);
  font-size: 0.8125rem;
}

.fresh-spinner {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: fresh-spin 800ms linear infinite;
}

@keyframes fresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fresh-spinner {
    animation: none;
    border-top-color: var(--border-strong);
  }
}

.compare {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .compare {
    grid-template-columns: 1fr 1fr;
  }
}

.compare-item {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.compare-item figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.compare-meta {
  color: var(--subtle);
  font-size: 0.8125rem;
}

.compare-empty {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.875rem;
}

.compare-empty .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.mention-title {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.mention-label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.mentions {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.mention {
  margin: 0;
  padding: 12px 16px;
  border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.review mark {
  padding: 0 2px;
  border-radius: 4px;
  background: var(--warning-soft);
  box-shadow: inset 0 -2px 0 var(--warning);
  color: var(--text);
  font-weight: 600;
}

.review-video {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #000;
}

.review-video + .compare-meta,
.fullpage + .compare-meta {
  margin-top: 8px;
}

.fullpage {
  max-height: 640px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.fullpage:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.fullpage img {
  display: block;
  width: 100%;
  height: auto;
}

.review-h2 {
  margin-bottom: 16px;
}

.review-note {
  margin-top: 20px;
}

/* Done-for-you takedowns: the order's progress, history and the staff queue. */
.td-steps {
  display: grid;
  gap: 8px;
  margin: 4px 0 16px;
  padding: 0;
  list-style: none;
}

.td-steps li {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--subtle);
}

.td-steps li.done {
  color: var(--muted);
}

.td-steps li.done .icon {
  color: var(--success);
}

.td-steps li.current {
  color: var(--text);
  font-weight: 600;
}

.td-steps li.current .icon {
  color: var(--accent);
}

@media (min-width: 720px) {
  .td-steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* A banner with its one action under the message. */
.td-unpaid,
.banner-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.td-unpaid .alert,
.banner-action .alert {
  width: 100%;
}

.td-auto {
  margin-bottom: 20px;
}

.td-auto .card-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.td-auto .list-main {
  flex: 1 1 220px;
}

.td-auto h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.td-now {
  margin: 0;
  max-width: 65ch;
}

.td-history .list-title {
  font-weight: 400;
}

.td-loa {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.td-admin-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.td-admin-head h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.td-actions {
  display: grid;
  gap: 8px;
}

.td-action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.td-action .input {
  flex: 1 1 240px;
  width: auto;
}

.td-intel {
  min-width: 640px;
}

/* Scammer contacts on a fake page (site review, plan.md 7.27). */
.scam-contacts {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.scam-contact {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.scam-contact-icon {
  display: inline-flex;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--muted);
}

.scam-contact-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scam-contact-body p {
  margin: 0;
}

.scam-contact-value {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.scam-contact-meta {
  color: var(--muted);
  font-size: 0.8125rem;
}

.scam-contact-next {
  color: var(--text-2);
  font-size: 0.875rem;
}

/* Admin: one Managed customer (plan.md 7.28). */
.stat .value.value-text {
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.asset-groups {
  display: grid;
  gap: 12px;
  margin: 0;
}

@media (min-width: 720px) {
  .asset-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.asset-groups dt {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.asset-groups dd {
  margin: 4px 0 0;
}

.plain-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-wrap: anywhere;
}

/* --- Managed: what to do today ---------------------------------------------------------- */

.today > li.today-item {
  align-items: flex-start;
  padding: 16px 0;
}

.today > li.today-item:first-child {
  padding-top: 0;
}

.today > li.today-item:last-child {
  padding-bottom: 0;
}

.today .list-title {
  margin: 0;
  font-size: 1rem;
}

.today .list-meta {
  margin: 4px 0 0;
}

.today-orders {
  font-size: 0.9375rem;
}

.today-orders a {
  display: inline-block;
  min-height: 24px;
}

@media (max-width: 640px) {
  .today > li.today-item {
    flex-wrap: wrap;
  }

  .today > li.today-item > .btn {
    margin-left: 48px;
    width: calc(100% - 48px);
  }
}
