/* The editor: the same light look as the site. Warm paper behind, white rounded fields and cards on it,
   one rose accent, so the invitation in the preview stays the star. */
:root {
  --paper: #FBFAF8; --paper-2: #F4F1EC; --card: #FFFFFF; --field: #FFFFFF; --ink: #18181B; --muted: #63635E; --line: #E6E2DB; --line-2: #D6D1C8;
  --claret: #A8324F; --rose-soft: #F7E9EC; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2363635E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --gold: #A8324F; --gold-ink: #A8324F; --ok: #3f7a52; --warn: #7a4a00;
  --display: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; --text: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15.5px/1.5 var(--text); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
h2, h3, .brand, .doc-title { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
.dev-only { display: none !important; }
body.dev .dev-only { display: inline-flex !important; }

/* ---------- the bar ---------- */
.bar { display: flex; align-items: center; gap: 22px; padding: 12px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #fff; }
.brand { display: inline-flex; align-items: center; min-height: 40px; gap: 9px; font-size: 17px; font-weight: 700; text-decoration: none; color: inherit; }
.brand .mark { width: 28px; height: 28px; flex: none; }
.doc { margin-right: auto; min-width: 0; padding-left: 22px; border-left: 1px solid var(--line); }
.doc-title { margin: 0; font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.status::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
.picker select { font: inherit; padding: 8px 36px 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff var(--chev) no-repeat right 14px center; appearance: none; max-width: 280px; }
.tools { display: flex; align-items: center; gap: 4px; }
.tools button, .tools .tool, .import {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: none; color: inherit; text-decoration: none;
  font: 500 14.5px/1 var(--text); transition: border-color .25s, background .25s;
}
.tools button:hover:not([disabled]), .tools .tool:hover { border-color: var(--line-2); }
.tools button[disabled] { opacity: .35; cursor: default; }
.tools .quiet { color: var(--muted); }
.tools .tool { border-color: var(--line-2); margin-left: 8px; }
.import { cursor: pointer; position: relative; overflow: hidden; }
.import input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* the one strong button: a printed label in ink, with its rule */
.tools .primary, .sheet .primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid var(--ink); border-radius: 10px;
  background: var(--ink); color: #fff; text-decoration: none; font: 600 15px/1 var(--text); transition: background .3s var(--ease);
}
.tools .primary { margin-left: 6px; }
.tools .primary:hover, .sheet .primary:hover { background: #000; }

/* ---------- sheets ---------- */
.sheet { width: min(540px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 32px 30px 28px; background: #fff; color: var(--ink); box-shadow: 0 40px 90px -30px rgba(24, 24, 27, .4); }
.sheet::backdrop { background: rgba(20, 17, 14, .55); }
.sheet h2 { margin: 0 0 10px; font-size: 26px; line-height: 1.15; }
.sheet .hint { font-size: 15px; }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 26px; }
.sheet-actions a:not(.primary), .sheet-actions button:not(.primary):not(.danger) { min-height: 44px; padding: 0 4px; border: 0; background: none; font-size: 15px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.sheet .danger { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: 10px; background: #b42318; color: #fff; font: 600 15px/1 var(--text); }
.sheet .danger:hover { background: #8f1c13; }
.fix-list { margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.fix-list li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--claret); }
.plans { display: grid; gap: 0; margin-top: 18px; border-top: 1px solid var(--line); }
.plan { display: flex; gap: 14px; align-items: flex-start; padding: 16px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .25s; }
.plan:has(input:checked) { background: var(--rose-soft); box-shadow: inset 3px 0 var(--claret); padding-left: 14px; }
.plan input { margin-top: 5px; accent-color: var(--claret); }
.plan span { display: grid; gap: 3px; }
.plan b { font: 600 16px/1.3 var(--text); }
.plan i { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font: 600 20px/1.2 var(--text); font-style: normal; letter-spacing: -.02em; }
.plan i s { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan i em { font: 600 12px/1 var(--text); font-style: normal; letter-spacing: 0; padding: 4px 8px; border-radius: 999px; background: var(--rose-soft); color: var(--claret); }
.plan small { color: var(--muted); font-size: 14px; }
.soon { margin: 18px 0 0; font-size: 14.5px; color: var(--muted); }
.live-at { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--rose-soft); color: var(--claret); font-weight: 600; }

/* ---------- the workspace ---------- */
.mobile-tabs { display: none; }
.workspace { flex: 1; display: grid; grid-template-columns: minmax(360px, 460px) 1fr; min-height: 0; }
.panel { border-right: 1px solid var(--line); overflow: auto; background: var(--paper); display: flex; flex-direction: column; }
.tabs { flex: none; display: flex; gap: 4px; position: sticky; top: 0; z-index: 2; margin: 0; padding: 14px 18px; background: var(--paper); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
/* the four parts as a row of pills; the open one is a white chip */
.tabs button { flex: 1 0 auto; padding: 10px 14px; border: 0; border-radius: 999px; background: none; white-space: nowrap; font: 600 14.5px/1.2 var(--text); color: var(--muted); transition: color .25s, background .25s, box-shadow .25s; }
.tabs button:hover { color: var(--ink); background: rgba(24, 24, 27, .04); }
.tabs [aria-selected="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(24, 24, 27, .08), 0 0 0 1px var(--line); }
.problems { margin: 16px 18px 0; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--claret) 25%, transparent); background: var(--rose-soft); color: #4d141d; font-size: 14.5px; }
.problems ul { margin: 6px 0 0; padding-left: 18px; }
.problems button { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: inherit; }
.problems .warn { margin: 6px 0 0; color: var(--warn); }
.form { padding: 24px 22px 80px; }
.form h2 { margin: 4px 0 6px; font-size: 28px; line-height: 1.15; }
.form h3 { margin: 30px 0 12px; font-size: 17px; }
.hint { color: var(--muted); margin: 0 0 18px; font-size: 14.5px; }

/* fields: a short label over a white, softly rounded box */
.f, .field { display: block; margin: 0 0 16px; }
.f label, .field > span { display: block; font: 500 14px/1.3 var(--text); color: var(--ink); margin-bottom: 6px; }
.f .req { color: var(--claret); }
.f input[type=text], .f input[type=date], .f input[type=datetime-local], .f input[type=number], .f input[type=email], .f input[type=url], .f input[type=time], .f select, .f textarea, .field select {
  width: 100%; min-height: 48px; font: 400 16px/1.4 var(--text); color: var(--ink); padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.f textarea { min-height: 96px; resize: vertical; }
/* our own chevron, with room around it, instead of the browser's pressed against the edge */
.f select, .field select { appearance: none; -webkit-appearance: none; padding-right: 44px; background: #fff var(--chev) no-repeat right 16px center; cursor: pointer; }
.f input:hover, .f select:hover, .f textarea:hover, .field select:hover { border-color: var(--line-2); }
.f input:focus, .f select:focus, .f textarea:focus, .field select:focus { outline: none; border-color: var(--claret); box-shadow: 0 0 0 3px var(--rose-soft); }
.f input[type=color] { width: 56px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--field); padding: 3px; }
.f [aria-invalid="true"] { border-color: var(--claret); background: #fdf5f4; }
.field-err { margin: 5px 0 0; color: var(--claret); font-size: 13px; }
.field-err:empty { display: none; }
.f.toggle { display: flex; align-items: center; gap: 10px; }
.f.toggle label { margin: 0; color: var(--ink); font: 400 15px/1.4 var(--text); letter-spacing: 0; text-transform: none; }
.f.toggle input { accent-color: var(--claret); width: 18px; height: 18px; }

/* lists of events, people and stories: each one a white card that opens */
.list { display: grid; gap: 10px; }
.item { padding: 0 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: box-shadow .25s; }
.item[open] { padding-bottom: 12px; box-shadow: 0 14px 30px -24px rgba(24, 24, 27, .35); }
.item summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 0; cursor: pointer; font: 600 16.5px/1.3 var(--text); list-style: none; }
.item[open] summary { margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.item .f input, .item .f select, .item .f textarea { background-color: var(--paper); }
.item summary::-webkit-details-marker { display: none; }
.item-tools { display: flex; gap: 2px; font-family: var(--text); }
.item-tools button, .s-tools button { min-width: 34px; min-height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 10px; font-size: 13px; color: var(--muted); }
.item-tools button:hover, .s-tools button:hover { border-color: var(--line-2); color: var(--ink); }
.add, .chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px dashed var(--line-2); background: #fff; border-radius: 999px; font: 500 14.5px/1 var(--text); justify-self: start; transition: border-color .2s, background .2s; }
.add { margin-top: 14px; }
.add::before { content: '+'; font: 300 18px/1 var(--text); margin-right: 10px; color: var(--gold-ink); }
.add:hover, .chip:hover { border-color: var(--ink); background: var(--field); }
.chip { margin: 0 8px 8px 0; border-style: solid; }
.sections { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.sections li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; flex-wrap: wrap; }
.sections li.off { opacity: .5; }
.s-name { font: 500 15.5px/1.3 var(--text); }
.sections em { font: italic 400 12px/1 var(--text); color: var(--claret); margin-left: 8px; }
.s-tools { display: flex; gap: 6px; align-items: center; }
.s-show { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.s-show input { accent-color: var(--claret); }
.section-fields { margin-top: 10px; padding: 4px 16px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.section-fields summary { cursor: pointer; font: 600 16.5px/1.3 var(--text); padding: 12px 0; }

/* ---------- the preview: the invitation on a sheet of paper ---------- */
.preview { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px; min-height: 0; overflow: auto; background: var(--paper-2); }
.device-toggle { flex: none; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.device-toggle button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font: 600 14px/1 var(--text); color: var(--muted); }
.device-toggle [aria-pressed="true"] { background: var(--ink); color: #fff; }
.frame { flex: none; position: relative; border-radius: 42px; padding: 8px; background: #18181b; box-shadow: 0 40px 80px -40px rgba(24, 24, 27, .45); }
/* the frame loading the next version waits, unseen, exactly over the one on show */
.frame iframe.back { position: absolute; top: 8px; left: 8px; width: calc(100% - 16px); height: calc(100% - 16px); visibility: hidden; pointer-events: none; }
.frame[data-device="desktop"] iframe.back { top: 6px; left: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
.frame[data-device="phone"] { width: 410px; height: min(860px, calc(100vh - 160px)); }
.frame[data-device="desktop"] { width: min(1200px, 100%); height: calc(100vh - 150px); border-radius: 6px; padding: 6px; }
.frame iframe { width: 100%; height: 100%; border: 0; border-radius: 33px; background: #141a33; display: block; }
.frame[data-device="desktop"] iframe { border-radius: 3px; }

@media (max-width: 900px) {
  .mobile-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--paper); }
  .mobile-tabs button { flex: 1; min-height: 46px; border: 0; background: none; font: 500 15px/1 var(--text); color: var(--muted); }
  .mobile-tabs [aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px var(--claret); }
  .tabs { padding: 10px 12px; }
  .tabs button { padding: 9px 12px; font-size: 14px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .workspace[data-view="edit"] .preview, .workspace[data-view="preview"] .panel { display: none; }
  .panel { border-right: 0; }
  .preview { padding: 0; }
  .device-toggle { display: none; }
  .frame[data-device] { width: 100%; height: calc(100vh - 120px); border-radius: 0; padding: 0; box-shadow: none; }
  .frame iframe { border-radius: 0; }
  .frame[data-device] iframe.back { top: 0; left: 0; width: 100%; height: 100%; }
}

@media (max-width: 600px) {
  .bar { gap: 10px 14px; padding: 10px 16px; }
  /* on phones the mark alone, still the way home */
  .brand { min-width: 40px; justify-content: center; }
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc { padding-left: 12px; }
  .tools { width: 100%; gap: 0; }
  .tools #preview-full { display: none; } /* the Edit and Preview switch below does this on phones */
  .tools button { padding: 0 8px; }
  .tools .primary { margin-left: auto; padding: 0 16px; }
  .form { padding: 20px 14px 80px; }
  .item { padding: 0 12px; }
}
