:root {
  color-scheme: light;
  --bg: #f6f6f6;
  --pane: #fff;
  --text: #222427;
  --muted: #626970;
  --line: #e3e3e3;
  --soft: #f1f2f3;
  --red: #b7222d;
  --red-hover: #961d26;
  --icon-bg: #f8eef0;
  --shadow: 0 4px 18px rgba(0, 0, 0, .045);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191b;
  --pane: #272a2d;
  --text: #f2f3f4;
  --muted: #bbc1c7;
  --line: #40464c;
  --soft: #31363b;
  --red: #e05a62;
  --red-hover: #ef747b;
  --icon-bg: #39282c;
  --shadow: 0 4px 18px rgba(0, 0, 0, .16);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17191b;
    --pane: #272a2d;
    --text: #f2f3f4;
    --muted: #bbc1c7;
    --line: #40464c;
    --soft: #31363b;
    --red: #e05a62;
    --red-hover: #ef747b;
    --icon-bg: #39282c;
    --shadow: 0 4px 18px rgba(0, 0, 0, .16);
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
svg { display: block; flex: 0 0 auto; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 5px; }
::selection { color: #fff; background: #961d26; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 12px 16px; background: var(--pane); color: var(--text); border-radius: 10px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { background: #1f2022; color: #f3f3f3; border-bottom: 1px solid #38393b; padding: env(safe-area-inset-top) max(28px, env(safe-area-inset-right)) 0 max(28px, env(safe-area-inset-left)); }
.header-inner { width: min(1120px, 100%); min-height: 132px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0; }
.brand { display: inline-flex; align-items: center; grid-column: 2; grid-row: 1; justify-self: center; width: 320px; max-width: 100%; min-width: 0; border-radius: 4px; }
.brand img { display: block; width: 100%; height: auto; }
.header-tools { display: flex; align-items: center; grid-column: 3; grid-row: 1; justify-self: end; gap: 24px; }
.portal-label { font-size: .875rem; font-weight: 500; color: #d7d8da; letter-spacing: .015em; }
.theme-button { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #505255; border-radius: 12px; background: #292b2e; color: #f4f4f4; }
.theme-button svg { width: 20px; height: 20px; }
.theme-button:hover { background: #3b3d41; border-color: #737579; }
.theme-button:focus-visible, .brand:focus-visible { outline-color: #ff949c; }
.portal-main { width: min(1120px, 100% - 56px); margin: 0 auto; flex: 1 0 auto; padding: clamp(38px, 6.7vh, 72px) 0 32px; }
.welcome { text-align: center; }
.greeting { color: var(--muted); font-size: 1rem; font-weight: 500; margin: 0 0 16px; }
h1 { font-size: clamp(1.625rem, 2.6vw, 2.125rem); line-height: 1.25; font-weight: 650; letter-spacing: -.03em; margin: 0; }
.portal-question { color: var(--text); font-size: 1.125rem; line-height: 1.4; font-weight: 500; letter-spacing: -.015em; margin: 10px 0 0; }
.thanks { color: var(--muted); font-size: .9375rem; margin: 12px 0 0; }
.areas { margin-top: 32px; }
.area-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.area-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 248px; padding: 26px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; background: var(--pane); box-shadow: var(--shadow); transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease; }
.area-icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 13px; color: var(--red); background: var(--icon-bg); margin-bottom: 23px; }
.area-icon svg { width: 26px; height: 26px; }
.area-copy { display: flex; flex-direction: column; min-width: 0; }
.area-title { font-size: 1.375rem; line-height: 1.3; font-weight: 700; letter-spacing: -.025em; }
.area-description { margin-top: 7px; font-size: 1rem; color: var(--muted); line-height: 1.5; }
.card-action { display: inline-flex; align-items: center; justify-content: center; font-size: .875rem; font-weight: 650; margin-top: 24px; color: var(--text); line-height: 1.4; }
.training-reminder { margin-top: 8px; color: var(--red); font-size: .875rem; line-height: 1.35; font-weight: 600; }
.area-card:focus-visible { outline-offset: 4px; border-color: var(--red); }
.area-card:active { background: var(--soft); border-color: var(--red); }
@media (hover: hover) {
  .area-card:hover { border-color: var(--red); box-shadow: 0 6px 24px rgba(0, 0, 0, .07); }
  .area-card:hover .card-action { color: var(--red); }
}
.safety-note { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 30px 0 0; color: var(--muted); }
.safety-note svg { width: 18px; height: 18px; }
.safety-note p { font-size: .875rem; margin: 0; }
.site-footer { padding: 0 max(28px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left)); }
.footer-inner { width: min(1120px, 100%); margin: 0 auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: .8125rem; }
.install-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--pane); color: var(--text); padding: 8px 12px; font-size: .875rem; font-weight: 600; }
.install-button:hover { background: var(--soft); }
.install-button svg { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) and (min-width: 681px) {
  .area-card { padding: 20px; }
  .area-title { font-size: 1.25rem; }
  .area-description { font-size: .9375rem; }
  .area-grid { gap: 12px; }
}
@media (max-width: 680px) {
  .site-header { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .header-inner { min-height: 108px; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 0; }
  .brand { width: 100%; max-width: 320px; }
  .header-tools { gap: 0; }
  .portal-label { display: none; }
  .theme-button { width: 44px; height: 44px; flex-shrink: 0; border-radius: 11px; }
  .portal-main { width: calc(100% - 36px); display: flex; flex-direction: column; padding-top: 22px; padding-bottom: 16px; }
  .welcome { padding-bottom: 20px; flex-shrink: 0; }
  .greeting { font-size: .9375rem; margin-bottom: 10px; }
  h1 { font-size: clamp(1.625rem, 7vw, 1.875rem); line-height: 1.2; }
  .portal-question { font-size: 1.125rem; margin-top: 8px; line-height: 1.3; }
  .thanks { margin-top: 10px; font-size: .875rem; }
  .areas { margin-top: auto; flex-shrink: 0; }
  .area-grid { grid-template-columns: 1fr; gap: 10px; }
  .area-card { min-height: 84px; flex-direction: row; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 15px; }
  .area-icon { width: 46px; height: 46px; border-radius: 12px; margin: 0; flex-shrink: 0; }
  .area-icon svg { width: 24px; height: 24px; }
  .area-title { font-size: 1.125rem; line-height: 1.3; }
  .area-description { font-size: .875rem; margin-top: 4px; }
  .card-action { display: none; }
  .training-reminder { font-size: .8125rem; }
  .safety-note { margin-top: 18px; gap: 7px; flex-shrink: 0; }
  .safety-note p { font-size: .8125rem; }
  .safety-note svg { width: 16px; height: 16px; }
  .site-footer { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .footer-inner { gap: 10px; flex-wrap: wrap; padding-top: 16px; }
  .install-button { order: 3; width: 100%; }
}
@media (max-width: 680px) and (max-height: 680px) {
  .header-inner { min-height: 92px; }
  .portal-main { padding-top: 14px; padding-bottom: 12px; }
  .welcome { padding-bottom: 16px; }
  .greeting { margin-bottom: 8px; }
  h1 { font-size: 1.625rem; }
  .portal-question { font-size: 1.0625rem; margin-top: 6px; }
  .thanks { margin-top: 8px; }
  .area-card { min-height: 80px; padding: 13px 16px; gap: 14px; }
  .safety-note { margin-top: 14px; }
  .footer-inner { padding-top: 12px; }
}
@media (max-width: 680px) and (max-height: 600px) {
  .header-inner { min-height: 84px; }
  .portal-main { padding-top: 10px; padding-bottom: 8px; }
  .welcome { padding-bottom: 12px; }
  h1 { font-size: 1.5rem; }
  .area-grid { gap: 8px; }
  .area-card { min-height: 72px; padding-top: 10px; padding-bottom: 10px; }
  .area-icon { width: 40px; height: 40px; }
  .safety-note { margin-top: 10px; }
  .footer-inner { padding-top: 10px; }
  .site-footer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 355px) {
  .site-header { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .portal-main { width: calc(100% - 28px); }
  .area-card { gap: 12px; padding-left: 13px; padding-right: 13px; }
  .area-icon { width: 42px; height: 42px; }
  .area-description { font-size: .875rem; line-height: 1.35; }
  .safety-note { align-items: flex-start; }
  .safety-note p { max-width: 240px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .area-card, .theme-button, .install-button { border: 1px solid ButtonText; }
  .area-icon { color: LinkText; }
}
