:root {
  --ink: #171719;
  --paper: #f1f2f3;
  --white: #fff;
  --yellow: #f5df32;
  --mint: #74f4ce;
  --muted: #6f7176;
  --line: #cfd1d4;
  --danger: #e84a4a;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; min-width: 320px; font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.site-header { min-height: 86px; padding: 20px clamp(20px, 4vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--paper); border-top: 6px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 900 18px/1 var(--mono); letter-spacing: -.05em; text-decoration: none; }
.brand-mark { width: 17px; height: 26px; display: inline-block; background: var(--ink); transform: skew(-24deg); }
.site-header nav { display: flex; align-items: center; gap: 12px; }
.header-link, .header-button { min-height: 44px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--ink); color: var(--ink); background: var(--white); font: 800 12px/1 var(--mono); letter-spacing: .04em; text-decoration: none; cursor: pointer; }
.header-button { background: var(--ink); color: var(--white); }
.header-publish { background: var(--yellow); color: var(--ink); }
.notice-bar { min-height: 62px; padding: 12px 20px; display: flex; align-items: center; justify-content: center; gap: 18px; background: var(--yellow); border-block: 2px solid var(--ink); font: 900 13px/1.2 var(--mono); letter-spacing: .08em; }
main { width: min(1180px, 100%); margin: 0 auto; padding: 0 24px 100px; }
.hero { padding: 32px 0; }
.eyebrow { margin: 0 0 22px; font: 900 13px/1.2 var(--mono); letter-spacing: .08em; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(52px, 8vw, 92px); line-height: .93; letter-spacing: -.065em; font-weight: 470; }
.lede { max-width: 740px; margin: 30px 0 0; font-size: clamp(18px, 2.1vw, 24px); line-height: 1.45; letter-spacing: -.025em; }
.hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.button { min-height: 48px; padding: 14px 19px; border: 2px solid var(--ink); border-radius: 0; font: 900 12px/1.15 var(--mono); letter-spacing: .035em; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.button:hover, .button:focus-visible { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.button:disabled { cursor: wait; opacity: .55; transform: none; box-shadow: none; }
.button-large { min-height: 62px; padding-inline: 25px; font-size: 14px; }
.button-dark { background: var(--ink); color: var(--white); }
.button-yellow { background: var(--yellow); color: var(--ink); }
.button-white { background: var(--white); color: var(--ink); }
.button-danger { border-color: var(--danger); color: var(--danger); background: var(--white); }
.status-badge { padding: 10px 12px; border: 2px solid var(--ink); background: var(--mint); font: 900 11px/1 var(--mono); }
.status-badge.offline { background: var(--white); }

.content-tabs { margin-bottom: 34px; display: flex; gap: 0; overflow-x: auto; border-bottom: 3px solid var(--ink); scrollbar-width: none; }
.content-tabs::-webkit-scrollbar { display: none; }
.content-tab { flex: 0 0 auto; min-height: 50px; padding: 0 20px; border: 2px solid var(--ink); border-bottom: 0; background: var(--white); font: 900 11px/1 var(--mono); cursor: pointer; }
.content-tab + .content-tab { border-left: 0; }
.content-tab.active { background: var(--ink); color: var(--white); }

.workspace { border-top: 3px solid var(--ink); padding-top: 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading .eyebrow { margin-bottom: 10px; }
h2 { margin: 0; font-size: clamp(36px, 5vw, 58px); line-height: 1; letter-spacing: -.05em; font-weight: 500; }
.count { font: 900 12px/1 var(--mono); }
.toolbar { margin: 30px 0 34px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto; gap: 12px; }
.search-field { min-width: 0; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 2px solid var(--ink); background: var(--white); }
.search-field span { font-size: 23px; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }
select { min-width: 0; padding: 0 14px; border: 2px solid var(--ink); border-radius: 0; background: var(--white); font: 900 11px/1 var(--mono); }
.setup-note { margin: 0 0 30px; padding: 18px 20px; display: flex; gap: 18px; align-items: center; border: 2px solid var(--ink); background: var(--yellow); font-family: var(--mono); }
.setup-note p { margin: 0; font-size: 12px; }
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.menu-card { min-width: 0; display: flex; flex-direction: column; border: 2px solid var(--ink); background: var(--white); box-shadow: 8px 8px 0 var(--ink); overflow: hidden; }
.card-image { position: relative; height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 2px solid var(--ink); background: var(--white); }
.card-image img { width: auto; max-width: 100%; height: auto; max-height: 150px; display: block; object-fit: contain; object-position: center; }
.card-image .draft { position: absolute; top: 12px; left: 12px; padding: 7px 9px; background: var(--ink); color: var(--white); font: 900 10px/1 var(--mono); }
.card-image .pending { position: absolute; top: 12px; right: 12px; padding: 7px 9px; border: 2px solid var(--ink); background: var(--yellow); color: var(--ink); font: 900 10px/1 var(--mono); }
.card-content { min-height: 190px; padding: 20px; display: flex; flex-direction: column; }
.card-kicker { margin: 0 0 10px; color: var(--muted); font: 900 10px/1.3 var(--mono); text-transform: uppercase; }
.card-title-row { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.card-title { margin: 0; font-size: 22px; line-height: 1.05; letter-spacing: -.035em; }
.card-price { white-space: nowrap; font: 900 16px/1 var(--mono); }
.card-description { margin: 14px 0 20px; color: #55575b; font-size: 14px; line-height: 1.45; }
.card-edit { width: 100%; margin-top: auto; background: var(--white); }
.empty-state { padding: 70px 20px; border: 2px dashed var(--ink); text-align: center; font: 800 14px/1.5 var(--mono); }
.mobile-add { display: none; }

.content-form { margin-top: 34px; display: grid; gap: 24px; }
.form-card { padding: clamp(20px, 4vw, 34px); border: 2px solid var(--ink); background: var(--white); box-shadow: 8px 8px 0 var(--ink); }
.form-card-heading { margin-bottom: 26px; display: flex; align-items: start; gap: 16px; }
.form-card-heading > span { width: 37px; height: 37px; flex: 0 0 auto; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--yellow); font: 900 11px/1 var(--mono); }
.form-card-heading h3 { margin: 0; font-size: 25px; line-height: 1; letter-spacing: -.035em; }
.form-card-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.media-heading { margin: 30px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font: 900 13px/1 var(--mono); }
.media-heading small { color: var(--muted); font-size: 12px; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.media-grid-single { grid-template-columns: minmax(0, 720px); }
.media-item { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; border: 2px solid var(--ink); background: #e1e2e4; }
.media-item img { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-item-wide { aspect-ratio: 16 / 7; background: var(--white); }
.media-item-wide img { object-fit: contain; }
.media-replace { position: absolute; inset: auto 7px 7px; min-height: 36px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--yellow); font: 900 9px/1 var(--mono); cursor: pointer; }
.media-replace input { position: absolute; opacity: 0; pointer-events: none; }
.media-add { display: grid; place-items: center; gap: 5px; border: 2px dashed var(--ink); background: var(--paper); text-align: center; font: 900 10px/1.2 var(--mono); cursor: pointer; }
.media-add span { display: block; font-size: 28px; }
.media-add input { position: absolute; opacity: 0; pointer-events: none; }
.form-save-footer { position: sticky; bottom: 14px; z-index: 5; display: flex; justify-content: flex-end; pointer-events: none; }
.form-save-footer .button { pointer-events: auto; box-shadow: 6px 6px 0 var(--ink); }

.editor-dialog { width: min(940px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 3px solid var(--ink); border-radius: 0; box-shadow: 12px 12px 0 var(--ink); overflow: clip; }
.editor-dialog::backdrop { background: rgba(15, 15, 17, .8); }
.editor-shell { max-height: calc(100dvh - 38px); display: flex; flex-direction: column; background: var(--paper); }
.editor-header { flex: 0 0 auto; padding: 24px 26px; display: flex; align-items: start; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--ink); background: var(--yellow); }
.editor-header .eyebrow { margin-bottom: 8px; }
.editor-header h2 { font-size: clamp(30px, 5vw, 48px); }
.icon-button { width: 44px; height: 44px; flex: 0 0 auto; border: 2px solid var(--ink); background: var(--white); font-size: 28px; cursor: pointer; }
.editor-body { min-height: 0; flex: 1 1 auto; padding: 26px; display: grid; grid-template-columns: 280px 1fr; gap: 28px; overflow: auto; scroll-padding-block: 24px 120px; }
.image-editor { min-width: 0; }
#image-preview, .image-placeholder { width: 100%; aspect-ratio: 1; border: 2px solid var(--ink); background: #dfe0e2; }
#image-preview { display: block; object-fit: contain; object-position: center; background: var(--white); }
#image-preview:not([src]) { display: none; }
.image-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; font: 800 12px/1.3 var(--mono); }
.image-placeholder span { font-size: 36px; }
.image-placeholder small { max-width: 190px; color: var(--muted); font-size: 10px; }
.image-button { width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: center; }
.image-button input { position: absolute; opacity: 0; pointer-events: none; }
.field-hint { color: var(--muted); font: 12px/1.5 var(--mono); }
.fields-grid { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-content: start; }
.field { min-width: 0; display: grid; gap: 9px; font: 900 13px/1.25 var(--mono); }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; padding: 15px; border: 2px solid var(--ink); border-radius: 0; outline: none; background: var(--white); color: var(--ink); font: 500 17px/1.45 var(--sans); }
.field select { min-height: 54px; font-family: var(--mono); font-size: 13px; font-weight: 900; }
.field input:focus, .field textarea:focus, .field select:focus, .search-field:focus-within { box-shadow: 4px 4px 0 var(--ink); }
.field textarea { resize: vertical; }
.field small { color: var(--muted); font: 12px/1.45 var(--mono); }
.taxonomy-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.taxonomy-add { white-space: nowrap; }
.taxonomy-chips { min-height: 38px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.taxonomy-chip { min-height: 36px; padding: 7px 8px 7px 12px; display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); background: var(--yellow); font: 900 12px/1 var(--mono); text-transform: uppercase; }
.taxonomy-chip button { width: 22px; height: 22px; padding: 0; border: 0; background: var(--ink); color: var(--white); font: 900 16px/1 var(--sans); cursor: pointer; }
.taxonomy-empty { color: var(--muted); font: 800 12px/1.3 var(--mono); }
.taxonomy-new { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.taxonomy-new .button { min-height: 0; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 18px; }
.toggle { display: flex; align-items: center; gap: 10px; font: 900 12px/1.35 var(--mono); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 37px; height: 22px; padding: 3px; display: block; border: 2px solid var(--ink); background: var(--white); }
.toggle span::after { content: ""; width: 12px; height: 12px; display: block; background: var(--ink); transition: transform .15s; }
.toggle input:checked + span { background: var(--yellow); }
.toggle input:checked + span::after { transform: translateX(15px); }
.editor-footer { flex: 0 0 auto; padding: 18px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 2px solid var(--ink); background: var(--white); }
.footer-actions { margin-left: auto; display: flex; gap: 12px; }
.preview-dialog { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; }
.preview-dialog::backdrop { background: rgba(15, 15, 17, .84); }
.preview-shell { width: 100vw; min-width: 0; height: 100dvh; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; background: var(--paper); }
.preview-header, .preview-footer { min-height: 72px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 2px solid var(--ink); background: var(--yellow); }
.preview-header .eyebrow { margin: 0 0 5px; font-size: 10px; }
.preview-header strong { font: 900 15px/1 var(--mono); text-transform: uppercase; }
.preview-frame { width: 100% !important; min-width: 0; max-width: none; height: 100% !important; min-height: 0; display: block; align-self: stretch; justify-self: stretch; border: 0; background: var(--white); }
.preview-footer { min-height: 68px; justify-content: flex-end; border-top: 2px solid var(--ink); border-bottom: 0; background: var(--white); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(430px, calc(100% - 44px)); padding: 16px 18px; border: 2px solid var(--ink); background: var(--mint); box-shadow: 6px 6px 0 var(--ink); font: 900 12px/1.5 var(--mono); opacity: 0; pointer-events: none; transform: translateY(15px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #ff8e8e; }

.login-view { min-height: 100dvh; padding: 30px; display: grid; place-items: center; background: var(--yellow); border-top: 6px solid var(--ink); }
.login-card { width: min(620px, 100%); padding: clamp(28px, 6vw, 58px); border: 3px solid var(--ink); background: var(--paper); box-shadow: 12px 12px 0 var(--ink); }
.login-card .brand { margin-bottom: 70px; }
.login-card h1 { font-size: clamp(48px, 9vw, 76px); }
.login-card .lede { margin-top: 24px; font-size: 18px; }
.stack-form { margin-top: 36px; display: grid; gap: 18px; }
.stack-form label { display: grid; gap: 8px; font: 900 11px/1 var(--mono); }
.stack-form input { min-width: 0; height: 54px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 0; background: var(--white); }
.form-error { min-height: 18px; margin: 0; color: #a60000; font: 800 11px/1.4 var(--mono); }

@media (max-width: 850px) {
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-body { grid-template-columns: 220px 1fr; }
}

@media (max-width: 620px) {
  .site-header { min-height: 70px; padding: 14px 16px; }
  .site-header .brand { font-size: 14px; }
  .site-header .brand-mark { width: 13px; height: 21px; }
  #view-site { display: none; }
  .header-link, .header-button { min-height: 40px; padding-inline: 9px; font-size: 9px; }
  .site-header nav { gap: 6px; }
  .notice-bar { min-height: 50px; gap: 9px; font-size: 10px; }
  main { padding: 0 16px 105px; }
  .hero { padding: 22px 0; }
  h1 { font-size: clamp(48px, 15vw, 66px); }
  .lede { margin-top: 22px; font-size: 17px; }
  .hero-actions .button { width: 100%; }
  .status-badge { width: 100%; text-align: center; }
  .section-heading { align-items: start; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .button { display: none; }
  select { height: 50px; }
  .setup-note { align-items: start; flex-direction: column; gap: 8px; }
  .menu-grid { grid-template-columns: 1fr; gap: 22px; }
  .card-image { height: 120px; }
  .card-image img { max-height: 90px; }
  .content-tabs { margin-inline: -16px; padding-inline: 16px; }
  .content-tab { padding-inline: 15px; }
  .form-card { box-shadow: 6px 6px 0 var(--ink); }
  .media-heading { align-items: start; flex-direction: column; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-save-footer { bottom: max(10px, env(safe-area-inset-bottom)); }
  .form-save-footer .button { width: 100%; }
  .content-form:has(.field input:focus, .field textarea:focus, .field select:focus) .form-save-footer { position: static; }
  .menu-card { box-shadow: 6px 6px 0 var(--ink); }
  .mobile-add { position: fixed; z-index: 8; right: 14px; bottom: 14px; left: 14px; min-height: 58px; display: block; border: 2px solid var(--ink); background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); font: 900 13px/1 var(--mono); }
  .editor-dialog { width: 100%; max-height: 100dvh; height: 100dvh; border: 0; box-shadow: none; }
  .editor-shell { height: 100dvh; max-height: none; display: block; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .editor-header { padding: 18px 16px; }
  .editor-body { min-height: auto; padding: 18px 16px 30px; grid-template-columns: 1fr; gap: 24px; overflow: visible; }
  .image-editor { display: grid; grid-template-columns: 112px 1fr; gap: 10px 12px; align-items: center; }
  #image-preview, .image-placeholder { grid-row: 1 / span 2; }
  .image-button { margin: 0; }
  .field-hint { margin: 0; }
  .fields-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .taxonomy-picker { grid-template-columns: 1fr; }
  .taxonomy-add { width: 100%; }
  .taxonomy-new { grid-template-columns: 1fr 1fr; }
  .taxonomy-new input { grid-column: 1 / -1; }
  .editor-footer { padding: 12px 16px; align-items: stretch; flex-direction: column-reverse; }
  .footer-actions { width: 100%; margin: 0; display: grid; grid-template-columns: .65fr 1fr 1.15fr; }
  .footer-actions .button { min-width: 0; padding-inline: 8px; font-size: 11px; }
  .editor-footer > .button { width: 100%; }
  .preview-dialog { width: 100vw; height: 100dvh; }
  .preview-header, .preview-footer { padding: 10px 12px; }
  .preview-footer .button { flex: 1; min-width: 0; padding-inline: 8px; font-size: 10px; }
  .toast { right: 16px; bottom: 82px; left: 16px; max-width: none; }
  .login-view { padding: 18px; }
  .login-card { padding: 28px 22px; box-shadow: 7px 7px 0 var(--ink); }
  .login-card .brand { margin-bottom: 52px; }
}

@media (max-width: 420px) {
  .site-header > .brand > span:last-child { display: none; }
}
