@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600&family=Space+Grotesk:wght@400;600&display=swap");

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  --bg: #f3efe6;
  --ink: #1f1c18;
  --muted: #6b6258;
  --accent: #e07a2f;
  --accent-ink: #2a1100;
  --paper: #fffaf2;
  --line: #e1d8cc;
  --shadow: 0 10px 30px rgba(32, 24, 16, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(224, 122, 47, 0.18), transparent 35%),
    radial-gradient(circle at 90% 0%, rgba(20, 70, 90, 0.12), transparent 40%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 24px;
  padding: 32px;
}

.nav {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 24px;
  height: fit-content;
}

.nav-title {
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
  margin: 0 0 14px 0;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  transform: translateX(4px);
  border-color: var(--line);
  background: #fff5e6;
}

.nav-link[aria-current="true"] {
  font-weight: 600;
  background: rgba(224, 122, 47, 0.12);
  border-color: rgba(224, 122, 47, 0.4);
}

.example {
  background: var(--paper);
  border-radius: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 60vh;
}

.example h1 {
  font-family: "Fraunces", serif;
  margin-top: 0;
}

.example-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  background: #fff;
  display: grid;
  gap: 18px;
}

.tabs {
  display: grid;
  gap: 16px;
}

.tablist {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tab[aria-selected="true"] {
  background: rgba(224, 122, 47, 0.18);
  border-color: rgba(224, 122, 47, 0.6);
}

.panel {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

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

.todo-subtitle {
  margin: 6px 0 0 0;
  color: var(--muted);
}

.todo-stats {
  text-align: right;
  display: grid;
  gap: 4px;
}

.todo-count strong {
  font-size: 1.4rem;
  color: var(--accent);
}

.todo-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.todo-input {
  flex: 1 1 220px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 1rem;
  background: #fff;
}

.todo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.todo-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.chip[aria-pressed="true"] {
  background: rgba(224, 122, 47, 0.18);
  border-color: rgba(224, 122, 47, 0.6);
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.todo-item.done .todo-title {
  text-decoration: line-through;
  color: var(--muted);
}

.todo-empty {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

.todo-check,
.todo-delete {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}

.todo-check {
  background: rgba(17, 92, 58, 0.15);
  color: #115c3a;
}

.todo-delete {
  background: rgba(164, 39, 53, 0.12);
  color: #a42735;
}


.meter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(224, 122, 47, 0.08);
}

.meter strong {
  font-size: 2rem;
  color: var(--accent);
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 14px rgba(24, 18, 12, 0.18);
}

.btn.secondary {
  background: #efe6d9;
  color: var(--ink);
}

.btn:hover {
  transform: translateY(-1px);
}

.toggle {
  background: var(--accent);
  color: var(--accent-ink);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 92, 58, 0.12);
  color: #115c3a;
  font-weight: 600;
}

.placeholder {
  color: var(--muted);
  font-style: italic;
}

.kanban {
  gap: 20px;
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.kanban-subtitle {
  margin: 6px 0 0 0;
  color: var(--muted);
}

.kanban-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.summary-block {
  background: rgba(224, 122, 47, 0.12);
  border: 1px solid rgba(224, 122, 47, 0.35);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 120px;
}

.summary-block strong {
  display: block;
  font-size: 1.4rem;
  color: var(--accent);
}

.summary-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.kanban-form {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
}

.kanban-input,
.kanban-select {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 1rem;
  background: #fff;
}

.kanban-board {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kanban-column {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fff8ef;
  display: grid;
  gap: 12px;
}

.kanban-column.is-drop {
  border-color: rgba(17, 92, 58, 0.5);
  box-shadow: 0 0 0 2px rgba(17, 92, 58, 0.12);
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban-column h2 {
  margin: 0;
  font-size: 1.05rem;
}

.kanban-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(28, 20, 12, 0.08);
}

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

.card-title {
  font-weight: 600;
}

.priority {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(17, 92, 58, 0.12);
  color: #115c3a;
}

.kanban-card[data-priority="high"] .priority {
  background: rgba(164, 39, 53, 0.12);
  color: #a42735;
}

.kanban-card[data-priority="medium"] .priority {
  background: rgba(224, 122, 47, 0.18);
  color: var(--accent-ink);
}

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

.pill {
  background: rgba(17, 92, 58, 0.12);
  color: #115c3a;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  font-size: 0.85rem;
}

.ghost {
  background: transparent;
  border: 1px dashed rgba(164, 39, 53, 0.35);
  color: #a42735;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .nav {
    position: static;
  }

  .kanban-form {
    grid-template-columns: 1fr;
  }
}

.nav-group-title {
  margin: 18px 10px 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cookbook-example {
  gap: 22px;
}

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

.cookbook-heading h1,
.cookbook-heading h2 {
  margin: 4px 0 0;
}

.cookbook-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cookbook-lede {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
}

.cookbook-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(17, 92, 58, 0.2);
  border-radius: 999px;
  background: rgba(17, 92, 58, 0.1);
  color: #115c3a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cookbook-stage {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf4;
}

.cookbook-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cookbook-status,
.cookbook-inline-status {
  margin: 0;
  color: var(--muted);
}

.cookbook-status strong,
.cookbook-inline-status {
  color: #115c3a;
}

.cookbook-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.cookbook-note code,
.cookbook-lede code,
.cookbook-request-panel code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(224, 122, 47, 0.11);
  color: var(--accent-ink);
  font-size: 0.9em;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

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

.cookbook-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 28, 24, 0.48);
}

.cookbook-dialog {
  width: min(100%, 520px);
  padding: 22px;
  border: 1px solid rgba(31, 28, 24, 0.14);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(31, 28, 24, 0.3);
}

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

.cookbook-dialog-heading h2 {
  margin: 4px 0 0;
}

.cookbook-form {
  display: grid;
  gap: 16px;
}

.cookbook-form-narrow {
  width: min(100%, 560px);
}

.cookbook-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 600;
}

.cookbook-field > span:first-child {
  font-size: 0.9rem;
}

.cookbook-field em {
  color: var(--muted);
  font-size: 0.84em;
  font-weight: 400;
}

.cookbook-field input,
.cookbook-field textarea,
.cookbook-field select,
.cookbook-input,
.cookbook-search input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.cookbook-field textarea {
  resize: vertical;
}

.cookbook-field input:focus,
.cookbook-field textarea:focus,
.cookbook-field select:focus,
.cookbook-input:focus,
.cookbook-search input:focus,
.cookbook-tooltip-trigger:focus,
.cookbook-dropdown-toggle:focus,
.cookbook-dropdown-option:focus,
.icon-button:focus {
  outline: 3px solid rgba(224, 122, 47, 0.28);
  outline-offset: 2px;
  border-color: var(--accent);
}

.field-error {
  min-height: 1.25em;
  color: #a42735;
  font-weight: 500;
}

.cookbook-field input.is-invalid {
  border-color: #a42735;
  box-shadow: 0 0 0 3px rgba(164, 39, 53, 0.1);
}

.cookbook-inline-form {
  align-items: end;
}

.cookbook-inline-form .cookbook-input {
  flex: 1 1 260px;
  width: auto;
}

.cookbook-tooltip-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 28px 0 58px;
}

.cookbook-tooltip {
  position: relative;
}

.cookbook-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.tooltip-symbol {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(224, 122, 47, 0.18);
  color: var(--accent-ink);
  font-size: 0.8rem;
}

.cookbook-tooltip-content {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 5;
  width: max-content;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.4;
}

.cookbook-tooltip-content::before {
  position: absolute;
  top: -5px;
  left: 18px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  content: "";
  transform: rotate(45deg);
}

.cookbook-tooltip-content kbd {
  padding: 1px 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 0.85em;
}

.cookbook-dropdown {
  position: relative;
  width: min(100%, 300px);
}

.cookbook-dropdown-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.cookbook-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 5;
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.cookbook-dropdown-option {
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.cookbook-dropdown-option:hover,
.cookbook-dropdown-option[aria-selected="true"] {
  background: rgba(224, 122, 47, 0.12);
}

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

.cookbook-request-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf4;
}

.cookbook-request-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.cookbook-request-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.cookbook-fragment-target {
  min-height: 76px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fff;
}

.cookbook-state-loading {
  color: var(--accent) !important;
}

.cookbook-state-error {
  color: #a42735 !important;
}

.cookbook-state-success {
  color: #115c3a !important;
}

.cookbook-lifecycle-target {
  min-height: 88px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
}

.cookbook-lifecycle-card,
.cookbook-template-card {
  display: grid;
  gap: 7px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(17, 92, 58, 0.09);
  color: #115c3a;
}

.cookbook-lifecycle-card p,
.cookbook-template-card p {
  margin: 0;
  color: var(--muted);
}

.cookbook-list,
.cookbook-results {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cookbook-list-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.cookbook-list-row.is-done {
  background: rgba(17, 92, 58, 0.07);
}

.cookbook-list-row.is-done .cookbook-list-label {
  color: var(--muted);
  text-decoration: line-through;
}

.cookbook-list-index {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.cookbook-list-label {
  min-width: 0;
  font-weight: 600;
}

.cookbook-list-state {
  color: var(--muted);
  font-size: 0.82rem;
}

.cookbook-search {
  display: grid;
  gap: 8px;
  width: min(100%, 580px);
  color: var(--ink);
  font-weight: 600;
}

.cookbook-results li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.cookbook-results li span {
  color: var(--muted);
  font-size: 0.85rem;
}

.cookbook-toast-region {
  min-height: 76px;
}

.cookbook-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 480px);
  padding: 12px 14px;
  border: 1px solid rgba(17, 92, 58, 0.22);
  border-radius: 13px;
  background: #f0faf3;
  color: #115c3a;
  box-shadow: var(--shadow);
}

.cookbook-toast.is-error {
  border-color: rgba(164, 39, 53, 0.25);
  background: #fff1f2;
  color: #a42735;
}

.cookbook-toast .icon-button {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-color: transparent;
  background: transparent;
  color: currentColor;
}

.cookbook-toast-mark {
  font-size: 0.7rem;
}

.cookbook-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.cookbook-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  text-align: left;
}

.cookbook-table caption {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cookbook-table th,
.cookbook-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.cookbook-table thead th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cookbook-table-row.is-selected {
  background: rgba(224, 122, 47, 0.09);
}

.cookbook-table-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(17, 92, 58, 0.1);
  color: #115c3a;
  font-size: 0.78rem;
}

.cookbook-table-check {
  width: 17px;
  height: 17px;
}

.cookbook-note-inline {
  color: var(--muted);
  font-size: 0.82rem;
}

.cookbook-template-output {
  min-height: 130px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fffaf4;
}

.cookbook-template-card h2 {
  margin: 0;
  color: #115c3a;
}

.template-copy {
  color: var(--ink);
}

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

.cookbook-binding-card {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffaf4;
}

.cookbook-binding-card strong {
  font-size: 1.2rem;
}

.cookbook-binding-card small {
  color: var(--muted);
}

.cookbook-binding-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.cookbook-check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

@media (max-width: 720px) {
  .cookbook-heading {
    display: grid;
  }

  .cookbook-request-grid,
  .cookbook-binding-grid {
    grid-template-columns: 1fr;
  }

  .cookbook-list-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .cookbook-list-state {
    grid-column: 2;
  }

  .cookbook-list-row .btn,
  .cookbook-list-row .ghost {
    grid-row: 2;
  }

  .cookbook-list-row .btn {
    grid-column: 2;
  }

  .cookbook-list-row .ghost {
    grid-column: 3;
  }
}
