
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-b);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--pine-bright); text-decoration: none; }


h1, h2, h3, h4 {
  font-family: var(--font-d);
  font-weight: 640;
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 560; }
h1 em { font-style: italic; color: var(--pine-bright); }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.8em; }

.tiny { font-size: 0.74rem; color: var(--faint); }
.mono { font-family: var(--font-m); }
.eyebrow {
  font-family: var(--font-m);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mari);
  margin: 0 0 0.8rem;
  font-weight: 600;
}
.display {
  font-family: var(--font-d);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
}
.display em { font-family: var(--font-serif, var(--font-d)); font-style: italic; font-weight: 400; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.tick-list {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0;
  display: grid;
  gap: 0.5rem;
}
.tick-list li {
  padding-left: 1.6rem;
  position: relative;
  font-weight: 600;
}
.tick-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--mari);
}

.tr { font-weight: 700; }
.tr.up { color: var(--teal); }
.tr.flat { color: var(--ink-soft); }
.tr.down { color: var(--clay); }

[hidden] { display: none !important; }


.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-b);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--pine);
  border-color: var(--pine);
  color: #F6F3E6;
}
.btn-primary:hover { background: var(--pine-bright); border-color: var(--pine-bright); }

.btn-ghost { background: transparent; }
.btn-mari {
  background: var(--mari);
  border-color: var(--mari);
  color: #241A04;
}
.btn-danger {
  background: transparent;
  border-color: var(--clay);
  color: var(--clay);
}
.btn-lg { padding: 0.8rem 1.4rem; font-size: 1rem; border-radius: var(--r-md); }
.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.8rem; }

.link-btn {
  background: none;
  border: none;
  color: var(--pine-bright);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn.tiny { font-size: 0.72rem; color: var(--faint); }

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink);
  position: relative;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--sunken); }


input, select, textarea {
  font-family: var(--font-b);
  font-size: 16px; 
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.55rem 0.7rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus,
button:focus-visible, [tabindex]:focus-visible {
  outline: none;
  border-color: var(--pine-bright);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine-bright) 25%, transparent);
}

.field { display: block; margin-bottom: 0.9rem; }
.field > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.field .hint { font-size: 0.72rem; color: var(--faint); margin-top: 0.25rem; }

.form-row { display: grid; gap: 0.9rem; grid-template-columns: 1fr 1fr; }
.form-row-3 { display: grid; gap: 0.9rem; grid-template-columns: 1fr 1fr 1fr; }
.form-row-between { display: flex; justify-content: flex-end; margin: -0.3rem 0 0.8rem; }
.form-err { color: var(--clay); font-size: 0.85rem; min-height: 1.2em; margin: 0.6rem 0 0; font-weight: 700; }


.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 99px;
  padding: 0.18rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.lv { border: 1.5px solid currentColor; font-family: var(--font-m); font-size: 0.7rem; letter-spacing: 0.02em; }
.lv-outstanding { color: var(--gold); }
.lv-strong { color: var(--teal); }
.lv-developing { color: var(--blue); }
.lv-emerging { color: var(--plum); }
.lv-support { color: var(--clay); }

.lv-solid.lv-outstanding { background: var(--gold); color: #fff; border-color: var(--gold); }
.lv-solid.lv-strong { background: var(--teal); color: #fff; border-color: var(--teal); }
.lv-solid.lv-developing { background: var(--blue); color: #fff; border-color: var(--blue); }
.lv-solid.lv-emerging { background: var(--plum); color: #fff; border-color: var(--plum); }
.lv-solid.lv-support { background: var(--clay); color: #fff; border-color: var(--clay); }

.chip-ghost { border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface); }
.chip-mari { background: var(--mari-soft); color: var(--gold); }

.mode-pill {
  font-family: var(--font-m);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1.5px solid var(--mari);
  color: var(--mari);
  border-radius: 99px;
  padding: 0.25rem 0.7rem;
}


.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.card h3 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


.grid { display: grid; gap: 1rem; }
.kpi-band { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.two-col { grid-template-columns: 1.4fr 1fr; }
.three-col { grid-template-columns: repeat(3, 1fr); }

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--kc, var(--pine));
}
.kpi .k-num {
  font-family: var(--font-d);
  font-size: 2rem;
  font-weight: 640;
  line-height: 1.1;
}
.kpi .k-lab {
  font-family: var(--font-m);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.kpi .k-sub { font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.15rem; }


table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.tbl th {
  font-family: var(--font-m);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1.5px solid var(--line);
}
.tbl td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.tbl tbody tr { cursor: pointer; transition: background 0.12s; }
.tbl tbody tr:hover { background: var(--sunken); }
.tbl .num { font-family: var(--font-m); font-size: 0.8rem; }


.bar-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr 2.4rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}
.bar-track {
  height: 9px;
  background: var(--sunken);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--bf, var(--pine));
  width: 0;
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar-row .val { font-family: var(--font-m); font-size: 0.72rem; text-align: right; color: var(--ink-soft); }


.tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 2px solid var(--line-soft);
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.tabs button {
  background: none;
  border: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tabs button.active {
  color: var(--pine-bright);
  border-bottom-color: var(--mari);
}


.spectrum {
  display: flex;
  height: 38px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.spectrum div {
  transition: flex-grow 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-width: 0;
}
.spectrum-legend {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.9rem;
}
.sl-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.83rem;
}
.sl-row .dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
}
.sl-row .n { margin-left: auto; font-family: var(--font-m); font-size: 0.78rem; }


.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 210px; }


.modal-veil {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 20, 0.55);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  animation: dropIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide { width: min(900px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 1.3rem; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.3rem;
  border-top: 1px solid var(--line-soft);
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

.toast-root {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 200;
  display: grid;
  gap: 0.5rem;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-md);
  font-size: 0.87rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.2, 1.2, 0.3, 1);
  display: flex;
  gap: 0.55rem;
  align-items: center;
  max-width: 340px;
}
.toast.ok { border-left: 4px solid var(--teal); }
.toast.warn { border-left: 4px solid var(--mari); }
.toast.err { border-left: 4px solid var(--clay); }


.empty { text-align: center; padding: 2.5rem 1rem; color: var(--faint); }
.empty .big { font-size: 2.2rem; display: block; margin-bottom: 0.4rem; }


.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--line-soft);
}
.rate-row .rr-lab { font-size: 0.86rem; font-weight: 700; }
.rate-row .rr-lab small { display: block; font-weight: 400; color: var(--faint); font-size: 0.72rem; }

.seg { display: flex; gap: 0.3rem; }
.seg button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: var(--font-m);
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.12s;
}
.seg button:hover { border-color: var(--pine-bright); transform: translateY(-1px); }
.seg button.on { background: var(--pine); border-color: var(--pine); color: #fff; }

.stars { display: flex; gap: 0.2rem; }
.stars button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--line);
  transition: color 0.12s, transform 0.12s;
  padding: 0 0.1rem;
}
.stars button.on { color: var(--mari); }
.stars button:hover { transform: scale(1.2); }

.pick-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pick-chips button {
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.12s;
}
.pick-chips button.on { border-color: var(--pine); background: var(--pine); color: #fff; }

.switch-row { display: flex; gap: 0.5rem; }
.switch-row button {
  flex: 1;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 0.5rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-soft);
}
.switch-row button.on {
  border-color: var(--pine);
  background: color-mix(in srgb, var(--pine) 12%, var(--surface));
  color: var(--pine-bright);
}


.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

.skel {
  border-radius: var(--r-md);
  background: linear-gradient(100deg, var(--sunken) 40%, var(--line-soft) 50%, var(--sunken) 60%);
  background-size: 200% 100%;
  animation: skel 1.2s infinite linear;
  height: 1rem;
  margin: 0.4rem 0;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: none; }
}
@keyframes skel {
  to { background-position: -200% 0; }
}


.stamp-grid { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.stamp {
  width: 138px;
  border: 2.5px solid var(--st, var(--pine));
  color: var(--st, var(--pine));
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  font-family: var(--font-m);
  font-size: 0.62rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--surface);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: default;
  animation: stampIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) backwards;
}
.stamp:hover {
  transform: rotate(0) translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}
.stamp b { display: block; font-size: 0.7rem; letter-spacing: 0.06em; }
.stamp .s-score {
  display: inline-block;
  margin-top: 0.3rem;
  border: 1.5px solid currentColor;
  border-radius: 99px;
  padding: 0.05rem 0.5rem;
  font-weight: 600;
}
@keyframes stampIn {
  0% { opacity: 0; transform: scale(1.7) rotate(8deg); }
  70% { opacity: 1; transform: scale(0.95) rotate(var(--rot, -2deg)); }
  100% { transform: scale(1) rotate(var(--rot, -2deg)); }
}


@media (max-width: 900px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  min-height: 40px;
}
.icon-btn {
  min-width: 44px;
  min-height: 44px;
  font-size: 1.2rem;
}
.user-chip {
  min-height: 40px;
  padding: 0.3rem 0.8rem 0.3rem 0.35rem;
}
.tabs button {
  min-height: 44px;
  padding: 0.4rem 0.7rem;
}