@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Italic-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Material Symbols Outlined";
  src: url("../fonts/MaterialSymbolsOutlined.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: block;
}

:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #172033;
  --muted: #64748b;
  --brand-primary-ink: #172033;
  --brand-secondary-ink: #4a1f8c;
  --line: #d7deea;
  --line-strong: #172033;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --given-bg: #f6f7ff;
  --given-ink: #1e1b4b;
  --assist-line: rgba(37, 99, 235, 0.2);
  --value-line: rgba(251, 191, 36, 0.22);
  --value-line-strong: rgba(146, 64, 14, 0.34);
  --value-match: var(--bad-ink);
  --good: #dcfce7;
  --good-ink: #166534;
  --warn: #fef3c7;
  --warn-ink: #92400e;
  --bad: #fee2e2;
  --bad-ink: #991b1b;
  --remove: #fecaca;
  --remove-border: #fca5a5;
  --remove-ink: #991b1b;
  --guess: #ddd6fe;
  --guess-ink: #4c1d95;
  --technique-focus: #f5f3ff;
  --technique-focus-border: rgba(124, 58, 237, 0.34);
  --technique-focus-ink: #4c1d95;
  --coloring-blue-bg: #dbeafe;
  --coloring-blue-ink: #1d4ed8;
  --coloring-blue-border: #93c5fd;
  --coloring-green-bg: #dcfce7;
  --coloring-green-ink: #166534;
  --coloring-green-border: #86efac;
  --badge-basic-bg: rgba(221, 235, 183, 0.96);
  --badge-basic-ink: #355332;
  --badge-basic-border: rgba(91, 111, 74, 0.36);
  --badge-limited-bg: rgba(205, 234, 241, 0.96);
  --badge-limited-ink: #1f4f5c;
  --badge-limited-border: rgba(31, 79, 92, 0.3);
  --badge-full-bg: rgba(224, 214, 255, 0.96);
  --badge-full-ink: #4c2d7f;
  --badge-full-border: rgba(76, 45, 127, 0.32);
  --nudge: var(--guess);
  --nudge-ink: var(--guess-ink);
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  background: radial-gradient(circle at top left, #dbeafe 0, transparent 34rem), var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-180%);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}


 .app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  width: 100%;
  margin: 0;
  padding: 9px max(14px, calc((100vw - 1320px) / 2 + 14px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(215, 222, 234, 0.86);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(18px);
}

.app-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  width: fit-content;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.app-brand-link img {
  flex: 0 0 auto;
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.app-brand-link .brand-text {
  display: grid;
  gap: 3px;
  min-width: 0;
  line-height: 1;
}

.app-brand-link .brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  letter-spacing: -0.052em;
  white-space: nowrap;
}

.app-brand-link .brand-word {
  display: inline-block;
  line-height: 0.9;
}

.app-brand-link .brand-word-primary,
.app-brand-link .brand-word-secondary {
  font-size: 1.50rem;
  font-weight: 800;
}

.app-brand-link .brand-word-primary {
  color: var(--brand-primary-ink);
}

.app-brand-link .brand-word-secondary {
  color: var(--brand-secondary-ink);
}

.app-brand-link .brand-word sup {
  position: relative;
  top: -0.22em;
  margin-left: 2px;
  color: var(--muted);
  font-size: 0.34em;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.app-brand-link small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.app-header-nav .button,
.app-header-nav label.button {
  min-height: 40px;
  padding: 9px 12px;
  white-space: nowrap;
}

.app-nav-button {
  border-color: rgba(215, 222, 234, 0.95);
  background: rgba(255, 255, 255, 0.92);
}

.app-tools-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: rgba(37, 99, 235, 0.28);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.11), rgba(124, 58, 237, 0.08));
  color: var(--accent-strong);
  font-weight: 800;
}

.app-tools-chevron {
  display: inline-block;
  width: 0.52em;
  height: 0.52em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.12em) rotate(45deg);
  transition: transform 160ms ease;
}

.app-tools-toggle[aria-expanded="true"] .app-tools-chevron {
  transform: translateY(0.10em) rotate(225deg);
}

.app-tools-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: max(14px, calc((100vw - 1320px) / 2 + 14px));
  z-index: 74;
  min-width: 250px;
  display: none;
  gap: 7px;
  border: 1px solid rgba(215, 222, 234, 0.95);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
}

.app-tools-menu.is-open {
  display: grid;
}

.app-tools-menu .button,
.app-tools-menu label.button {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.app-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  min-height: 44px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  padding: 9px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.hamburger-lines {
  display: grid;
  gap: 4px;
  width: 18px;
}

.hamburger-lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 12px;
  }

  .app-brand-link img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .app-brand-link .brand-word-primary,
  .app-brand-link .brand-word-secondary {
    font-size: clamp(1.12rem, 5.2vw, 1.42rem);
  }

  .app-brand-link small {
    font-size: clamp(0.56rem, 2.4vw, 0.68rem);
    letter-spacing: 0.10em;
  }

  .app-menu-toggle {
    display: inline-flex;
  }

  .app-header-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 10px;
    right: 10px;
    display: none;
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    border: 1px solid rgba(215, 222, 234, 0.95);
    border-radius: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.18);
  }

  .app-header.is-menu-open .app-header-nav {
    display: grid;
  }

  .app-tools-toggle {
    display: none;
  }

  .app-tools-menu {
    position: static;
    min-width: 0;
    display: grid;
    gap: 8px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .app-header-nav .button,
  .app-header-nav label.button {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    padding: 11px 12px;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .app-brand-link {
    gap: 8px;
  }

  .app-brand-link img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .app-brand-link .brand-word-primary,
  .app-brand-link .brand-word-secondary {
    font-size: clamp(0.98rem, 5.9vw, 1.20rem);
  }

  .app-brand-link small {
    font-size: 0.50rem;
    letter-spacing: 0.08em;
  }
}

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

.primary-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.94fr) minmax(420px, 1.06fr);
  gap: 18px;
  align-items: stretch;
}

.left-workspace,
.right-workspace {
  min-width: 0;
}

.left-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-content: start;
}

.right-workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  min-height: 100%;
}

.right-workspace > .nudge-panel {
  margin-block-start: -6px;
}

.support-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.card,
.board-panel,
.walkthrough-panel {
  min-width: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 222, 234, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.walkthrough-panel {
  min-height: 0;
  overflow: auto;
}

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

.panel-heading.compact {
  margin-bottom: 12px;
}

.status-heading {
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  gap: 12px;
}

.status-heading .api-status-mini {
  margin-left: auto;
}

.section-helper {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.board-heading,
.board-toolbar {
  align-items: center;
}

.board-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

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

h1,
h2 {
  font-size: clamp(1.12rem, 1.7vw, 1.45rem);
  letter-spacing: -0.03em;
}


.app-brand-title {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
}

.app-brand-title img {
  flex: 0 0 auto;
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.app-brand-title .brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  letter-spacing: -0.052em;
  white-space: nowrap;
}

.app-brand-title .brand-word {
  display: inline-block;
  line-height: 0.9;
}

.app-brand-title .brand-word-primary,
.app-brand-title .brand-word-secondary {
  font-size: 1.50rem;
  font-weight: 800;
}

.app-brand-title .brand-word-primary {
  color: var(--brand-primary-ink);
}

.app-brand-title .brand-word-secondary {
  color: var(--brand-secondary-ink);
}

.app-brand-title .brand-word sup {
  position: relative;
  top: -0.22em;
  margin-left: 2px;
  color: var(--muted);
  font-size: 0.34em;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.board-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
}

.board-meta #boardMode {
  margin-left: auto;
}

.board-status-pill,
.step-pill,
.pill-toggle,
.pill-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  min-height: 32px;
}

.pill-toggle,
.pill-action {
  border: 1px solid var(--line);
  appearance: none;
}

.pill-toggle.is-on {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--accent-strong);
}

.pill-toggle:focus-visible,
.pill-action:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.pill-action {
  background: transparent;
}

.pill-action:hover,
.pill-toggle:hover {
  border-color: var(--accent);
}

.walkthrough-header #walkthroughSummary {
  display: none;
}

.step-heading {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(124, 58, 237, 0.06));
}

.step-heading-label {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.step-heading-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}


.board-mobile-nav-row {
  display: none;
  width: 100%;
}

.mobile-walkthrough-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  min-height: 44px;
  white-space: nowrap;
}

.mobile-step-count {
  color: var(--ink);
  flex: 0 0 56px;
  min-width: 56px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 7px 6px;
  border-radius: 10px;
  background: transparent;
  border: 0;
}

.mobile-step-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 40px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--brand-deep);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 8px;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .mobile-step-button:hover:not(:disabled) {
    background: var(--surface-soft);
    color: var(--accent-strong);
  }
}

.mobile-step-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.mobile-step-button:active,
.mobile-step-button:focus:not(:focus-visible) {
  background: transparent;
  outline: 0;
}

.mobile-step-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.32);
  outline-offset: 1px;
}


/* Milestone 21D: keep the walkthrough under the board as its own white card. */
.board-walkthrough-panel {
  margin-top: 0;
}

.board-walkthrough-panel .step-detail {
  background: transparent;
}

@media (min-width: 1101px) {
  .primary-workspace {
    align-items: start;
  }

  .right-workspace {
    grid-template-rows: auto auto;
    align-content: start;
  }
}

/* Milestone 21F: regular-puzzle Nudge is its own right-column white card. */
.nudge-panel {
  border: 1px solid rgba(215, 222, 234, 0.95);
  background: rgba(255, 255, 255, 0.94);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.nudge-panel[hidden] {
  display: none;
}

.nudge-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.nudge-panel-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.nudge-panel-body {
  color: var(--muted);
  line-height: 1.48;
}

.nudge-panel-body p {
  margin: 0;
}

.nudge-panel-body p + p {
  margin-top: 8px;
}

.nudge-panel-body strong {
  color: var(--ink);
  font-weight: 700;
}

.nudge-panel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.nudge-panel-controls:has(.nudge-panel-meta[hidden]):has(.nudge-panel-actions[hidden]) {
  display: none;
}

.nudge-panel-meta {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 7px;
}

.nudge-panel-meta[hidden] {
  display: none;
}

.nudge-panel-meta span {
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 8px;
}

.nudge-panel-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 0;
}

.nudge-panel-actions[hidden] {
  display: none;
}

.nudge-panel.is-cta {
  border-color: rgba(37, 99, 235, 0.16);
  background: radial-gradient(circle at 12% 15%, rgba(37, 99, 235, 0.15), transparent 36%), radial-gradient(circle at 88% 10%, rgba(16, 185, 129, 0.13), transparent 35%), #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.nudge-panel.is-cta .nudge-panel-heading::after {
  content: '?';
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.18);
}

.nudge-panel.is-ok {
  border-color: rgba(34, 197, 94, 0.28);
}

.nudge-panel.is-bad {
  border-color: rgba(248, 113, 113, 0.55);
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.96));
}

/* Milestone 23G: coaching-style regular Nudge card. */
.nudge-panel.is-coach {
  border-color: rgba(124, 58, 237, 0.34);
  background: linear-gradient(135deg, rgba(245, 243, 255, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: inset 4px 0 0 rgba(124, 58, 237, 0.72), 0 14px 32px rgba(88, 28, 135, 0.08);
}

.nudge-panel.is-coach .nudge-panel-heading h2 {
  color: #4c1d95;
}

.nudge-panel.is-coach .nudge-panel-meta span {
  background: rgba(124, 58, 237, 0.12);
  color: #4c1d95;
}

.walkthrough-access-cta,
.status-access-cta {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 18px;
  background: radial-gradient(circle at 12% 15%, rgba(37, 99, 235, 0.13), transparent 36%), radial-gradient(circle at 88% 10%, rgba(16, 185, 129, 0.12), transparent 35%), #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  padding: 16px;
}

.walkthrough-access-cta[hidden],
.status-access-cta[hidden] {
  display: none;
}

.walkthrough-access-cta h3,
.status-access-cta h3 {
  margin: 10px 0 8px;
  font-size: 1.08rem;
}

.walkthrough-access-cta p,
.status-access-cta p {
  margin: 0 0 8px;
  color: var(--muted);
}


.walkthrough-access-cta-compact {
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.walkthrough-access-cta-compact h3 {
  margin: 6px 0 4px;
  font-size: 0.98rem;
}

.walkthrough-access-cta-compact p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.walkthrough-access-cta-compact .walkthrough-access-actions {
  margin-top: 8px;
}

.walkthrough-access-actions,
.status-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.board-walkthrough-panel.is-access-cta .walkthrough-header {
  margin-bottom: 12px;
}

.status-card.is-access-cta .status-heading {
  margin-bottom: 12px;
}


.app-section-panel h1:focus,
.app-section-panel h2:focus,
.app-section-panel h3:focus,
.manual-page-title-card h2:focus {
  outline: none;
}


.card-page-heading .manual-kicker,
.app-page-heading .manual-kicker,
.library-header .manual-kicker,
.manual-header .manual-kicker {
  display: none;
}
