:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --ink: #1b2423;
  --muted: #63706b;
  --line: #d8ded5;
  --panel: #ffffff;
  --panel-alt: #eef5ef;
  --teal: #147c72;
  --teal-dark: #0c5d55;
  --red: #c14953;
  --danger: #c14953;
  --amber: #d68d21;
  --blue: #2d6cdf;
  --shadow: 0 18px 60px rgba(31, 48, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 124, 114, 0.12), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(214, 141, 33, 0.16), transparent 26%),
    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;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: min(1760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

body.auth-loading .app-shell,
body.auth-required .app-shell,
body.authenticated .auth-gate {
  display: none;
}

.auth-gate {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-hero {
  width: min(560px, 100%);
  border: 1px solid rgba(20, 124, 114, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 245, 239, 0.88)),
    var(--panel);
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-mark {
  width: 74px;
  height: 74px;
  margin-bottom: 18px;
  filter: drop-shadow(0 14px 28px rgba(20, 124, 114, 0.2));
}

.auth-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: 3.9rem;
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: 0;
}

.auth-tagline {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.auth-copy {
  margin: 12px 0 0;
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 700;
}

.auth-google-button {
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  font-size: 0.95rem;
}

.auth-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.4;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.topbar h1,
.section-head h2,
.block-head h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.55rem, 2.7vw, 2.45rem);
  line-height: 1;
}

.tagline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions,
.section-head,
.panel-footer,
.note-actions,
.field-strip,
.tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-saved-teams {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(216, 222, 213, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.top-saved-teams[hidden] {
  display: none;
}

.top-saved-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.top-saved-head h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.top-saved-picker {
  width: min(280px, 100%);
}

.top-saved-team-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.top-saved-team-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: min(360px, 86vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.top-saved-team-card.active {
  border-color: rgba(20, 124, 114, 0.5);
  box-shadow: 0 0 0 3px rgba(20, 124, 114, 0.08);
}

.saved-team-roster-button {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.saved-team-roster-button strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.app-tabs {
  display: flex;
  gap: 6px;
  width: min(420px, 100%);
  padding: 5px;
  margin: 0 0 16px;
  border: 1px solid rgba(216, 222, 213, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.app-tab {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.app-tab.active {
  background: var(--ink);
  color: white;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.teams-workspace,
.meta-workspace,
.battle-workspace,
.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(480px, 1.45fr) minmax(330px, 1fr);
  gap: 16px;
  align-items: start;
}

.teams-workspace {
  grid-template-columns: minmax(420px, 1.4fr) minmax(320px, 0.8fr);
}

.battle-workspace {
  grid-template-columns: minmax(520px, 1.35fr) minmax(330px, 0.8fr);
}

.meta-workspace {
  grid-template-columns: minmax(520px, 1.35fr) minmax(330px, 0.8fr);
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 222, 213, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 1.35rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(20, 124, 114, 0.25);
  border-radius: 999px;
  background: rgba(20, 124, 114, 0.08);
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-chip,
.user-chip,
.google-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.user-chip {
  gap: 8px;
}

.user-chip small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.user-chip small.sync-error {
  color: var(--danger);
}

.user-chip img,
.user-chip span,
.google-mark {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.user-chip img {
  object-fit: cover;
}

.user-chip span {
  background: rgba(20, 124, 114, 0.12);
  color: var(--teal-dark);
}

.google-button {
  gap: 8px;
}

.google-mark {
  background: #ffffff;
  color: #1a73e8;
  border: 1px solid rgba(99, 112, 107, 0.18);
  font-weight: 900;
}

.data-menu {
  position: relative;
}

.data-menu summary {
  list-style: none;
}

.data-menu summary::-webkit-details-marker {
  display: none;
}

.data-menu-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
}

.data-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(340px, 92vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.menu-title {
  margin: 2px 2px 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-menu-item {
  width: 100%;
  margin: 0 0 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(246, 247, 242, 0.74);
  color: var(--ink);
  text-align: left;
  display: grid;
  gap: 3px;
}

.data-menu-item:last-child {
  margin-bottom: 0;
}

.data-menu-item strong {
  font-size: 0.9rem;
}

.data-menu-item span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.danger-menu-item {
  border-color: rgba(193, 73, 83, 0.28);
  background: #fff5f4;
}

.danger-menu-item strong {
  color: #9b2734;
}

.primary-button.compact,
.ghost-button.compact,
.danger-button.compact {
  min-height: 34px;
  padding: 0 10px;
}

.primary-button,
.ghost-button,
.danger-button,
.voice-button,
.icon-button {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 13px;
  font-weight: 800;
}

.primary-button {
  background: var(--teal);
  color: white;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.ghost-button {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: #fff5f4;
  border-color: rgba(193, 73, 83, 0.35);
  color: #9b2734;
}

.voice-button {
  background: #233f72;
  color: white;
}

.voice-button.listening {
  background: #9b2734;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: var(--ink);
  color: white;
  font-size: 1.15rem;
  line-height: 1;
}

.icon-button.small {
  width: 32px;
  min-height: 32px;
  font-size: 1rem;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.team-list,
.team-rating,
.scan-results,
.ops-list,
.opponent-list,
.history-list,
.signal-list,
.insight-list {
  display: grid;
  gap: 10px;
}

.team-row,
.rating-row,
.opponent-row,
.history-row,
.signal-row,
.insight-row,
.rec-card,
.compact-block,
.notes-block,
.review-form,
.source-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.team-row,
.rating-row,
.opponent-row,
.history-row,
.signal-row,
.insight-row,
.rec-card {
  padding: 12px;
}

.team-row {
  display: grid;
  gap: 10px;
}

.team-name-field {
  margin-bottom: 12px;
}

.team-analysis-panel {
  grid-column: 2;
  grid-row: 1;
}

.team-rating {
  display: grid;
  gap: 12px;
}

.rating-hero {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid rgba(20, 124, 114, 0.22);
  background: rgba(20, 124, 114, 0.08);
  padding: 12px;
}

.rating-hero strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0;
}

.rating-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.rating-hero.strong {
  border-color: rgba(20, 124, 114, 0.34);
  background: rgba(20, 124, 114, 0.1);
}

.rating-hero.solid {
  border-color: rgba(214, 141, 33, 0.34);
  background: rgba(214, 141, 33, 0.1);
}

.rating-hero.needs-work {
  border-color: rgba(193, 73, 83, 0.28);
  background: #fff5f4;
}

.rating-section {
  display: grid;
  gap: 8px;
}

.rating-section h3 {
  margin: 0;
  font-size: 0.95rem;
}

.rating-row {
  display: grid;
  gap: 6px;
}

.rating-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.rating-row.plan {
  border-color: rgba(45, 108, 223, 0.22);
  background: rgba(45, 108, 223, 0.06);
}

.strategy-question-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.strategy-question-head {
  display: grid;
  gap: 2px;
}

.strategy-question-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.strategy-footer {
  justify-content: flex-end;
}

.strategy-answer {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(20, 124, 114, 0.18);
  border-radius: 8px;
  background: rgba(20, 124, 114, 0.08);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.5;
  padding: 12px;
}

.strategy-question-echo {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid rgba(20, 124, 114, 0.16);
  padding-bottom: 10px;
}

.strategy-question-echo span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strategy-question-echo p,
.strategy-answer-body p {
  margin: 0;
}

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

.strategy-answer-body ul,
.strategy-answer-body ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.strategy-answer[hidden] {
  display: none;
}

.strategy-answer.loading {
  color: var(--muted);
}

.strategy-answer.error {
  border-color: rgba(193, 73, 83, 0.28);
  background: #fff5f4;
  color: var(--danger);
}

.row-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-title input {
  min-width: 0;
  flex: 1;
}

.pokemon-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(20, 124, 114, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 52% 38%, rgba(255, 255, 255, 0.94), transparent 42%),
    rgba(20, 124, 114, 0.1);
}

.pokemon-icon img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.pokemon-icon.placeholder {
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

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

.saved-member-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(20, 124, 114, 0.16);
  border-radius: 8px;
  background: rgba(20, 124, 114, 0.06);
  color: var(--ink);
  padding: 3px 8px 3px 3px;
  font-size: 0.78rem;
  font-weight: 900;
}

.saved-member-chip .pokemon-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 7px;
}

.saved-member-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.move-grid {
  display: grid;
  gap: 7px;
}

.move-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 7px;
}

.move-row.locked {
  grid-template-columns: minmax(0, 1fr) 82px;
}

.move-type {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f7f5;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(20, 124, 114, 0.62);
  box-shadow: 0 0 0 3px rgba(20, 124, 114, 0.12);
}

.locked-select:disabled {
  opacity: 1;
  cursor: not-allowed;
  border-color: rgba(20, 124, 114, 0.28);
  background:
    linear-gradient(135deg, rgba(20, 124, 114, 0.1), rgba(214, 141, 33, 0.08)),
    var(--panel-alt);
  color: var(--ink);
  font-weight: 900;
}

.battle-panel {
  min-height: 680px;
}

.battle-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(238, 245, 239, 0.75);
  margin-bottom: 12px;
}

.scan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.28fr);
  gap: 10px;
  margin-bottom: 12px;
}

.source-toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.scan-status {
  border-radius: 8px;
  background: #f4f7f5;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 12px;
}

.scan-status.active {
  background: rgba(45, 108, 223, 0.1);
  color: #214b99;
}

.scan-status.error {
  background: #fff5f4;
  color: #9b2734;
}

.scan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  display: grid;
  gap: 7px;
}

.scan-card a {
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
}

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

.battle-prompt {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 16px;
  line-height: 1.4;
}

.battle-cue {
  margin-bottom: 12px;
  border: 1px solid rgba(45, 108, 223, 0.22);
  border-radius: 8px;
  background: rgba(45, 108, 223, 0.08);
  color: #214b99;
  padding: 11px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.battle-coach-panel {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(20, 124, 114, 0.22);
  border-radius: 8px;
  background: rgba(20, 124, 114, 0.07);
}

.battle-coach-output {
  display: grid;
  gap: 10px;
}

.coach-output-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(99, 238, 228, 0.28);
  border-radius: 8px;
  background: rgba(6, 14, 20, 0.56);
}

.coach-output-card.compact {
  gap: 9px;
}

.coach-output-card h3,
.coach-output-card p {
  margin: 0;
}

.coach-output-card h3 {
  font-size: 1.25rem;
  line-height: 1.15;
}

.coach-output-card p {
  color: var(--muted);
  line-height: 1.45;
}

.coach-output-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.battle-chip-row,
.coach-pick-grid,
.coach-rec-list {
  display: grid;
  gap: 8px;
}

.battle-chip-row {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.battle-chip,
.coach-pick {
  border: 1px solid rgba(99, 238, 228, 0.2);
  border-radius: 8px;
  background: rgba(99, 238, 228, 0.08);
  padding: 9px 10px;
  font-weight: 900;
}

.coach-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.coach-pick span {
  color: var(--green);
}

.coach-next-call,
.coach-rec {
  border-top: 1px solid rgba(99, 238, 228, 0.16);
  padding-top: 10px;
}

.coach-rec strong {
  display: block;
  margin-bottom: 4px;
}

.battle-step-head {
  display: grid;
  gap: 4px;
}

.battle-step-head h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.15;
}

.battle-step-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.4;
}

.battle-coach-panel textarea {
  min-height: 96px;
  resize: vertical;
}

.battle-coach-panel textarea.is-hidden,
.battle-lead-controls.is-hidden,
.battle-coach-actions .is-hidden {
  display: none;
}

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

.battle-lead-select {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 850;
}

.battle-coach-actions {
  justify-content: flex-end;
}

.battle-live.is-hidden,
.battle-prompt.is-hidden {
  display: none;
}

.field-strip {
  justify-content: stretch;
  padding: 10px;
  background: linear-gradient(90deg, rgba(20, 124, 114, 0.08), rgba(214, 141, 33, 0.09));
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
}

.field-strip label {
  min-width: 140px;
  flex: 1;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid rgba(20, 124, 114, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.check-row input {
  width: auto;
}

.battle-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  margin-bottom: 12px;
}

.compact-block,
.notes-block,
.review-form,
.source-form {
  padding: 12px;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.block-head h3 {
  font-size: 0.95rem;
}

.active-slots {
  display: grid;
  gap: 8px;
}

.lead-slots {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.active-slot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.opponent-row {
  display: grid;
  gap: 8px;
}

.opponent-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 100px 32px;
  gap: 7px;
}

.opponent-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.notes-block {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

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

.known-species > div:first-child {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.inline-tags {
  margin: 0;
}

.rule-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.mega-note {
  grid-column: 1 / -1;
  border: 1px solid rgba(214, 141, 33, 0.26);
  border-radius: 8px;
  background: rgba(214, 141, 33, 0.08);
  padding: 10px;
}

.mega-note strong {
  display: block;
  margin-bottom: 4px;
}

.mega-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.38;
}

.spread-block {
  display: grid;
  gap: 8px;
}

.spread-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.spread-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(20, 124, 114, 0.22);
  background: rgba(20, 124, 114, 0.08);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.spread-total.over {
  border-color: rgba(193, 73, 83, 0.35);
  background: #fff5f4;
  color: #9b2734;
}

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

.voice-status {
  min-height: 26px;
  border-radius: 7px;
  background: #f4f7f5;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.voice-status.active {
  background: rgba(45, 108, 223, 0.1);
  color: #214b99;
}

.voice-status.error {
  background: #fff5f4;
  color: #9b2734;
}

.note-actions {
  justify-content: flex-end;
}

.recommendations {
  display: grid;
  gap: 10px;
}

.selection-advice {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.meta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.meta-trends {
  display: grid;
  gap: 12px;
}

.meta-summary-card {
  border: 1px solid rgba(99, 238, 228, 0.28);
  border-radius: 8px;
  background: rgba(99, 238, 228, 0.07);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.meta-summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.journey-card {
  border: 1px solid rgba(20, 124, 114, 0.22);
  border-radius: 8px;
  background: rgba(20, 124, 114, 0.07);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.journey-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.journey-step {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  padding: 8px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
}

.journey-step.done {
  border-color: rgba(20, 124, 114, 0.28);
  background: rgba(20, 124, 114, 0.1);
  color: var(--teal-dark);
}

.journey-step.current {
  border-color: rgba(45, 108, 223, 0.3);
  background: rgba(45, 108, 223, 0.09);
  color: #214b99;
}

.selection-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 10px;
}

.bring-list,
.lead-list {
  display: grid;
  gap: 8px;
}

.selection-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
  display: grid;
  gap: 5px;
}

.selection-row strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.selection-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.opponent-read {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.read-card {
  border: 1px solid rgba(45, 108, 223, 0.22);
  border-radius: 8px;
  background: rgba(45, 108, 223, 0.06);
  padding: 12px;
  display: grid;
  gap: 11px;
}

.read-card.solid {
  border-color: rgba(214, 141, 33, 0.3);
  background: rgba(214, 141, 33, 0.08);
}

.read-card.strong {
  border-color: rgba(20, 124, 114, 0.32);
  background: rgba(20, 124, 114, 0.08);
}

.read-card.uncertain {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.read-card p,
.read-card ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.read-card ul {
  padding-left: 18px;
}

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

.read-head strong {
  display: block;
  font-size: 1.25rem;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 34px;
  border: 1px solid rgba(20, 124, 114, 0.22);
  border-radius: 999px;
  background: white;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

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

.read-grid h3 {
  margin: 0 0 6px;
  font-size: 0.88rem;
}

.read-counter {
  border-top: 1px solid rgba(99, 112, 107, 0.18);
  padding-top: 9px;
  display: grid;
  gap: 4px;
}

.rec-card {
  position: relative;
  overflow: hidden;
}

.rec-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--teal);
}

.rec-card.warning::before {
  background: var(--amber);
}

.rec-card.danger::before {
  background: var(--red);
}

.rec-card.info::before {
  background: var(--blue);
}

.rec-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-left: 10px;
}

.rec-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.odds-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 32px;
  border: 1px solid rgba(20, 124, 114, 0.24);
  border-radius: 999px;
  background: rgba(20, 124, 114, 0.1);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.rec-card p {
  margin: 0 0 0 10px;
  color: var(--muted);
  line-height: 1.45;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 0 10px;
}

.tag {
  border-radius: 999px;
  border: 1px solid rgba(20, 124, 114, 0.22);
  background: rgba(20, 124, 114, 0.08);
  color: var(--teal-dark);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.tabs {
  width: 100%;
  padding: 4px;
  background: #eef1eb;
  border-radius: 8px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(31, 48, 43, 0.08);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: grid;
  gap: 12px;
}

.review-form,
.source-form {
  display: grid;
  gap: 9px;
}

.history-row,
.signal-row,
.insight-row {
  display: grid;
  gap: 6px;
}

.row-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  line-height: 1.4;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 3px 8px;
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.panel-footer {
  justify-content: flex-end;
  margin-top: 12px;
}

.save-status {
  margin-top: 10px;
  border: 1px solid rgba(20, 124, 114, 0.24);
  border-radius: 8px;
  background: rgba(20, 124, 114, 0.08);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.4;
  padding: 10px 12px;
}

.save-status[hidden] {
  display: none;
}

.save-status.success {
  border-color: rgba(20, 124, 114, 0.32);
  background: rgba(20, 124, 114, 0.12);
}

.save-status.error {
  border-color: rgba(193, 73, 83, 0.28);
  background: #fff5f4;
  color: var(--danger);
}

@media (max-width: 1220px) {
  .workspace,
  .teams-workspace,
  .meta-workspace,
  .battle-workspace {
    grid-template-columns: 1fr 1fr;
  }

  .battle-panel {
    grid-column: 1 / -1;
    order: -1;
  }

  .team-analysis-panel {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 820px) {
  .auth-gate {
    align-items: stretch;
    min-height: 100svh;
    padding: 16px;
  }

  .auth-hero {
    align-self: center;
    padding: 24px;
  }

  .auth-hero h1 {
    font-size: 2.65rem;
  }

  .app-shell {
    width: min(100% - 20px, 760px);
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-saved-head {
    align-items: stretch;
  }

  .top-saved-picker {
    width: 100%;
  }

  .top-saved-team-card {
    grid-template-columns: minmax(0, 1fr);
    min-width: min(320px, 88vw);
  }

  .top-saved-team-actions button {
    flex: 1;
  }

  .workspace,
  .teams-workspace,
  .meta-workspace,
  .battle-workspace,
  .battle-grid,
  .battle-setup,
  .read-grid,
  .journey-steps,
  .selection-grid,
  .meta-trend-grid,
  .scan-grid,
  .source-toggles,
  .form-grid,
  .known-species,
  .opponent-details {
    grid-template-columns: 1fr;
  }

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

  .opponent-top .icon-button {
    width: 100%;
  }

  .move-row {
    grid-template-columns: minmax(0, 1fr) 108px;
  }

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

/* Mobile-first strategy console skin */
:root {
  color-scheme: dark;
  --bg: #0b141b;
  --ink: #eef8f7;
  --muted: #9db5b7;
  --line: rgba(113, 229, 222, 0.2);
  --panel: rgba(14, 31, 42, 0.88);
  --panel-alt: rgba(21, 46, 59, 0.82);
  --teal: #63eee4;
  --teal-dark: #3cc9c0;
  --red: #ff5f6d;
  --danger: #ff5f6d;
  --amber: #ff9f50;
  --blue: #7aa7ff;
  --violet: #a78bfa;
  --green: #7ee787;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

body {
  background:
    linear-gradient(90deg, transparent 0 24%, rgba(99, 238, 228, 0.09) 24.2%, transparent 24.6% 64%, rgba(99, 238, 228, 0.07) 64.2%, transparent 64.6%),
    linear-gradient(180deg, #142534 0%, #0b141b 54%, #091017 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(99, 238, 228, 0.14) 18% 18.2%, transparent 18.2% 100%),
    linear-gradient(90deg, transparent 0 72%, rgba(99, 238, 228, 0.12) 72% 72.2%, transparent 72.2% 100%),
    repeating-linear-gradient(0deg, transparent 0 86px, rgba(99, 238, 228, 0.055) 87px, transparent 89px);
  mask-image: linear-gradient(180deg, transparent 0%, black 14%, black 88%, transparent 100%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1420px, calc(100% - 28px));
  padding-top: 18px;
}

.auth-gate {
  background:
    radial-gradient(circle at 50% 24%, rgba(99, 238, 228, 0.15), transparent 28%),
    linear-gradient(90deg, transparent 0 21%, rgba(99, 238, 228, 0.1) 21.2%, transparent 21.5% 72%, rgba(122, 167, 255, 0.08) 72.2%, transparent 72.5%);
}

.auth-hero {
  border-color: rgba(113, 229, 222, 0.22);
  background:
    linear-gradient(180deg, rgba(17, 38, 50, 0.95), rgba(8, 17, 24, 0.94)),
    var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 42px rgba(99, 238, 228, 0.1);
}

.auth-mark {
  filter: drop-shadow(0 0 28px rgba(99, 238, 228, 0.28));
}

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

.topbar {
  padding: 12px;
  border: 1px solid rgba(113, 229, 222, 0.16);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.58);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 18px rgba(99, 238, 228, 0.22));
}

.topbar h1 {
  font-size: clamp(1.55rem, 2.8vw, 2.35rem);
  text-transform: uppercase;
}

.eyebrow {
  color: var(--teal);
}

.tagline {
  color: #d8e7e6;
}

.status-pill {
  border-color: rgba(126, 231, 135, 0.3);
  background: rgba(126, 231, 135, 0.1);
  color: var(--green);
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 14px rgba(255, 95, 109, 0.8);
}

.status-pill.rules-status.loaded::before {
  background: var(--green);
  box-shadow: 0 0 14px rgba(126, 231, 135, 0.8);
}

.status-pill.rules-status.empty::before {
  background: var(--gold);
  box-shadow: 0 0 14px rgba(214, 141, 33, 0.75);
}

.status-pill.rules-status.error::before {
  background: var(--red);
}

.auth-chip,
.user-chip,
.google-button {
  background: rgba(17, 35, 46, 0.84);
  border-color: rgba(113, 229, 222, 0.22);
  color: var(--ink);
}

.user-chip span {
  background: rgba(99, 238, 228, 0.13);
  color: var(--teal);
}

.google-mark {
  color: #1a73e8;
}

.data-menu-panel {
  border-color: rgba(113, 229, 222, 0.2);
  background: rgba(10, 22, 31, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

.data-menu-item {
  border-color: rgba(113, 229, 222, 0.16);
  background: rgba(17, 35, 46, 0.84);
  color: var(--ink);
}

.top-saved-teams {
  border-color: rgba(113, 229, 222, 0.16);
  background: rgba(9, 16, 23, 0.54);
  box-shadow: var(--shadow);
}

.top-saved-team-card {
  border-color: rgba(113, 229, 222, 0.16);
  background: rgba(13, 27, 37, 0.78);
}

.top-saved-team-card.active {
  border-color: rgba(99, 238, 228, 0.42);
  box-shadow: 0 0 0 3px rgba(99, 238, 228, 0.08);
}

.data-menu-item span,
.menu-title {
  color: var(--muted);
}

.danger-menu-item {
  border-color: rgba(255, 95, 109, 0.3);
  background: rgba(255, 95, 109, 0.12);
}

.danger-menu-item strong {
  color: #ffb3ba;
}

.app-tabs {
  width: min(460px, 100%);
  border-color: rgba(113, 229, 222, 0.18);
  background: rgba(10, 22, 31, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

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

.app-tab.active {
  background: linear-gradient(180deg, rgba(99, 238, 228, 0.22), rgba(99, 238, 228, 0.08));
  color: var(--teal);
  box-shadow: 0 0 24px rgba(99, 238, 228, 0.14);
}

.panel,
.team-row,
.rating-row,
.opponent-row,
.history-row,
.signal-row,
.insight-row,
.rec-card,
.compact-block,
.notes-block,
.review-form,
.source-form,
.scan-card,
.read-card,
.journey-card,
.selection-row,
.battle-setup,
.battle-prompt,
.field-strip,
.battle-cue,
.voice-status,
.empty-state {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.025), 0 18px 44px rgba(0, 0, 0, 0.18);
}

.panel {
  background: linear-gradient(180deg, rgba(17, 38, 50, 0.91), rgba(9, 17, 24, 0.88));
}

.team-row,
.rating-row,
.opponent-row,
.history-row,
.signal-row,
.insight-row,
.rec-card,
.selection-row {
  background: rgba(13, 27, 37, 0.78);
}

input,
select,
textarea {
  border-color: rgba(113, 229, 222, 0.18);
  background: rgba(5, 12, 18, 0.76);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(157, 181, 183, 0.72);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(99, 238, 228, 0.7);
  box-shadow: 0 0 0 3px rgba(99, 238, 228, 0.13), 0 0 22px rgba(99, 238, 228, 0.11);
}

.locked-select:disabled {
  border-color: rgba(99, 238, 228, 0.28);
  background:
    linear-gradient(135deg, rgba(99, 238, 228, 0.13), rgba(255, 159, 80, 0.09)),
    rgba(8, 17, 24, 0.82);
  color: var(--ink);
}

.mega-note {
  border-color: rgba(255, 159, 80, 0.26);
  background: rgba(255, 159, 80, 0.08);
}

.primary-button {
  background: linear-gradient(180deg, rgba(99, 238, 228, 0.92), rgba(60, 201, 192, 0.84));
  color: #061015;
}

.primary-button:hover {
  background: linear-gradient(180deg, #8af7ef, #4edbd2);
}

.ghost-button {
  background: rgba(17, 35, 46, 0.84);
  border-color: rgba(113, 229, 222, 0.22);
  color: var(--ink);
}

.danger-button {
  background: rgba(255, 95, 109, 0.12);
  border-color: rgba(255, 95, 109, 0.32);
  color: #ffb3ba;
}

.voice-button {
  background: linear-gradient(180deg, rgba(122, 167, 255, 0.8), rgba(85, 119, 202, 0.72));
  color: white;
}

.icon-button {
  background: rgba(99, 238, 228, 0.12);
  border-color: rgba(99, 238, 228, 0.3);
  color: var(--teal);
}

.pokemon-icon {
  border-color: rgba(113, 229, 222, 0.24);
  background:
    radial-gradient(circle at 52% 38%, rgba(210, 255, 252, 0.42), transparent 43%),
    rgba(99, 238, 228, 0.08);
  box-shadow: inset 0 0 20px rgba(99, 238, 228, 0.08);
}

.pokemon-icon.placeholder {
  color: var(--teal);
}

.saved-member-chip {
  border-color: rgba(113, 229, 222, 0.18);
  background: rgba(99, 238, 228, 0.07);
}

.battle-panel {
  min-height: 720px;
}

.decision-summary,
.roster-scout {
  margin-bottom: 12px;
}

.decision-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 14px;
  border: 1px solid rgba(99, 238, 228, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(99, 238, 228, 0.14), rgba(167, 139, 250, 0.08)),
    rgba(9, 18, 26, 0.92);
  box-shadow: 0 0 28px rgba(99, 238, 228, 0.12);
}

.decision-card h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
  line-height: 1.1;
}

.decision-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: #c3d6d6;
  line-height: 1.45;
}

.decision-odds {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 52px;
  border: 1px solid rgba(126, 231, 135, 0.34);
  border-radius: 8px;
  background: rgba(126, 231, 135, 0.12);
  color: var(--green);
  font-size: 1.05rem;
  font-weight: 900;
}

.decision-odds.muted {
  border-color: rgba(157, 181, 183, 0.22);
  background: rgba(157, 181, 183, 0.08);
  color: var(--muted);
}

.roster-scout {
  border: 1px solid rgba(255, 159, 80, 0.24);
  border-radius: 8px;
  background: rgba(255, 159, 80, 0.07);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.battle-setup,
.field-strip {
  background: linear-gradient(90deg, rgba(99, 238, 228, 0.08), rgba(255, 159, 80, 0.06));
}

.battle-cue,
.voice-status.active {
  background: rgba(122, 167, 255, 0.1);
  color: #c7d8ff;
}

.check-row {
  background: rgba(5, 12, 18, 0.58);
  border-color: rgba(113, 229, 222, 0.18);
  color: var(--ink);
}

.rating-hero,
.rating-hero.strong,
.rating-hero.solid,
.rating-hero.needs-work,
.battle-coach-panel,
.strategy-question-panel,
.read-card,
.read-card.strong,
.read-card.solid,
.read-card.uncertain {
  background: rgba(11, 25, 35, 0.82);
}

.strategy-answer {
  border-color: rgba(113, 229, 222, 0.16);
  background: rgba(99, 238, 228, 0.08);
  color: var(--ink);
}

.strategy-answer.error {
  border-color: rgba(255, 95, 109, 0.28);
  background: rgba(255, 95, 109, 0.1);
  color: #ffd0d6;
}

.save-status {
  border-color: rgba(113, 229, 222, 0.2);
  background: rgba(99, 238, 228, 0.08);
  color: var(--ink);
}

.save-status.success {
  border-color: rgba(126, 231, 135, 0.32);
  background: rgba(126, 231, 135, 0.1);
}

.save-status.error {
  border-color: rgba(255, 95, 109, 0.28);
  background: rgba(255, 95, 109, 0.1);
  color: #ffd0d6;
}

.strategy-question-echo {
  border-color: rgba(113, 229, 222, 0.16);
}

.rating-hero.strong,
.read-card.strong {
  border-color: rgba(126, 231, 135, 0.32);
}

.rating-hero.solid,
.read-card.solid {
  border-color: rgba(255, 159, 80, 0.32);
}

.rating-hero.needs-work {
  border-color: rgba(255, 95, 109, 0.28);
}

.journey-card {
  background: rgba(8, 17, 24, 0.82);
}

.journey-step {
  background: rgba(6, 14, 20, 0.82);
}

.journey-step.done {
  border-color: rgba(126, 231, 135, 0.3);
  background: rgba(126, 231, 135, 0.1);
  color: var(--green);
}

.journey-step.current {
  border-color: rgba(255, 159, 80, 0.36);
  background: rgba(255, 159, 80, 0.11);
  color: #ffd0a6;
}

.rec-card::before {
  background: var(--teal);
  box-shadow: 0 0 18px rgba(99, 238, 228, 0.48);
}

.rec-card.warning::before {
  background: var(--amber);
}

.rec-card.danger::before {
  background: var(--red);
}

.rec-card.info::before {
  background: var(--blue);
}

.odds-pill,
.confidence-pill {
  background: rgba(99, 238, 228, 0.1);
  border-color: rgba(99, 238, 228, 0.26);
  color: var(--teal);
}

.tag {
  border-color: rgba(99, 238, 228, 0.24);
  background: rgba(99, 238, 228, 0.09);
  color: var(--teal);
}

.type-pill {
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

.empty-state {
  color: var(--muted);
  border-style: solid;
  background: rgba(9, 18, 26, 0.52);
}

.tabs {
  background: rgba(5, 12, 18, 0.74);
}

.tab.active {
  background: rgba(99, 238, 228, 0.11);
  color: var(--teal);
}

.row-meta,
.rating-row p,
.selection-row p,
.read-card p,
.read-card ul,
.rec-card p,
.history-row p,
.signal-row p,
.insight-row p,
.scan-card p {
  color: var(--muted);
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 18px, 760px);
    padding-bottom: 86px;
  }

  .topbar {
    padding: 12px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions > * {
    flex: 1 1 auto;
  }

  .data-menu,
  .data-menu-trigger {
    width: 100%;
  }

  .data-menu-trigger {
    justify-content: center;
  }

  .data-menu-panel {
    left: 0;
    right: auto;
    width: min(340px, calc(100vw - 36px));
  }

  .app-tabs {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    width: auto;
    margin: 0 auto;
    backdrop-filter: blur(12px);
  }

  .journey-steps {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

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

  .decision-odds {
    width: max-content;
  }

  .selection-row strong {
    display: grid;
  }
}
