:root {
  --ink: #171717;
  --muted: #6d6a64;
  --paper: #f5f3ee;
  --white: #fff;
  --line: #dedbd3;
  --accent: #de5b3e;
  --accent-soft: #f8e8e2;
  --green: #35695a;
  --yellow: #f0c85a;
  --sidebar: 232px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
.mobile-bottom-nav { display: none; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 238, .94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-size: 19px; font-weight: 800; }
.brand img { display: block; }
.header-actions, .section-heading, .intro-row { display: flex; align-items: center; justify-content: space-between; }
.header-actions { gap: 10px; }
.icon-button, .primary-button, .secondary-button {
  border: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button { min-width: 40px; border-radius: 6px; background: transparent; color: var(--ink); font-size: 22px; position: relative; }
.icon-button:hover { background: #e9e6df; }
.favorite-count { font-size: 11px; background: var(--accent); color: white; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center; position: absolute; top: 0; right: -2px; }
.primary-button { background: var(--ink); color: white; border-radius: 6px; padding: 0 16px; font-weight: 700; gap: 5px; }
.primary-button:hover { background: #343434; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 6px; padding: 0 15px; font-weight: 700; }
.secondary-button:hover { border-color: var(--ink); }
.full-width { width: 100%; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { border-right: 1px solid var(--line); padding: 31px 18px; position: sticky; top: 68px; height: calc(100vh - 68px); }
.sidebar-label { font-size: 11px; font-weight: 800; color: #8c8982; margin: 0 10px 12px; text-transform: uppercase; }
.category-list { display: grid; gap: 3px; }
.category-button {
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 6px;
  color: #56534d;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  font-weight: 650;
}
.category-button:hover { background: #ebe8e1; color: var(--ink); }
.category-button.active { background: var(--ink); color: white; }
.category-icon { width: 20px; text-align: center; font-size: 16px; }
.category-count { margin-left: auto; font-size: 11px; opacity: .65; }
.sidebar-note { position: absolute; left: 18px; right: 18px; bottom: 24px; border-top: 1px solid var(--line); padding: 18px 10px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sidebar-note p { margin: 8px 0 0; }
.sidebar-note strong { color: var(--accent); }
.note-mark { color: var(--accent); font-size: 18px; }

.content { width: min(1180px, 100%); padding: 50px 48px 80px; margin: 0 auto; }
.intro-row { align-items: flex-end; gap: 30px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: 1.4px; }
h1 { font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(36px, 5vw, 58px); line-height: 1.12; margin: 0; font-weight: 600; letter-spacing: 0; }
.intro-copy { color: var(--muted); font-size: 16px; margin: 15px 0 0; }
.prompt-stat { flex: 0 0 auto; border-left: 1px solid var(--line); padding: 4px 0 4px 22px; display: grid; }
.prompt-stat strong { font: 600 30px/1 Georgia, serif; }
.prompt-stat span { font-size: 12px; color: var(--muted); margin-top: 7px; }

.search-wrap { margin: 38px 0 34px; height: 54px; background: white; border: 1px solid #d6d2c9; border-radius: 7px; display: flex; align-items: center; padding: 0 14px 0 18px; box-shadow: 0 5px 22px rgba(30, 27, 21, .05); }
.search-wrap:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,23,23,.08); }
.search-icon { font-size: 25px; color: var(--muted); transform: rotate(-15deg); }
.search-wrap input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; padding: 0 14px; color: var(--ink); }
.search-wrap input::placeholder { color: #9a978f; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 4px 7px; color: #8a8780; font-size: 11px; background: #faf9f6; }
.mobile-categories { display: none; }

.section-heading { margin-bottom: 18px; gap: 16px; }
.section-heading h2 { font-size: 19px; margin: 0; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.section-heading select { border: 1px solid var(--line); background: transparent; border-radius: 6px; height: 38px; color: var(--muted); padding: 0 30px 0 11px; }

.prompt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.prompt-card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 7px; padding: 20px; display: flex; flex-direction: column; min-height: 235px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.prompt-card:hover { transform: translateY(-2px); border-color: #c7c2b8; box-shadow: 0 10px 30px rgba(30, 27, 21, .07); }
.card-top, .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-labels { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.tag { background: var(--accent-soft); color: #9e3f2b; padding: 5px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.verified-tag { color: var(--green); background: #e7f0ec; padding: 5px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.favorite-button { border: 0; background: transparent; color: #918d85; font-size: 21px; line-height: 1; padding: 3px; }
.favorite-button:hover, .favorite-button.active { color: var(--accent); }
.prompt-card h3 { font-size: 17px; margin: 17px 0 9px; line-height: 1.35; }
.prompt-preview { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { margin-top: auto; padding-top: 19px; }
.use-count { color: #8b8780; font-size: 11px; }
.card-actions { display: flex; align-items: center; gap: 13px; }
.detail-link { color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; }
.detail-link:hover { color: var(--accent); }
.copy-button { border: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 800; padding: 7px 0 7px 8px; }
.copy-button:hover { color: var(--accent); }
.empty-state { text-align: center; padding: 80px 20px; border: 1px dashed #ccc7bd; background: rgba(255,255,255,.35); }
.empty-state span { font-size: 32px; color: var(--accent); }
.empty-state h3 { margin: 12px 0 6px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }

.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); background: var(--green); color: white; padding: 11px 16px; border-radius: 6px; font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: .22s ease; z-index: 50; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
dialog { border: 0; border-radius: 8px; box-shadow: 0 24px 80px rgba(20,20,20,.22); padding: 0; color: var(--ink); }
dialog::backdrop { background: rgba(21,20,18,.52); backdrop-filter: blur(3px); }
.prompt-dialog { width: min(980px, calc(100% - 32px)); max-height: calc(100vh - 32px); }
.dialog-close { position: absolute; right: 14px; top: 14px; z-index: 2; }
.dialog-inner { padding: 38px; }
.dialog-inner h2, .submit-dialog h2 { margin: 13px 0 8px; font-size: 25px; }
.dialog-description { color: var(--muted); margin: 0 40px 24px 0; line-height: 1.6; }
.source-link { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: -8px 0 22px; padding: 11px 13px; border: 1px solid #cfe0d9; border-radius: 6px; background: #f1f7f4; color: var(--green); text-decoration: none; font-size: 12px; }
.source-link:hover { border-color: var(--green); }
.source-link strong { text-align: right; }
.builder-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); gap: 14px; }
.variable-panel, .preview-panel { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; min-width: 0; }
.builder-heading { min-height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #faf9f6; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; }
.builder-heading small { color: var(--muted); font-weight: 500; }
.variable-fields { padding: 14px; display: grid; gap: 13px; max-height: 360px; overflow: auto; }
.variable-field { display: grid; gap: 6px; color: #504d47; font-size: 11px; font-weight: 800; }
.variable-field b { color: var(--accent); margin-left: 3px; }
.variable-field input, .variable-field textarea, .variable-field select { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 9px 10px; outline: 0; color: var(--ink); background: white; resize: vertical; font-size: 12px; font-weight: 400; line-height: 1.5; min-height: 40px; }
.variable-field input:focus, .variable-field textarea:focus, .variable-field select:focus { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(23,23,23,.06); }
.variable-field .field-invalid { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(222,91,62,.1); }
.no-variables { color: var(--muted); font-size: 12px; margin: 3px 0; line-height: 1.6; }
.prompt-code { background: #f3f1eb; border: 1px solid var(--line); padding: 18px; border-radius: 6px; white-space: pre-wrap; font: 13px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; max-height: 360px; overflow: auto; }
.preview-panel .prompt-code { border: 0; border-radius: 0; height: 360px; max-height: 360px; }
.builder-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.builder-tab { border: 0; background: transparent; color: var(--muted); padding: 10px 13px; font-size: 12px; font-weight: 800; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.builder-tab:hover { color: var(--ink); }
.builder-tab.active { color: var(--ink); border-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.split-actions { justify-content: space-between; align-items: center; gap: 15px; }
.split-actions > div { display: flex; align-items: center; gap: 9px; }
.form-message { min-height: 18px; margin: 8px 0 -5px; color: var(--accent); font-size: 12px; font-weight: 700; }
.feedback-panel { margin-top: 17px; padding: 12px 14px; background: #f7f6f2; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 12px; color: var(--muted); }
.feedback-panel[hidden] { display: none; }
.feedback-panel > div { display: flex; gap: 5px; }
.feedback-button { border: 1px solid var(--line); background: white; color: var(--muted); border-radius: 5px; min-height: 31px; padding: 0 9px; font-size: 11px; font-weight: 700; }
.feedback-button:hover, .feedback-button.active { border-color: var(--green); color: var(--green); background: #eef5f2; }
.example-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 14px; }
.example-layout > section { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; min-width: 0; }
.example-inputs { margin: 0; padding: 5px 15px; max-height: 380px; overflow: auto; }
.example-inputs div { padding: 11px 0; border-bottom: 1px solid #ebe8e1; }
.example-inputs div:last-child { border-bottom: 0; }
.example-inputs dt { color: var(--muted); font-size: 10px; font-weight: 800; margin-bottom: 5px; }
.example-inputs dd { margin: 0; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.example-output { height: 380px; overflow: auto; background: #f3f1eb; padding: 18px; white-space: pre-wrap; font: 13px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; }
.example-action { display: flex; justify-content: flex-end; margin-top: 18px; }
.example-empty, .history-empty { text-align: center; padding: 50px 20px; border: 1px dashed var(--line); color: var(--muted); line-height: 1.6; }
.text-button { border: 0; background: transparent; padding: 8px 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
.text-button:hover { color: var(--ink); }
.text-button.danger { color: #a74734; }
.submit-dialog { width: min(560px, calc(100% - 32px)); padding: 36px; }
.submit-dialog > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; font-size: 14px; }
.submit-dialog form { display: grid; gap: 16px; margin-top: 24px; }
.submit-dialog label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; }
.submit-dialog input, .submit-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 11px 12px; outline: none; resize: vertical; }
.submit-dialog input:focus, .submit-dialog textarea:focus { border-color: var(--ink); }
.history-dialog, .stats-dialog { width: min(720px, calc(100% - 32px)); padding: 36px; max-height: calc(100vh - 32px); }
.history-dialog h2, .stats-dialog h2 { margin: 8px 0 5px; }
.stats-note { color: var(--muted); margin: 0 40px 24px 0; font-size: 13px; line-height: 1.6; }
.history-list { display: grid; border-top: 1px solid var(--line); }
.history-item { border: 0; border-bottom: 1px solid var(--line); background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 4px; text-align: left; color: var(--ink); }
.history-item:hover { background: #f4f2ed; padding-left: 10px; padding-right: 10px; }
.history-item span:first-child { display: grid; gap: 4px; }
.history-item strong { font-size: 13px; }
.history-item small { color: var(--muted); font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.metric-grid > div { padding: 18px; display: grid; gap: 6px; border-right: 1px solid var(--line); background: #faf9f6; }
.metric-grid > div:last-child { border-right: 0; }
.metric-grid strong { font: 600 25px/1 Georgia, serif; }
.metric-grid span { color: var(--muted); font-size: 10px; }
.stats-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 24px; }
.stats-columns h3 { font-size: 13px; margin: 0 0 8px; }
.stats-columns ol { list-style: none; margin: 0; padding: 0; }
.stats-columns li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.stats-columns li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-columns p { color: var(--muted); font-size: 11px; }
.data-actions { display: flex; align-items: center; gap: 8px; padding-top: 24px; margin-top: 20px; border-top: 1px solid var(--line); }
.data-actions .danger { margin-left: auto; }

@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .content { padding: 38px 22px 70px; }
  .mobile-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 21px 0 29px; padding: 0; }
  .mobile-category { width: 100%; min-width: 0; min-height: 40px; border: 1px solid var(--line); background: transparent; padding: 7px 8px; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted); }
  .mobile-category span:first-child { width: 16px; color: #8b8780; text-align: center; font-size: 14px; }
  .mobile-category.active { background: var(--ink); border-color: var(--ink); color: white; }
  .mobile-category.active span:first-child { color: white; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 17px; height: 62px; }
  .brand span { font-size: 17px; }
  .header-actions .primary-button { width: 40px; padding: 0; font-size: 0; }
  .header-actions .primary-button span { font-size: 21px; }
  .content { padding: 31px 16px 60px; }
  .intro-row { align-items: flex-start; }
  h1 { font-size: 37px; max-width: 330px; }
  .intro-copy { line-height: 1.6; }
  .prompt-stat { display: none; }
  .search-wrap { margin: 27px 0 24px; }
  kbd { display: none; }
  .mobile-categories { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .prompt-grid { grid-template-columns: 1fr; }
  .prompt-card { min-height: 220px; }
  .section-heading { align-items: flex-end; }
  .section-heading select { max-width: 115px; }
  .dialog-inner, .submit-dialog { padding: 30px 22px 24px; }
  .prompt-dialog { max-height: calc(100vh - 20px); }
  .builder-layout { grid-template-columns: 1fr; }
  .variable-fields { max-height: 270px; }
  .preview-panel .prompt-code { height: 260px; max-height: 260px; }
  .source-link { align-items: flex-start; flex-direction: column; }
  .source-link strong { text-align: left; overflow-wrap: anywhere; }
  .example-layout { grid-template-columns: 1fr; }
  .example-output { height: 280px; }
  .split-actions { align-items: stretch; flex-direction: column-reverse; }
  .split-actions > div { width: 100%; }
  .split-actions > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .feedback-panel { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid > div:nth-child(2) { border-right: 0; }
  .metric-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats-columns { grid-template-columns: 1fr; gap: 20px; }
  .history-dialog, .stats-dialog { padding: 30px 22px 24px; }
  .data-actions { align-items: stretch; flex-direction: column; }
  .data-actions .danger { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.site-footer { min-height: 78px; padding: 24px max(22px, calc((100% - 1180px)/2)); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 12px; }
.site-footer div { display: flex; align-items: baseline; gap: 9px; }
.site-footer strong { color: var(--ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.language-switch { min-width: 36px; min-height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; font-weight: 800; text-decoration: none; }
.language-switch:hover { border-color: #aaa59b; color: var(--ink); }
.header-language { margin-left: auto; margin-right: 10px; }
.ad-placeholder { width: 100%; min-height: 104px; margin: 0 auto; border: 1px dashed #cbc7be; background: rgba(255,255,255,.4); display: grid; place-items: center; color: #97928a; font-size: 10px; }
.ad-placeholder-home { margin-top: 6px; margin-bottom: 28px; }
.prompt-grid + .ad-placeholder-home { margin-top: 28px; margin-bottom: 0; }
.ad-placeholder span { padding: 3px 6px; border: 1px solid #d7d3ca; background: var(--paper); }

@media (max-width: 700px) {
  html, body { max-width: 100%; overflow-x: clip; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .topbar { height: 58px; padding: 0 16px; }
  .topbar .header-actions { display: none; }
  .brand { gap: 9px; font-size: 16px; }
  .brand img { width: 32px; height: 32px; }
  .app-shell, .content, .intro-row, .section-heading, .prompt-grid, .prompt-card { min-width: 0; max-width: 100%; }
  .content { width: 100%; padding: 28px 14px 36px; overflow: hidden; }
  .intro-row { display: block; }
  .eyebrow { font-size: 10px; margin-bottom: 8px; }
  h1 { max-width: 100%; font-size: 34px; line-height: 1.16; }
  .intro-copy { max-width: 100%; margin-top: 12px; font-size: 14px; line-height: 1.6; }
  .search-wrap { width: 100%; height: 48px; margin: 24px 0 18px; padding-left: 14px; }
  .search-wrap input { width: 100%; font-size: 16px; padding-right: 4px; }
  .search-icon { font-size: 21px; }
  .mobile-categories { width: 100%; max-width: 100%; margin: 18px 0 26px; padding: 0; }
  .mobile-category { min-height: 39px; padding: 6px 7px; font-size: 11px; }
  .section-heading { margin-bottom: 14px; }
  .section-heading h2 { font-size: 18px; }
  .section-heading select { flex: 0 0 auto; height: 36px; max-width: 112px; font-size: 12px; }
  .prompt-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .prompt-card { width: 100%; min-height: 196px; padding: 16px; border-radius: 6px; overflow: hidden; }
  .prompt-card:hover { transform: none; box-shadow: none; }
  .prompt-card h3 { margin: 14px 0 8px; font-size: 16px; overflow-wrap: anywhere; }
  .prompt-preview { font-size: 12px; line-height: 1.6; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
  .card-footer { padding-top: 15px; }
  .use-count, .copy-button { font-size: 11px; }
  .mobile-bottom-nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(62px + env(safe-area-inset-bottom));
    padding: 5px 8px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.97);
    box-shadow: 0 -8px 24px rgba(30,27,21,.06);
    backdrop-filter: blur(12px);
  }
  .mobile-bottom-nav button { min-width: 0; border: 0; background: transparent; color: #77736c; display: grid; place-content: center; justify-items: center; gap: 1px; border-radius: 5px; }
  .mobile-bottom-nav button span { height: 25px; font-size: 20px; line-height: 23px; }
  .mobile-bottom-nav button small { font-size: 10px; line-height: 14px; }
  .mobile-bottom-nav button.active { color: var(--accent); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100% - 28px); text-align: center; }
  dialog { max-width: calc(100% - 12px); }
  .prompt-dialog, .submit-dialog, .history-dialog, .stats-dialog { width: calc(100% - 12px); max-height: calc(100dvh - 12px); border-radius: 7px; }
  .dialog-inner, .submit-dialog, .history-dialog, .stats-dialog { padding-left: 16px; padding-right: 16px; }
  .dialog-inner h2, .submit-dialog h2 { margin-right: 34px; font-size: 23px; overflow-wrap: anywhere; }
  .dialog-description { margin-right: 24px; font-size: 13px; }
  .builder-tabs { overflow-x: auto; }
  .builder-tab { flex: 0 0 auto; }
  .variable-panel, .preview-panel, .example-layout > section { width: 100%; }
  .dialog-close { position: sticky; float: right; top: 8px; margin: 5px 0 -45px; background: rgba(255,255,255,.92); }
  .site-footer { min-height: 0; padding: 24px 14px 30px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .site-footer div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .site-footer nav { gap: 14px; }
  .ad-placeholder { min-height: 100px; }
  .ad-placeholder-home { margin-top: 0; margin-bottom: 22px; }
  .prompt-grid + .ad-placeholder-home { margin-top: 22px; }
}

@media (max-width: 360px) {
  .content { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 30px; }
  .intro-copy { font-size: 13px; }
  .mobile-categories { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; gap: 6px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading select { width: 100%; max-width: none; }
  .prompt-card { min-height: 188px; padding: 15px; }
  .mobile-bottom-nav { padding-left: 3px; padding-right: 3px; }
}

@media (max-width: 420px) {
  .intro-row h1 span { display: block; }
}
