:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --ink: #1a1d1f;
  --muted: #646a6e;
  --line: #d8dcde;
  --soft: #f2f3f3;
  --soft-strong: #e8eaea;
  --accent: #315e72;
  --accent-soft: #e6eff2;
  --supports: #2d6b4a;
  --supports-soft: #e4f0e9;
  --presses: #9a463d;
  --presses-soft: #f6e8e6;
  --mixed: #776225;
  --mixed-soft: #f3eedc;
  --focus: #156fc3;
  --shadow: rgba(16, 22, 25, 0.2);
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #171a1c;
  --ink: #f0f1f2;
  --muted: #adb3b6;
  --line: #3b4144;
  --soft: #202426;
  --soft-strong: #292e31;
  --accent: #8cb7c8;
  --accent-soft: #20343d;
  --supports: #8bc7a5;
  --supports-soft: #20382b;
  --presses: #e0a09a;
  --presses-soft: #442725;
  --mixed: #d9c47d;
  --mixed-soft: #403a24;
  --focus: #79b8ff;
  --shadow: rgba(0, 0, 0, 0.46);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
}

body,
button {
  font-family: var(--font);
}

body {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app {
  width: min(700px, 100%);
  height: min(600px, 100vh);
  margin: 0 auto;
  padding: 12px 14px 10px;
  display: grid;
  grid-template-rows: 42px 43px minmax(0, 1fr) 26px;
  gap: 7px;
  overflow: hidden;
  background: var(--bg);
}

.app__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--ink);
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.info-button {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.info-button:hover {
  background: var(--soft);
}

.situations {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
}

.situations__label,
.eyebrow,
.measure__actor,
.tradeoff__label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.situation-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.situation-tab {
  min-width: 0;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.situation-tab:last-child {
  border-right: 0;
}

.situation-tab:hover {
  background: var(--soft);
}

.situation-tab[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 14px;
}

.choice-panel {
  min-height: 0;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.situation-copy {
  min-height: 104px;
  padding: 3px 0 11px;
  border-bottom: 1px solid var(--line);
}

.situation-copy h2,
.result-heading h2 {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 820;
  line-height: 1.1;
  letter-spacing: -0.018em;
}

.situation-copy > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.measures {
  min-width: 0;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

.measures legend {
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  font-size: 14px;
  font-weight: 800;
}

.measure-list {
  display: grid;
  gap: 6px;
}

.measure {
  width: 100%;
  min-height: 62px;
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 31px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.measure:hover {
  background: var(--soft);
}

.measure[data-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.measure__label {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}

.measure__arrow {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--muted);
  font-size: 18px;
  transform: translateY(-50%);
}

.measure[data-selected="true"] .measure__arrow {
  color: var(--accent);
}

.result-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) auto;
  gap: 6px;
}

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

.timeframe {
  margin-top: 2px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.goal-list {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.goal {
  min-height: 0;
  padding: 6px 7px 5px 9px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid;
}

.goal--supports {
  border-left-color: var(--supports);
}

.goal--presses {
  border-left-color: var(--presses);
}

.goal--mixed {
  border-left-color: var(--mixed);
}

.goal__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.goal h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.15;
}

.goal p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.22;
}

.verdict {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
}

.verdict i {
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.verdict--supports {
  color: var(--supports);
}

.verdict--presses {
  color: var(--presses);
}

.verdict--mixed {
  color: var(--mixed);
}

.tradeoff {
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.tradeoff__label {
  margin-bottom: 4px;
  color: var(--ink);
}

.tradeoff #tradeoff-text {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
}

.legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mark {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.mark--supports {
  background: var(--supports-soft);
  color: var(--supports);
}

.mark--presses {
  background: var(--presses-soft);
  color: var(--presses);
}

.mark--mixed {
  background: var(--mixed-soft);
  color: var(--mixed);
}

.info-dialog {
  width: min(440px, calc(100% - 40px));
  max-height: calc(100% - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 18px 48px var(--shadow);
}

.info-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.info-dialog__frame {
  margin: 0;
}

.info-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 13px 9px;
  border-bottom: 1px solid var(--line);
}

.info-dialog__header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 820;
  line-height: 1.15;
}

.info-dialog__close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.info-dialog__close:hover {
  background: var(--soft);
}

.info-dialog__body {
  padding: 11px 13px 13px;
  font-size: 13px;
  line-height: 1.42;
}

.info-dialog__body > p {
  margin: 0;
}

.info-dialog__body > p + p,
.sources {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.sources p {
  margin: 0 0 5px;
  font-weight: 700;
}

.sources ul {
  margin: 0;
  padding-left: 18px;
}

.sources li + li {
  margin-top: 3px;
}

.sources a {
  color: var(--accent);
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .goal,
  .tradeoff {
    animation: reveal 150ms ease-out both;
  }

  @keyframes reveal {
    from {
      opacity: 0.72;
      transform: translateY(2px);
    }
  }
}

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

  h1 {
    font-size: 23px;
  }

  .workspace {
    grid-template-columns: 218px minmax(0, 1fr);
    gap: 8px;
  }

  .choice-panel {
    padding-right: 8px;
  }

  .goal p {
    font-size: 10.5px;
  }
}
