/* Letters studio — built on the FSN tokens. Cerise acts, aubergine holds, lilac-white is the ground. */
:root { --text-muted: #6B5A74; --col-w: 300px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--fsn-cream); color: var(--text-body); font-family: var(--font-body); font-weight: 300; font-size: 16px; line-height: 1.55; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--link); }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--brand-primary) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.eyebrow { font-style: italic; font-weight: 400; color: var(--fsn-orchid-royal); margin: 0 0 6px; }
.chev { color: var(--brand-primary); font-style: normal; }

/* ---------- bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in oklab, var(--fsn-cream) 90%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-subtle); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 128px; height: auto; display: block; }
.brand span { font-family: var(--font-display); font-size: 20px; color: var(--text-strong); padding-left: 12px; border-left: 1px solid var(--border-subtle); }
.bar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--border-subtle); background: var(--fsn-white); font-weight: 900; font-size: 14px; color: var(--text-strong); cursor: pointer; transition: transform var(--dur-fast) var(--ease-buoyant), border-color var(--dur-base); }
.btn:hover { border-color: var(--brand-primary); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; box-shadow: var(--shadow-cerise); }
.btn.primary:hover { background: var(--fsn-magenta); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.who { border: 0; background: var(--fsn-aubergine); color: var(--text-on-brand); width: 38px; height: 38px; border-radius: 50%; font-weight: 900; cursor: pointer; }
.icon { border: 0; background: transparent; font-size: 28px; line-height: 1; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; color: var(--text-muted); }
.icon:hover { background: var(--fsn-mist); }

/* ---------- sign in ---------- */
.signin { max-width: 440px; margin: 9vh auto 0; padding: 0 16px; }
.signin h1 { font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1.1; color: var(--text-strong); margin: 0 0 12px; }
.signin form { display: grid; gap: 8px; margin-top: 28px; }
.signin label { font-weight: 900; font-size: 14px; color: var(--text-strong); margin-top: 8px; }
input, textarea, select { width: 100%; padding: 11px 13px; border: 1.5px solid var(--fsn-line); border-radius: 12px; background: #fff; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand-primary) 22%, transparent); }
.error { color: #B4233F; min-height: 1.4em; margin: 4px 0 0; font-size: 14px; }

/* ---------- board ---------- */
.board-wrap { overflow-x: auto; padding: 22px max(16px, env(safe-area-inset-left)) 40px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, var(--col-w)); gap: 16px; align-items: start; min-width: min-content; }
.col { background: color-mix(in oklab, var(--fsn-shell) 70%, transparent); border-radius: 20px; padding: 14px; min-height: 160px; }
.col.drop { outline: 2px dashed var(--brand-primary); outline-offset: -4px; }
.col h3 { font-family: var(--font-display); font-weight: 400; font-size: 21px; margin: 0; color: var(--text-strong); display: flex; justify-content: space-between; align-items: baseline; }
.col h3 small { font-family: var(--font-body); font-size: 13px; color: var(--text-muted); }
.col .hint { font-style: italic; font-size: 13px; color: var(--text-muted); margin: 2px 0 12px; }
.col.out { background: var(--fsn-aubergine); }
.col.out h3, .col.out h3 small, .col.out .hint { color: var(--text-on-brand); }
.cards { display: grid; gap: 10px; }
.card { text-align: left; width: 100%; border: 1px solid var(--fsn-line); background: #fff; border-radius: 16px; padding: 14px 14px 12px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform var(--dur-base) var(--ease-buoyant), box-shadow var(--dur-base); position: relative; overflow: hidden; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--fsn-gradient-festival); opacity: 0; transition: opacity var(--dur-base); }
.card:hover::before { opacity: 1; }
.card .t { font-family: var(--font-display); font-size: 19px; line-height: 1.25; color: var(--text-strong); margin: 0 0 4px; }
.card .w { font-style: italic; font-size: 14px; color: var(--fsn-orchid-royal); margin: 0 0 10px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; background: var(--fsn-mist); color: var(--text-strong); }
.pill.live { background: color-mix(in oklab, var(--fsn-teal) 22%, #fff); color: #145E57; }
.pill.rec { background: color-mix(in oklab, var(--fsn-gold) 35%, #fff); color: #6B4A00; }
.pill.ask { background: color-mix(in oklab, var(--brand-primary) 14%, #fff); color: var(--fsn-magenta); }
.add-seed { width: 100%; border: 1.5px dashed var(--fsn-line); background: transparent; border-radius: 16px; padding: 12px; color: var(--text-muted); font-weight: 900; cursor: pointer; }
.add-seed:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* ---------- panel ---------- */
.scrim { position: fixed; inset: 0; background: rgba(42, 8, 38, .28); z-index: 30; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); z-index: 40; background: var(--fsn-cream); box-shadow: var(--shadow-xl); overflow-y: auto; }
.panel-inner { padding: 20px max(20px, env(safe-area-inset-right)) 60px 24px; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.panel-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.15; color: var(--text-strong); margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 18px 0 20px; border-bottom: 1px solid var(--border-subtle); }
.tab { border: 0; background: none; padding: 10px 12px; font-weight: 900; font-size: 14px; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--text-strong); border-bottom-color: var(--brand-primary); }
.field { display: grid; gap: 6px; margin: 0 0 16px; }
.field > label, .label { font-weight: 900; font-size: 14px; color: var(--text-strong); }
.field .help { font-size: 13px; color: var(--text-muted); font-style: italic; margin: 0; }
textarea.letter { min-height: 440px; font-size: 17px; line-height: 1.7; padding: 18px 20px; background: #FFFDF9; }
textarea { resize: vertical; min-height: 90px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .split { grid-template-columns: 1fr; } .brand span { display: none; } }
.box { background: #fff; border: 1px solid var(--fsn-line); border-radius: 16px; padding: 16px; margin: 0 0 14px; }
.box.soft { background: var(--fsn-shell); border-color: transparent; }
.box h4 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 19px; color: var(--text-strong); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { background: #fff; border: 1px solid var(--fsn-line); border-radius: 14px; padding: 12px 14px; }
.item .by { font-size: 12px; color: var(--text-muted); margin: 0 0 4px; }
.item .kind { font-style: italic; color: var(--fsn-orchid-royal); }
.item p { margin: 0; white-space: pre-wrap; }
.item.activity { background: transparent; border-style: dashed; padding: 8px 12px; font-size: 14px; color: var(--text-muted); }
.draft-body { white-space: pre-wrap; font-size: 15px; line-height: 1.65; max-height: 260px; overflow: auto; background: #FFFDF9; border-radius: 10px; padding: 12px; margin-top: 8px; }
.spread { display: grid; gap: 8px; }
.spread .ch { display: grid; grid-template-columns: 1fr 130px 1.2fr; gap: 8px; align-items: center; }
@media (max-width: 620px) { .spread .ch { grid-template-columns: 1fr 1fr; } .spread .ch input { grid-column: 1 / -1; } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--fsn-shell); padding: 10px 12px; border-radius: 10px; }
.guide { min-height: 60vh; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

dialog { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-xl); background: var(--fsn-cream); color: var(--text-body); }
dialog::backdrop { background: rgba(42, 8, 38, .35); }
dialog form { padding: 24px; display: grid; gap: 10px; }
dialog h3 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: 0; color: var(--text-strong); }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(calc(100% + 48px)); opacity: 0; background: var(--fsn-aubergine); color: var(--text-on-brand); padding: 12px 20px; border-radius: 999px; font-weight: 900; font-size: 14px; z-index: 60; transition: transform var(--dur-slow) var(--ease-buoyant); max-width: calc(100vw - 32px); }
.toast.on { transform: translateX(-50%) translateY(0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
