@font-face {
  font-family: Manrope;
  src: url('/assets/fonts/manrope.ttf') format('truetype');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f5f7fb; --panel: #fff; --surface: #f8fafc; --text: #18243a;
  --muted: #5e6c81; --border: #dce3ee; --blue: #285de5; --blue-hover: #1948c6;
  --tint: #edf2ff; --focus: #b35b00; --danger: #b52b3b;
  --positive: #21704f; --positive-bg: #eaf6ef; --shadow: 0 4px 20px #1e3a6505;
  font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #111723; --panel: #192231; --surface: #141d2b; --text: #e8eef8;
    --muted: #a4b2c8; --border: #303e53; --blue: #9abbff; --blue-hover: #b6ceff;
    --tint: #233450; --focus: #ffd08a; --danger: #ffa1aa;
    --positive: #91d7b3; --positive-bg: #213c33; --shadow: none;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #111723; --panel: #192231; --surface: #141d2b; --text: #e8eef8;
  --muted: #a4b2c8; --border: #303e53; --blue: #9abbff; --blue-hover: #b6ceff;
  --tint: #233450; --focus: #ffd08a; --danger: #ffa1aa;
  --positive: #91d7b3; --positive-bg: #213c33; --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--blue); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1rem; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.3; }
h1 { font-size: clamp(1.8rem, 4vw, 2.35rem); letter-spacing: -.045em; margin: .35rem 0 .6rem; font-weight: 700; }
h2 { font-size: 1.1rem; letter-spacing: -.02em; margin: 0 0 .35rem; }
h3 { font-size: .93rem; margin: 0 0 1rem; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1176px; margin: auto; padding: 1rem 1.75rem; display: flex; align-items: center; gap: 2.5rem; }
.brand { display: inline-block; color: var(--text); font-family: Manrope, system-ui, sans-serif; font-size: 1.35rem; font-weight: 600; letter-spacing: .015em; text-decoration: none; white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: .3rem; }
nav a { color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600; padding: .6rem .8rem; border-radius: 8px; }
nav a:hover { color: var(--text); background: var(--surface); }
nav a[aria-current=page] { color: var(--blue); background: var(--tint); }
.main-nav:empty { display: none; }
.theme { margin: 0 0 0 auto; font-size: .72rem; color: var(--muted); }
.theme select { min-height: 32px; padding: .2rem 1.7rem .2rem .5rem; margin: .15rem 0 0; font-size: .8rem; background: var(--panel); }
main { max-width: 1120px; margin: 2.75rem auto; padding: 0 1.75rem; min-height: 65vh; }
.page-heading { margin-bottom: 1.8rem; }
.eyebrow { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .4rem; }
.page-intro { color: var(--muted); margin-bottom: 0; }
.page-intro:empty, .eyebrow:empty { display: none; }
.card { padding: 1.75rem; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.auth-view main { max-width: 540px; margin-top: clamp(2.5rem, 7vh, 5rem); }
.auth-view .page-heading { text-align: center; margin-bottom: 1.75rem; }
.auth-view .card { padding: 2rem; }
.auth-intro { color: var(--muted); margin-bottom: 1.5rem; }
.auth-note { font-size: .8rem; color: var(--muted); margin: 1.5rem 0 0; }
.auth-note p { margin-bottom: .45rem; }
.auth-view form > button, .auth-view .passkey-button { width: 100%; }
.auth-view .email-form { margin: 0; }
.divider { display: flex; align-items: center; gap: .8rem; margin: 1.5rem 0; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
label, legend { font-size: .85rem; font-weight: 600; }
label { display: block; margin: 0 0 1rem; }
input, select, button, .button { font: inherit; border: 1px solid var(--border); border-radius: 8px; min-height: 44px; }
input, select { display: block; width: 100%; min-width: 0; background: var(--panel); color: var(--text); padding: .65rem .8rem; margin: .45rem 0 0; }
input::placeholder { color: var(--muted); opacity: .85; }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { border-color: var(--blue); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; cursor: pointer; background: #285de5; border-color: #285de5; color: #fff; padding: .65rem 1.05rem; font-size: .85rem; font-weight: 600; text-decoration: none; line-height: 1.4; }
button:hover, .button:hover { background: #1948c6; border-color: #1948c6; }
button:disabled { opacity: .6; cursor: wait; }
.secondary { background: var(--panel); border-color: var(--border); color: var(--text); }
.secondary:hover { background: var(--surface); border-color: var(--muted); }
.quiet { color: var(--blue); background: transparent; border-color: transparent; padding-inline: .6rem; }
.quiet:hover { background: var(--surface); border-color: var(--border); }
.danger { color: var(--danger); }
.key-icon { position: relative; width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 50%; transform: scale(.62); margin-right: .3rem; }
.key-icon::after { content: ""; position: absolute; width: 15px; height: 8px; border-bottom: 3px solid currentColor; border-right: 3px solid currentColor; top: 7px; left: 11px; transform: rotate(35deg); }
.mail-icon, .app-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--blue); }
.mail-icon { font-weight: 700; font-size: 1.5rem; margin-bottom: 1rem; }
.app-icon::before { content: ""; width: 18px; height: 18px; border: 1.5px solid currentColor; border-radius: 4px; background: linear-gradient(currentColor,currentColor) center/1px 100% no-repeat, linear-gradient(currentColor,currentColor) center/100% 1px no-repeat; }
.code-input { font-family: ui-monospace, monospace; font-size: 1.7rem; letter-spacing: .18em; text-align: center; }
.back-link { display: inline-block; font-size: .85rem; margin-top: 1rem; }
.tabs { padding: .35rem; border: 1px solid var(--border); background: var(--panel); border-radius: 12px; width: fit-content; margin-bottom: 1.5rem; }
.tabs a { padding: .6rem 1.1rem; }
.section-heading { margin-bottom: 1.4rem; }
.section-heading p, .card-heading p { color: var(--muted); font-size: .85rem; margin-bottom: 0; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-grid > * { min-width: 0; }
.form-actions { margin-top: .5rem; }
.application-card { padding: 0; overflow: hidden; }
.application-card .card-heading { padding: 1.5rem 1.75rem; margin: 0; border-bottom: 1px solid var(--border); }
.application-identity { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.application-identity > div { min-width: 0; }
.application-identity h2 { overflow-wrap: anywhere; }
.text-action { font-size: .8rem; font-weight: 600; text-decoration: none; flex-shrink: 0; }
.policy-body { padding: 1.5rem 1.75rem; }
fieldset { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin: 0 0 1.25rem; }
.duration-field { border: 0; padding: 0; margin: 0 0 1.2rem; max-width: 480px; }
.duration-field legend { padding: 0; margin: 0; }
.duration-controls { display: grid; grid-template-columns: minmax(60px,1fr) minmax(110px,1fr); gap: .5rem; }
.duration-field:disabled { opacity: .55; }
.check { display: flex; align-items: center; gap: .65rem; font-weight: 400; font-size: .85rem; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: #285de5; flex-shrink: 0; }
.policy-footer { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.policy-footer button { flex-shrink: 0; }
.field-help, .muted { color: var(--muted); font-size: .83rem; }
.field-help { margin: 0; }
#nickname-help { margin: -.4rem 0 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,270px),1fr)); gap: 1.25rem; }
.grid .card { margin-bottom: 0; }
.app { display: block; text-decoration: none; color: var(--text); }
.app:hover { border-color: var(--blue); }
.app .app-icon { margin-bottom: 1.25rem; }
.app p { color: var(--muted); font-size: .85rem; }
.app-open { display: flex; justify-content: space-between; color: var(--blue); font-size: .85rem; font-weight: 600; margin-top: 1.75rem; }
.empty-state { text-align: center; padding: 3rem; }
.empty-state .app-icon { margin-bottom: 1.25rem; }
.empty-state p { color: var(--muted); margin-bottom: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.row > span { overflow-wrap: anywhere; min-width: 0; }
.row form { flex-shrink: 0; }
.method-add { margin-top: 1.5rem; }
.email-form { margin-top: 1.5rem; }
.badge { display: inline-block; padding: .25rem .65rem; border-radius: 20px; color: var(--muted); background: var(--surface); font-size: .73rem; font-weight: 600; white-space: nowrap; }
.badge.positive { background: var(--positive-bg); color: var(--positive); }
details { color: var(--muted); font-size: .8rem; margin: 1rem 0; }
summary { cursor: pointer; width: fit-content; margin-bottom: .4rem; }
.session-times { display: flex; flex-wrap: wrap; gap: 1rem 3rem; margin: 1.5rem 0; }
dt { color: var(--muted); font-size: .75rem; }
dd { margin: .2rem 0 0; font-size: .9rem; }
.notice { border: 1px solid var(--border); padding: .85rem 1.1rem; border-radius: 10px; color: var(--muted); font-size: .85rem; }
code, pre { font: .78rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; padding: 1.5rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 1rem; font-size: .8rem; border-bottom: 1px solid var(--border); }
th { background: var(--surface); color: var(--muted); font-size: .72rem; font-weight: 650; }
td code { display: block; max-width: 220px; }
td time { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -100px; background: var(--panel); padding: 1rem; z-index: 10; }
.skip:focus { top: 1rem; }
#status:empty { display: none; }
#status:not(:empty) { background: var(--tint); border: 1px solid var(--blue); padding: 1rem; border-radius: 10px; font-size: .9rem; }
@media (max-width: 900px) {
  .header-inner { gap: 1rem; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; }
}
@media (max-width: 600px) {
  .header-inner { padding: .8rem 1.1rem; }
  .main-nav { gap: .1rem; }
  .main-nav a { padding: .5rem .55rem; font-size: .8rem; }
  main { padding: 0 1.1rem; margin-top: 1.75rem; }
  .auth-view main { margin-top: 2.5rem; }
  .card, .auth-view .card { padding: 1.3rem; border-radius: 12px; }
  .application-card { padding: 0; }
  .application-card .card-heading, .policy-body { padding: 1.3rem; }
  .card-heading { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .policy-footer { align-items: stretch; flex-direction: column; gap: 1rem; }
  .tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; text-align: center; gap: .2rem; }
  .tabs a { padding: .6rem .5rem; }
  .code-input { font-size: 1.5rem; letter-spacing: .12em; }
  .row { gap: .5rem; flex-wrap: wrap; }
  button, .button { max-width: 100%; }
}

.api-access { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.75rem; border-top: 1px solid var(--border); }
.api-access h3, .api-access p { margin-bottom: .2rem; }
