@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,560;9..144,650&family=Outfit:wght@400;500;600&display=swap");

:root {
  --ink: #1c1915;
  --muted: #5c5348;
  --paper: #f3ecdf;
  --sheet: #fffaf3;
  --line: #e3d5c3;
  --ocean: #143744;
  --ocean-2: #0d2832;
  --tuna: #b4333f;
  --palm: #1d6843;
  --gold: #8d5a10;
  --focus: #c9842a;
  --mark: none;
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  background: var(--paper);
  font-size: 17px;
  line-height: 1.45;
}

html[data-theme="tuna"] {
  --ink: #2a1214;
  --paper: #f6ebe6;
  --sheet: #fff7f4;
  --line: #e7cfc8;
  --ocean: #8d2432;
  --ocean-2: #4c1218;
  --focus: #b4333f;
  --mark: url("/brand/tuna-loin.jpg");
}
html[data-theme="coco"] {
  --ink: #1d2b26;
  --muted: #4e655c;
  --paper: #f6f1df;
  --sheet: #fffdf8;
  --line: #e3d6b4;
  --ocean: #2e8f45;
  --ocean-2: #3aa4d4;
  --palm: #2e8f45;
  --gold: #e2b31a;
  --tuna: #e4572e;
  --focus: #e4572e;
  --mark: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(243, 236, 223, 0.92), rgba(243, 236, 223, 0.95)), var(--mark);
  background-size: auto, cover;
  background-attachment: fixed;
  background-position: center, center top;
}
html[data-theme="tuna"] body { background-image: linear-gradient(rgba(246, 235, 230, 0.9), rgba(246, 235, 230, 0.94)), var(--mark); }
html[data-theme="coco"] body {
  background-color: #f6f1df;
  background-image: linear-gradient(180deg, #7ec8ea 0 64px, #f6f1df 240px);
}
html[data-theme="coco"] .top { background: #3aa4d4; color: #fffef8; }
html[data-theme="coco"] .brand p { color: #e7f6ff; }
html[data-theme="coco"] .nav { background: #2e8f45; }
html[data-theme="coco"] .nav button[aria-current="page"] { background: #ffe58a; color: #1d2b26; }
html[data-theme="coco"] .primary { background: #2e8f45; }
html[data-theme="coco"] .coco-kicker,
html[data-theme="coco"] .coco-line .num { background: #2e8f45; }
html[data-theme="coco"] .theme-mark { background: transparent; object-fit: contain; width: 108px; height: 108px; border-radius: 0; }
html[data-theme="tuna"] .theme-mark { width: 96px; height: 96px; object-fit: cover; }
.theme-mark { width: 54px; height: 54px; object-fit: cover; border-radius: 12px; background: white; }
html:not([data-theme="tuna"]):not([data-theme="coco"]) .theme-mark { display: none; }
.theme-picker { display: flex; gap: 8px; justify-content: flex-end; margin: 0 22px 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, [role="button"] { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top {
  background: var(--ocean-2);
  color: #f6efe4;
  padding: 18px 22px 14px;
}
.brand {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: 2rem;
  margin: 0;
  letter-spacing: -0.03em;
}
.brand p { margin: 2px 0 0; color: #d9cbb8; max-width: 28rem; line-height: 1.25; }
.who { text-align: right; }
.who strong { display: block; }
.feedback {
  margin: 0 1.25rem 0.5rem;
  padding: 0.8rem 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.feedback textarea { width: 100%; min-height: 7rem; }
.who button {
  margin-top: 6px;
  background: transparent;
  color: #f6efe4;
  border: 1px solid #6e8490;
  border-radius: 999px;
  padding: 6px 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 22px;
  background: var(--ocean);
}
.nav button {
  background: transparent;
  color: #f4ecdf;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
}
.nav button[aria-current="page"] { background: #f4ecdf; color: var(--ocean-2); }

.banner {
  margin: 16px 22px 0;
  background: #f3d7a4;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.banner button {
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
}

main { padding: 22px; max-width: 1100px; }
h2 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: 2.1rem;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.lede { color: var(--muted); margin-top: 0; max-width: 46rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.card, .sheet, .stage, .lesson, .login {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.card { padding: 16px; }
.card span { display: block; color: var(--muted); font-size: 0.92rem; }
.card strong { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.8rem; line-height: 1.1; }
.who span { display: block; color: #d9cbb8; font-size: 0.92rem; }
.card button, .text-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ocean);
  text-decoration: underline;
}

.notice, .error {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.notice { background: #e5f2e8; }
.error { background: #f8d9d6; }

.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.stage { padding: 14px 14px 12px; position: relative; width: min(320px, 100%); }
.stage[contenteditable="false"] { cursor: grab; }
.card-minus, .flow-plus {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.card-minus { flex: 0 0 auto; }
.flow-plus { align-self: center; font-size: 1.5rem; }
.stage.draft, .lesson.draft { box-shadow: inset 0 0 0 2px var(--focus); }
.was { color: var(--muted); font-size: 0.85rem; }
.drag-handle {
  height: 14px;
  margin: 0 0 8px;
  border-radius: 8px;
  cursor: grab;
  background: repeating-linear-gradient(90deg, transparent, transparent 7px, var(--line) 7px, var(--line) 9px);
}
.stage [contenteditable="plaintext-only"],
.lesson [contenteditable="plaintext-only"] { outline: none; min-width: 1rem; cursor: text; user-select: text; }
.stage [contenteditable="plaintext-only"]:focus, .lesson [contenteditable="plaintext-only"]:focus {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 6px;
}
.lesson-flow { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.lesson-flow .lesson { width: min(340px, 100%); position: relative; }
.lesson-body[contenteditable="plaintext-only"] { white-space: pre-wrap; }
.stage header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.stage h3 { margin: 0; font-size: 1.25rem; }
.num {
  font-family: Fraunces, Georgia, serif;
  color: white;
  background: var(--ocean);
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.tuna-line .num { background: var(--tuna); }
.coco-line .num { background: var(--palm); }
.where { color: var(--gold); font-weight: 600; margin: 6px 0; }
.owns { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }

.line-block { margin: 28px 0; }
.line-kicker {
  display: inline-block;
  color: white;
  background: var(--tuna);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.coco-kicker { background: var(--palm); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.sheet { padding: 8px 12px 16px; overflow-x: auto; }
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  background: #efe4d2;
}
.tag.own { background: #f3d7a4; }
.tag.off { background: #f0d6d4; color: #7d2430; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  max-width: 34rem;
  background: white;
  border: 1px solid #cbbba6;
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 90px; }
.price-input { max-width: 9rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 40rem; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.choices label {
  margin: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 500;
}
.primary, .ghost {
  border-radius: 999px;
  padding: 12px 16px;
  border: 0;
  margin: 8px 8px 0 0;
}
.primary { background: var(--ocean); color: white; }
.ghost { background: white; border: 1px solid var(--line); }
.tiny { padding: 6px 10px; }

.lesson { padding: 16px 18px; margin: 12px 0; }
.lesson h3 { margin: 0 0 8px; font-family: Fraunces, Georgia, serif; }
.switch {
  width: 3.1rem;
  height: 1.8rem;
  border-radius: 999px;
  border: 0;
  background: #d7cdc0;
  position: relative;
}
.switch[aria-pressed="true"] { background: var(--palm); }
.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: white;
  transition: left 0.15s ease;
}
.switch[aria-pressed="true"] i { left: 1.45rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.filters button[aria-pressed="true"] { background: var(--ocean); color: white; }

.login {
  max-width: 32rem;
  margin: 8vh auto;
  padding: 28px;
}
.login h1 { font-family: Fraunces, Georgia, serif; font-size: 2.6rem; margin: 0; }
.starters { margin-top: 18px; background: #f7f1e6; border-radius: 12px; padding: 12px; }
.starters li { margin: 4px 0; }

@media (max-width: 720px) {
  .brand, .banner { flex-direction: column; align-items: start; }
  .who { text-align: left; }
  .row-2 { grid-template-columns: 1fr; }
  main { padding: 16px; }
  .sheet table thead { display: none; }
  .sheet tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .sheet td { display: block; border: 0; padding: 4px 0; }
  .sheet td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
  }
}
@media (min-width: 900px) {
  .flow { grid-template-columns: 1fr 1fr 1fr; }
}
@media print {
  .top, .nav, .banner, .noprint { display: none !important; }
  body { background: white; }
  .sheet, .card, .lesson { border: 0; }
}
