@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/app/assets/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/app/assets/manrope-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #f7f4ec;
  --surface: #fffdf8;
  --card: #fff;
  --ink: #17151d;
  --ink-soft: #3f3b48;
  --muted: #716d79;
  --line: #e4dfd3;
  --line-strong: #cec7ba;
  --accent: #5b47d6;
  --accent-strong: #4935c2;
  --accent-soft: #f0edff;
  --ok: #167858;
  --ok-bg: #e8f7f0;
  --warn: #8b5b10;
  --warn-bg: #f8efd9;
  --bad: #b33d30;
  --bad-bg: #faebe7;
  --info-bg: #efedfa;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 16px 48px rgba(38, 31, 66, .08);
  --font: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --heading: "Manrope", "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.no-smooth-scroll { scroll-behavior: auto; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 450 14px/1.625 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
img, svg { display: block; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--heading); letter-spacing: -.025em; }
code, .mono { font-family: var(--mono); }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; }
.hidden { display: none !important; }
.clipboard-fallback { inset: 0 auto auto 0; opacity: 0; pointer-events: none; position: fixed; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { clip: rect(0, 0, 0, 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
:focus-visible { outline: 3px solid rgba(91, 71, 214, .28); outline-offset: 2px; }

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 9px 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 71, 214, .1); outline: 0; }
textarea { resize: vertical; }
label > span:first-child { display: block; font-size: 12px; font-weight: 650; margin-bottom: 6px; }

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  font-weight: 650;
  gap: 7px;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-strong); }
.button.secondary { background: var(--card); border-color: var(--line); }
.button.secondary:hover { border-color: var(--ink); }
.button.text { background: transparent; color: var(--accent-strong); }
.button.danger { background: var(--bad-bg); border-color: #efc5bd; color: var(--bad); }
.button.small { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.button.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.auth-dialog { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 0; width: min(440px, calc(100vw - 32px)); }
.auth-dialog::backdrop { background: rgba(20, 18, 31, .42); backdrop-filter: blur(4px); }
.auth-inner { background: var(--surface); padding: 28px; position: relative; }
.auth-close { background: transparent; border: 0; color: var(--muted); font-size: 26px; position: absolute; right: 15px; top: 10px; }
.auth-brand { margin-bottom: 20px; text-align: center; }
.auth-brand-lockup { align-items: center; display: inline-flex; font-size: 16px; font-weight: 700; gap: 8px; margin-bottom: 16px; }
.auth-brand-lockup img { height: auto; max-width: min(70vw, 180px); width: 180px; }
.auth-brand h1 { font-size: 26px; }
.auth-card { display: grid; gap: 16px; }
.tabs { background: #eeeae1; border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; }
.tab { background: transparent; border: 0; border-radius: 8px; min-height: 38px; }
.tab.active { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); font-weight: 700; }
.form-stack { display: grid; gap: 12px; }
.oauth-divider { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 10px; }
.oauth-divider::before, .oauth-divider::after { background: var(--line); content: ""; flex: 1; height: 1px; }
.oauth-provider-button img { height: 18px; width: 18px; }
.auth-legal { color: var(--muted); font-size: 11px; text-align: center; }
.auth-legal a { color: var(--accent-strong); }
.error, .contact-error { color: var(--bad); font-size: 13px; }

.notice, .load-error { align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; gap: 12px; margin: 16px 24px 0; padding: 10px 12px; }
.notice { background: var(--info-bg); color: var(--accent-strong); }
.notice.error-state, .load-error { background: var(--bad-bg); border-color: #efc5bd; color: var(--bad); }
.load-error { justify-content: space-between; }

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 14px; vertical-align: top; }
th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfaf6; }
.cell-sub { color: var(--muted); display: block; font-size: 11px; margin-top: 3px; }
.token-ellipsis { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { background: var(--info-bg); border-radius: 999px; color: var(--accent-strong); display: inline-flex; font-size: 11px; font-weight: 750; line-height: 1; padding: 6px 8px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.neutral { background: #efedf1; color: var(--ink-soft); }

.inline-form, .issued { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; padding: 18px; }
.inline-form .actions { align-items: end; }
.issued { grid-template-columns: 1fr; }
.issued-head, .issued-token { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.issued-token { background: #f0ede5; border-radius: var(--radius-sm); padding: 10px; }
.issued-token code { overflow-wrap: anywhere; }
.table-foot { display: flex; justify-content: center; padding: 16px; }

.dialog { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 0; width: min(520px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(20, 18, 31, .42); backdrop-filter: blur(4px); }
.dialog form { display: grid; gap: 15px; padding: 24px; }
.dialog h3 { font-size: 21px; }
.dialog-body { color: var(--ink-soft); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.registration-notice-dialog { width: min(560px, calc(100vw - 32px)); }
.registration-notice-dialog .dialog-body { display: grid; gap: 12px; max-height: min(58vh, 460px); overflow-y: auto; }
.registration-notice-dialog .dialog-body p { margin: 0; }
.registration-notice-list { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
.registration-notice-links { font-size: 12px; }
.registration-notice-links a { color: var(--accent-strong); }
.dialog-field { display: grid; }
.contact-counter { align-items: center; background: #f0ede5; border-radius: var(--radius-sm); display: flex; justify-content: space-between; padding: 10px 12px; }
.contact-fields { display: grid; gap: 10px; }
.contact-field-row { align-items: center; display: flex; gap: 8px; }
.contact-field-icon { color: var(--muted); width: 24px; }

@media (max-width: 720px) {
  .inline-form { grid-template-columns: 1fr; }
  th, td { padding: 10px; }
  .auth-inner { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
