:root {
  color-scheme: light;
  --bg: oklch(0.975 0.008 252);
  --surface: oklch(1 0 0);
  --surface-subtle: oklch(0.965 0.012 252);
  --surface-selected: oklch(0.955 0.025 255);
  --ink: oklch(0.21 0.028 255);
  --muted: oklch(0.43 0.035 255);
  --line: oklch(0.88 0.018 252);
  --line-strong: oklch(0.77 0.055 255);
  --primary: oklch(0.54 0.18 255);
  --primary-dark: oklch(0.4 0.16 255);
  --accent: oklch(0.86 0.17 90);
  --accent-soft: oklch(0.96 0.06 90);
  --green: oklch(0.62 0.17 145);
  --red: oklch(0.57 0.2 30);
  --red-soft: oklch(0.96 0.035 30);
  --white: oklch(1 0 0);
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --focus: 0 0 0 3px oklch(0.86 0.17 90 / 0.58);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: fixed;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 40;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--white);
  transform: translateY(-150%);
  transition: transform 180ms ease-out;
}

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

.app-shell {
  width: min(74rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: var(--space-xl) 0 var(--space-2xl);
}

.brand-bar {
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.brand-logo-frame {
  width: 15.5rem;
  height: 3.75rem;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.brand-logo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.brand-meta {
  display: grid;
  gap: 0.15rem;
  text-align: right;
}

.brand-meta span {
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 750;
}

.brand-meta strong {
  color: var(--ink);
  font-size: 1rem;
}

.checklist-switcher {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.switcher-label {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

.checklist-tab {
  min-width: 0;
  min-height: 4.75rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition:
    background 180ms ease-out,
    border-color 180ms ease-out,
    color 180ms ease-out;
}

.checklist-tab:hover {
  background: var(--surface-subtle);
}

.checklist-tab.active {
  border-color: var(--primary);
  background: var(--surface-selected);
}

.tab-step {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.checklist-tab.active .tab-step {
  background: var(--primary);
  color: var(--white);
}

.tab-copy {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.tab-copy strong {
  font-size: 1rem;
  line-height: 1.25;
}

.tab-copy small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.tab-progress {
  min-width: 3.25rem;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.checklist-tab.active .tab-progress {
  background: var(--accent-soft);
  color: var(--ink);
}

.switcher-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 25rem;
  gap: var(--space-xl);
  align-items: stretch;
  margin-top: var(--space-md);
  padding: var(--space-xl);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.hero-copy {
  min-height: 18rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-row {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.brand-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
}

.brand-dot-blue {
  background: var(--primary);
}

.brand-dot-yellow {
  background: var(--accent);
}

.brand-dot-green {
  background: var(--green);
}

.brand-dot-red {
  background: var(--red);
}

.kicker,
.panel-label,
.dialog-label {
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.88rem;
  font-weight: 750;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 15ch;
  margin: var(--space-xs) 0 0;
  font-size: 3.5rem;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-text {
  max-width: 58ch;
  margin: var(--space-lg) 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.action-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
}

.save-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: flex-start;
}

.save-state {
  margin: var(--space-xs) 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.instructor {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-align: right;
}

.instructor-photo {
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border: 2px solid var(--white);
  border-radius: 50%;
  object-fit: cover;
}

.instructor div {
  display: grid;
  gap: 0.1rem;
}

.instructor span {
  color: var(--muted);
  font-size: 0.75rem;
}

.instructor strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-xs);
}

.summary-grid div {
  min-width: 0;
  padding: var(--space-md) var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.summary-grid span {
  display: block;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.summary-grid small {
  display: block;
  margin-top: var(--space-xs);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
}

.button {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 750;
  transition:
    background 160ms ease-out,
    border-color 160ms ease-out,
    color 160ms ease-out,
    transform 160ms ease-out;
}

.button:active {
  transform: translateY(1px);
}

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

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

.button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--primary-dark);
}

.button.secondary:hover,
.button.ghost:hover {
  background: var(--surface-selected);
}

.button.ghost {
  grid-column: 1 / -1;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.button.danger {
  background: var(--red);
  color: var(--white);
}

.button.danger:hover {
  background: oklch(0.49 0.19 30);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto;
  gap: var(--space-lg);
  align-items: end;
  margin-top: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.search-field {
  display: grid;
  gap: var(--space-xs);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.search-field input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0 var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--ink);
}

.search-field input::placeholder {
  color: oklch(0.5 0.035 255);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.filter-button {
  min-height: 2.65rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  transition:
    background 160ms ease-out,
    border-color 160ms ease-out,
    color 160ms ease-out;
}

.filter-button:hover {
  background: var(--surface-subtle);
}

.filter-button.active {
  border-color: oklch(0.8 0.12 90);
  background: var(--accent-soft);
  color: var(--ink);
}

.content-grid {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.guide-panel {
  position: sticky;
  top: var(--space-md);
  align-self: start;
  padding: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.guide-order {
  margin: 0 0 var(--space-lg);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
}

.guide-panel h2 {
  margin: 0 0 var(--space-xs);
  font-size: 1.15rem;
}

.guide-panel p,
.guide-panel li {
  color: var(--muted);
  line-height: 1.65;
}

.guide-panel ol {
  margin: var(--space-md) 0 0;
  padding-left: 1.4rem;
}

.checklist-list {
  display: grid;
  gap: var(--space-md);
}

.category {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.category-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}

.category-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.4;
}

.category-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.items {
  display: grid;
}

.checklist-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease-out;
}

.checklist-item:last-child {
  border-bottom: 0;
}

.checklist-item:hover {
  background: var(--surface-subtle);
}

.checklist-item.is-checked {
  background: var(--surface-selected);
}

.check-control {
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.2rem;
  accent-color: var(--primary);
}

.item-main {
  min-width: 0;
}

.item-heading {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
  cursor: pointer;
}

.item-number {
  min-width: 2.15rem;
  min-height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.item-keyword {
  color: var(--primary-dark);
  font-weight: 800;
}

.item-description {
  margin: var(--space-xs) 0 0;
  color: var(--ink);
  line-height: 1.6;
}

.empty-state {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-xl);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.empty-state span {
  color: var(--muted);
}

.confirm-dialog {
  width: min(30rem, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
}

.confirm-dialog::backdrop {
  background: oklch(0.16 0.025 255 / 0.58);
}

.dialog-content {
  display: grid;
  gap: var(--space-xl);
  padding: var(--space-xl);
}

.dialog-content h2 {
  margin: var(--space-xs) 0 0;
  font-size: 1.5rem;
}

.dialog-content p:last-child {
  margin: var(--space-sm) 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
}

.toast {
  position: fixed;
  right: var(--space-lg);
  bottom: var(--space-lg);
  z-index: 30;
  max-width: min(24rem, calc(100% - 2rem));
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition:
    opacity 180ms ease-out,
    transform 180ms ease-out;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 56rem) {
  .app-shell {
    width: min(45rem, calc(100% - 1.25rem));
    padding-top: var(--space-md);
  }

  .workspace,
  .toolbar,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    gap: var(--space-lg);
  }

  .hero-copy {
    min-height: auto;
    padding: var(--space-md) 0;
  }

  h1 {
    max-width: 18ch;
    font-size: 2.65rem;
  }

  .guide-panel {
    position: static;
  }

  .toolbar {
    align-items: stretch;
  }
}

@media (max-width: 38rem) {
  .app-shell {
    width: min(100% - 1rem, 34rem);
    padding-top: var(--space-xs);
  }

  .brand-bar {
    min-height: 4.6rem;
    padding: var(--space-xs) var(--space-sm);
  }

  .brand-logo-frame {
    width: min(56vw, 12.5rem);
    height: 3rem;
  }

  .brand-meta span {
    display: none;
  }

  .brand-meta strong {
    max-width: 8rem;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .checklist-switcher,
  .workspace,
  .toolbar,
  .guide-panel {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  .tab-list {
    grid-template-columns: 1fr;
  }

  .checklist-tab {
    min-height: 4.25rem;
  }

  .workspace {
    gap: var(--space-md);
  }

  .brand-row {
    margin-bottom: var(--space-md);
  }

  h1 {
    max-width: none;
    font-size: 2rem;
    line-height: 1.1;
  }

  .hero-text {
    margin-top: var(--space-md);
    font-size: 1rem;
  }

  .action-panel {
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  .save-header {
    display: grid;
  }

  .instructor {
    text-align: left;
  }

  .summary-grid div {
    padding: var(--space-sm) var(--space-xs);
  }

  .summary-grid span {
    font-size: 1.3rem;
  }

  .summary-grid small {
    font-size: 0.72rem;
  }

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

  .button.ghost {
    grid-column: auto;
  }

  .filter-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-button {
    padding-inline: var(--space-xs);
  }

  .category {
    border-radius: var(--radius-md);
  }

  .category-header {
    display: grid;
    gap: var(--space-xs);
    padding: var(--space-md);
  }

  .checklist-item {
    padding: var(--space-md);
  }

  .check-control {
    width: 1.6rem;
    height: 1.6rem;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toast {
    right: var(--space-xs);
    bottom: var(--space-xs);
    max-width: calc(100% - 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
