/* Layout and controls follow poc-2's Atelier console. Semantic colors and the
 * self-hosted type families live in theme.css, copied from its source tokens. */
:root {
  font-family: "Inter Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: hsl(var(--foreground)); background: hsl(var(--background)); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 8px 14px; border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px); cursor: pointer;
  color: hsl(var(--secondary-foreground)); background: hsl(var(--secondary));
  font-size: 13px; line-height: 20px; font-weight: 500;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .04);
  transition: transform .15s, background-color .15s, border-color .15s, box-shadow .15s;
}
button:hover { background: hsl(var(--muted)); border-color: hsl(var(--border-strong)); }
button:active { transform: translateY(1px); }
button:disabled { cursor: wait; opacity: .5; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 3px; }
.primary { color: hsl(var(--primary-foreground)); background: hsl(var(--primary)); border-color: transparent; box-shadow: inset 0 1px 0 rgb(255 255 255 / .12); }
.primary:hover { background: hsl(var(--primary) / .9); border-color: transparent; transform: translateY(-1px); box-shadow: 0 6px 20px -6px hsl(var(--accent) / .5); }
.quiet { background: transparent; border-color: transparent; box-shadow: none; }
a { color: hsl(var(--accent)); text-underline-offset: 4px; font-size: 13px; }
p { color: hsl(var(--muted-foreground)); line-height: 1.65; }
h1, h2, h3 { margin-top: 0; }
h1, .gate h1, .home-explanation > h2, .explanation-heading h2, .public-guide > h1 {
  font-family: "Newsreader Variable", "Iowan Old Style", Georgia, serif;
  font-weight: 400; letter-spacing: -.01em;
}
h1 { font-size: 32px; line-height: 1.2; margin: 8px 0; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
h3 { font-size: 14px; font-weight: 600; letter-spacing: -.015em; }
small { display: block; color: hsl(var(--muted-foreground)); line-height: 1.6; margin-top: 8px; }
.wordmark { display: flex; align-items: center; gap: .35em; white-space: nowrap; font-family: "Newsreader Variable", Georgia, serif; font-size: 26px; font-weight: 400; letter-spacing: 0; color: var(--wordmark-ink); }
.wordmark strong { font-weight: 600; }
.logo { color: var(--wordmark-ink); font-size: 28px; line-height: 1; }
.pill { border: 1px solid hsl(var(--border)); border-radius: 999px; padding: 3px 8px; font: 500 10px/1.3 "Inter Variable", sans-serif; letter-spacing: .02em; color: hsl(var(--muted-foreground)); }
.eyebrow, .sidebar-caption { font-size: 10px; letter-spacing: .12em; color: hsl(var(--muted-foreground)); font-weight: 500; }
.muted { color: hsl(var(--muted-foreground)); font-size: 12px; }
.gate { max-width: 1140px; padding: 32px 32px 80px; margin: auto; background: hsl(var(--background)); }
/* Landing-paper tokens affect the entire public page, matching PublicShell. */
body:has(> .gate:not([hidden])) { background: hsl(220 18% 97%); }
.dark body:has(> .gate:not([hidden])) { background: hsl(var(--background)); }
.gate-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.theme-toggle { color: hsl(var(--muted-foreground)); font-size: 12px; flex-shrink: 0; }
.gate-layout { display: grid; grid-template-columns: 1.1fr 1fr; align-items: start; gap: 64px; margin-top: 88px; }
.gate h1 { font-size: clamp(40px, 4.8vw, 60px); line-height: 1.06; margin: 14px 0 22px; }
.lede { font-size: 16px; max-width: 470px; }
.steps { margin: 28px 0; font-size: 13px; }
.steps b { color: hsl(var(--accent)); font: 500 11px "Geist Mono Variable", monospace; margin-right: 14px; }
.auth-card, .table-card, .guide-card, .security-comparison article {
  position: relative; border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  background-color: hsl(var(--card));
  background-image: linear-gradient(180deg, hsl(var(--card)), hsl(var(--background) / .4));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .04), 0 1px 2px rgb(0 0 0 / .06);
}
.auth-card { padding: 28px; }
.auth-card > h2 { font-size: 18px; }
.auth-card > p { font-size: 13px; margin-bottom: 24px; }
/* Clerk keeps its own accessible components; only their frame joins our card. */
.auth-card .cl-rootBox, .auth-card .cl-cardBox { width: 100%; max-width: 100%; }
.auth-card .cl-card { background: transparent; box-shadow: none; padding: 0; }
.auth-card .cl-footer { background: transparent; }
.app { display: grid; grid-template-columns: 235px 1fr; min-height: 100dvh; }
.app > aside { padding: 22px 16px; position: sticky; top: 0; height: 100dvh; background: hsl(var(--secondary) / .4); border-right: 1px solid hsl(var(--border)); display: flex; flex-direction: column; }
.app > aside .wordmark { font-size: 19px; }
.app > aside .logo { font-size: 23px; }
.sidebar-caption { margin: 36px 10px 12px; }
#organization { min-height: 36px; margin: 0 6px 20px; }
nav { display: grid; gap: 4px; }
nav button { justify-content: space-between; text-align: left; border-color: transparent; background: transparent; box-shadow: none; color: hsl(var(--muted-foreground)); padding: 8px 10px; font-size: 12px; }
nav button:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
nav button.selected { background: hsl(var(--accent) / .1); color: hsl(var(--foreground)); border-color: hsl(var(--accent) / .2); }
nav button span { font-size: 11px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
nav button:last-child { margin-top: 16px; }
.sidebar-bottom { margin-top: auto; padding: 22px 10px 4px; }
.sidebar-bottom p, .sidebar-bottom a { font-size: 12px; }
main { min-width: 0; }
.topbar { height: 56px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; color: hsl(var(--muted-foreground)); font-size: 12px; }
.status-dot { display: inline-block; height: 6px; width: 6px; background: hsl(var(--success)); border-radius: 50%; margin-right: 6px; }
.account { display: flex; align-items: center; gap: 10px; }
.content { padding: 28px; max-width: 1450px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { font-weight: 600; }
.page-heading p { margin: 6px 0 0; font-size: 13px; }
.page-heading .eyebrow { font-size: 10px; }
.page-heading button { flex-shrink: 0; }
.table-card { overflow: auto; }
.table-title { display: flex; justify-content: space-between; padding: 14px 16px; font-size: 13px; border-bottom: 1px solid hsl(var(--border)); }
.empty { text-align: center; padding: 52px 24px; }
.empty h2 { font-size: 16px; }
.empty p { font-size: 13px; }
.empty .symbol { font-size: 28px; color: hsl(var(--muted-foreground)); margin-bottom: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
th { color: hsl(var(--muted-foreground)); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; background: hsl(var(--secondary) / .5); }
th, td { padding: 14px 16px; border-bottom: 1px solid hsl(var(--border)); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: hsl(var(--secondary) / .35); }
td code { font-size: 11px; overflow-wrap: anywhere; }
td .muted { display: block; margin-top: 5px; font-size: 11px; }
td button { min-height: 32px; padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; }
.tag { font-size: 10px; border: 1px solid hsl(var(--success) / .25); border-radius: 999px; padding: 3px 8px; color: hsl(var(--success)); background: hsl(var(--success) / .06); white-space: nowrap; }
.tag.ended { color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); background: transparent; }
.guide-card { max-width: 850px; padding: 28px; }
.guide-card h2 { margin-top: 30px; }
.guide-card h2:first-child { margin-top: 0; }
.guide-card p { font-size: 14px; }
pre { overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: hsl(var(--secondary) / .6); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); padding: 16px; line-height: 1.7; font-size: 12px; color: hsl(var(--foreground)); }
code, pre { font-family: "Geist Mono Variable", ui-monospace, "SF Mono", monospace; font-variant-numeric: tabular-nums; }
label, legend { font-size: 12px; color: hsl(var(--foreground)); display: block; margin: 20px 0 8px; }
input, select, textarea { background: hsl(var(--background)); border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); color: hsl(var(--foreground)); padding: 10px 12px; width: 100%; min-width: 0; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
input[readonly] { color: hsl(var(--muted-foreground)); }
textarea { font-family: "Geist Mono Variable", monospace; resize: vertical; }
.masked { -webkit-text-security: disc; }
dialog { color: hsl(var(--popover-foreground)); background: hsl(var(--popover)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); width: min(500px, calc(100% - 32px)); max-height: 90dvh; padding: 24px; box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 24px 60px -12px rgb(0 0 0 / .5); }
dialog::backdrop { background: rgb(0 0 0 / .6); backdrop-filter: blur(4px); }
dialog p { font-size: 13px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0; font-size: 17px; }
.close { border: 0; background: transparent; box-shadow: none; font-size: 22px; padding: 0 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
fieldset { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); padding: 12px 16px; max-height: 240px; overflow: auto; margin-top: 20px; }
legend { margin: 0; padding: 0 5px; }
fieldset label { display: flex; gap: 10px; align-items: center; margin: 10px 0; overflow-wrap: anywhere; font-size: 12px; }
fieldset input { width: auto; accent-color: hsl(var(--accent)); }
.form-error { color: hsl(var(--destructive)) !important; }
.form-error:empty { display: none; }
#notice { padding: 12px 16px; margin-bottom: 22px; border: 1px solid hsl(var(--success) / .3); background: hsl(var(--success) / .08); border-radius: var(--radius); color: hsl(var(--foreground)); font-size: 13px; }
#notice.error { border-color: hsl(var(--destructive) / .4); background: hsl(var(--destructive) / .08); }
#copy-token { margin-top: 10px; }
.code-block { position: relative; }
.code-block pre { padding-right: 76px; }
.code-copy { position: absolute; top: 8px; right: 8px; z-index: 1; min-height: 28px; padding: 2px 10px; font-size: 11px; background: hsl(var(--card)); }
.public-guide { max-width: 850px; margin: auto; padding: 32px 24px 80px; }
.public-guide .guide-card { margin-top: 36px; }
.public-guide > h1 { margin-top: 40px; font-size: 40px; }
.home-explanation { margin-top: 88px; padding-top: 48px; border-top: 1px solid hsl(var(--border)); }
.home-explanation > h2 { font-size: clamp(30px, 3.8vw, 42px); line-height: 1.14; margin: 14px 0 22px; }
.explanation-intro { max-width: 780px; font-size: 15px; }
.security-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 30px 0 52px; }
.security-comparison article { padding: 24px; }
.security-comparison .reference-card { border-color: hsl(var(--accent) / .35); background-color: hsl(var(--accent) / .03); }
.comparison-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.security-comparison h3 { font-size: 17px; margin: 14px 0; }
.security-comparison p, .secret-flow p, .security-benefits p, .trust-note p { font-size: 13px; margin-bottom: 0; }
.security-comparison code { display: block; overflow-wrap: anywhere; color: hsl(var(--accent)); font-size: 11px; line-height: 1.7; }
.explanation-heading h2 { font-size: 30px; margin: 12px 0; }
.explanation-heading > p:last-child { font-size: 13px; }
.secret-flow { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 0; margin: 30px 0 40px; }
.secret-flow li { border-top: 1px solid hsl(var(--border)); padding-top: 18px; min-width: 0; }
.flow-number { color: hsl(var(--accent)); font: 500 11px "Geist Mono Variable", monospace; }
.secret-flow h3, .security-benefits h3, .trust-note h3 { font-size: 14px; margin: 12px 0; }
.security-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 20px; border-top: 1px solid hsl(var(--border)); }
.trust-note { border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--secondary) / .35); padding: 20px 24px; margin: 34px 0 24px; }
.trust-note h3 { margin-top: 0; }
@media (max-width: 900px) {
  .gate-layout { gap: 28px; }
  .app { grid-template-columns: 200px 1fr; }
  .content { padding: 24px 20px; }
  .topbar { padding: 0 20px; }
  .table-title .muted { display: none; }
}
@media (max-width: 650px) {
  .gate { padding: 24px 20px 60px; }
  .gate-layout { grid-template-columns: 1fr; margin-top: 42px; }
  .gate-header .wordmark { font-size: 23px; }
  .gate-header .pill { display: none; }
  .theme-toggle { padding-inline: 8px; font-size: 11px; }
  .app { display: block; }
  .app > aside { position: relative; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .sidebar-caption, .sidebar-bottom { display: none; }
  #organization { margin: 16px 0; }
  nav { display: flex; overflow: auto; gap: 3px; }
  nav button { white-space: nowrap; font-size: 12px; padding: 8px; }
  nav button:last-child { margin: 0; }
  nav button span { display: none; }
  .topbar { padding: 0 16px; }
  .topbar > div:first-child { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account { gap: 2px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 30px; }
  .page-heading p { max-width: 240px; }
  .page-heading > button { font-size: 11px; padding: 8px; }
  .content { padding: 24px 16px; }
  .table-title, th, td { padding: 14px; }
  .guide-card, .auth-card { padding: 20px; }
  .home-explanation { margin-top: 56px; padding-top: 32px; }
  .security-comparison, .secret-flow, .security-benefits { grid-template-columns: 1fr; }
  .security-comparison { margin-bottom: 36px; gap: 14px; }
  .secret-flow { gap: 20px; }
  .security-benefits { gap: 16px; }
  .trust-note { padding: 18px; }
}
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
  button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.external-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
