/* Dashboard, editor and auth pages. Tokens, buttons and forms live in base.css. */

.app { background: var(--bg); }
.icon { flex-shrink: 0; }

/* ---------- Shell ---------- */

.app-shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--teal-900) 236px, transparent 236px); }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--teal-900);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand-mark { padding: 0 8px; font-size: 1.2rem; }
.sidebar .brand-mark .brand-icon { width: 28px; height: 28px; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: #c9dfdb;
  font: 550 0.93rem/1.2 var(--font-ui);
  text-decoration: none;
}
.nav-link:hover { background: rgba(251, 245, 234, 0.08); color: var(--cream-100); }
.nav-link[aria-current="page"] { background: rgba(251, 245, 234, 0.12); color: #fff; font-weight: 650; }
.nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--coral-500);
}
.nav-link:focus-visible { box-shadow: 0 0 0 2px var(--teal-900), 0 0 0 4px var(--coral-300); }
.nav-button { width: 100%; background: none; border: none; cursor: pointer; text-align: left; }

.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(251, 245, 234, 0.12); padding-top: 14px; }
.sidebar-account { margin: 0 12px 6px; font-size: 0.82rem; font-weight: 650; color: var(--cream-100); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; padding: 32px 44px 72px; outline: none; }
.main > .messages { max-width: 1180px; }

/* ---------- Page header ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 6px;
}
.page-subtitle { color: var(--ink-soft); margin: 0; font-size: 0.97rem; }
.page-subtitle a { font-weight: 600; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.88rem; font-weight: 600; margin-bottom: 10px; text-decoration: none; }

.section-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title .count { font-weight: 600; color: var(--ink-muted); font-size: 0.9rem; }
.section { margin-bottom: 40px; }

/* ---------- Surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 24px; }
.card > h2, .card > h3 { font-size: 1.05rem; margin: 0 0 12px; }
.card-danger { border-color: #efc3bd; }
.card-danger > h2 { color: var(--danger); }

.narrow { max-width: 560px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }

.empty-state {
  text-align: center;
  padding: 48px 28px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: rgba(255, 253, 248, 0.6);
}
.empty-state .empty-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--teal-50);
  color: var(--teal-700);
  margin-bottom: 14px;
}
.empty-state .empty-icon .icon { width: 28px; height: 28px; }
.empty-state h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin-bottom: 8px; }
.empty-state p { color: var(--ink-soft); max-width: 44ch; margin: 0 auto 18px; }

/* ---------- Setup checklist (only shown until setup is done) ---------- */

.setup {
  background: var(--teal-900);
  color: var(--cream-100);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  margin-bottom: 36px;
}
.setup h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin: 0 0 4px; }
.setup > p { color: #cfe3df; margin: 0 0 18px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.setup-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--r);
  background: rgba(251, 245, 234, 0.07);
  border: 1px solid rgba(251, 245, 234, 0.12);
}
.setup-step .mark {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid rgba(251, 245, 234, 0.4); font-weight: 700; font-size: 0.8rem;
}
.setup-step.is-done .mark { background: var(--coral-500); border-color: var(--coral-500); color: var(--ink); }
.setup-step.is-done .mark .icon { width: 15px; height: 15px; stroke-width: 3; }
.setup-step strong { display: block; font-size: 0.93rem; }
.setup-step span { font-size: 0.82rem; color: #cfe3df; }
.setup-step a { color: var(--coral-300); font-weight: 650; font-size: 0.85rem; }
.setup-step.is-done strong { text-decoration: line-through; text-decoration-color: rgba(251, 245, 234, 0.5); color: #cfe3df; }

/* ---------- Menu cards ---------- */

.menu-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.menu-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.menu-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.menu-card-body { padding: 16px 18px 6px; flex: 1; }
.menu-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 2px; }
.menu-card h3 { font-size: 1.08rem; margin: 0; }
.menu-card h3 a { color: var(--ink); text-decoration: none; }
.menu-card h3 a:hover { color: var(--teal-700); text-decoration: underline; }
.menu-card .meta { color: var(--ink-muted); font-size: 0.85rem; margin: 0; }
.menu-card-actions { display: flex; gap: 6px; padding: 12px 18px 16px; flex-wrap: wrap; }

/* Thumbnail: the first few real items, in the business's colors. */
.menu-thumb {
  --brand-primary: #0f766e;
  --brand-secondary: #134e4a;
  display: block;
  margin: 12px 12px 0;
  padding: 14px 16px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-secondary) 45%, #120e0b);
  color: #fff6e8;
  text-decoration: none;
  min-height: 150px;
  font-size: 0.78rem;
  line-height: 1.35;
}
.menu-thumb:hover { color: #fff6e8; }
.menu-thumb-cat { font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: color-mix(in srgb, var(--brand-primary) 55%, #fff4e0); margin: 0 0 3px; }
.menu-thumb-cat + ul { margin-bottom: 8px; }
.menu-thumb ul { list-style: none; margin: 0; padding: 0; }
.menu-thumb li { display: flex; gap: 8px; justify-content: space-between; }
.menu-thumb li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-thumb li .price { font-weight: 700; white-space: nowrap; }
.menu-thumb li.is-sold-out span:first-child { opacity: 0.55; }
.menu-thumb .more { margin: 4px 0 0; opacity: 0.75; font-size: 0.74rem; }
@supports (color: oklch(from red l c h)) {
  .menu-thumb { background: oklch(from var(--brand-secondary) min(l, 0.24) min(c, 0.05) h); }
  .menu-thumb-cat { color: oklch(from var(--brand-primary) max(l, 0.8) min(c, 0.12) h); }
}
.menu-thumb-empty { display: flex; align-items: center; justify-content: center; text-align: center; color: #d9cfc2; font-size: 0.85rem; }

.new-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 250px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--teal-700);
  font-weight: 650;
  text-decoration: none;
  background: transparent;
}
.new-card:hover { background: var(--surface); color: var(--teal-900); }
.new-card .icon { width: 26px; height: 26px; }

/* ---------- Display rows ---------- */

.row-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row-list > li { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.row-list > li:last-child { border-bottom: none; }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; }
.row-main .meta { color: var(--ink-muted); font-size: 0.86rem; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.tpl-swatch { width: 54px; height: 34px; border-radius: 7px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.tpl-swatch.tpl-elegant { background: linear-gradient(90deg, transparent 16%, #e9b872 16% 48%, transparent 48%) 0 10px / 100% 3px no-repeat, linear-gradient(90deg, transparent 16%, #6e5b4a 16% 72%, transparent 72%) 0 18px / 100% 2px no-repeat, #231a14; }
.tpl-swatch.tpl-grid { background: linear-gradient(#c4502d, #c4502d) 6px 7px / 19px 6px no-repeat, linear-gradient(#fff, #fff) 6px 7px / 19px 20px no-repeat, linear-gradient(#c4502d, #c4502d) 29px 7px / 19px 6px no-repeat, linear-gradient(#fff, #fff) 29px 7px / 19px 20px no-repeat, #f6efe3; }
.tpl-swatch.tpl-minimal { background: linear-gradient(#1d6f8a, #1d6f8a) 7px 7px / 3px 10px no-repeat, linear-gradient(#111, #111) 7px 22px / 40px 2px no-repeat, #fff; }

/* ---------- Tables ---------- */

.table-simple { width: 100%; border-collapse: collapse; }
.table-simple th, .table-simple td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 0.93rem; vertical-align: middle; }
.table-simple tr:last-child td { border-bottom: none; }
.table-simple th { color: var(--ink-muted); font-weight: 650; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; }
.table-simple td.actions { text-align: right; white-space: nowrap; }
.table-simple td.actions form { display: inline; }

/* ---------- Popover menus (<details>) ---------- */

.popover { position: relative; display: inline-block; }
.popover > summary { list-style: none; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 190px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: 0 12px 32px rgba(40, 30, 15, 0.16);
}
.popover-menu form { margin: 0; }
.popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: 550 0.9rem/1.2 var(--font-ui);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.popover-item:hover, .popover-item:focus-visible { background: var(--cream-200); color: var(--ink); box-shadow: none; }
.popover-item .icon { width: 16px; height: 16px; color: var(--ink-muted); }
.popover-item.is-danger { color: var(--danger); }
.popover-item.is-danger .icon { color: var(--danger); }
.popover-item.is-danger:hover, .popover-item.is-danger:focus-visible { background: var(--danger-bg); }
.popover-item[disabled] { opacity: 0.45; cursor: default; background: none; }
.popover-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------- Editor ---------- */

.editor-toolbar {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: -32px -44px 24px;
  padding: 14px 44px;
  background: color-mix(in srgb, var(--cream-100) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.editor-toolbar-title { min-width: 0; flex: 1 1 260px; }
.editor-toolbar-title h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
.editor-toolbar-title p { margin: 2px 0 0; color: var(--ink-muted); font-size: 0.86rem; }
.editor-toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor-status { display: flex; align-items: center; gap: 10px; }
.editor-status .status-note { font-size: 0.8rem; color: var(--ink-muted); max-width: 22ch; line-height: 1.3; }
.editor-status .badge { font-size: 0.82rem; padding: 5px 12px; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }

.category-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.category-block-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.category-block-header h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.category-block-header .count { font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; color: var(--ink-muted); margin-left: 8px; }
.category-block-header .inline-form { flex: 1; }
.category-actions { display: flex; align-items: center; gap: 6px; }

.item-list { list-style: none; margin: 0; padding: 0; }
.item-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: none; }
.item-row.is-sold-out .item-name, .item-row.is-sold-out .item-price { color: var(--ink-muted); }
.item-row.is-hidden .item-name, .item-row.is-hidden .item-price, .item-row.is-hidden .desc { color: var(--ink-muted); }
.item-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--cream-200); }
.item-info { flex: 1; min-width: 0; }
.item-info .name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-name { font-weight: 650; }
.item-info .desc { color: var(--ink-muted); font-size: 0.85rem; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.item-price small { font-weight: 500; color: var(--ink-muted); font-size: 0.78rem; }
.item-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.item-empty { padding: 18px 20px; color: var(--ink-muted); font-size: 0.92rem; }

/* Availability toggle: shows the current state; clicking flips it. */
.avail-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  min-width: 104px;
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: 600 0.82rem/1.2 var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
}
.avail-btn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.avail-btn:hover { border-color: var(--ink-muted); }
.avail-btn.is-sold-out { background: var(--danger-bg); border-color: #efb9b3; color: var(--danger); }
.avail-btn.is-sold-out::before { background: var(--danger); }
.avail-hidden { font-size: 0.82rem; color: var(--ink-muted); font-weight: 600; padding: 0 6px; }

.add-row { padding: 10px 16px 14px 20px; border-top: 1px dashed var(--line); }
.add-row .btn { color: var(--teal-700); }

.add-category { padding: 18px 20px; }
.add-category label { margin-bottom: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; }

/* Preview panel */
.preview-panel { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.preview-head h2 { margin: 0; font-size: 1rem; }
.preview-frame {
  border-radius: 28px;
  border: 8px solid #121516;
  background: #fbf7f0;
  overflow: hidden;
  overflow-y: auto;
  height: min(560px, 62vh);
  box-shadow: var(--shadow);
}
.preview-frame .menu-content { padding-top: 20px; }

.qr-box { display: flex; gap: 16px; align-items: flex-start; }
.qr-box img { width: 112px; height: 112px; border: 1px solid var(--line); border-radius: 10px; background: #fff; flex-shrink: 0; }
.qr-box .url { font-size: 0.8rem; word-break: break-all; margin: 8px 0 0; color: var(--ink-muted); }

/* ---------- Item dialog ---------- */

dialog.modal {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: none;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(12, 35, 36, 0.35);
}
dialog.modal::backdrop { background: rgba(8, 44, 46, 0.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.modal-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin: 0; }
.modal-head p { margin: 2px 0 0; color: var(--ink-muted); font-size: 0.88rem; }
.modal-body { padding: 18px 24px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; border-top: 1px solid var(--line); background: var(--cream-100); border-radius: 0 0 var(--r-lg) var(--r-lg); position: sticky; bottom: 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.field-row .field { margin-bottom: 18px; }
.price-field { position: relative; }
.price-field .prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-weight: 600; pointer-events: none; }
.price-field input { padding-left: 26px; }

fieldset.fieldset { border: none; margin: 0 0 18px; padding: 0; }
fieldset.fieldset legend { font-weight: 600; font-size: 0.88rem; margin-bottom: 8px; padding: 0; }

.radio-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.radio-pills label { margin: 0; }
.radio-pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-pills span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: #fff; font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.radio-pills input:checked + span { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.radio-pills input:focus-visible + span { box-shadow: var(--focus); }

/* Photo upload */
.photo-field { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: #fff; }
.photo-field.is-dragover { border-color: var(--teal-600); background: var(--teal-50); }
.photo-preview { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--cream-200); display: flex; align-items: center; justify-content: center; color: var(--ink-muted); }
.photo-preview .icon { width: 28px; height: 28px; }
.photo-controls { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-controls .help-text { margin: 0; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-button { margin: 0; }
.file-input:focus-visible + .file-button { box-shadow: var(--focus); }
.photo-filename { font-size: 0.82rem; color: var(--ink-soft); word-break: break-all; }
.photo-clear { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.85rem; margin: 0; }

.variants { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.variants h3 { font-size: 0.95rem; margin: 0 0 2px; }
.variants > p { margin: 0 0 12px; }
.variant-head, .variant-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 92px; gap: 8px; align-items: center; }
.variant-head { font-size: 0.76rem; font-weight: 650; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.variant-row { margin-bottom: 8px; }
.variant-row .remove { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.82rem; margin: 0; }

/* ---------- Template picker (display form) ---------- */

.template-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.template-option { margin: 0; cursor: pointer; }
.template-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.template-card {
  display: block;
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.template-card .tv-frame { display: block; pointer-events: none; }
.template-card-text { display: block; padding: 10px 12px 12px; }
.template-card-text strong { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; }
.template-card-text span { display: block; font-weight: 400; font-size: 0.8rem; color: var(--ink-muted); line-height: 1.4; margin-top: 2px; }
.template-option:hover .template-card { border-color: var(--line-strong); }
.template-option input:checked + .template-card { border-color: var(--teal-700); box-shadow: 0 0 0 3px rgba(17, 96, 95, 0.18); }
.template-option input:focus-visible + .template-card { box-shadow: var(--focus); }
.template-card .check { display: none; width: 20px; height: 20px; border-radius: 50%; background: var(--teal-700); color: #fff; align-items: center; justify-content: center; }
.template-card .check .icon { width: 13px; height: 13px; stroke-width: 3; }
.template-option input:checked + .template-card .check { display: inline-flex; }

.big-preview { margin-top: 18px; }
.big-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.big-preview-head h3 { margin: 0; font-size: 0.95rem; }
.big-preview-head p { margin: 0; font-size: 0.82rem; color: var(--ink-muted); }
.big-preview-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #121516; border: 8px solid #121516; box-shadow: var(--shadow); }
.big-preview-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.checkbox-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 6px; background: #fff; }
.checkbox-list label { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.checkbox-list label:hover { background: var(--cream-100); }

.link-box { display: flex; gap: 8px; align-items: center; }
.link-box input { font-size: 0.84rem; color: var(--ink-soft); background: var(--cream-100); }

.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Branding */
.color-row { display: flex; gap: 20px; flex-wrap: wrap; }
.color-row .field { display: flex; flex-direction: column; }
.logo-current { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.logo-current img { height: 56px; max-width: 160px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 4px; }

/* ---------- Auth pages ---------- */

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side {
  background:
    radial-gradient(circle at 85% 90%, rgba(238, 106, 75, 0.35), transparent 40%),
    var(--teal-900);
  color: var(--cream-100);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-side blockquote { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 2vw + 0.8rem, 2.4rem); line-height: 1.12; letter-spacing: -0.02em; max-width: 14em; }
.auth-side p { color: #cfe3df; margin: 14px 0 0; max-width: 30em; }
.auth-side small { color: #9fc0bb; }
.auth-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; margin: 0 0 6px; letter-spacing: -0.02em; }
.auth-card .lead { color: var(--ink-soft); margin: 0 0 24px; }
.auth-foot { text-align: center; margin: 16px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.auth-mobile-brand { display: none; margin-bottom: 28px; }

/* ---------- Misc ---------- */

.htmx-swapping { opacity: 0.4; transition: opacity 0.15s ease; }
.htmx-request .avail-btn, .avail-btn.htmx-request { opacity: 0.6; }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .editor-layout, .two-col { grid-template-columns: minmax(0, 1fr); }
  .preview-panel { position: static; }
  .template-picker { grid-template-columns: 1fr; }
  .template-option .template-card { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; }
}

@media (max-width: 860px) {
  .app-shell { flex-direction: column; background: none; }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 25;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
  }
  .sidebar .brand-mark span { display: none; }
  .sidebar .brand-mark { padding: 0 4px; }
  .nav-group { flex-direction: row; overflow-x: auto; scrollbar-width: none; flex: 1; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .nav-group::-webkit-scrollbar { display: none; }
  .nav-link { padding: 9px 11px; white-space: nowrap; font-size: 0.86rem; }
  .nav-link .icon { display: none; }
  .nav-link[aria-current="page"]::before { left: 10px; right: 10px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .sidebar-footer { margin: 0; border: none; padding: 0; }
  .sidebar-account { display: none; }
  .sidebar-footer .nav-button span { display: none; }
  .sidebar-footer .nav-button .icon { display: block; }
  .main { padding: 22px 16px 56px; }
  .editor-toolbar { margin: -22px -16px 18px; padding: 12px 16px; top: 56px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: inline-flex; }
}

@media (max-width: 600px) {
  .page-title { font-size: 1.6rem; }
  .setup-steps { grid-template-columns: 1fr; }
  .item-row { flex-wrap: wrap; padding: 12px 14px; }
  .item-info { flex-basis: calc(100% - 140px); }
  .item-thumb + .item-info { flex-basis: calc(100% - 200px); }
  .item-actions { width: 100%; justify-content: flex-end; }
  .item-price { min-width: 0; }
  .category-block-header { padding: 12px 14px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .variant-head, .variant-row { grid-template-columns: minmax(0, 1fr) 100px 80px; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal-foot { padding: 12px 18px 16px; }
  .row-list > li { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; }
  .template-option .template-card { grid-template-columns: 120px minmax(0, 1fr); }
  .editor-status .status-note { display: none; }
  .table-simple th:nth-child(2), .table-simple td:nth-child(2) { display: none; }
}
