:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --paper: #fffefa;
  --paper-2: #f7faf7;
  --ink: #172323;
  --muted: #5d6b69;
  --line: #d8ded6;
  --primary: #2f6f5e;
  --primary-dark: #1f5448;
  --primary-soft: #dcefe7;
  --blue: #315f76;
  --blue-soft: #dceaf0;
  --amber: #98651c;
  --amber-soft: #fff1c9;
  --red: #a9342d;
  --red-soft: #ffe0dc;
  --rose-soft: #f7e2dd;
  --shadow: 0 18px 48px rgba(34, 48, 42, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(220, 234, 240, 0.72), rgba(244, 246, 241, 0.8) 44%, rgba(255, 241, 201, 0.38)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary-dark);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.site-shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 46px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid rgba(216, 222, 214, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.92);
  box-shadow: 0 10px 34px rgba(34, 48, 42, 0.1);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  min-width: 320px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(34, 48, 42, 0.1);
}

.brand strong {
  display: block;
}

.brand strong {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: baseline;
  color: #0b0f0e;
  font-family: Inter, "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.18rem, 1.9vw, 1.36rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-separator {
  color: inherit;
  font-weight: inherit;
}

.brand strong span:last-child {
  color: inherit;
  font-weight: 600;
}

.nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 8px;
  min-width: 0;
  align-items: stretch;
}

.nav a,
.nav button,
.reset-button,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.chip-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-weight: 760;
  text-decoration: none;
}

.nav > a,
.nav > button {
  display: grid;
  min-width: 0;
  min-height: 82px;
  grid-template-rows: 34px minmax(0, auto);
  gap: 4px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.05;
  text-align: center;
  text-decoration: none !important;
}

.nav > a:visited {
  color: var(--muted);
}

.nav > a span:last-child,
.nav > button span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.nav > a.active,
.nav > button.active {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav > a:hover,
.nav > a:focus-visible,
.nav > button:hover,
.nav > button:focus-visible {
  border-color: var(--line);
  background: rgba(220, 239, 231, 0.48);
  color: var(--primary-dark);
  text-decoration: none !important;
}

.nav-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.nav > a.active .nav-icon,
.nav > button.active .nav-icon {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: #efaaa4;
  background: linear-gradient(180deg, #fff4f1, var(--red-soft));
  color: #7a241e;
  white-space: nowrap;
}

.reset-button:hover,
.reset-button:focus-visible {
  border-color: #df8077;
  background: #ffd8d2;
  color: #5d1713;
}

.reset-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 18px;
  flex: 0 0 16px;
}

.reset-icon::before,
.reset-icon::after {
  position: absolute;
  content: "";
  border: 2px solid currentColor;
}

.reset-icon::before {
  top: 1px;
  left: 2px;
  width: 12px;
  height: 3px;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.reset-icon::after {
  top: 6px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  box-shadow: inset 3px 0 0 -1px currentColor, inset -3px 0 0 -1px currentColor;
}

.app {
  display: grid;
  gap: 18px;
}

.hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}

.hero.support-first,
.hero.today-hero {
  min-height: auto;
  grid-template-columns: 1fr;
}

.hero-copy,
.hero-visual,
.panel,
.card,
.legal-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  align-content: center;
  padding: clamp(22px, 4vw, 42px);
  background:
    linear-gradient(135deg, rgba(220, 239, 231, 0.95), rgba(255, 254, 250, 0.98) 54%, rgba(220, 234, 240, 0.9)),
    var(--paper);
}

.today-hero .hero-copy {
  padding: clamp(18px, 3vw, 32px);
}

.today-hero h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.hero-copy p {
  max-width: 720px;
  color: #324341;
  font-size: 1.08rem;
  line-height: 1.58;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.state-card {
  display: grid;
  min-height: 82px;
  gap: 5px;
  align-content: start;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.state-card strong {
  font-size: 1.05rem;
}

.state-card span {
  color: #334341;
  font-size: 0.94rem;
  line-height: 1.3;
}

.state-card.green {
  background: var(--primary-soft);
}

.state-card.yellow {
  background: var(--amber-soft);
}

.state-card.red {
  background: var(--red-soft);
  color: #671915;
}

.support-strip {
  display: grid;
  gap: 10px;
}

.support-strip .danger-button,
.support-strip .primary-button,
.support-strip .secondary-button {
  width: 100%;
}

.compact-alert {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
  border: 1px solid #efaaa4;
  border-radius: var(--radius);
  padding: 12px;
  background: #fff7f4;
  box-shadow: none;
}

.compact-alert .eyebrow {
  margin-bottom: 4px;
}

.compact-alert h2 {
  margin-bottom: 4px;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
}

.compact-alert p {
  margin-bottom: 0;
  color: #4d3b39;
  font-size: 0.94rem;
  line-height: 1.42;
}

.compact-alert .muted {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.88rem;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.support-strip .support-actions > button {
  width: auto;
  min-height: 38px;
  padding: 8px 10px;
}

.secondary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 0;
  padding-bottom: 2px;
}

.hero-visual {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 280px;
  padding: 20px;
  background: #fbf8ef;
}

.curve-card {
  display: grid;
  gap: 10px;
}

.curve-svg {
  width: 100%;
  min-height: 210px;
}

.curve-key {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.curve-key span {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: #fff;
  font-size: 0.84rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.today-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.today-stack .panel {
  padding: 18px;
}

#checkin-panel,
#recommendations-panel {
  scroll-margin-top: 180px;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.legal-panel {
  padding: 20px;
}

.card {
  padding: 16px;
}

.card.flat {
  box-shadow: none;
}

.card.warning {
  border-color: #efc76b;
  background: var(--amber-soft);
}

.card.danger {
  border-color: #efaaa4;
  background: var(--red-soft);
}

.card.blue {
  background: var(--blue-soft);
}

.kpi {
  display: grid;
  gap: 4px;
  min-height: 92px;
  align-content: center;
}

.kpi span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 760;
}

.kpi strong {
  font-size: 2rem;
  line-height: 1;
}

.button-row,
.toolbar,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.secondary-button {
  border-color: #bdd0d8;
  background: var(--blue-soft);
  color: #1d4356;
}

.danger-button {
  background: var(--red);
  color: #fff;
}

.ghost-button,
.chip-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.chip-button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.full {
  width: 100%;
}

.delete-zone {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid #efaaa4;
  border-radius: var(--radius);
  padding: 14px;
  background: linear-gradient(180deg, #fff9f6, var(--red-soft));
}

.delete-zone p {
  margin: 5px 0 0;
  color: #7a3d37;
  font-size: 0.92rem;
}

.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
}

.notice.danger {
  border-color: #efaaa4;
  background: var(--red-soft);
  color: #6e1512;
}

.notice.warning {
  border-color: #efc76b;
  background: var(--amber-soft);
  color: #583600;
}

.notice.success {
  border-color: #acd5ba;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full-span {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  color: #223331;
  font-size: 0.92rem;
  font-weight: 780;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 94, 0.16);
}

input[type="range"] {
  accent-color: var(--primary);
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.range-value {
  display: grid;
  min-width: 48px;
  min-height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px;
  text-align: center;
  font-weight: 720;
}

.choice input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.skill-list,
.list {
  display: grid;
  gap: 10px;
}

.skill-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--paper);
}

.skill-card.warning-only {
  border-color: #efc76b;
  background: #fff8e8;
}

.skill-illustration {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid #ccdad4;
  border-radius: var(--radius);
  background: #eef6f2;
  overflow: hidden;
}

.skill-illustration svg {
  width: 58px;
  height: 58px;
}

.skill-body {
  display: grid;
  gap: 8px;
}

.skill-head {
  display: flex;
  gap: 8px;
  align-items: start;
  justify-content: space-between;
}

.skill-title {
  margin: 0;
  font-weight: 860;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  background: #eef2ef;
  color: #31403c;
  padding: 5px 9px;
  font-size: 0.8rem;
  font-weight: 780;
}

.badge.red {
  background: var(--red-soft);
  color: var(--red);
}

.badge.yellow {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.green {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.steps {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px;
}

.steps li::before {
  content: attr(data-step);
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.source-list {
  display: grid;
  gap: 8px;
}

.source-list a,
.external-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: var(--radius);
  background: #fff;
  padding: 7px 9px;
  text-decoration: none;
  font-weight: 760;
}

.phone-card {
  display: grid;
  gap: 10px;
}

.phone-card.urgent {
  border-color: #efaaa4;
  background: var(--red-soft);
}

.game-stage {
  display: grid;
  gap: 14px;
}

.breath-circle {
  display: grid;
  width: 190px;
  height: 190px;
  margin: 8px auto;
  place-items: center;
  border: 1px solid #86ad9f;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fffefa, #bad7ca 45%, #6f9b88);
  color: #173d31;
  font-weight: 900;
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.78); }
  42% { transform: scale(1); }
  58% { transform: scale(1); }
}

.sort-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sort-column {
  min-height: 156px;
  border: 1px dashed #b8b5aa;
  border-radius: var(--radius);
  padding: 12px;
  background: #faf7ee;
}

.canvas-wrap {
  display: grid;
  gap: 10px;
  align-items: start;
}

canvas {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7faf7;
}

.arcade-shell {
  display: grid;
  width: min(100%, 640px);
  gap: 10px;
}

.arcade-status {
  min-height: 38px;
  border: 1px solid #bdd0d8;
  border-radius: var(--radius);
  background: #eef6f8;
  color: #1d4356;
  padding: 9px 11px;
  font-size: 0.9rem;
  font-weight: 760;
}

.arcade-canvas {
  max-width: 640px;
  touch-action: none;
}

.arcade-controls {
  display: grid;
  width: min(100%, 640px);
  grid-template-columns: repeat(6, minmax(76px, 1fr));
  gap: 8px;
}

.arcade-button {
  min-width: 0;
  touch-action: none;
  user-select: none;
}

.data-box {
  width: 100%;
  min-height: 190px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre;
}

.data-transfer-panel {
  display: grid;
  gap: 10px;
}

.data-label {
  color: #223331;
  font-size: 0.92rem;
  font-weight: 780;
}

.data-help {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(220, 239, 231, 0.36);
}

.data-help strong {
  display: block;
  margin-bottom: 6px;
}

.data-help ol {
  margin: 0;
  padding-left: 1.15rem;
}

.data-help li + li {
  margin-top: 4px;
}

.export-actions {
  margin-top: 2px;
}

.import-area {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 82px;
  z-index: 40;
  max-width: min(420px, calc(100% - 36px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  padding: 11px 13px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top-button {
  position: fixed;
  right: 18px;
  left: auto;
  inset-inline-end: 18px;
  bottom: 18px;
  z-index: 38;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(47, 111, 94, 0.35);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 254, 250, 0.94);
  color: var(--primary-dark);
  box-shadow: 0 12px 32px rgba(34, 48, 42, 0.16);
  backdrop-filter: blur(12px);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.scroll-top-button:hover,
.scroll-top-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.print-card {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .hero,
  .section-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .curve-key {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero.support-first,
  .hero.today-hero {
    grid-template-columns: 1fr;
  }

  .compact-alert {
    grid-template-columns: 1fr;
  }

  .support-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(100% - 18px, 620px);
    padding-top: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand strong {
    display: block;
    font-size: 1rem;
    line-height: 1.08;
  }

  .brand-separator {
    display: inline;
    margin: 0 0.16rem;
  }

  .brand strong span:last-child {
    display: inline;
    margin-top: 0;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav a,
  .nav button {
    min-height: 70px;
    font-size: 0.62rem;
  }

  .nav-icon {
    width: 30px;
    height: 30px;
    font-size: 0.74rem;
  }

  .state-grid {
    grid-template-columns: 1fr;
  }

  .support-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .support-strip .support-actions > button {
    width: 100%;
  }

  .scroll-top-button {
    right: 12px;
    left: auto;
    inset-inline-end: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
  }

  .toast {
    right: 12px;
    bottom: 68px;
    max-width: calc(100% - 24px);
  }

  .panel,
  .legal-panel,
  .card,
  .hero-copy,
  .hero-visual {
    padding: 14px;
  }

  .form-grid,
  .skill-card {
    grid-template-columns: 1fr;
  }

  .skill-illustration {
    width: 100%;
    height: 82px;
  }

  .sort-board {
    grid-template-columns: 1fr;
  }

  .arcade-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .arcade-status {
    font-size: 0.84rem;
  }
}
