/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V4
 * Workbench and public index · technical modern-minimal · cobalt anchor
 * Audience: designated publishers and public visitors · task: issue a token or open a page
 */
:root {
  color-scheme: light;
  --canvas: #f5f5f0;
  --paper: #fff;
  --ink: #131927;
  --muted: #4c5668;
  --line: #ced4db;
  --line-dark: #a7b1be;
  --wash: #eef2f7;
  --blue: #194bc1;
  --blue-hover: #103b9d;
  --blue-wash: #e8effe;
  --red: #9d2b37;
  --red-hover: #801e2b;
  --red-wash: #fff0f1;
  --dark-code: #171f30;
  --code-ink: #eef3ff;
  --code-border: #67738a;
  --shadow: rgb(19 25 39 / 17%);
  --font: "Pretendard Variable", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 1rem/1.6 var(--font);
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; min-width: 0; line-height: 1.16; }
h1 { font-size: clamp(2.35rem, 4.7vw, 4.4rem); letter-spacing: -.062em; font-weight: 760; }
h2 { font-size: 1.48rem; letter-spacing: -.044em; }
h3 { font-size: 1rem; letter-spacing: -.025em; }
p + p { margin-top: .75rem; }
p, label, summary { word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--blue); text-underline-offset: .22em; }
code, pre { font-family: var(--mono); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
input:focus-visible { outline-offset: 1px; }
:focus:not(:focus-visible) { outline: none; }
.frame { width: min(100% - 4rem, 70rem); margin-inline: auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 4.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .64rem; min-height: 44px; color: var(--ink); font-weight: 740; text-decoration: none; letter-spacing: -.035em; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 1.82rem;
  height: 1.82rem;
  background: var(--blue);
  color: var(--paper);
  font-family: var(--mono);
  font-size: .92rem;
  letter-spacing: 0;
}
nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: .91rem; white-space: nowrap; text-decoration: none; }
nav a:hover { color: var(--blue); text-decoration: underline; }

.portal, .directory { padding-block: clamp(2.8rem, 7vw, 7rem) 4.5rem; }
.initial-status { color: var(--muted); }
.auth-shell {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
  gap: clamp(2.4rem, 9vw, 7.25rem);
  max-width: 63rem;
}
.auth-intro { padding-top: 1rem; }
.auth-intro h1 + p { margin-top: 1.4rem; max-width: 27rem; color: var(--muted); font-size: 1.02rem; }
.address { margin-top: 2.1rem; padding-top: 1rem; border-top: 1px solid var(--line-dark); }
.address span { display: block; color: var(--muted); font-size: .79rem; font-weight: 680; }
.address code { display: block; margin-top: .3rem; color: var(--blue); font-size: clamp(.74rem, 1.8vw, .93rem); overflow-wrap: anywhere; }
.auth-card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  background: var(--paper);
  min-width: 0;
  padding: clamp(1.2rem, 3.8vw, 2rem);
}
.auth-card section > p { margin-top: .75rem; color: var(--muted); }
#google-button { display: flex; align-items: center; min-height: 44px; margin-top: 1.5rem; }
.auth-card .footnote { font-size: .82rem; }
.auth-switch { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.auth-form { display: grid; gap: .6rem; margin-top: 1.3rem; }
.auth-form button { justify-self: start; margin-top: .35rem; }
label { display: block; color: var(--ink); font-weight: 690; font-size: .86rem; }
input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .49rem .7rem;
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
input::placeholder { color: var(--muted); }
[data-otp-form] input { max-width: 12rem; font-family: var(--mono); letter-spacing: .26em; }
.primary, .quiet, .danger-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: .47rem .91rem;
  font-size: .88rem;
  line-height: 1.2;
  font-weight: 710;
  white-space: nowrap;
}
.primary { background: var(--blue); color: var(--paper); }
.primary:hover:not(:disabled) { background: var(--blue-hover); }
.quiet { color: var(--ink); background: var(--paper); border-color: var(--line-dark); }
.quiet:hover:not(:disabled) { background: var(--wash); }
.quiet.danger { color: var(--red); }
.danger-primary { background: var(--red); color: var(--paper); }
.danger-primary:hover:not(:disabled) { background: var(--red-hover); }

.notice { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem; justify-content: space-between; border-inline-start: 3px solid var(--red); padding: .65rem .9rem; margin-bottom: 1.35rem; background: var(--red-wash); color: var(--red); }
.status-line { font-size: .83rem; color: var(--muted); overflow-wrap: anywhere; }
.status-line:empty { display: none; }
.status-line.is-error, .auth-card .status-line.is-error { color: var(--red); }
.qr-block { margin-top: 1rem; }
.qr-block img { display: block; width: min(100%, 10.5rem); height: auto; margin-block: .75rem; }
.qr-block button { margin-top: .6rem; }
details { margin-top: .6rem; }
summary { width: fit-content; padding: .5rem 0; color: var(--blue); cursor: pointer; font-size: .9rem; }
.secret-tools { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.secret-tools code { flex: 1; overflow-wrap: anywhere; }
.secret-tools input { flex: 1; font-family: var(--mono); font-size: .81rem; }

.dashboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1.8rem; border-bottom: 1px solid var(--line-dark); }
.dashboard-heading p { margin-top: .55rem; color: var(--muted); overflow-wrap: anywhere; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 4.5rem); padding-top: 1.8rem; align-items: start; }
.tokens-section > .status-line { margin-block: .75rem; }
.token-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .62rem; align-items: end; margin-block: 1.25rem 1rem; }
.token-form input { margin-top: .32rem; }
.new-token { background: var(--blue-wash); border-inline-start: 3px solid var(--blue); padding: 1rem; margin-block: 1rem; }
.new-token p { color: var(--muted); margin-block: .55rem; }
.new-token .token-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .65rem; }
.token-actions p { margin: 0; }
.token-actions p:empty + button { margin-inline-start: auto; }
.token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; column-gap: .7rem; border-top: 1px solid var(--line); padding-block: 1rem; }
.token-row:last-child { border-bottom: 1px solid var(--line); }
.token-row h3 { padding-top: .23rem; }
.token-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .5rem 0 0; color: var(--muted); font-size: .78rem; }
.token-meta div { display: flex; gap: .33rem; }
.token-meta dd { margin: 0; }
.token-state { color: var(--muted); font-size: .75rem; padding-top: .26rem; white-space: nowrap; }
.token-state.is-active { color: var(--blue); }
.connection { min-width: 0; border-top: 3px solid var(--blue); padding: 1.2rem; background: var(--paper); }
.connection > p { margin-top: .8rem; color: var(--muted); font-size: .9rem; }
.desktop-setup { margin-top: 1rem; }
.desktop-setup p { margin-top: .65rem; color: var(--muted); font-size: .9rem; }
.connection .command {
  margin-top: .68rem;
  background: var(--dark-code);
  color: var(--code-ink);
  padding: .75rem .8rem;
}
.command pre, .shell-followup { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; font-size: .78rem; line-height: 1.6; }
.command button { margin-top: .55rem; background: var(--dark-code); color: var(--code-ink); border-color: var(--code-border); }
.command button:hover:not(:disabled) { background: var(--muted); }
.command button:focus-visible { outline-color: var(--code-ink); }
.shell-followup { margin-top: .6rem; }
.empty { border-top: 1px solid var(--line); padding-block: 1rem; color: var(--muted); }
dialog { width: min(100% - 2rem, 26rem); color: var(--ink); border: 1px solid var(--line-dark); padding: 0; }
dialog::backdrop { background: var(--shadow); }
.dialog-body { padding: 1.3rem; }
.dialog-body p { margin: .75rem 0 1rem; overflow-wrap: anywhere; }
.dialog-actions { display: flex; gap: .5rem; justify-content: end; }

.directory-heading { padding-bottom: 1.6rem; border-bottom: 1px solid var(--line-dark); margin-bottom: 1.25rem; }
.directory-heading p { color: var(--muted); margin-top: .72rem; }
.listing-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; }
.listing-toolbar div { width: min(100%, 22rem); }
.listing-toolbar input { margin-top: .32rem; }
.listing-count { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.listing-table { background: var(--paper); border: 1px solid var(--line); }
.listing-labels, .page-row { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, .7fr) minmax(6rem, .38fr); gap: 1rem; }
.listing-labels { padding: .7rem 1.15rem; background: var(--wash); color: var(--muted); font-size: .78rem; font-weight: 720; }
.page-list { list-style: none; padding: 0; margin: 0; }
.page-row { align-items: center; min-height: 4.7rem; border-top: 1px solid var(--line); padding: .7rem 1.15rem; }
.page-row a { font-weight: 710; display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.page-name { min-width: 0; }
.page-name code { display: block; margin-top: -.3rem; }
.page-name code, .page-publisher, .page-date { color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.mobile-label { display: none; }

@media (max-width: 780px) {
  .frame { width: min(100% - 2.5rem, 70rem); }
  .auth-shell { gap: 1.7rem; }
}
@media (max-width: 635px) {
  .frame { width: min(100% - 2rem, 70rem); }
  .masthead-inner { min-height: 3.9rem; }
  .portal, .directory { padding-top: 2rem; }
  .auth-shell, .workbench { grid-template-columns: minmax(0, 1fr); }
  .auth-intro { padding: 0; }
  .auth-intro h1 + p { margin-top: .85rem; }
  .address { margin-top: 1rem; padding-top: .65rem; }
  .dashboard-heading { padding-bottom: 1.05rem; }
  .workbench { padding-top: 1.2rem; }
  .listing-labels { display: none; }
  .page-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: .7rem; row-gap: .45rem; padding: .55rem .82rem .8rem; }
  .page-row:first-child { border-top: 0; }
  .page-name { grid-column: 1 / -1; }
  .mobile-label { display: inline; margin-right: .14rem; font-size: .74rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a, input { transition: color .12s ease, background-color .12s ease, border-color .12s ease; }
}
