/* Sunnyletter design system. Fonts are self-hosted (Inter and Instrument Serif,
   both SIL Open Font License) so no visitor data goes to a font CDN. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/Inter-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/InstrumentSerif-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/InstrumentSerif-italic.woff2') format('woff2');
}

:root {
  --paper: #f8f5ef;
  --paper-2: #f1ebe1;
  --surface: #ffffff;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #78716c;
  --faint: #a8a29e;
  --line: #ece7e0;
  --line-strong: #ddd5ca;
  --accent: #c2410c;
  --accent-ink: #9a3412;
  --accent-soft: #fff3e8;
  --sun: #f59e0b;
  --green: #15803d;
  --green-soft: #ecf8f0;
  --amber: #a16207;
  --amber-soft: #fdf6e3;
  --red: #b91c1c;
  --red-soft: #fdeeee;
  --blue: #1d4ed8;
  --blue-soft: #edf2fd;
  --violet: #6d28d9;
  --violet-soft: #f3edfd;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 8px 24px -12px rgba(28, 25, 23, 0.12);
  --shadow-lg: 0 2px 6px rgba(28, 25, 23, 0.04), 0 30px 70px -24px rgba(28, 25, 23, 0.28);
  --ring: 0 0 0 3px rgba(194, 65, 12, 0.16);
  --font-sans: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  font-family: var(--font-sans);
  font-feature-settings: 'cv11', 'ss01';
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { color: var(--ink); }
h1 { font-family: var(--font-serif); font-weight: 400; font-size: 38px; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 14px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.serif { font-family: var(--font-serif); font-weight: 400; }
::selection { background: #fde2c8; }

/* ---------- Form controls ---------- */

input, select, textarea {
  font: inherit;
  font-size: 14px;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type='checkbox'], input[type='radio'] { width: auto; margin: 3px 0 0; box-shadow: none; accent-color: var(--ink); }
input[type='color'] { padding: 3px; width: 52px; height: 38px; }
input[type='range'] { padding: 0; box-shadow: none; border: 0; accent-color: var(--ink); }
input[type='file'] { padding: 7px; font-size: 13px; }
input.narrow { width: 96px; }
textarea { resize: vertical; line-height: 1.55; }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #fcfbf9; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 500; font-size: 13.5px; margin-bottom: 8px; color: var(--ink-2); }
.hint { font-weight: 400; font-size: 12.5px; color: var(--muted); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  font: inherit; font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:hover { background: #fcfbf9; border-color: #cfc6ba; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--ink); border-color: var(--ink); color: #fff;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn-primary:hover { background: #2e2925; border-color: #2e2925; color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(154, 52, 18, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15); }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #f1c4c4; color: var(--red); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-brand { background: var(--brand, var(--ink)); color: var(--brand-fg, #fff); border: 0; height: 46px; font-size: 15px; }
.btn-brand:hover { filter: brightness(0.95); background: var(--brand, var(--ink)); color: var(--brand-fg, #fff); }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.link-button:hover { color: var(--accent-ink); }
.link-button.danger, .danger { color: var(--red); }
.warn { color: var(--amber); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid transparent; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; color: var(--muted); font-size: 15px; }
.icon-btn:hover:not(:disabled) { border-color: var(--line); background: var(--surface); color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn.danger:hover { color: var(--red); }

/* ---------- Utilities ---------- */

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.break { word-break: break-all; }
.inline { display: inline; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; }
.row.space { justify-content: space-between; }
.small-gap { gap: 4px; }
.grow { flex: 1 1 0; }
.row > input:not(.grow), .row > select:not(.grow) { width: auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.align-start { align-items: start; }
.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- App shell ---------- */

body.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
.logo img { border-radius: 8px; box-shadow: 0 1px 2px rgba(154, 52, 18, 0.3); }
.logo-word { font-family: var(--font-serif); font-size: 24px; letter-spacing: -0.01em; line-height: 1; }
.sidebar .logo { padding: 2px 8px 0; }
.account-name { font-size: 12.5px; color: var(--muted); padding: 10px 10px 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; border: 1px solid transparent;
  color: var(--ink-2); font-weight: 500; font-size: 14px;
}
.sidebar nav a .icon { color: var(--muted); }
.sidebar nav a:hover { background: rgba(28, 25, 23, 0.04); color: var(--ink); }
.sidebar nav a.active { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.sidebar nav a.active .icon { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 4px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); }
.sidebar-foot .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { flex: 1; min-width: 0; }
.main { max-width: 1080px; margin: 0 auto; padding: 40px 44px 80px; }
.main.wide { max-width: 1360px; }

.banner { padding: 10px 44px; font-size: 13.5px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.banner-info { background: var(--amber-soft); color: #6b4705; }
.banner-error { background: var(--red-soft); color: var(--red); }
.banner-dev { display: block; background: var(--ink); color: #d6d3d1; font-size: 12.5px; border-bottom: 0; }
.banner-dev a { color: #fdba74; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-header p { margin: 6px 0 0; font-size: 14.5px; }
.back { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; color: var(--muted); }
.back:hover { color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.stack > .card, .grid-2 > .card { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-highlight { border-color: #f3c9a5; box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-sm); }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; border: 1px solid transparent; }
.flash-ok { background: var(--green-soft); color: var(--green); border-color: #cdebd7; }
.flash-error { background: var(--red-soft); color: var(--red); border-color: #f5cfcf; }
.flash-info { background: var(--blue-soft); color: var(--blue); border-color: #d3dff9; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; text-transform: capitalize; vertical-align: middle; line-height: 1.6; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge-gray { background: #f1eeea; color: #6b6560; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); margin-left: 8px; text-transform: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-family: var(--font-serif); font-size: 36px; line-height: 1.1; margin-top: 6px; letter-spacing: -0.01em; }
.stat-hint { font-size: 12.5px; color: var(--faint); margin-top: 2px; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.card .table { border: 0; box-shadow: none; border-radius: 0; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fcfbf9; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.table tbody tr:hover td { background: #fdfcfa; }
.table tr:last-child td { border-bottom: 0; }
.table td a { color: var(--ink); font-weight: 500; }
.table td a:hover { color: var(--accent); }
.table.compact td { padding: 9px 10px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; font-size: 14px; }

.empty { text-align: center; padding: 64px 24px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty h3 { font-family: var(--font-serif); font-weight: 400; font-size: 28px; margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto 20px; }

.checklist { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; counter-reset: step; }
.checklist li { position: relative; counter-increment: step; }
.checklist li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 500; }
.checklist li a:hover { background: var(--paper); }
.checklist li a::before { content: counter(step); flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; color: var(--muted); background: var(--surface); }
.checklist li.done a { color: var(--faint); text-decoration: line-through; }
.checklist li.done a::before { content: '✓'; background: var(--ink); border-color: var(--ink); color: #fff; font-size: 13px; font-weight: 700; }

.split { display: flex; gap: 24px; align-items: flex-start; }
.split-main { flex: 1; min-width: 0; }
.split-side { width: 330px; flex-shrink: 0; }
.split-side.wide-side { width: 500px; position: sticky; top: 24px; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filters input { flex: 2; }
.filters select { flex: 1; }
.tag-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 2px; }
.tag-list li { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; }
.tag-list li:hover { background: var(--paper); }
.tag-list li a { flex: 1; color: var(--ink); }
.tag-list .link-button { font-size: 17px; line-height: 1; color: var(--faint); padding: 0 2px; }
.tag-list .link-button:hover { color: var(--red); }
.tag-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-left: 26px; }
.chip { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; font-family: inherit; }
.chip input { margin: 0; }
.chip:hover { border-color: var(--ink); }
.radio-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.radio-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.meta { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; word-break: break-word; }
.problems { margin: 0; padding: 14px 16px 14px 34px; color: var(--red); background: var(--red-soft); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.send-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.logo-preview { max-height: 60px; max-width: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.domain { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.dns td { font-size: 12px; }
pre.code { background: #fcfbf9; border: 1px solid var(--line); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; }

.progress { position: relative; height: 28px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--line); }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--sun)); transition: width 0.4s; }
.progress span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }

.timeline { list-style: none; padding: 0; margin: 0 0 20px; }
.timeline li { position: relative; padding-left: 28px; }
.timeline li::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline-delay { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 0 8px; position: relative; text-transform: uppercase; letter-spacing: 0.05em; }
.timeline-delay::before { content: ''; position: absolute; left: -24px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline-card { margin-bottom: 6px; }

/* ---------- Editor ---------- */

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-right { position: sticky; top: 20px; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.blocks { display: flex; flex-direction: column; gap: 10px; }
.block { margin: 0; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.block-head { display: flex; justify-content: space-between; align-items: center; }
.block-type { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.add-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255, 255, 255, 0.5); }
.ai-card { margin: 0; border-color: #f3d3b8; background: linear-gradient(180deg, #fff8f1, #fff 70%); }
.ai-card summary { cursor: pointer; list-style: none; }
.ai-card summary::-webkit-details-marker { display: none; }
.ai-card[open] summary { margin-bottom: 14px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestions:empty { display: none; }
.save-status { min-height: 18px; }
.preview-frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.preview-frame iframe { width: 100%; height: 72vh; border: 0; display: block; background: #f6f3ee; }
.preview-frame.mobile { max-width: 390px; margin: 0 auto; }
.preview-subject { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; font-size: 14px; gap: 2px; }

.busy-overlay { position: fixed; inset: 0; background: rgba(250, 248, 245, 0.86); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.busy-box { text-align: center; max-width: 360px; font-size: 15px; }
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 16px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Public site ----------
   Editorial, print-newsletter styling: ink on paper, hairline rules, one spot
   color used the way a printer would, and asymmetric layouts. */

body.public { background: var(--paper); }
.container { max-width: 1160px; margin: 0 auto; padding: 0 32px; }

.public-nav { border-bottom: 1px solid var(--line-strong); background: var(--paper); }
.public-nav .container { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.public-nav nav { display: flex; gap: 30px; align-items: center; }
.public-nav nav a:not(.btn) { color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.public-nav nav a:not(.btn):hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.public-main { max-width: 760px; margin: 0 auto; padding: 32px 32px 96px; }
.public-main.wide { max-width: none; padding: 0; }

.text-link { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.text-link:hover { color: var(--accent); }
.fine { font-size: 13.5px; color: var(--muted); }

/* Hero */
.hero { padding: 40px 0 112px; }
.dateline { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); font-size: 11.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 72px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 72px; align-items: center; }
.hero h1 { font-size: 104px; line-height: 0.92; letter-spacing: -0.035em; margin: 0 0 30px; }
.hero h1 em { font-style: italic; letter-spacing: -0.02em; }
.lead { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 520px; margin: 0 0 36px; }
.hero-actions { display: flex; gap: 24px; align-items: center; margin-bottom: 20px; }

/* A letter on the desk, with a postmark */
.letters { position: relative; height: 600px; }
.letter { position: absolute; background: #fffdf9; border: 1px solid #e9e1d4; border-radius: 4px; box-shadow: 0 1px 1px rgba(60, 40, 20, 0.04), 0 22px 44px -26px rgba(60, 40, 20, 0.45); }
.letter.under { inset: 38px 0 18px 46px; transform: rotate(3.5deg); background: #f9f3e8; }
.letter.over { inset: 0 34px 34px 0; transform: rotate(-1.6deg); padding: 34px 36px 22px; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; }
.letter.over .letter-head { align-self: stretch; }
.letter-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid #efe7da; padding-bottom: 14px; margin-bottom: 26px; }
.letter-head strong { color: var(--ink); font-weight: 600; }
.letter-head span:last-child { white-space: nowrap; }
.letter .sig { font-family: var(--font-serif); font-style: italic; font-size: 20px; color: var(--ink); margin: 22px 0 18px; line-height: 1.25; }
.letter-foot { margin-top: auto; align-self: stretch; border-top: 1px solid #efe7da; padding-top: 12px; font-size: 11px; color: var(--faint); }
.letter .from { font-family: var(--font-serif); font-size: 19px; color: #7c2d12; margin-bottom: 14px; }
.letter h4 { font-family: var(--font-serif); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 14px; }
.letter p { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 12px; }
.btn-mail { display: inline-block; margin-top: 4px; background: #9a3412; color: #fff; font-size: 13.5px; font-weight: 600; padding: 9px 16px; border-radius: 6px; }
.stamp { position: absolute; right: -14px; bottom: 70px; width: 128px; height: 128px; color: var(--accent); transform: rotate(14deg); opacity: 0.88; mix-blend-mode: multiply; }

/* Sections */
.section { padding: 104px 0; border-top: 1px solid var(--line-strong); }
.section-title { display: grid; grid-template-columns: 200px 1fr; gap: 0 32px; align-items: baseline; margin-bottom: 56px; }
.section-title .no { font-family: var(--font-serif); font-size: 19px; color: var(--accent); }
.section-title h2 { font-family: var(--font-serif); font-weight: 400; font-size: 60px; line-height: 1; letter-spacing: -0.025em; margin: 0; max-width: 820px; }
.section-title p { grid-column: 2; margin: 18px 0 0; font-size: 18px; color: var(--ink-2); max-width: 620px; }

.columns { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.columns > div { padding: 30px 36px 0 0; }
.columns > div + div { border-left: 1px solid var(--line-strong); padding-left: 36px; }
.columns .num { display: block; font-family: var(--font-serif); font-style: italic; font-size: 20px; color: var(--accent); margin-bottom: 22px; }
.columns h3 { font-family: var(--font-serif); font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 12px; }
.columns p { margin: 0; color: var(--ink-2); font-size: 16px; }

.demo { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 72px; align-items: start; }
.note { border-top: 1px solid var(--ink); padding-top: 26px; }
.note .label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.note blockquote { font-family: var(--font-serif); font-size: 40px; line-height: 1.12; letter-spacing: -0.015em; margin: 16px 0 34px; }
.note blockquote::before { content: '\201C'; color: var(--accent); }
.note blockquote::after { content: '\201D'; color: var(--accent); }
.note ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line-strong); }
.note li { padding: 14px 0; border-bottom: 1px solid var(--line-strong); color: var(--ink-2); font-size: 15px; display: flex; gap: 14px; }
.note li b { font-weight: 600; color: var(--ink); min-width: 92px; }
.sheet { background: #fffdf9; border: 1px solid #e9e1d4; border-radius: 4px; box-shadow: 0 22px 44px -28px rgba(60, 40, 20, 0.4); }
.sheet .letter-head { margin: 0; padding: 16px 28px; }
.sheet-body { padding: 30px 36px 34px; }
.sheet-body .from { font-family: var(--font-serif); font-size: 19px; color: #7c2d12; margin-bottom: 14px; }
.sheet-body h4 { font-family: var(--font-serif); font-weight: 400; font-size: 36px; line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 16px; }
.sheet-body p { font-size: 15px; line-height: 1.65; color: var(--ink-2); margin: 0 0 14px; }
.sheet-body ul { margin: 0 0 16px; padding-left: 20px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.sheet-foot { border-top: 1px solid #efe7da; padding: 14px 36px 18px; font-size: 11.5px; color: var(--faint); }

.pull { font-family: var(--font-serif); font-size: 52px; line-height: 1.08; letter-spacing: -0.02em; margin: 0; max-width: 980px; }
.pull em { color: var(--accent); }
.pull-by { margin-top: 26px; font-size: 14px; color: var(--muted); }

.index { border-top: 1px solid var(--ink); }
.index-row { display: grid; grid-template-columns: 200px 1fr 1.25fr; gap: 32px; padding: 30px 0; border-bottom: 1px solid var(--line-strong); align-items: baseline; }
.index-row .n { font-family: var(--font-serif); font-size: 19px; color: var(--accent); }
.index-row h3 { font-family: var(--font-serif); font-weight: 400; font-size: 32px; line-height: 1.08; letter-spacing: -0.015em; margin: 0; }
.index-row p { margin: 0; color: var(--ink-2); font-size: 16px; }

.pricelist { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); }
.pricelist th { text-align: left; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 14px 20px 14px 0; border-bottom: 1px solid var(--ink); }
.pricelist td { padding: 26px 20px 26px 0; border-bottom: 1px solid var(--line-strong); font-size: 15.5px; color: var(--ink-2); vertical-align: middle; }
.pricelist .plan-name { font-family: var(--font-serif); font-size: 32px; color: var(--ink); letter-spacing: -0.01em; }
.pricelist .price { font-family: var(--font-serif); font-size: 38px; color: var(--ink); white-space: nowrap; letter-spacing: -0.02em; }
.pricelist .price small { font-family: var(--font-sans); font-size: 13px; color: var(--muted); letter-spacing: 0; }
.pricelist td.act { text-align: right; padding-right: 0; width: 1%; white-space: nowrap; }
.pricelist tr.current td { background: #fffaf2; }
.pricelist-note { margin-top: 22px; font-size: 14.5px; color: var(--muted); max-width: 720px; }

.qa { border-top: 1px solid var(--ink); }
.qa-row { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; padding: 30px 0; border-bottom: 1px solid var(--line-strong); }
.qa-row h3 { font-family: var(--font-serif); font-weight: 400; font-size: 27px; line-height: 1.18; letter-spacing: -0.01em; margin: 0; }
.qa-row p { margin: 0; color: var(--ink-2); font-size: 16px; }

.signoff { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 72px; align-items: end; }
.signoff h2 { font-family: var(--font-serif); font-weight: 400; font-size: 76px; line-height: 0.98; letter-spacing: -0.03em; margin: 0; }
.signoff h2 em { color: var(--accent); }
.signoff p { font-size: 17px; color: var(--ink-2); margin: 0 0 28px; }
.signature { font-family: var(--font-serif); font-style: italic; font-size: 26px; color: var(--ink); margin-top: 28px; }

.public-footer { border-top: 2px solid var(--ink); padding: 30px 0 44px; color: var(--muted); font-size: 14px; }
.footer-row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.footer-row nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-row a { color: var(--ink-2); }
.footer-row a:hover { color: var(--ink); }
.footer-row .logo-word { font-size: 22px; }

/* Auth, legal and hosted pages */
.auth-wrap { min-height: calc(100vh - 73px); display: grid; place-items: center; padding: 56px 20px 96px; }
.auth-card { width: 100%; max-width: 440px; padding: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 42px; margin: 0 0 8px; letter-spacing: -0.02em; }
.auth-card > p.muted { margin-bottom: 26px; }
.auth-card .btn-block { height: 46px; margin-top: 4px; }
.auth-foot { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.prose { max-width: 720px; margin: 0 auto; padding: 48px 0; }
.prose h1 { font-size: 60px; margin-bottom: 28px; letter-spacing: -0.025em; }
.prose h2 { font-size: 20px; margin-top: 40px; }
.prose p, .prose li { font-size: 16.5px; color: var(--ink-2); line-height: 1.7; }

body.hosted { background: var(--paper); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.hosted-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 40px; max-width: 460px; width: 100%; box-shadow: var(--shadow); }
.hosted-card h1 { font-size: 36px; letter-spacing: -0.02em; }
.hosted-logo { max-height: 48px; max-width: 200px; margin-bottom: 22px; }
.hosted-name { font-family: var(--font-serif); font-size: 26px; margin-bottom: 22px; color: var(--brand, var(--ink)); }
.hosted-done { font-size: 17px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

@media (max-width: 1100px) {
  .hero h1 { font-size: 80px; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .letters { max-width: 560px; }
  .section-title { grid-template-columns: 1fr; gap: 10px; }
  .section-title p { grid-column: 1; }
  .index-row { grid-template-columns: 120px 1fr; }
  .index-row p { grid-column: 2; }
  .demo, .signoff { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 1000px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-right { position: static; }
  .split { flex-direction: column; }
  .split-side, .split-side.wide-side { width: 100%; position: static; }
}
@media (max-width: 760px) {
  body.app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { flex-direction: row; justify-content: space-between; }
  .main { padding: 24px 18px 56px; }
  .banner { padding: 10px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
  .public-nav nav { gap: 18px; }
  .public-nav nav a.nav-link { display: none; }
  .dateline span.optional { display: none; }
  .dateline { margin-bottom: 44px; }
  .hero { padding-bottom: 72px; }
  .hero h1 { font-size: 58px; }
  .lead { font-size: 17px; }
  .hero-actions { flex-wrap: wrap; }
  .letters { height: auto; padding: 0 12px 22px 0; }
  .letter.over { position: relative; inset: auto; padding: 24px 22px 18px; }
  .letter.under { inset: 26px 0 0 26px; }
  .letter h4 { font-size: 28px; }
  .stamp { width: 96px; height: 96px; right: -4px; bottom: 64px; }
  .section { padding: 72px 0; }
  .section-title h2 { font-size: 42px; }
  .columns { grid-template-columns: 1fr; }
  .columns > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-strong); }
  .columns > div { padding: 26px 0; }
  .note blockquote { font-size: 32px; }
  .sheet-body { padding: 24px 22px; }
  .pull { font-size: 36px; }
  .index-row { grid-template-columns: 1fr; gap: 8px; }
  .index-row p { grid-column: 1; }
  .index-row h3 { font-size: 28px; }
  .pricelist thead { display: none; }
  .pricelist tr { display: grid; grid-template-columns: 1fr auto; padding: 20px 0; border-bottom: 1px solid var(--line-strong); }
  .pricelist td { border: 0; padding: 4px 0; }
  .pricelist td.detail { grid-column: 1 / -1; font-size: 14.5px; }
  .pricelist td.detail::before { content: attr(data-label) " · "; color: var(--muted); }
  .pricelist td.act { grid-column: 1 / -1; text-align: left; padding-top: 12px; }
  .qa-row { grid-template-columns: 1fr; gap: 12px; }
  .signoff h2 { font-size: 52px; }
  .filters { flex-direction: column; }
  .meta { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
  .auth-card, .hosted-card { padding: 28px 22px; }
  .prose h1 { font-size: 44px; }
}
