:root {
  color-scheme: light;
  --bg: #f6f6f1;
  --paper: #fff;
  --surface: #f9f9f5;
  --ink: #202924;
  --muted: #737a74;
  --line: #dedfd7;
  --accent: #1b4637;
  --accent-soft: #e9f0e8;
  --accent-ink: #fff;
  --accent-hover: #295a46;
  --success-line: #d2ddce;
  --invite-line: #c9d6c5;
  --error: #9b392d;
  --error-soft: #f8eeeb;
  --control-line: var(--line);
  --toast-bg: var(--ink);
  --toast-ink: #fff;
  --toast-shadow: #20292412;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100dvh; margin: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--bg); font: 13px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 3px; }
button, summary, input[type=checkbox] { cursor: pointer; }
button { border: 0; border-radius: 0; background: none; }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
input, select { border: 1px solid var(--control-line); border-radius: 0; background: var(--paper); }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 10; background: var(--accent); color: var(--accent-ink); padding: 12px; }
.skip-link:focus { top: 12px; }
.site-header { height: 76px; padding: 0 40px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 24px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-mark { width: 34px; height: 36px; display: grid; place-items: center; padding-bottom: 2px; color: var(--accent-ink); background: var(--accent); font: 31px/1 var(--serif); }
.brand-word { font-size: 10px; letter-spacing: 1.7px; font-weight: 700; }
.header-link { display: inline-flex; align-items: center; gap: 17px; padding: 10px 0 10px 12px; text-decoration: none; font-size: 11px; }
.header-link:hover, .text-button:hover { color: var(--accent); text-decoration: underline; }
.header-label { font-size: 11px; color: var(--muted); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: auto; padding: 21px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.site-footer a { text-decoration: none; }
.home-main { width: min(100% - 80px, 940px); margin: 0 auto; padding: clamp(70px, 10vh, 120px) 0 100px; }
.home-intro { margin-bottom: 70px; }
.eyebrow { font-size: 9px; letter-spacing: 1.1px; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.home-intro h1 { font: 400 clamp(42px, 5.2vw, 64px)/1.12 var(--serif); letter-spacing: -1.5px; margin-top: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 0 15px; border-bottom: 1px solid var(--line); }
.section-heading h2 { font-size: 11px; font-weight: 600; }
.section-count { font-size: 9px; color: var(--muted); font-variant-numeric: tabular-nums; }
.project-row { display: flex; align-items: center; gap: 24px; padding: 27px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .15s; }
a.project-row:hover { background: var(--accent-soft); }
.project-mark { width: 52px; height: 55px; display: grid; place-items: center; flex-shrink: 0; background: var(--paper); border: 1px solid var(--line); font: 36px/1 var(--serif); color: var(--accent); }
.japanese-mark { font-size: 27px; }
.project-description { display: flex; flex-direction: column; gap: 3px; }
.project-title { font: 25px/1.3 var(--serif); letter-spacing: -.3px; }
.project-description .muted { font-size: 11px; }
.muted { color: var(--muted); }
.project-meta { margin-left: auto; font-size: 9px; color: var(--muted); }
.project-arrow { width: 30px; text-align: center; font-size: 18px; color: var(--accent); }
.project-planned .project-mark, .project-planned .project-title, .project-planned .project-arrow { color: var(--muted); }
.auth-main { width: min(100% - 48px, 420px); margin: 0 auto; padding: 72px 0 90px; outline: none; }
.auth-main.wide { width: min(100% - 64px, 860px); padding-top: 56px; }
.initial-loading { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 180px; color: var(--muted); font-size: 12px; }
.loading-dot { width: 7px; height: 7px; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.auth-heading { margin-bottom: 30px; }
.auth-heading h1 { font: 400 35px/1.2 var(--serif); letter-spacing: -.6px; margin: 9px 0 10px; }
.auth-heading p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field>span, .field>label { font-size: 11px; font-weight: 500; }
.field input, .field select { width: 100%; height: 44px; padding: 10px 12px; outline-offset: 2px; }
.field input[readonly] { background: var(--surface); color: var(--muted); }
.field small { font-size: 10px; color: var(--muted); }
.password-field { position: relative; }
.password-field input { padding-right: 57px; }
.password-toggle { position: absolute; right: 1px; top: 1px; height: 42px; padding: 0 13px; color: var(--muted); font-size: 10px; }
.check-label { display: flex; align-items: flex-start; gap: 10px; font-size: 11px; color: var(--muted); cursor: pointer; }
.check-label input { margin-top: 1px; }
.form-options { display: flex; justify-content: space-between; align-items: center; margin: 1px 0 27px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 10px 15px; gap: 10px; border: 1px solid var(--accent); text-decoration: none; font-size: 11px; font-weight: 500; }
.primary-button { background: var(--accent); color: var(--accent-ink); }
.primary-button:hover:not(:disabled) { background: var(--accent-hover); }
.secondary-button { border-color: var(--control-line); background: var(--paper); }
.secondary-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.full-width { width: 100%; }
.text-button { padding: 8px 0; font-size: 11px; color: var(--muted); text-underline-offset: 3px; }
.form-footnote { margin-top: 24px; font-size: 10px; text-align: center; color: var(--muted); line-height: 1.7; }
.form-footnote .text-button { font-size: 10px; }
.form-error { padding: 11px 13px; margin: 0 0 20px; color: var(--error); background: var(--error-soft); border-left: 2px solid var(--error); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.form-notice { padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); margin: 0 0 22px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.code-input { font-size: 23px; font-variant-numeric: tabular-nums; letter-spacing: 8px; text-align: center; height: 56px !important; }
.qr-wrap { display: flex; justify-content: center; background: white; border: 1px solid var(--line); padding: 20px; margin: 0 0 18px; }
.qr-wrap canvas { max-width: 100%; height: auto !important; }
.setup-secret { margin: 0 0 24px; font-size: 10px; color: var(--muted); }
.setup-secret summary { padding: 7px 0; }
.secret-key { display: block; padding: 13px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); line-height: 1.8; overflow-wrap: anywhere; user-select: all; margin-top: 7px; font-family: ui-monospace, monospace; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; background: var(--paper); border: 1px solid var(--line); padding: 22px; margin: 0 0 13px; font: 12px/1.6 ui-monospace, monospace; text-align: center; }
.backup-actions { display: flex; gap: 20px; margin: 0 0 24px; }
.backup-confirm { margin-bottom: 26px; }
.account-topline { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; }
.account-topline .auth-heading { margin-bottom: 28px; }
.account-topline .text-button { margin-top: 15px; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 0 0 28px; }
.tab { padding: 12px 0; margin-bottom: -1px; color: var(--muted); font-size: 11px; border-bottom: 2px solid transparent; }
.tab[aria-selected=true] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.account-section { margin-top: 33px; }
.account-section h2, .subheading { font-size: 11px; font-weight: 600; margin-bottom: 16px; }
.account-section .project-row { padding: 18px 0; }
.account-section .project-row:first-of-type { border-top: 1px solid var(--line); }
.account-section .project-mark { width: 39px; height: 42px; font-size: 28px; }
.account-section .project-title { font-size: 21px; }
.security-row { display: flex; gap: 16px; align-items: center; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.security-row>span:first-child { font-size: 12px; }
.status-badge { font-size: 9px; color: var(--accent); border: 1px solid var(--success-line); background: var(--accent-soft); padding: 3px 6px; white-space: nowrap; }
.status-badge.neutral { color: var(--muted); background: var(--surface); border-color: var(--line); }
.security-row .status-badge { margin-left: auto; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 4px; }
.section-title-row h2 { margin: 0; }
.session-row, .invite-row, .user-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); }
.row-main { min-width: 0; }
.row-title { font-size: 12px; overflow-wrap: anywhere; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.row-detail { font-size: 10px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.row-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.danger-button { color: var(--error); }
.empty-message { font-size: 11px; color: var(--muted); padding: 20px 0; }
.inline-form { padding: 25px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 30px; }
.inline-form .field { margin-bottom: 17px; }
.inline-form .primary-button { min-width: 130px; }
.app-checkboxes { border: 0; padding: 0; margin: 0 0 22px; display: flex; gap: 20px; flex-wrap: wrap; }
.app-checkboxes legend { padding: 0; margin-bottom: 10px; font-size: 11px; }
.invite-result { border: 1px solid var(--invite-line); background: var(--accent-soft); padding: 17px; margin: 0 0 25px; }
.invite-result h3 { font-size: 11px; font-weight: 600; margin-bottom: 9px; }
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input { width: 100%; min-width: 0; padding: 10px; font-size: 11px; }
.copy-row button { flex-shrink: 0; }
.invite-result p { font-size: 10px; color: var(--muted); margin-top: 10px; }
.user-editor { padding: 20px; border: 1px solid var(--line); background: var(--paper); margin-top: 14px; }
.editor-heading { margin-bottom: 17px; font-size: 12px; }
.button-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 20px; background: var(--toast-bg); color: var(--toast-ink); font-size: 11px; z-index: 20; box-shadow: 0 3px 20px var(--toast-shadow); }
.noscript-message { margin: 20px auto; }
.recovery-note { margin: 20px 0; font-size: 11px; line-height: 1.7; color: var(--muted); }
@media (max-width: 600px) {
  .site-header { height: 64px; padding: 0 20px; }
  .header-actions { gap: 16px; }
  .brand-mark { width: 30px; height: 32px; font-size: 27px; }
  .brand-word { font-size: 9px; }
  .site-footer { padding: 19px 20px; font-size: 9px; }
  .home-main { width: calc(100% - 40px); padding: 62px 0 75px; }
  .home-intro { margin-bottom: 52px; }
  .home-intro h1 { font-size: 45px; }
  .project-row { gap: 15px; padding: 24px 0; flex-wrap: wrap; }
  .project-mark { width: 43px; height: 46px; font-size: 30px; }
  .japanese-mark { font-size: 23px; }
  .project-title { font-size: 23px; }
  .project-description .muted { font-size: 10px; }
  .project-meta { font-size: 8px; }
  .project-arrow { width: 12px; font-size: 16px; }
  .auth-main { padding: 48px 0 65px; }
  .auth-main.wide { width: calc(100% - 40px); padding: 37px 0 65px; }
  .auth-heading h1 { font-size: 32px; }
  .field input, .field select { font-size: 16px; }
  .field .code-input { font-size: 23px; }
  .inline-form { padding: 20px 16px; }
  .session-row, .invite-row, .user-row { gap: 10px; }
  .row-actions { gap: 10px; }
  .row-actions .text-button { font-size: 10px; }
  .account-topline { gap: 12px; }
  .account-topline .auth-heading p { overflow-wrap: anywhere; }
  .account-topline>.text-button { flex-shrink: 0; }
}
@media (max-width: 360px) {
  .site-header { padding-inline: 16px; }
  .header-actions { gap: 10px; }
  .header-actions .header-link { gap: 8px; padding-left: 0; }
  .project-meta { display: none; }
  .project-arrow { margin-left: auto; }
  .home-intro h1 { font-size: 39px; }
  .backup-codes { padding: 16px 10px; gap: 10px; font-size: 11px; }
}
/* Appearance changes only screen colors. QR codes keep their white quiet zone. */
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000;
    --paper: #000;
    --surface: #0d110e;
    --ink: #e3e9e3;
    --muted: #a0aaa2;
    --line: #28302a;
    --accent: #9cc8ac;
    --accent-soft: #13231a;
    --accent-ink: #07150c;
    --accent-hover: #b4d7bf;
    --success-line: #355440;
    --invite-line: #355440;
    --error: #eda79d;
    --error-soft: #291512;
    --control-line: #526157;
    --toast-bg: #1a231d;
    --toast-ink: var(--ink);
    --toast-shadow: #0008;
  }
  html[data-theme="dark"] input::placeholder { color: #8d9a90; opacity: 1; }
  html[data-theme="dark"] .toast { border: 1px solid var(--control-line); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
