:root {
  --paper: #f4f5f0;
  --white: #fff;
  --ink: #20392f;
  --muted: #58665b;
  --line: #ced8cc;
  --green: #173e33;
  --lime: #d6ef9b;
  --radius: 16px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 3px solid #638b49; outline-offset: 3px; }
[hidden] { display: none !important; }
.page-width { width: min(1280px, calc(100% - 80px)); margin: auto; }

.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-size: 30px; font-weight: 730; letter-spacing: -1.8px; line-height: 1; }
.wordmark-dot { color: #638147; margin-left: -8px; }
.brand-mark { display: grid; grid-template-columns: 7px 7px; grid-template-rows: 7px 7px; gap: 3px; transform: rotate(-12deg); margin-right: 2px; }
.brand-mark i { display: block; background: var(--green); border-radius: 2px; }
.brand-mark i:last-child { background: #95b666; }
.site-header nav { display: flex; gap: 30px; font-size: 14px; font-weight: 600; }
.site-header nav a { color: var(--muted); }
.site-header nav .nav-current, .site-header nav a:hover { color: var(--green); }
.site-header nav span { margin-left: 5px; }
.intro { display: flex; align-items: center; justify-content: space-between; padding: 44px 0 36px; gap: 24px; }
.intro h1 { font-size: clamp(36px, 3.8vw, 52px); font-weight: 600; letter-spacing: -2px; line-height: 1.16; margin: 0 0 14px; }
.intro h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.intro-copy { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0; }

.studio { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 32px; align-items: start; }
.controls { display: grid; gap: 20px; min-width: 0; }
.setup-section { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: 0 3px 12px #20392f04; min-width: 0; }
.section-heading { display: flex; gap: 12px; align-items: center; margin: 0 0 24px; }
.section-heading h2 { font-size: 19px; font-weight: 650; letter-spacing: -.35px; line-height: 1.3; margin: 0; }
.step-number { display: grid; place-items: center; background: var(--green); color: var(--lime); border-radius: 8px; font-size: 12px; width: 32px; height: 32px; font-weight: 600; flex-shrink: 0; }
.setup-section > label, .embed-panel > label { font-size: 14px; font-weight: 600; display: block; margin: 19px 0 8px; }
.controls input[type=text], .controls input[type=datetime-local], .controls select,
.copy-row input, .recent-timers select { width: 100%; height: 48px; background: #fff; border: 1px solid #b9c7b8; border-radius: 8px; color: var(--ink); padding: 0 12px; font-size: 16px; min-width: 0; }
.controls input:hover, .controls select:hover { border-color: #718d68; }
.select-wrap { position: relative; }
.select-wrap:after { content: "⌄"; position: absolute; right: 13px; top: 11px; font-size: 16px; color: var(--muted); pointer-events: none; }
.controls select, .recent-timers select { appearance: none; padding-right: 32px; }
.fold-field { margin-top: 18px; padding: 14px; background: #f8f0db; border: 1px solid #d9c796; border-radius: 8px; }
.fold-field label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 9px; }
.fold-field select { font-size: 13px; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.design-grid, .font-grid, .color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.design-option, .font-option { display: block; position: relative; cursor: pointer; min-width: 0; }
.design-option input, .font-option input { position: absolute; left: 7px; top: 6px; width: 1px; height: 1px; opacity: 0; }
.design-option input:focus-visible + .design-sample, .font-option input:focus-visible + .font-choice { outline: 3px solid #638b49; outline-offset: 3px; }
.design-sample { height: 68px; border: 1px solid var(--line); background: #f4f6f0; border-radius: 8px; display: flex; justify-content: center; align-items: center; gap: 4px; color: #425a3b; font-size: 16px; font-variant-numeric: tabular-nums; }
.design-sample b { font-weight: 600; letter-spacing: -.7px; }
.design-sample i { font-size: 10px; font-style: normal; color: #697d60; }
.design-option input:checked + .design-sample, .font-option input:checked + .font-choice { border-color: #3d6735; background: #eef4e5; box-shadow: inset 0 0 0 1px #3d6735; }
.sample-cards b { padding: 7px 4px; border: 1px solid #d2dfc7; border-radius: 3px; background: #fff; font-size: 13px; }
.sample-minimal { background: #fff; }
.sample-minimal b { font-family: Georgia, serif; font-weight: 400; }
.design-name { display: flex; justify-content: space-between; font-size: 13px; margin-top: 8px; padding: 0 2px; color: var(--muted); }
.design-option:has(input:checked) .design-name { color: #2b5227; font-weight: 600; }
.selected-tick { opacity: 0; }
.design-option input:checked ~ .design-name .selected-tick { opacity: 1; }
.font-fieldset, .color-fieldset { margin-top: 26px; }
.font-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-height: 94px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.font-option:hover .font-choice { border-color: #829d73; }
.font-specimen { font-size: 29px; line-height: 1.15; font-weight: 700; letter-spacing: -1px; color: #2f5037; }
.font-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.font-sans { font-family: "Moment Sans", sans-serif; }
.font-serif { font-family: "Moment Serif", Georgia, serif; }
.font-mono { font-family: "Moment Mono", monospace; }
.color-control { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; font-size: 12px; font-weight: 500; padding: 12px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.color-control input[type=color] { padding: 0; border: 1px solid #b6c4ae; display: block; width: 32px; height: 32px; border-radius: 50%; background: none; overflow: hidden; cursor: pointer; flex-shrink: 0; }
.color-control input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-control input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-control input[type=color]::-moz-color-swatch { border: 2px solid white; border-radius: 50%; }
.fine-tune { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; }
.fine-tune summary, .email-details summary { font-size: 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.fine-tune summary::-webkit-details-marker, .email-details summary::-webkit-details-marker { display: none; }
.fine-tune summary span, .email-details summary span { font-weight: 400; font-size: 22px; color: var(--muted); line-height: 1; }
.fine-tune[open] summary span, .email-details[open] summary span { transform: rotate(45deg); }
.fine-tune-content { padding-top: 20px; }
.labels-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.labels-grid label { font-size: 13px; color: var(--muted); }
.labels-grid input { margin-top: 6px; }

.workspace { position: sticky; top: 24px; min-width: 0; }
.preview-heading { margin: 3px 0 17px; }
.preview-heading h2 { font-size: 20px; font-weight: 600; letter-spacing: -.4px; line-height: 1.4; margin: 0; }
.preview-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: white; box-shadow: 0 4px 18px #20392f05; }
.preview-toolbar { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.state-tabs { display: flex; background: #edf1e8; border: 1px solid #d8e0d0; border-radius: 8px; padding: 3px; gap: 2px; }
.state-tab { border: 0; border-radius: 5px; background: transparent; padding: 8px 12px; font-size: 13px; color: var(--muted); line-height: 1.2; }
.state-tab.selected { background: white; color: var(--green); box-shadow: 0 1px 4px #20392f16; font-weight: 600; }
.preview-badge { font-size: 12px; color: #42623a; display: flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #638b49; flex-shrink: 0; }
.preview-stage { background: #eaf0e4; padding: 64px 32px; min-height: 290px; display: flex; align-items: center; }
.preview-image-wrap { width: 100%; aspect-ratio: 640 / 180; box-shadow: 0 14px 24px -18px #20392f70; position: relative; border-radius: 3px; overflow: hidden; }
.preview-image-wrap svg { display: block; width: 100%; height: auto; aspect-ratio: 640 / 180; overflow: hidden; font-synthesis: none; }
.preview-image-wrap svg, .preview-image-wrap svg text { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.preview-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; gap: 3%; background: #153e35; color: #f4f7ed; font-variant-numeric: tabular-nums; }
.preview-placeholder > span { font-size: clamp(24px, 3.5vw, 47px); line-height: 1.2; font-weight: 650; text-align: center; min-width: 15%; }
.preview-placeholder small { display: block; font-size: 8px; font-weight: 500; letter-spacing: 1.7px; color: #d2ee94; margin-top: 10px; }
.preview-placeholder i { font-size: 24px; font-style: normal; margin-bottom: 22px; color: #d2ee94; }
.preview-bottom { padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.preview-note { font-variant-numeric: tabular-nums; }
.preview-format { white-space: nowrap; }
.deadline-note { display: grid; gap: 4px; margin: 16px 0 20px; padding: 15px 18px; background: #e7ece2; border-radius: 10px; overflow-wrap: anywhere; }
.deadline-note > span { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.deadline-note strong { font-size: 14px; font-weight: 600; }
.generate-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.generate-row .section-heading { margin: 0; }
.generate-row h2 { font-size: 18px; }
.primary-button { background: var(--green); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 25px; border: 1px solid var(--green); border-radius: 8px; padding: 14px 18px; font-size: 14px; font-weight: 600; min-height: 50px; }
.primary-button:hover { background: #265640; }
.primary-button span { font-size: 18px; color: var(--lime); font-weight: 400; }
.quota-note { font-size: 12px; color: var(--muted); text-align: right; margin: 10px 2px 0; line-height: 1.6; }
.error-message { padding: 15px 18px; border: 1px solid #d6af9c; background: #fff5ef; border-radius: 9px; color: #843d28; font-size: 14px; line-height: 1.6; margin-top: 15px; overflow-wrap: anywhere; }

.embed-panel { background: #fff; border: 1px solid #adc19b; border-radius: var(--radius); padding: 26px; margin-top: 24px; scroll-margin-top: 20px; }
.embed-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.embed-heading h2 { font-size: 22px; font-weight: 600; letter-spacing: -.5px; margin: 0; }
.saved-badge { font-size: 12px; background: #e9f2dd; color: #42652d; padding: 6px 9px; border-radius: 30px; white-space: nowrap; }
.saved-badge.stale { background: #f9f1df; color: #785a25; }
.saved-notice { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 14px 0 20px; }
.copy-row { display: flex; gap: 8px; min-width: 0; }
.copy-row input { background: #f6f8f2; font-size: 12px; font-family: Consolas, monospace; height: 44px; flex: 1; }
.copy-button { font-size: 13px; background: #edf2e6; border: 1px solid #becdaf; border-radius: 7px; padding: 0 14px; white-space: nowrap; color: #365628; min-height: 44px; font-weight: 600; }
.copy-button:hover { background: #e2ecd7; }
.embed-panel textarea { display: block; resize: vertical; width: 100%; min-height: 110px; max-height: 260px; border: 1px solid #b9c7b8; border-radius: 8px; padding: 12px; font: 12px/1.7 Consolas, monospace; color: #385133; background: #f6f8f2; overflow-wrap: anywhere; }
.embed-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.html-copy span { margin-left: 12px; }
.gif-preview-link, .inline-link { font-size: 13px; color: #355c2c; text-decoration: underline; text-underline-offset: 3px; }
.gif-preview-link { white-space: nowrap; }
.gif-preview-link span { margin-left: 5px; }
.local-origin-note { background: #fcf5e5; border-radius: 7px; padding: 12px; font-size: 13px; color: #795f2d; line-height: 1.6; margin-bottom: 0; }
.recent-timers { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.recent-timers > label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.recent-timers select { font-size: 14px; }

.guide { border-top: 1px solid var(--line); margin-top: 56px; padding: 36px 0; }
.guide-intro h2 { font-size: 28px; font-weight: 600; line-height: 1.3; letter-spacing: -.8px; margin: 0 0 26px; }
.guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.guide-steps article { display: flex; gap: 12px; }
.guide-number { font-size: 13px; color: #48673b; line-height: 1.7; font-weight: 600; min-width: 22px; }
.guide h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
.guide-steps p { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 0; }
.email-details { border: 1px solid var(--line); background: #ecf0e6; border-radius: 10px; padding: 18px 22px; margin-bottom: 36px; }
.email-details > div { padding-top: 15px; max-width: 1040px; }
.email-details p { font-size: 14px; line-height: 1.75; color: var(--muted); margin: 0; }
.email-details p + p { margin-top: 12px; }
.site-footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 26px 0 32px; gap: 15px; }
.footer-wordmark { font-size: 24px; }
.site-footer > span { font-size: 13px; color: var(--muted); }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: #203f31; color: #f0f6e9; font-size: 14px; padding: 13px 20px; border-radius: 10px; box-shadow: 0 4px 30px #16371b26; z-index: 20; max-width: calc(100vw - 40px); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@font-face { font-family: "Moment Sans"; src: url("/static/fonts/dejavu-sans.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Moment Sans"; src: url("/static/fonts/dejavu-sans-bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Moment Serif"; src: url("/static/fonts/dejavu-serif.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Moment Serif"; src: url("/static/fonts/dejavu-serif-bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Moment Mono"; src: url("/static/fonts/dejavu-mono.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Moment Mono"; src: url("/static/fonts/dejavu-mono-bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

@media (max-width: 1120px) {
  .page-width { width: calc(100% - 48px); }
  .studio { grid-template-columns: 350px minmax(0, 1fr); gap: 24px; }
  .setup-section { padding: 23px; }
  .intro { align-items: flex-start; }
  .intro h1 { font-size: 42px; }
  .preview-stage { padding: 54px 22px; min-height: 255px; }
  .preview-toolbar { padding: 14px; }
  .state-tab { padding: 8px 10px; }
  .generate-row { padding: 22px; }
  .generate-row .primary-button { flex: 1 0 100%; }
  .preview-bottom { padding: 14px; flex-wrap: wrap; gap: 6px 14px; }
}
@media (max-width: 900px) {
  .intro { display: block; }
  .studio { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .workspace { position: static; }
  .preview-stage { padding: 50px 32px; min-height: 265px; }
  .generate-row .primary-button { flex: initial; }
  .guide-steps { gap: 22px; }
}
@media (max-width: 760px) {
  .controls { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .page-width { width: calc(100% - 32px); }
  .site-header { height: 74px; gap: 12px; }
  .wordmark { font-size: 26px; }
  .site-header nav { gap: 16px; font-size: 12px; }
  .site-header nav span { display: none; }
  .intro { padding: 30px 0; }
  .intro h1 { font-size: 37px; letter-spacing: -1.4px; max-width: 420px; }
  .intro-copy { font-size: 15px; }
  .controls { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .setup-section { padding: 22px; }
  .section-heading h2 { font-size: 19px; }
  .preview-toolbar { padding: 13px; gap: 10px; flex-wrap: wrap; }
  .state-tab { font-size: 12px; padding: 8px 10px; }
  .preview-badge { font-size: 11px; margin-left: auto; }
  .preview-stage { padding: 44px 14px; min-height: 190px; }
  .preview-bottom { font-size: 12px; }
  .preview-placeholder > span { font-size: 28px; }
  .preview-placeholder small { font-size: 6px; margin-top: 7px; }
  .preview-placeholder i { font-size: 20px; margin-bottom: 16px; }
  .generate-row { flex-direction: column; align-items: stretch; padding: 22px; }
  .quota-note { text-align: center; }
  .embed-panel { padding: 21px; }
  .embed-heading h2 { font-size: 20px; }
  .copy-row { flex-wrap: wrap; }
  .copy-row input { flex-basis: 100%; }
  .guide { margin-top: 36px; padding: 30px 0; }
  .guide-intro h2 { font-size: 25px; }
  .guide-steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .email-details { padding: 17px 19px; }
  .site-footer > span { font-size: 12px; }
}
@media (max-width: 360px) {
  .site-header nav { gap: 12px; font-size: 11px; }
  .design-grid, .font-grid { gap: 6px; }
  .design-sample { gap: 2px; font-size: 13px; }
  .sample-cards b { font-size: 11px; padding: 6px 2px; }
  .color-grid { grid-template-columns: minmax(0, 1fr); }
  .color-control { flex-direction: row; align-items: center; gap: 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { animation: none !important; transition: none !important; }
}
