:root {
  color-scheme: light;
  font: 100%/1.55 "Inter", "Segoe UI", sans-serif;
  --page: #f5f7f5;
  --surface: #ffffff;
  --ink: #182b2b;
  --muted: #465c59;
  --line: #ccd7d2;
  --field-line: #71847f;
  --accent: #165c4d;
  --accent-text: #ffffff;
  --nav: #173e38;
  --nav-text: #ffffff;
  --nav-on: #e4efe8;
  --soft: #edf3ef;
  --focus: #ad5200;
  --danger: #983322;
}
:root[data-theme="contrast"] {
  color-scheme: dark;
  --page: #10171b;
  --surface: #172126;
  --ink: #ffffff;
  --muted: #d0dde1;
  --line: #8c9fa8;
  --field-line: #b3c1ca;
  --accent: #aef0d9;
  --accent-text: #0a2824;
  --nav: #0b1115;
  --nav-text: #ffffff;
  --nav-on: #2d413f;
  --soft: #222f35;
  --focus: #ffce7a;
  --danger: #ffae9e;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: .19em; }
a:hover { text-decoration-thickness: 2px; }
.icon { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.appbar {
  min-height: 4.4rem; display: flex; align-items: center; gap: 1rem;
  padding: .7rem clamp(1rem, 3vw, 2.5rem); background: var(--nav); color: var(--nav-text);
  border-bottom: 1px solid var(--line);
}
.appbar a { color: inherit; }
.appbar .brand, .account-shortcut, .menu-toggle { white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: .8rem; font-weight: 600; font-size: 1.15rem; letter-spacing: -.02em; text-decoration: none; }
.brand b { border: 1px solid currentColor; border-radius: .22rem; padding: .13rem .4rem; font-size: .92rem; letter-spacing: .025em; }
.account-shortcut, .menu-toggle { display: inline-flex; align-items: center; gap: .5rem; color: inherit; }
.account-shortcut { margin-left: auto; text-decoration: none; }
.account-shortcut:hover { text-decoration: underline; }
.menu-toggle { border: 1px solid currentColor; color: inherit; background: transparent; padding: .38rem .55rem; }
.desk-shell { display: grid; grid-template-columns: minmax(12.6rem, 15rem) minmax(0, 1fr); min-height: calc(100vh - 4.4rem); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1.5rem .85rem; }
.sidebar nav { display: grid; gap: .22rem; }
.personal-nav { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.sidebar a, .sidebar button {
  display: flex; gap: .7rem; align-items: center; width: 100%; padding: .67rem .8rem; color: var(--ink);
  background: transparent; border: none; border-radius: .35rem; font: inherit; font-weight: 550; text-align: left; text-decoration: none; cursor: pointer;
}
.sidebar a:hover, .sidebar button:hover { background: var(--soft); text-decoration: underline; }
.sidebar [aria-current="page"] { background: var(--nav-on); color: var(--accent); box-shadow: inset 3px 0 var(--accent); font-weight: 700; }
main { min-width: 0; width: 100%; max-width: 77rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.6rem) clamp(1.1rem, 4vw, 4rem) 5rem; }
.guest-shell main { max-width: 43rem; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.05rem, 4.3vw, 3.15rem); font-weight: 680; letter-spacing: -.045em; margin: 0 0 1.6rem; }
h2 { font-size: clamp(1.2rem, 2.3vw, 1.55rem); font-weight: 650; letter-spacing: -.025em; margin: 0 0 .55rem; }
.context-line { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; color: var(--muted); margin: 0 0 1.15rem; font-size: .9rem; }
.context-line .icon { width: 1rem; height: 1rem; }
.context-line a { font-weight: 600; }
.workspace-focus, .desk-panel, article, .preference-form, .office-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: .65rem;
}
.workspace-focus { padding: clamp(1.15rem, 2.8vw, 2rem); display: flex; align-items: flex-start; gap: 1rem; margin: 0 0 1.15rem; }
.focus-icon { padding: .72rem; border-radius: .55rem; background: var(--soft); color: var(--accent); }
.focus-icon .icon { width: 1.65rem; height: 1.65rem; }
.focus-content { min-width: 0; }
.focus-content p { color: var(--muted); margin: .15rem 0 1rem; }
.focus-content .action { display: inline-block; }
.desk-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.15rem; align-items: start; }
.desk-panel { padding: 1.25rem; }
.desk-panel h2 { margin: .1rem 0 .75rem; font-size: 1.2rem; }
.desk-panel > a { padding: .83rem .1rem; display: flex; align-items: flex-start; gap: .68rem; border-top: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.desk-panel > a:hover span { text-decoration: underline; }
.desk-panel .icon { margin-top: .13rem; }
.desk-panel small, .theme-option small { display: block; color: var(--muted); font-size: .9rem; font-weight: 400; }
article { padding: 1.2rem; margin: 1rem 0; }
form, dl { max-width: 40rem; }
form p { margin: 0 0 1rem; }
label, dt, legend { display: block; font-weight: 600; }
dd { margin: .18rem 0 1.15rem; }
fieldset { border: 0; margin: 0 0 1.25rem; padding: 0; min-width: 0; }
legend { margin-bottom: .65rem; padding: 0; }
input:not([type=hidden]):not([type=radio]):not([type=checkbox]), textarea, select {
  display: block; width: 100%; max-width: 100%; margin-top: .28rem; border: 1px solid var(--field-line);
  background: var(--surface); color: var(--ink); border-radius: .35rem; padding: .62rem .7rem; font: inherit;
}
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
textarea { resize: vertical; }
.helptext { display: block; color: var(--muted); font-size: .92rem; }
.errorlist, [role=alert] { color: var(--danger); }
button, .action { border: 1px solid transparent; border-radius: .36rem; background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 650; padding: .62rem 1rem; text-decoration: none; cursor: pointer; }
button:hover, .action:hover { text-decoration: underline; }
img, canvas, video { max-width: 100%; }
pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.appbar :focus-visible { outline-color: #ffcd80; }
.skip { position: absolute; left: .65rem; top: -6rem; z-index: 2; }
.skip:focus { top: .65rem; padding: .5rem; background: var(--surface); }
.notice { max-width: 45rem; background: var(--soft); padding: .65rem 1rem; border-left: 3px solid var(--accent); }
.preference-form, .office-form { padding: clamp(1.15rem, 3vw, 1.75rem); }
.office-form button { margin-top: 1rem; }
.theme-option { display: flex; align-items: center; gap: .75rem; padding: .8rem .2rem; cursor: pointer; border-top: 1px solid var(--line); }
.theme-option input { flex: 0 0 auto; margin: 0; }
.theme-preview { flex: 0 0 3rem; height: 2.1rem; display: grid; grid-template: .52rem 1fr / .85rem 1fr; border: 1px solid #7d9089; border-radius: .2rem; overflow: hidden; }
.theme-preview i:first-child { grid-column: span 2; background: #173e38; }
.theme-preview i:nth-child(2) { background: #d2dfd7; }
.theme-preview i:last-child { background: #f5f7f5; }
.preview-contrast i:first-child { background: #0b1115; }
.preview-contrast i:nth-child(2) { background: #aef0d9; }
.preview-contrast i:last-child { background: #172126; }
@media (max-width: 48rem) {
  .desk-shell { display: block; }
  .sidebar { padding: .65rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .personal-nav { margin-top: .5rem; padding-top: .5rem; }
  .appbar { gap: .65rem; }
}
@media (max-width: 30rem) {
  .brand { gap: .45rem; font-size: 1rem; }
  .account-shortcut { font-size: .9rem; }
  .account-shortcut .icon { display: none; }
  .menu-toggle { padding: .35rem .48rem; }
}
