:root {
  color-scheme: light;
  --ink: #17191f;
  --muted: #687078;
  --paper: #ffffff;
  --panel: #ffffff;
  --line: #ded8cf;
  --green: #7b2f3a;
  --green-dark: #54232b;
  --blue: #315f72;
  --gold: #b9852d;
  --rose: #8f4259;
  --violet: #5d34c7;
  --holo: linear-gradient(135deg, #842f3d 0%, #bc2389 46%, #5d34c7 100%);
  --holo-soft: linear-gradient(135deg, rgba(188, 35, 137, 0.08), rgba(93, 52, 199, 0.07), rgba(28, 175, 123, 0.07));
  --shadow: 0 16px 44px rgba(38, 29, 24, 0.10);
  --content-width: 760px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
textarea,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 14px;
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.workspace,
.results-shell,
.session-history {
  min-width: 0;
}

.topbar,
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #d7dbe0;
  border-radius: 8px;
  background: rgba(241, 243, 245, 0.88);
  color: #233f53;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 760;
}

.app-nav-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  justify-content: center;
  width: min(100%, 760px);
  margin: 0 auto 2px;
  min-height: 56px;
}

.app-nav-row .brand-lockup {
  justify-self: start;
}

.app-nav-row .topbar-actions {
  justify-self: end;
}

.app-tabbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: auto;
  margin: 0;
}

.app-tab {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 820;
  cursor: pointer;
}

.app-tab.active {
  border-color: transparent;
  background: var(--holo);
  color: white;
  box-shadow: 0 10px 24px rgba(123, 47, 58, 0.16);
}

.seo-intro {
  margin: 0 0 14px;
  padding: 0;
  color: var(--ink);
}

.seo-intro p {
  margin: 0;
  max-width: none;
  font-size: 1rem;
  line-height: 1.45;
  text-align: left;
}

.app-view-panel {
  width: 100%;
}

.workspace {
  max-width: var(--content-width);
  margin: 0 auto;
}

.results-shell {
  max-width: var(--content-width);
  margin: 0 auto;
}

.session-history {
  max-width: var(--content-width);
  margin: 0 auto;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-lockup img {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 8px 22px rgba(38, 29, 24, 0.10);
}

.brand-lockup img.brand-wordmark {
  width: clamp(154px, 18vw, 190px);
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
}

.topbar h1 {
  font-size: 1.45rem;
}

h2 {
  font-size: clamp(1.55rem, 2.7vw, 2.2rem);
}

h3 {
  font-size: 0.96rem;
  margin-bottom: 12px;
}

.cohort-chip,
.metric {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.topbar .cohort-chip {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.metric {
  display: grid;
  text-align: right;
}

.metric span {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 760;
}

.query-panel,
.results,
.empty-state {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    var(--holo-soft) border-box;
  border: 1px solid rgba(123, 47, 58, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.query-panel {
  padding: 18px;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-row.single-mode {
  grid-template-columns: 1fr;
}

.mode-button,
.primary-button,
.ghost-button,
.small-button,
.remove-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.mode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 690;
}

.mode-button.active {
  background: var(--holo);
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(123, 47, 58, 0.16);
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.78rem;
  line-height: 1;
}

.prompt-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 720;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

textarea.compact-prompt {
  min-height: 76px;
}

#promptInput {
  min-height: 104px;
}

textarea:focus,
.option-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.16);
}

.response-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.response-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 720;
}

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

.response-heading > div {
  display: grid;
  gap: 3px;
}

.response-heading span {
  color: var(--ink);
}

.response-heading small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 520;
}

.inline-alert {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #e4c27a;
  border-radius: 8px;
  background: #fff7df;
  color: #6b4a12;
  font-size: 0.84rem;
  line-height: 1.35;
}

.inline-alert.info {
  border-color: #b8d2de;
  background: #edf7fb;
  color: #214f63;
}

.prompt-guidance {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #b8d2de;
  border-radius: 8px;
  background: #edf7fb;
  color: #214f63;
  font-size: 0.86rem;
  line-height: 1.4;
}

.prompt-guidance strong {
  color: var(--ink);
}

.prompt-guidance p {
  margin: 0;
}

.guidance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guidance-actions .small-button {
  background: white;
}

.guidance-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 25, 31, 0.42);
}

.guidance-modal-card {
  display: grid;
  gap: 12px;
  width: min(100%, 560px);
  padding: 22px;
  border: 1px solid #b8d2de;
  border-radius: 8px;
  background: #fbfcf8;
  box-shadow: 0 24px 70px rgba(23, 25, 31, 0.24);
}

.guidance-modal-card h2 {
  font-size: clamp(1.55rem, 4vw, 2rem);
}

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

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

.guidance-modal-actions .small-button {
  min-height: 46px;
  background: white;
}

.guidance-modal-actions .small-button:first-child {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

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

.improve-card strong {
  color: var(--ink);
}

.improve-card p {
  margin: 0;
}

.improve-preview {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(49, 95, 114, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.improve-preview span {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.improve-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 760;
}

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

.add-option-button {
  width: fit-content;
  margin-top: 8px;
  margin-left: 86px;
}

.option-row {
  display: grid;
  grid-template-columns: 78px 1fr 32px;
  gap: 8px;
  align-items: center;
}

.option-row.has-result {
  align-items: start;
}

.option-list.long-options {
  gap: 12px;
}

.option-list.long-options .option-row {
  grid-template-columns: 78px 1fr 32px;
  align-items: start;
}

.option-list.long-options .option-label-cell {
  margin-top: 2px;
}

.option-label-cell {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.option-code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 34px;
  border: 1px solid rgba(93, 52, 199, 0.28);
  border-radius: 8px;
  background: rgba(93, 52, 199, 0.07);
  color: #47248f;
  font-size: 0.78rem;
  font-weight: 800;
}

.option-result-percent {
  color: var(--green-dark);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 860;
}

.option-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  outline: none;
}

.option-textarea {
  height: auto;
  min-height: 128px;
  padding: 10px;
  line-height: 1.42;
  resize: vertical;
}

.remove-option {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  cursor: pointer;
}

.privacy-note {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #f6fbf8;
}

.privacy-note strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.privacy-note span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.privacy-note a,
.faq-item a {
  color: var(--maroon);
  font-weight: 800;
  text-decoration: none;
}

.privacy-note a:hover,
.faq-item a:hover {
  text-decoration: underline;
}

@keyframes wotspoll-logo-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg) scale(1);
    box-shadow: 0 16px 34px rgba(23, 25, 31, 0.08);
  }
  50% {
    transform: translateY(-6px) rotate(1deg) scale(1.025);
    box-shadow: 0 22px 42px rgba(23, 25, 31, 0.12);
  }
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.ghost-button {
  padding: 0 16px;
  font-weight: 760;
}

.primary-button {
  flex: 1;
  background: var(--holo);
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(123, 47, 58, 0.16);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-button {
  flex: 0 0 auto;
  background: #ffffff;
  color: var(--green-dark);
}

.enterprise-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, var(--content-width));
  margin: 16px auto 0;
  padding: 14px;
  border: 1px solid rgba(123, 47, 58, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(38, 29, 24, 0.06);
}

.enterprise-callout h2 {
  margin: 2px 0 6px;
  font-size: 1rem;
  line-height: 1.2;
}

.enterprise-callout p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.enterprise-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--holo);
  color: white;
  border-color: transparent;
  font-weight: 780;
  text-decoration: none;
  white-space: nowrap;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.results-shell {
  display: flex;
  flex-direction: column;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: min(620px, calc(100vh - 190px));
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.empty-logo {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  animation: wotspoll-logo-float 3.4s ease-in-out infinite;
}

.empty-state p {
  max-width: 38ch;
  margin: 0;
}

.results {
  min-height: min(620px, calc(100vh - 190px));
  padding: 22px;
}

.winner-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 16px;
  border-radius: 8px;
  background: #eef6ef;
  border: 1px solid #cfe1d5;
}

.public-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #f6fbf8;
}

.public-summary h3 {
  margin: 0;
  font-size: 0.95rem;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid #cbd8d0;
  border-radius: 999px;
  background: #f4faf6;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 820;
}

.confidence-pill.close {
  border-color: #d7c7a4;
  background: #fff7e5;
  color: #5b4210;
}

.confidence-pill.slight {
  border-color: #cbd8d0;
  background: #f4faf6;
}

.confidence-pill.clear,
.confidence-pill.strong {
  border-color: #b8d3c4;
  background: #eef8f1;
}

.public-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.inline-result-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 14px;
  align-items: center;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #f6fbf8;
}

.inline-public-summary {
  display: grid;
  gap: 8px;
}

.inline-public-summary h3 {
  margin: 0;
  font-size: 0.95rem;
}

.inline-public-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.inline-result-chart {
  display: grid;
  place-items: center;
}

.inline-result-pie {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(23, 25, 31, 0.08);
}

.inline-result-pie > i {
  position: relative;
  z-index: 2;
  display: block;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(23, 25, 31, 0.10);
}

.inline-slice-label {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-weight: 840;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 1px 4px rgba(23, 25, 31, 0.48);
  pointer-events: none;
}

.inline-slice-label strong {
  color: inherit;
  font-size: 0.75rem;
}

.inline-slice-label em {
  font-size: 0.68rem;
  font-style: normal;
}

.session-save-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 18px;
}

.session-save-row .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
}

.session-save-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.session-history {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 248, 0.92);
  box-shadow: 0 14px 28px rgba(23, 25, 31, 0.08);
}

.session-history header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.session-history h3 {
  margin: 0;
  font-size: 0.98rem;
}

.session-history small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.session-history header span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
}

.session-history-tools {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: max-content;
}

.clear-results-button {
  padding: 7px 10px;
  min-height: 32px;
  font-size: 0.78rem;
}

.clear-results-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.session-history-list {
  display: grid;
  gap: 8px;
  max-height: min(560px, calc(100vh - 220px));
  overflow: auto;
}

.session-history-item {
  display: grid;
  gap: 4px;
  min-height: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.session-history-item.active,
.session-history-item:hover {
  border-color: #b8d3c4;
  background: #eef8f1;
}

.session-history-item strong,
.session-history-item span,
.session-history-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-history-item span,
.session-history-item small {
  color: var(--muted);
}

.session-history-item small {
  font-size: 0.78rem;
}

.session-history-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.84rem;
  line-height: 1.4;
}

.model-strip {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px;
  border: 1px solid #e7decf;
  border-radius: 8px;
  background: #fffaf0;
  color: #5d4930;
  font-size: 0.84rem;
  line-height: 1.35;
}

.model-strip strong {
  color: var(--ink);
}

.winner-strip strong {
  font-size: 1.15rem;
}

.winner-strip span {
  color: var(--green-dark);
  font-weight: 780;
}

.dev-panel {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dev-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dev-panel header span {
  padding: 6px 8px;
  border: 1px solid #e7decf;
  border-radius: 8px;
  color: var(--muted);
  background: #fffaf0;
  font-size: 0.76rem;
  font-weight: 760;
}

.dev-panel pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid #e7decf;
  border-radius: 8px;
  background: #14161b;
  color: #edf0ea;
  font-size: 0.76rem;
  line-height: 1.45;
}

.chart-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.result-pie-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 18px;
  border: 1px solid #d7e6dc;
  border-radius: 10px;
  background: #f8fcf9;
}

.result-pie {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(23, 25, 31, 0.08);
}

.result-pie-center {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(23, 25, 31, 0.12);
}

.result-pie-center strong {
  color: var(--green-dark);
  font-size: 1.35rem;
  font-weight: 860;
  line-height: 1;
}

.result-pie-center span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
}

.result-slice-label {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-weight: 820;
  line-height: 1.08;
  text-align: center;
  text-shadow: 0 1px 4px rgba(23, 25, 31, 0.45);
  pointer-events: none;
}

.result-slice-label strong {
  color: inherit;
  font-size: 0.88rem;
}

.result-slice-label em {
  font-size: 0.78rem;
  font-style: normal;
}

.result-legend {
  display: grid;
  gap: 10px;
}

.result-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 8px 0;
  border-bottom: 1px solid #e9efe9;
}

.result-legend-row:last-child {
  border-bottom: 0;
}

.result-legend-row.has-thumbnail {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.result-legend-row i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.result-legend-row i.result-thumb-swatch {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid #dce7de;
  border-radius: 8px;
  background: #f1f5ef;
  box-shadow: 0 2px 8px rgba(23, 25, 31, 0.08);
}

.result-legend-row i.result-thumb-swatch img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-legend-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 760;
}

.result-legend-row strong {
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr 64px;
  align-items: center;
  gap: 12px;
}

.bar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 720;
}

.bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 8px;
  background: #e8ece6;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--green);
}

.bar-value {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 1fr;
  gap: 18px;
  align-items: start;
}

.mini-table,
.trait-list {
  display: grid;
  gap: 8px;
}

.mini-row,
.trait-row {
  display: grid;
  grid-template-columns: minmax(74px, 120px) 1fr auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf0ea;
  font-size: 0.88rem;
}

.mini-row:last-child,
.trait-row:last-child {
  border-bottom: 0;
}

.mini-row span:first-child,
.trait-row span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.mini-row strong,
.trait-row strong {
  font-variant-numeric: tabular-nums;
}

.mini-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: #e8ece6;
}

.mini-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.trait-row:nth-child(2n) .mini-bar i {
  background: var(--gold);
}

.hidden {
  display: none !important;
}

.methodology-page {
  display: grid;
  align-content: start;
  gap: 24px;
  min-height: 100vh;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 36px 24px;
}

.methodology-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.methodology-header h1 {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
}

.methodology-copy {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(123, 47, 58, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    var(--holo-soft) border-box;
  box-shadow: var(--shadow);
}

.methodology-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
}

.methodology-disclaimer {
  margin-top: 6px;
  padding: 14px;
  border: 1px solid #d3b36d;
  border-radius: 8px;
  background: #fff7df;
}

.methodology-disclaimer p {
  color: #5c4314;
  font-size: 0.94rem;
}

.methodology-faq {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.methodology-faq h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.45rem;
  letter-spacing: 0;
}

.faq-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.faq-item h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.faq-item p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.privacy-policy {
  gap: 16px;
}

.policy-section {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.policy-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: 0;
}

@media (min-width: 641px) {
  .methodology-header .brand-lockup {
    flex: 1 1 auto;
  }

  .methodology-header h1 {
    max-width: 100%;
    white-space: nowrap;
    font-size: clamp(1.45rem, 3.7vw, 2.35rem);
  }
}

.guide-copy {
  gap: 16px;
}

.guide-page .methodology-header h1 {
  font-size: clamp(1.6rem, 2.7vw, 2.35rem);
}

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

.guide-steps article,
.guide-example {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.guide-steps article {
  display: flex;
  align-items: flex-start;
  align-content: start;
  gap: 10px;
  padding: 11px;
}

.guide-steps span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 820;
}

.guide-steps h2,
.guide-examples h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: 0;
}

.guide-steps p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.38;
}

.guide-examples {
  display: grid;
  gap: 10px;
  padding-top: 0;
}

.guide-example {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  overflow: hidden;
}

.guide-example > div {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.guide-example > div:first-child {
  border-right: 1px solid var(--line);
  background: #fff7df;
}

.guide-example h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.9rem;
}

.guide-example p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.validation-page {
  display: grid;
  align-content: start;
  gap: 20px;
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px;
}

.validation-intro,
.validation-runner,
.validation-results,
.validation-suite,
.benchmark-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.validation-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.validation-intro p,
.benchmark-card p,
.validation-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.validation-intro p {
  max-width: 70ch;
  margin-top: 8px;
}

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

.benchmark-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.benchmark-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.benchmark-card .chart-list {
  margin-bottom: 0;
}

.validation-runner,
.validation-results,
.validation-suite {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.validation-runner header,
.validation-suite header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.validation-suite header p {
  max-width: 72ch;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.suite-summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 680;
}

.reference-note {
  padding: 12px;
  border: 1px solid #e7decf;
  border-radius: 8px;
  background: #fffaf0;
  color: #5d4930;
  font-size: 0.88rem;
  line-height: 1.45;
}

.suite-table {
  display: grid;
  gap: 8px;
}

.suite-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(82px, 0.45fr) minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(90px, 0.55fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.story-suite-table .suite-row {
  grid-template-columns: minmax(180px, 1.05fr) minmax(82px, 0.36fr) minmax(210px, 1fr) minmax(190px, 0.9fr) minmax(100px, 0.5fr);
}

.suite-row strong,
.suite-row span {
  min-width: 0;
}

.suite-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suite-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.suite-pill {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.suite-row.pass .suite-pill {
  border-color: #b7d1c0;
  background: #eef8f1;
  color: #245d35;
}

.suite-row.warn .suite-pill {
  border-color: #d3b36d;
  background: #fff7df;
  color: #5c4314;
}

.suite-row.fail .suite-pill {
  border-color: #e1a3a3;
  background: #fff0f0;
  color: #7b2f3a;
}

.validation-runner select {
  min-height: 38px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fbfcf8;
  color: var(--ink);
  font: inherit;
  font-weight: 690;
}

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

.validation-option {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.validation-option input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fbfcf8;
  color: var(--ink);
  outline: none;
}

.validation-option input:focus,
.validation-runner select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(123, 47, 58, 0.14);
}

.validation-results .chart-list {
  margin-bottom: 0;
}

.validation-note {
  padding: 12px;
  border: 1px solid #d3b36d;
  border-radius: 8px;
  background: #fff7df;
  color: #5c4314;
}

@media (max-width: 980px) {
  .session-history-list {
    max-height: 280px;
  }

  .empty-state,
  .results {
    min-height: auto;
  }

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

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

@media (max-width: 560px) {
  .app-shell {
    padding: 14px;
  }

  .results-header,
  .methodology-header,
  .validation-intro,
  .validation-runner header,
  .validation-suite header,
  .winner-strip,
  .action-row,
  .enterprise-callout {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    justify-content: center;
  }

  .app-nav-row {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
  }

  .app-nav-row .topbar-actions {
    justify-self: center;
    justify-content: center;
  }

  .brand-lockup {
    align-items: center;
  }

  .brand-lockup img {
    width: 48px;
    height: 48px;
  }

  .brand-lockup img.brand-wordmark {
    width: min(48vw, 168px);
    height: auto;
  }

  .topbar-actions {
    justify-content: center;
    flex-wrap: nowrap;
  }

  .mode-row {
    grid-template-columns: 1fr;
  }

  .add-option-button {
    width: 100%;
    margin-left: 0;
  }

  .validation-options {
    grid-template-columns: 1fr;
  }

  .guide-steps,
  .guide-example {
    grid-template-columns: 1fr;
  }

  .guide-example > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .guidance-modal-actions {
    grid-template-columns: 1fr;
  }

  .inline-result-summary {
    grid-template-columns: 1fr;
  }

  .inline-result-chart {
    display: none;
  }

  .result-pie-card {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .result-pie {
    width: min(100%, 220px);
  }

  .result-legend {
    width: 100%;
  }

  .suite-row {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-value {
    text-align: left;
  }
}
