:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #111217;
  --panel-2: #171922;
  --panel-3: #0d0e13;
  --text: #f7f7f8;
  --muted: #9b9daa;
  --dim: #6f7280;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #a855f7;
  --accent-2: #5eead4;
  --amber: #fbbf24;
  --danger: #fb7185;
  --green: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 30% -10%, rgba(168, 85, 247, 0.26), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(94, 234, 212, 0.12), transparent 28%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  color: var(--text);
}

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

button {
  color: inherit;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
}

.boot-card,
.login-screen,
.mobile-frame {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px;
}

.boot-card {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 0;
  background: transparent;
  opacity: 0;
  user-select: none;
  animation: bootFadeIn 180ms ease-out forwards;
}

.boot-card.is-ready {
  cursor: pointer;
  touch-action: manipulation;
}

.boot-card.is-leaving {
  pointer-events: none;
  animation: bootFadeOut 520ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.boot-inner {
  display: grid;
  place-items: center;
  gap: 18px;
}

.boot-logo-stage {
  width: min(58vw, 248px);
  height: min(58vw, 248px);
  display: grid;
  place-items: center;
  position: relative;
  animation: bootLogoGroupSettle 920ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.boot-card.is-leaving .boot-logo-stage {
  animation: bootLogoGroupLeave 520ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.boot-logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  opacity: 0;
  background:
    conic-gradient(from 0deg, transparent 0 22deg, rgba(94, 234, 212, 0.96) 48deg 90deg, transparent 118deg 178deg, rgba(255, 255, 255, 0.74) 210deg 246deg, transparent 284deg 360deg);
  filter: drop-shadow(0 0 24px rgba(94, 234, 212, 0.24));
  mask: radial-gradient(circle, transparent 58%, #000 59%, #000 66%, transparent 67%);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%, #000 66%, transparent 67%);
  animation: bootRingEnter 860ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.boot-logo {
  width: min(56vw, 238px);
  height: min(56vw, 238px);
  display: block;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 0 34px rgba(255, 255, 255, 0.16));
  transform: scale(0.94);
  animation: bootLogoEnter 720ms 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.boot-inner p {
  margin: 0;
  color: rgba(247, 247, 248, 0.78);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0;
}

.boot-inner .boot-welcome {
  color: rgba(247, 247, 248, 0.66);
  font-size: 12px;
  font-weight: 720;
}

.boot-welcome,
.boot-loading-copy {
  max-height: 24px;
  overflow: hidden;
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    max-height 420ms ease;
}

.boot-card.is-ready .boot-welcome,
.boot-card.is-ready .boot-loading-copy {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
}

.boot-inner .boot-start-prompt {
  max-height: 0;
  overflow: hidden;
  color: transparent;
  font-size: 30px;
  font-weight: 880;
  line-height: 1.05;
  background: linear-gradient(90deg, #ffffff 0%, #5eead4 34%, #a855f7 68%, #ffffff 100%);
  background-size: 240% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 460ms 150ms ease,
    transform 460ms 150ms ease,
    max-height 460ms 150ms ease;
}

.boot-card.is-ready .boot-start-prompt {
  max-height: 44px;
  opacity: 1;
  transform: translateY(0);
  animation:
    bootStartGradient 2.8s linear infinite,
    bootStartBlink 1.65s ease-in-out infinite;
}

.boot-content-enter {
  animation: contentFadeIn 260ms ease-out both;
}

@keyframes bootFadeIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bootFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes bootRingEnter {
  0% {
    opacity: 0;
    transform: rotate(-34deg) scale(0.9);
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(224deg) scale(1);
  }
}

@keyframes bootLogoEnter {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1.025);
  }
}

@keyframes bootLogoGroupSettle {
  from {
    transform: scale(0.985);
  }
  to {
    transform: scale(1);
  }
}

@keyframes bootLogoGroupLeave {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.72);
  }
}

@keyframes bootStartGradient {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 240% 50%;
  }
}

@keyframes bootStartBlink {
  0%,
  100% {
    opacity: 0.42;
    filter: drop-shadow(0 0 10px rgba(94, 234, 212, 0.16));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 22px rgba(168, 85, 247, 0.32));
  }
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-screen {
  display: grid;
  align-content: start;
  position: relative;
  overflow: hidden;
  gap: 18px;
  padding-top: max(16px, calc(env(safe-area-inset-top) + 10px));
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(168, 85, 247, 0.11) 1px, transparent 1px);
  background-size: 104px 104px;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 44%, rgba(56, 189, 248, 0.24) 44% 45%, transparent 45% 100%),
    linear-gradient(45deg, transparent 0 58%, rgba(168, 85, 247, 0.18) 58% 59%, transparent 59% 100%);
  opacity: 0.42;
}

.login-screen > * {
  position: relative;
  z-index: 1;
}

.login-card,
.hero-panel,
.section-block,
.route-panel,
.store-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  justify-self: center;
  width: min(100%, 378px);
  gap: 12px;
  padding: 16px;
}

.login-card h1,
.hero-panel h1,
.section-heading h2,
.panel-header h2,
.store-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.total-score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.total-score strong {
  color: var(--accent-2);
  font-size: 38px;
  line-height: 0.95;
}

.total-score span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 760;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-card .login-subtitle {
  color: var(--fg);
  font-size: 17px;
  font-weight: 650;
}

.login-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-hero {
  padding: 34px 0 8px;
}

.login-hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: 48px;
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.brand-row,
.header-line,
.meta-strip,
.panel-header,
.toggle-row,
.inline-actions,
.store-meta {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 9px;
  color: var(--text);
  font-weight: 750;
}

.brand-row.compact {
  font-size: 14px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  object-fit: cover;
  background: #050505;
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.12);
}

.brand-row.compact .logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.primary-action,
.secondary-action,
.test-entry-button,
.feature-button,
.icon-button,
.bottom-nav button,
.bottom-nav a,
.inline-actions button,
.choice-card,
.segmented button,
.role-switch button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  color: #fff;
  font-weight: 800;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent),
    var(--accent);
  border-color: rgba(255, 255, 255, 0.2);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 760;
}

.test-entry {
  justify-self: start;
  width: min(100%, 286px);
}

.test-entry-button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  background: rgba(255, 255, 255, 0.035);
}

.test-panel {
  display: grid;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    var(--panel-3);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.test-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.test-panel-header strong {
  font-size: 13px;
}

.test-panel .icon-button {
  width: 32px;
  height: 32px;
  font-size: 24px;
}

.test-gate {
  display: grid;
  gap: 10px;
}

.test-gate label {
  display: grid;
  gap: 7px;
}

.test-gate span {
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.dev-logins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.dev-logins span {
  grid-column: 1 / -1;
  color: var(--dim);
  font-size: 12px;
}

.dev-logins a {
  min-height: 34px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.035);
}

.app-header {
  display: grid;
  gap: 12px;
}

.header-line {
  justify-content: space-between;
  gap: 12px;
}

.language-select,
select,
input,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-3);
}

.language-select {
  width: auto;
  min-height: 34px;
  color: var(--muted);
}

textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
}

.hero-panel {
  padding: 18px;
}

.hero-panel h1 {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.14;
}

.kicker,
.muted,
.feature-button small,
.metric-grid span,
.store-meta,
.record-list span,
.mini-list span,
.score-bars span {
  color: var(--muted);
}

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  margin: 0;
  line-height: 1.55;
}

.meta-strip {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.meta-strip span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 700;
}

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

.feature-button {
  display: grid;
  align-content: space-between;
  min-height: 120px;
  padding: 13px;
  text-align: left;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--panel-2);
}

.feature-button span {
  font-weight: 800;
  line-height: 1.25;
}

.feature-button strong {
  display: block;
  margin-top: 12px;
  color: var(--accent-2);
  font-size: 24px;
  line-height: 1;
}

.feature-button small {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.feature-button.needs-action:not(.is-disabled) {
  border-color: rgba(251, 191, 36, 0.42);
  background:
    linear-gradient(160deg, rgba(251, 191, 36, 0.18), rgba(255, 255, 255, 0.025)),
    var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.06);
}

.feature-button.needs-action:not(.is-disabled) strong {
  color: #fbbf24;
}

.feature-button.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.section-block {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
}

.test-cta {
  border-color: rgba(94, 234, 212, 0.24);
}

.section-heading {
  display: grid;
  gap: 6px;
}

.identity-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.identity-list div {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.identity-list span {
  color: var(--muted);
  font-size: 12px;
}

.identity-footer {
  display: flex;
  justify-content: center;
  margin: 18px 0 8px;
}

.identity-footer button {
  min-height: 30px;
  padding: 4px 8px;
  border-color: transparent;
  color: rgba(247, 247, 248, 0.42);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.identity-footer button:active,
.identity-footer button:hover {
  color: rgba(247, 247, 248, 0.68);
  border-color: var(--line);
}

.identity-list code {
  min-width: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.metric-grid div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.metric-grid strong {
  display: block;
  color: var(--accent-2);
  font-size: 24px;
}

.metric-grid span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.mini-list,
.record-list,
.choice-list,
.score-bars {
  display: grid;
  gap: 8px;
}

.mini-list div,
.record-list div,
.score-bars div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.record-list .record-row {
  align-items: center;
}

.record-list .record-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.record-list .record-row b {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.record-list .record-row small {
  color: rgba(247, 247, 248, 0.66);
  font-size: 11px;
  font-weight: 650;
}

.record-list .tone-bonus {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.13);
}

.record-list .tone-deduction {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.14);
}

.record-delete-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(251, 113, 133, 0.42);
  border-radius: 8px;
  color: var(--danger);
  background: rgba(251, 113, 133, 0.08);
  font-size: 12px;
  font-weight: 760;
}

.compact-section {
  padding: 12px;
}

.catalog-section {
  margin-top: 12px;
  box-shadow: none;
}

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

.catalog-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.catalog-row strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.catalog-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.category-choice-card {
  justify-content: center;
  min-height: 68px;
  text-align: center;
}

.category-choice-card.tone-bonus {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.13);
}

.category-choice-card.tone-deduction {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.14);
}

.category-choice-card strong {
  width: 100%;
  text-align: center;
  font-size: 15px;
}

.behavior-item-card,
.behavior-entry .behavior-item-card {
  display: grid;
  gap: 10px;
  align-items: stretch;
  justify-content: stretch;
  text-align: initial;
}

.behavior-item-card.tone-bonus {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.14);
}

.behavior-item-card.tone-deduction {
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.15);
}

.behavior-item-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(74px, 0.8fr) minmax(74px, 0.8fr);
  align-items: center;
  gap: 8px;
}

.behavior-item-main strong {
  min-width: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.behavior-item-card span,
.behavior-entry .behavior-item-card span {
  flex: initial;
  max-width: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
  text-align: center;
}

.behavior-item-note {
  color: rgba(247, 247, 248, 0.72);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
}

.record-list strong,
.mini-list strong,
.score-bars strong {
  flex: 0 0 auto;
}

.store-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-top: 10px;
}

.store-meta {
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.inline-actions {
  gap: 8px;
}

.inline-actions button {
  flex: 1;
  min-height: 36px;
  color: var(--muted);
}

.bottom-nav {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 14, 19, 0.86);
  backdrop-filter: blur(18px);
}

.bottom-nav button,
.bottom-nav a {
  flex: 1;
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bottom-nav button {
  display: grid;
  place-items: center;
}

.bottom-nav a {
  display: grid;
  place-items: center;
}

.route-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: min(100%, 460px);
  margin: 0 auto;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
}

.panel-header {
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2 {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel-header .language-select {
  flex: 0 0 auto;
}

.icon-button {
  width: 42px;
  height: 42px;
  font-size: 30px;
  line-height: 1;
}

.stack {
  display: grid;
  gap: 13px;
}

.behavior-entry {
  align-content: start;
  gap: 16px;
  padding-top: min(18vh, 96px);
}

.behavior-entry .choice-list,
.behavior-entry .segmented,
.centered-options {
  text-align: center;
}

.behavior-entry .choice-card {
  justify-content: center;
  min-height: 72px;
  text-align: center;
}

.behavior-entry .choice-card span {
  flex: 0 0 auto;
}

.behavior-entry .behavior-item-card {
  justify-content: stretch;
  text-align: initial;
}

.behavior-entry .behavior-item-card span {
  flex: initial;
}

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

.behavior-direction-choice {
  position: relative;
  min-width: 0;
}

.behavior-direction-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.behavior-direction-button {
  min-height: 120px;
  color: var(--text);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    var(--panel-2);
}

.behavior-direction-button span {
  font-size: 16px;
}

.behavior-direction-button strong {
  color: rgba(247, 247, 248, 0.58);
  font-size: 30px;
}

.behavior-direction-choice input:checked + .behavior-direction-button.tone-bonus {
  border-color: rgba(52, 211, 153, 0.62);
  background:
    linear-gradient(160deg, rgba(52, 211, 153, 0.78), rgba(20, 83, 45, 0.88)),
    #14532d;
}

.behavior-direction-choice input:checked + .behavior-direction-button.tone-deduction {
  border-color: rgba(251, 113, 133, 0.66);
  background:
    linear-gradient(160deg, rgba(251, 113, 133, 0.78), rgba(127, 29, 29, 0.9)),
    #7f1d1d;
}

.behavior-direction-choice input:checked + .behavior-direction-button strong,
.behavior-direction-choice input:checked + .behavior-direction-button span {
  color: #fff;
}

.behavior-direction-choice:focus-within .behavior-direction-button {
  outline: 2px solid rgba(94, 234, 212, 0.32);
  outline-offset: 2px;
}

.full-width-action {
  width: 100%;
  margin-top: 4px;
}

.stack label,
.field-label,
.rating-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.rating-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.rating-row label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dimension-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.45;
}

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

.range-control {
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: center;
  gap: 10px;
}

.range-control strong {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 8px;
  color: var(--accent-2);
  background: rgba(94, 234, 212, 0.08);
  font-size: 18px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.toggle-row {
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.toggle-row input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

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

.check-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.check-list input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

.peer-release-form {
  gap: 10px;
}

.stack .peer-publish-toggle {
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 13px;
}

.peer-permission-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.peer-permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(66px, 74px) minmax(66px, 74px);
  align-items: stretch;
  min-height: 50px;
}

.peer-permission-row + .peer-permission-row {
  border-top: 1px solid var(--line);
}

.peer-permission-header {
  min-height: 38px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.peer-permission-header span,
.peer-person-name,
.stack .peer-permission-cell {
  display: grid;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
}

.peer-permission-header span:first-child {
  justify-content: start;
  text-align: left;
}

.peer-permission-header span:not(:first-child),
.stack .peer-permission-cell {
  border-left: 1px solid var(--line);
}

.peer-person-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.stack .peer-permission-cell {
  position: relative;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.peer-permission-cell input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.peer-check-visual {
  position: relative;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.peer-permission-cell input:checked + .peer-check-visual {
  border-color: rgba(94, 234, 212, 0.86);
  background: rgba(94, 234, 212, 0.2);
  box-shadow: inset 0 0 0 12px rgba(94, 234, 212, 0.12);
}

.peer-permission-cell input:checked + .peer-check-visual::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.peer-permission-cell:focus-within .peer-check-visual {
  outline: 2px solid rgba(94, 234, 212, 0.38);
  outline-offset: 2px;
}

.segmented,
.role-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.segmented button,
.role-switch button {
  min-height: 42px;
  color: var(--muted);
}

.segmented button.selected,
.role-switch button.selected {
  border-color: rgba(168, 85, 247, 0.55);
  color: #fff;
  background: rgba(168, 85, 247, 0.22);
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  text-align: left;
}

.choice-card strong {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.choice-card span {
  flex: 0 0 auto;
  max-width: 44%;
  text-align: right;
  white-space: normal;
  color: var(--accent-2);
  font-weight: 900;
}

.choice-card.status-card span {
  max-width: 42%;
  text-align: right;
  white-space: normal;
}

.choice-card.category-choice-card {
  justify-content: center;
  text-align: center;
}

.choice-card.category-choice-card strong {
  width: 100%;
  text-align: center;
}

.primary-action:disabled,
.secondary-action:disabled,
.choice-card:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.empty-state {
  padding: 20px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px);
}

.modal-card {
  width: min(100%, 360px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-card h2,
.modal-card p {
  margin: 0;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.55;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-actions .primary-action,
.modal-actions .secondary-action {
  width: 100%;
  min-height: 42px;
}

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

.confirm-detail-list div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.confirm-detail-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.confirm-detail-list strong {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (max-width: 360px) {
  .action-grid,
  .metric-grid,
  .segmented,
  .role-switch {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding-top: 26px;
  }

  .login-hero h1 {
    font-size: 40px;
  }

  .hero-panel h1 {
    font-size: 24px;
  }

  .peer-permission-row {
    grid-template-columns: minmax(0, 1fr) 58px 58px;
  }

  .peer-permission-header {
    font-size: 10px;
  }

  .peer-person-name {
    font-size: 13px;
  }

  .peer-check-visual {
    width: 22px;
    height: 22px;
  }
}

.filter-grid {
  display: grid;
  gap: 13px;
}

@media (min-width: 920px) {
  .app-shell,
  .route-panel {
    width: min(100%, 720px);
  }

  .mobile-frame,
  .login-screen {
    padding: 28px 40px 24px;
  }

  .route-panel {
    padding: 28px 40px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

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

  .hero-panel h1 {
    font-size: 32px;
  }

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

  .metric-grid {
    gap: 10px;
  }

  .modal-card {
    width: min(100%, 420px);
  }

  .bottom-nav {
    bottom: 16px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .feature-button:not(.is-disabled),
  .choice-card:not(:disabled),
  .primary-action,
  .secondary-action,
  .bottom-nav button,
  .bottom-nav a,
  .icon-button {
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
  }

  .feature-button:not(.is-disabled):hover,
  .choice-card:not(:disabled):hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
  }

  .primary-action:not(:disabled):hover {
    filter: brightness(1.08);
  }

  .secondary-action:not(:disabled):hover,
  .bottom-nav button:hover,
  .bottom-nav a:hover,
  .icon-button:hover {
    border-color: var(--line-strong);
    color: var(--text);
  }
}
