/* fuush dashboard (app.fuu.sh + admin.fuu.sh) styles.
   Shares its design tokens with the marketing site at fuu.sh:
   warm cream paper, near-black ink, electric tangerine accent,
   Bricolage Grotesque display + Instrument Sans body + JetBrains Mono code. */

:root {
  --bg:        #f4f0e6;   /* page background */
  --bg-2:      #ece7d8;   /* alt surfaces (admin nav stripe, etc.) */
  --paper:     #faf7ee;   /* card surface */
  --card:      #faf7ee;
  --ink:       #1a1814;   /* primary text + brand */
  --ink-soft:  #4a463c;
  --ink-2:     #4a463c;
  --ink-3:     #7d786b;   /* muted text + footnotes */
  --rule:      #d8d2bf;   /* borders */
  --line:      #d8d2bf;
  --line-2:    #b8b09a;

  --accent:    #ff4d1f;   /* electric tangerine */
  --accent-ink:#160500;
  --good:      #2a7d4f;
  --warn:      #c87a1a;
  --bad:       #c33;      /* destructive actions (delete/revoke) */

  --display:   "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --sans:      "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:      "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

a { color: var(--ink); }
::selection { background: var(--accent); color: var(--accent-ink); }
code, pre {
  font-family: var(--mono);
}

.topbar {
  background: var(--paper);
  color: var(--ink);
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  height: 52px;
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-decoration: none;
  padding-right: 28px;
}
.topbar .brand::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: -5px 0 0 -1px color-mix(in oklab, var(--accent) 60%, transparent),
              -10px 0 0 -3px color-mix(in oklab, var(--accent) 35%, transparent);
}
.topbar-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.topbar-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.topbar-nav a:hover { color: var(--ink); }
.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-email { color: var(--ink-3); font-size: 14px; }
.topbar-logout { margin: 0; }
.topbar-logout button {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.topbar-logout button:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .topbar-email { display: none; }
  .topbar-nav a { padding: 0 10px; }
}

main {
  max-width: 800px;
  margin: 28px auto;
  padding: 0 20px;
}

.back-link {
  margin: 0 0 12px;
  font-size: 14px;
}
.back-link a { color: var(--ink-soft); text-decoration: none; }
.back-link a:hover { color: var(--ink); }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 24px;
}

.danger-card { border-color: #e8b8b8; }

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}
h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 28px 0 12px;
}
h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.muted { color: var(--ink-soft); }
.footnote { color: var(--ink-soft); font-size: 13px; }

.site-meta {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.cta:hover { transform: translateY(-1px); }
.cta-danger { background: var(--bad); color: #fff; }
.cta-danger:hover { background: #a22; }

.link {
  background: none;
  border: none;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}
.link.danger { color: var(--bad); }

input[type="email"], input[type="text"], input[type="file"],
input[type="password"], select, textarea {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  margin-right: 8px;
  min-width: 240px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent);
}

.email-form, .upload, .newdomain {
  margin: 16px 0;
}

/* "your-name [.fuu.sh]" input row */
.slug-input {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  border-radius: 5px;
  overflow: hidden;
  margin-right: 8px;
}
.slug-input input {
  border: none;
  border-radius: 0;
  margin: 0;
  min-width: 200px;
}
.slug-input:focus-within { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent); }
.slug-input input:focus { box-shadow: none; }
.slug-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg-2);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 14px;
  border-left: 1px solid var(--rule);
}

.newsite {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 0;
  align-items: center;
}

.error {
  color: #6e1f1f;
  background: color-mix(in oklab, var(--bad) 12%, var(--paper));
  border: 1px solid color-mix(in oklab, var(--bad) 35%, var(--line));
  border-radius: 6px;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 14px;
}

.success {
  color: #1a5a2e;
  background: color-mix(in oklab, var(--good) 14%, var(--paper));
  border: 1px solid color-mix(in oklab, var(--good) 40%, var(--line));
  border-radius: 6px;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 14px;
}

ul.sites, ul.domains {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
ul.sites li {
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
ul.sites li:first-child { border-top: none; }
.site-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-link { font-weight: 600; text-decoration: none; }
.site-desc {
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
}
.site-domains {
  font-size: 13px;
  word-break: break-all;
}
.site-domains a {
  color: var(--ink-soft);
  text-decoration: underline;
}
.site-domains a:hover { color: var(--ink); }
.site-domains .status {
  font-size: 10px;
  padding: 0 6px;
  margin-left: 2px;
}
.site-stats {
  font-size: 13px;
}
.manage { margin-left: auto; color: var(--ink-soft); text-decoration: none; }
.manage:hover { color: var(--ink); }

ul.domains li {
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
ul.domains li:first-child { border-top: none; }
.domain-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inline-form { display: inline; margin-left: 8px; }

.status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.status-unverified { background: color-mix(in oklab, var(--bad)  18%, var(--paper)); color: #6e1f1f; }
.status-pending    { background: color-mix(in oklab, var(--warn) 22%, var(--paper)); color: #6b3a06; }
.status-active     { background: color-mix(in oklab, var(--good) 18%, var(--paper)); color: #1a5a2e; }
.status-revoked    { background: var(--bg-2); color: var(--ink-3); }

.verify {
  margin-top: 12px;
  background: var(--bg-2);
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
}
.verify p { margin: 0 0 8px; }
.verify p:last-child { margin-bottom: 0; }

/* DNS-record table — three short rows, label/value pairs.
   The value cell wraps the long base32 token without overflowing. */
.dns-record {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 10px 12px;
  margin: 8px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.dns-record > div {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  align-items: baseline;
  border-bottom: 1px solid #f0eee5;
}
.dns-record > div:last-child { border-bottom: none; }
.dns-label {
  flex: 0 0 60px;
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.dns-record code {
  flex: 1 1 auto;
  word-break: break-all;
  background: transparent;
  padding: 0;
}
.dns-value {
  /* The base32 token is ~50 chars. break-all so it wraps cleanly. */
  user-select: all;
}

.delete-block { margin-top: 16px; }
.delete-block summary {
  cursor: pointer;
  color: var(--bad);
  font-weight: 600;
  padding: 8px 0;
}
.delete-form {
  margin-top: 12px;
  padding: 14px 16px;
  background: #fff8f8;
  border: 1px solid #f5d4d4;
  border-radius: 6px;
}
.delete-form input[type="text"] {
  border: 1px solid #e6b8b8;
  margin-right: 10px;
}

.danger { color: var(--bad); }

code {
  font-family: var(--mono);
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  border: 1px solid var(--line);
}

footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
footer a { color: var(--ink-3); }
footer a:hover { color: var(--ink); }

.login { max-width: 460px; margin: 80px auto; }
.login h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.login .lead { color: var(--ink-soft); margin-bottom: 24px; font-size: 17px; }

@media (max-width: 560px) {
  .card { padding: 20px; }
  .slug-input { width: 100%; }
  .slug-input input { min-width: 0; flex: 1; }
  .newsite, .newdomain, .upload { flex-direction: column; align-items: stretch; }
  .newsite .cta, .newdomain .cta, .upload .cta { margin-top: 8px; }
  .dns-label { flex: 0 0 50px; font-size: 10px; }
}

/* ---------- API token + admin extensions ---------- */

.code-block {
  background: #111;
  color: #eee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 12px 0;
}

/* Option row used on the site page for SPA toggle */
.option-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-2);
  border-radius: 6px;
  margin: 12px 0;
}
.option-text { flex: 1; }
.option-text > div { margin-top: 4px; font-size: 13px; }

/* Advanced options collapsible. Wraps the SPA / index / custom-404 forms
   so the site page stays calm by default — most users never touch them. */
.advanced-options summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 4px 0;
}
.advanced-options summary::-webkit-details-marker { display: none; }
.advanced-options summary h2 {
  margin: 0;
  font-size: inherit;
}
.advanced-options summary::before {
  content: "▸ ";
  display: inline-block;
  width: 1em;
  transition: transform 0.15s;
}
.advanced-options[open] summary::before { content: "▾ "; }

/* Forms page: unread submissions get a subtle highlight bar. */
.admin-table tr.unread td { background: #fffdf2; }
.admin-table tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.nowrap { white-space: nowrap; }

/* Inline toggle (checkbox styled as a small "on"/"off" pill). */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.toggle input { margin: 0; }

/* File tree on /sites/{id}/files */
.file-tree { list-style: none; margin: 8px 0 0; }
.file-tree-row {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.5;
}
.file-tree-row code { background: transparent; padding: 0; font-size: 14px; }
.file-tree-row details summary { cursor: pointer; }
.file-tree-row details summary::-webkit-details-marker { display: none; }
.file-tree-icon { display: inline-block; width: 1.4em; }
.file-tree-size { font-size: 12px; margin-left: 8px; }
.file-tree-actions { margin-left: 12px; display: inline-flex; gap: 12px; }
.file-tree-actions form { display: inline; }
.files-upload { background: var(--bg-2); padding: 16px; border-radius: 6px; margin-top: 8px; }

/* Pending-changes bar — sticks to the top so the publish button is
   always reachable while the user scrolls a long file tree. */
.pending-bar {
  position: sticky;
  top: 8px;
  z-index: 5;
  background: #fff8e6;
  border: 1px solid #f0d27a;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.pending-bar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pending-bar-spacer { flex: 1; }
.pending-list { list-style: none; margin: 10px 0 0; padding: 0; }
.pending-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
}
.pending-verb {
  display: inline-block;
  min-width: 56px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 3px;
  color: #fff;
  text-align: center;
}
.pending-verb-replace { background: #1f7a4d; }
.pending-verb-delete  { background: #a83232; }
.pending-list code { background: transparent; padding: 0; }

/* Visual hint on file-tree rows that have a staged change pending. */
.file-tree-row.pending-del code { text-decoration: line-through; opacity: 0.6; }
.file-tree-row.pending-rep > code,
.file-tree-row.pending-rep > a code { font-weight: 700; }
.file-tree-row.pending-rep::after { content: " · edited"; font-size: 11px; color: #1f7a4d; margin-left: 6px; }
.file-tree-row.pending-del::after { content: " · will delete"; font-size: 11px; color: #a83232; margin-left: 6px; }

/* Status page */
.status-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.status-table th, .status-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.status-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-pill-up   { background: #e8f5ec; color: #1f7a4d; }
.status-pill-down { background: #fbe6e6; color: #a83232; }
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.status-dot-up   { background: #1f7a4d; box-shadow: 0 0 0 3px rgba(31,122,77,0.18); }
.status-dot-down { background: #a83232; box-shadow: 0 0 0 3px rgba(168,50,50,0.18); }
.spark { display: inline-flex; align-items: stretch; gap: 1px; height: 22px; }
.spark-cell { display: inline-block; width: 6px; height: 100%; border-radius: 1px; background: #e8e3d5; }
.spark-cell.spark-up    { background: #1f7a4d; }
.spark-cell.spark-mixed { background: #e7b13a; }
.spark-cell.spark-down  { background: #a83232; }

/* (admin nav now lives in .topbar-nav — see topbar block above.) */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.stat {
  background: var(--bg-2);
  padding: 18px;
  border-radius: 6px;
  text-align: center;
}
.stat-num {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-search {
  display: flex;
  gap: 10px;
  margin: 12px 0 20px;
}
.admin-search input[type="text"] {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.admin-filters { color: var(--ink-soft); font-size: 14px; margin: 4px 0 16px; }
.admin-filters a { margin: 0 4px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  background: var(--bg-2);
}
.admin-table td code { font-size: 12px; }
.admin-table .inline-form { display: inline; margin-right: 4px; }

.abuse-row {
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
}
.abuse-row:last-child { border-bottom: none; }
.abuse-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}
.abuse-reason { margin: 6px 0; white-space: pre-wrap; }
.abuse-notes { color: var(--ink-soft); font-size: 13px; }
.abuse-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.abuse-actions select, .abuse-actions input[type="text"] {
  margin: 0;
}
.abuse-actions input[type="text"] { flex: 1; min-width: 200px; }


/* Admin views get more horizontal room than the user-facing pages. */
body.admin main { max-width: 1200px; }
/* Pages with wide tables (audit log) opt into using the full viewport
   width minus a small gutter. */
body.admin-wide main { max-width: min(1800px, calc(100vw - 32px)); }

.metric .metric-main { font-weight: 600; font-size: 13px; }
.metric .metric-sub { color: var(--ink-soft); font-weight: 400; }
.metric .metric-pct { color: var(--ink-soft); font-size: 11px; margin-top: 3px; }
.bar {
  height: 5px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.bar-fill {
  height: 100%;
  background: var(--good);
  transition: width 0.3s ease;
}
.bar-fill.bar-warn { background: var(--warn); }
.bar-fill.bar-bad  { background: var(--bad); }

.edges-table th, .edges-table td { font-size: 13px; padding: 10px 8px; }
.edges-table td:first-child { white-space: nowrap; }

.topbar-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 9px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
}

.token-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px 0;
}
.token-form input[type="text"] { flex: 1; min-width: 220px; }
.token-form select {
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.token-show {
  background: var(--bg-2);
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
}
.token-meta {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  align-items: baseline;
}
.token-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0;
  overflow: hidden;
}
.token-value {
  flex: 1;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: transparent;
  border: none;
  word-break: break-all;
  user-select: all;
}
.cta-copy {
  border-radius: 0;
  padding: 0 18px;
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- TOTP setup ---------- */
.totp-setup {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: center;
  margin: 18px 0;
  padding: 18px;
  background: var(--bg-2);
  border-radius: 6px;
}
.totp-qr {
  width: 200px;
  height: 200px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--rule);
}
@media (max-width: 560px) {
  .totp-setup { grid-template-columns: 1fr; justify-items: center; }
}

.recovery-codes {
  list-style: none;
  padding: 16px;
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  background: #fff8e1;
  border: 1px solid #e8c46b;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
.recovery-codes li code {
  background: transparent;
  padding: 0;
  border: none;
}

/* ----- Drag-and-drop upload ----- */
.dropzone {
  position: relative;
  border: 2px dashed color-mix(in oklab, var(--ink) 22%, transparent);
  border-radius: 10px;
  background: color-mix(in oklab, var(--cream) 60%, var(--paper));
  padding: 28px 20px;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone.is-drag {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--paper));
}
.dropzone-icon {
  font-size: 28px;
  line-height: 1;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.dropzone-call {
  font-size: 16px;
  margin: 0 0 6px;
  color: var(--ink);
}
.dropzone-pick {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.dropzone-name {
  font-weight: 600;
  margin: 0 0 10px;
  word-break: break-all;
}
.dropzone-pct {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.upload-progress {
  height: 8px;
  background: color-mix(in oklab, var(--ink) 10%, var(--paper));
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress > div {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .15s linear;
}

/* ----- Per-site description form ----- */
.description-form textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid color-mix(in oklab, var(--ink) 18%, transparent);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
  min-height: 56px;
}
.description-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent);
}

/* ----- 7-day traffic block ----- */
.traffic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.traffic-grid > div {
  padding: 14px 16px;
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--cream) 35%, var(--paper));
}

/* ----- Active sessions ----- */
.sessions {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 8px;
  background: var(--paper);
}
.session-row.session-current {
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  background: color-mix(in oklab, var(--accent) 5%, var(--paper));
}
.session-meta { flex: 1; min-width: 0; }
.session-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-ip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.session-ua {
  margin-top: 4px;
  font-size: 13px;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.session-times { margin-top: 6px; font-size: 12px; }
.session-action { flex-shrink: 0; }
.badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
  font-weight: 600;
}
.badge-this {
  background: color-mix(in oklab, var(--accent) 22%, var(--paper));
  color: var(--accent-ink);
}
.badge-pending {
  background: color-mix(in oklab, var(--warn) 22%, var(--paper));
  color: #6b3a06;
}

/* ----- Deploy history table ----- */
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}
.history-table th, .history-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
}
.history-table th {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.history-table tr.current td { background: color-mix(in oklab, var(--good) 8%, var(--paper)); }
.history-table .release-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ----- Admin site-moves UI ----- */
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  margin: 12px 0;
  background: color-mix(in oklab, var(--cream) 50%, var(--paper));
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 8px;
}
.bulk-bar select,
.bulk-bar button { font: inherit; }
.bulk-select-all { font-weight: 600; }
.bulk-count { font-size: 13px; }
.moves-table tr.moving td { background: color-mix(in oklab, var(--warn) 6%, var(--paper)); }
.moves-table input[type="checkbox"] { transform: scale(1.2); cursor: pointer; }
.moves-table select { font-size: 13px; padding: 2px 4px; }

/* ----- Drift banner on /admin/overview ----- */
.drift-banner {
  border-color: color-mix(in oklab, var(--bad) 35%, transparent);
  background: color-mix(in oklab, var(--bad) 7%, var(--paper));
}
.drift-banner h2.danger {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.warn-banner {
  border-color: color-mix(in oklab, var(--warn) 40%, transparent);
  background: color-mix(in oklab, var(--warn) 8%, var(--paper));
}
.warn-banner h2 {
  color: #6b3a06;
  margin-top: 0;
}

/* ----- Recent move activity timeline ----- */
.moves-history { font-size: 13px; }
.moves-history td { vertical-align: top; }
.move-step {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: .04em;
  border-radius: 999px;
  font-weight: 600;
  background: color-mix(in oklab, var(--ink) 6%, var(--paper));
  color: var(--ink-soft);
  white-space: nowrap;
}
.move-step-site_move,
.move-step-site_move_bulk { background: color-mix(in oklab, var(--accent) 16%, var(--paper)); color: var(--accent-ink); }
.move-step-site_move_pre_stage_wait { background: color-mix(in oklab, var(--warn) 16%, var(--paper)); color: #6b3a06; }
.move-step-site_move_pre_stage_ok,
.move-step-site_move_dns_flipped,
.move-step-site_move_ttl_waited { background: color-mix(in oklab, var(--warn) 16%, var(--paper)); color: #6b3a06; }
.move-step-site_move_done { background: color-mix(in oklab, var(--good) 18%, var(--paper)); color: #1a5a2e; }
.move-step-site_move_failed { background: color-mix(in oklab, var(--bad) 18%, var(--paper)); color: #6e1f1f; }

/* ----- Reserved-slug built-in chip grid ----- */
.reserved-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 8px 0 4px;
}
.dns-bad td:last-child { background: color-mix(in oklab, var(--bad) 8%, var(--paper)); }

/* ----- Audit log table ----- */
.audit-table { font-size: 13px; }
.audit-table td { vertical-align: top; }
.audit-source {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
  font-weight: 600;
}
.audit-source-admin {
  background: color-mix(in oklab, var(--accent) 18%, var(--paper));
  color: var(--accent-ink);
}
.audit-source-user {
  background: color-mix(in oklab, var(--ink) 6%, var(--paper));
  color: var(--ink-soft);
}
.audit-meta {
  display: inline-block;
  max-width: 100%;
  font-size: 11px;
  word-break: break-all;
  /* On wide-mode (audit page) the meta column has room to grow; the
     inherited table-cell width caps how wide it actually renders. */
}

/* ----- Deploy status pill + banner ----- */
.deploy-pill {
  display: inline-block;
  padding: 1px 10px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
  font-weight: 600;
  vertical-align: middle;
}
.deploy-pill-unknown {
  background: color-mix(in oklab, var(--ink) 8%, var(--paper));
  color: var(--ink-soft);
}
.deploy-pill-live {
  background: color-mix(in oklab, var(--good) 18%, var(--paper));
  color: #1a5a2e;
}
.deploy-pill-deploying {
  background: color-mix(in oklab, var(--warn) 22%, var(--paper));
  color: #6b3a06;
  /* Subtle pulse so a deploy in flight feels alive. */
  animation: deployPulse 1.6s ease-in-out infinite;
}
.deploy-pill-empty {
  background: var(--bg-2);
  color: var(--ink-3);
  text-transform: none;
  letter-spacing: 0;
}
.deploy-pill-stalled {
  background: color-mix(in oklab, var(--bad) 18%, var(--paper));
  color: #6e1f1f;
}
@keyframes deployPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

.deploy-banner {
  padding: 10px 14px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 14px;
  transition: opacity .5s ease;
}
.deploy-banner.deploying {
  background: color-mix(in oklab, var(--warn) 14%, var(--paper));
  color: #6b3a06;
}
.deploy-banner.live {
  background: color-mix(in oklab, var(--good) 14%, var(--paper));
  color: #1a5a2e;
}
.deploy-banner.stalled {
  background: color-mix(in oklab, var(--bad) 14%, var(--paper));
  color: #6e1f1f;
}
.deploy-banner.fading { opacity: 0; }

.info-banner {
  padding: 10px 14px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 14px;
  background: color-mix(in oklab, var(--accent) 8%, var(--paper));
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
  color: var(--ink);
}
.reserved-chips .chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  background: color-mix(in oklab, var(--ink) 6%, var(--paper));
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 999px;
  color: var(--ink-soft);
}
