/* =====================================================
   FLOREON STAFF – admin site styles
   ===================================================== */
:root {
  --bg: #fbf5f7;        /* blush white */
  --panel: #ffffff;
  --ink: #2f2636;       /* plum ink */
  --muted: #76687f;
  --line: #eadde3;
  --soft: #f5ecf0;      /* hover / input fill */
  --petal: #d9637f;     /* primary, from the logo pink */
  --petal-ink: #b44663;
  --moss: #5f8f5b;      /* success / published, from the logo leaves */
  --moss-soft: #e8f1e6;
  --danger: #c0443f;
  --stripe: linear-gradient(180deg, #f07f8f 0%, #d9a07a 50%, #8cc47c 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 30, 55, .06), 0 6px 20px rgba(60, 30, 55, .06);
  --side-w: 236px;
  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1722; --panel: #271f2e; --ink: #f4e9f0; --muted: #b6a6c0; --line: #3a2f45; --soft: #312739;
    --petal: #ec7f99; --petal-ink: #f6a1b5; --moss: #88c07f; --moss-soft: #263627; --danger: #f07a72;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.15rem; }
p { margin: 0; }
a { color: var(--petal-ink); }
small { font-size: .82em; color: var(--muted); font-weight: 600; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--petal) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.ico { width: 20px; height: 20px; flex: none; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- buttons + fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .95rem var(--font-body); color: #fff; background: var(--petal); border: 1px solid transparent;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--petal-ink); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger:not(.ghost) { background: var(--danger); }
.btn.ghost.danger { color: var(--danger); }
.btn.small { padding: 7px 13px; font-size: .86rem; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--soft); }

input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--petal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--petal) 22%, transparent); }
select { cursor: pointer; width: auto; max-width: 100%; }
label > select { width: 100%; }
label { display: grid; gap: 6px; font-weight: 700; font-size: .9rem; }
label small { font-weight: 600; }
.stack { display: grid; gap: 14px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.full { width: 100%; }
.err { color: var(--danger); font-weight: 700; font-size: .9rem; min-height: 1.3em; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); background: var(--panel); border-radius: 22px; padding: 34px 30px 26px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, #f07f8f, #d9a07a, #8cc47c); }
.login-card img { display: block; margin-bottom: 14px; }
.login-card .lead { margin: 4px 0 22px; }
.fine { margin-top: 18px; font-size: .84rem; color: var(--muted); }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
  background: var(--panel); display: flex; flex-direction: column; padding: 20px 14px 16px;
  border-right: 1px solid var(--line); overflow-y: auto;
}
/* the one bold element: the logo's petal-to-leaf gradient down the sidebar edge */
.side::after { content: ""; position: fixed; top: 0; bottom: 0; left: calc(var(--side-w) - 3px); width: 3px; background: var(--stripe); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; text-decoration: none; color: var(--ink); }
.brand span { display: grid; font: 600 1.2rem/1.05 var(--font-display); }
.brand small { font: 700 .74rem var(--font-body); color: var(--muted); }
.nav { display: grid; gap: 10px; }
.nav-group { display: grid; gap: 2px; }
.nav-label { font-size: .78rem; font-weight: 800; color: var(--muted); padding: 0 12px 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 6px 12px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem;
}
.nav a .ico { color: var(--muted); }
.nav a:hover { background: var(--soft); }
.nav a.active { background: color-mix(in srgb, var(--petal) 14%, var(--panel)); color: var(--petal-ink); }
.nav a.active .ico { color: var(--petal); }
.side-foot { margin-top: auto; padding-top: 14px; display: grid; gap: 2px; }
.who { display: grid; padding: 0 12px 8px; font-weight: 800; }
.who small { overflow: hidden; text-overflow: ellipsis; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 10px; border: 0; background: none; font: 700 .9rem var(--font-body); color: var(--muted); cursor: pointer; text-decoration: none; text-align: left; }
.side-link:hover { background: var(--soft); color: var(--ink); }
.side-link .ico { width: 18px; height: 18px; }
.main-wrap { flex: 1; margin-left: var(--side-w); min-width: 0; }
.main { max-width: 1120px; margin: 0 auto; padding: 36px 40px 80px; outline: none; }
.topbar { display: none; }
.scrim { display: none; }

/* ---------- page header + panels ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.lead { color: var(--muted); margin-top: 4px; max-width: 60ch; }
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.panel > h2 { margin-bottom: 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.empty, .loading { color: var(--muted); padding: 10px 0; }
.tag { display: inline-block; font-size: .74rem; font-weight: 800; padding: 1px 9px; border-radius: 999px; background: var(--moss-soft); color: var(--moss); }
.tag.draft { background: var(--soft); color: var(--muted); }

/* ---------- dashboard ---------- */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.quick-link {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  border: 1px solid transparent; transition: border-color .15s;
}
.quick-link:hover { border-color: var(--petal); }
.quick-link .ico { width: 26px; height: 26px; color: var(--petal); margin-top: 2px; }
.quick-link span { display: grid; gap: 2px; color: var(--muted); font-size: .9rem; }
.quick-link strong { color: var(--ink); font-size: 1rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rows li:first-child { border-top: 0; }
.rows li > a { font-weight: 700; color: var(--ink); text-decoration: none; }
.rows li > a:hover { color: var(--petal-ink); text-decoration: underline; }
.meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: .85rem; }
.subtle { color: var(--muted); }
.soon { display: flex; gap: 14px; align-items: flex-start; max-width: 640px; }
.soon .ico { width: 26px; height: 26px; color: var(--moss); }

/* ---------- media library ---------- */
.dropzone {
  display: grid; grid-template-columns: auto 1fr auto; gap: 6px 16px; align-items: center;
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--panel);
  transition: border-color .15s, background .15s;
}
.dropzone > .ico { width: 30px; height: 30px; color: var(--petal); }
.dropzone.drag { border-color: var(--petal); background: color-mix(in srgb, var(--petal) 6%, var(--panel)); }
.dropzone .progress { grid-column: 1 / -1; }
.progress { color: var(--moss); font-weight: 700; font-size: .9rem; min-height: 0; }
.progress:empty { display: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 14px; }
.search { position: relative; display: block; flex: 1 1 240px; max-width: 380px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input { padding-left: 38px; border-radius: 999px; }
.count { color: var(--muted); font-size: .88rem; font-weight: 700; margin-right: auto; }
.media-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.media-layout:has(.detail:not([hidden])) { grid-template-columns: 1fr 320px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.grid > .empty, .grid > .loading { grid-column: 1 / -1; }
.tile {
  display: grid; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--panel); box-shadow: var(--shadow); text-align: left; font: inherit; color: var(--ink);
}
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block;
  background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px; } /* checkerboard shows transparency */
.tile-name { font-size: .8rem; font-weight: 700; padding: 6px 9px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.tile:hover { border-color: var(--line); }
.tile.selected { border-color: var(--petal); }
.tile.selected .tile-name { color: var(--petal-ink); }
.detail { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; position: sticky; top: 20px; display: grid; gap: 14px; }
.detail-head { display: flex; justify-content: space-between; align-items: center; }
.detail-img img { width: 100%; max-height: 240px; object-fit: contain; border-radius: 10px;
  background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px; }
.facts { margin: 0; display: grid; gap: 4px; font-size: .88rem; }
.facts div { display: grid; grid-template-columns: 60px 1fr; gap: 8px; }
.facts dt { color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.used { font-size: .86rem; color: var(--muted); }

/* ---------- dialogs ---------- */
.dialog-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(35, 20, 40, .5); display: grid; place-items: center; padding: 18px; }
.dialog { width: min(460px, 100%); max-height: calc(100vh - 36px); display: flex; flex-direction: column; background: var(--panel); border-radius: 18px; box-shadow: 0 20px 60px rgba(30, 10, 30, .3); }
.dialog.wide { width: min(880px, 100%); }
.dialog header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px 22px; }
.dialog-body { padding: 8px 22px 6px; overflow-y: auto; display: grid; gap: 10px; }
.dialog footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; }
.picker-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.picker-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding: 4px 2px 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 95;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: .25s;
  background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-weight: 700; max-width: min(560px, calc(100vw - 32px));
}
.toast[data-kind="error"] { background: var(--danger); color: #fff; border-radius: 16px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens ---------- */
@media (max-width: 1000px) {
  .quick { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .media-layout:has(.detail:not([hidden])) { grid-template-columns: 1fr; }
  .detail { position: static; }
}
@media (max-width: 820px) {
  .main-wrap { margin-left: 0; }
  .main { padding: 22px 16px 70px; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; }
  .side { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .side::after { display: none; }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(35, 20, 40, .4); }
  h1 { font-size: 1.5rem; }
  .dropzone { grid-template-columns: 1fr; text-align: left; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* =====================================================
   PAGE LIST + EDITOR
   ===================================================== */
.panel.flush { padding: 4px 0; }
.table-rows { list-style: none; margin: 0; padding: 0; }
.table-rows > li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px; padding: 12px 22px; border-top: 1px solid var(--line); }
.table-rows > li:first-child { border-top: 0; }
.table-rows > li.empty, .table-rows > li.loading { display: block; }
.row-main { display: grid; text-decoration: none; color: var(--ink); min-width: 0; }
.row-main strong { font-size: 1rem; }
.row-main:hover strong { color: var(--petal-ink); text-decoration: underline; }
.row-main .subtle { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: inline-flex; gap: 10px; align-items: center; color: var(--muted); font-size: .86rem; }
.row-acts { display: inline-flex; gap: 6px; align-items: center; }
.icon-btn.danger { color: var(--danger); }
.icon-btn[disabled] { opacity: .35; cursor: default; background: none; }
.hint { margin-top: 14px; color: var(--muted); font-size: .9rem; }
.prefixed { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); }
.prefixed > span { padding: 9px 4px 9px 12px; color: var(--muted); font-weight: 600; background: var(--soft); white-space: nowrap; }
.prefixed input { border: 0; border-radius: 0; }
.prefixed:focus-within { border-color: var(--petal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--petal) 22%, transparent); }
.prefixed input:focus { box-shadow: none; }

.back { display: inline-block; margin-bottom: 8px; font-weight: 700; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--petal-ink); }
.editor-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin: 0 -40px 18px; padding: 12px 40px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.editor-title { display: grid; min-width: 0; }
.editor-title h1 { font-size: 1.6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-title .subtle { font-size: .88rem; }
.editor-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.save-state { font-size: .86rem; font-weight: 700; color: var(--moss); }
.save-state.warn { color: var(--petal-ink); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; font-size: .9rem; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; padding: 0; border: 0; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--moss); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:checked + span { color: var(--moss); }

.page-settings { margin-bottom: 18px; padding: 0; }
.page-settings > summary { cursor: pointer; padding: 16px 22px; font: 600 1.05rem var(--font-display); list-style: none; display: flex; gap: 10px; align-items: baseline; }
.page-settings > summary::-webkit-details-marker { display: none; }
.page-settings > summary::before { content: "›"; color: var(--muted); transition: transform .2s; display: inline-block; }
.page-settings[open] > summary::before { transform: rotate(90deg); }
.page-settings > .stack { padding: 0 22px 20px; }

.blocks { display: grid; gap: 0; }
.block { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid transparent; transition: border-color .15s; }
.block.open { border-color: color-mix(in srgb, var(--petal) 40%, var(--line)); }
.block.is-hidden .block-head { opacity: .6; }
.block.dragging { opacity: .4; }
.block.drop-before { box-shadow: 0 -3px 0 var(--petal), var(--shadow); }
.block.drop-after { box-shadow: 0 3px 0 var(--petal), var(--shadow); }
.block-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 4px; }
.drag { cursor: grab; color: var(--muted); padding: 8px 6px; letter-spacing: -2px; font-weight: 800; user-select: none; }
.block-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 8px 6px; text-align: left; font: inherit; color: var(--ink); border-radius: 8px; }
.block-toggle .ico { color: var(--petal); }
.block-label { font-weight: 800; white-space: nowrap; }
.block-sum { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.block-acts { display: inline-flex; gap: 2px; flex: none; }
.block-acts .icon-btn { width: 34px; height: 34px; }
.block-acts .ico { width: 18px; height: 18px; }
.block-body { padding: 6px 22px 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.add-between { display: flex; justify-content: center; height: 14px; position: relative; }
.add-between:first-child { height: 0; }
.add-between .add-block { position: absolute; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity .15s; z-index: 2; }
.add-between:hover .add-block, .add-between .add-block:focus-visible { opacity: 1; }
.add-block { display: inline-flex; align-items: center; gap: 6px; font: 700 .82rem var(--font-body); color: var(--petal-ink); background: var(--panel); border: 1px dashed var(--petal); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.add-block .ico { width: 16px; height: 16px; }
.add-block.big { margin-top: 18px; width: 100%; justify-content: center; padding: 14px; font-size: .95rem; border-radius: var(--radius); }
.add-block:hover { background: color-mix(in srgb, var(--petal) 8%, var(--panel)); }
details.more > summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: .9rem; }
details.more[open] > summary { margin-bottom: 12px; }

/* block type chooser */
.block-types { display: grid; gap: 18px; padding-bottom: 10px; }
.block-types h3 { font-size: .95rem; margin-bottom: 8px; color: var(--muted); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.type-btn { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font: inherit; color: var(--muted); font-size: .88rem; }
.type-btn span { display: grid; gap: 2px; }
.type-btn strong { color: var(--ink); font-size: .95rem; }
.type-btn .ico { color: var(--petal); margin-top: 2px; }
.type-btn:hover { border-color: var(--petal); background: color-mix(in srgb, var(--petal) 5%, var(--panel)); }

/* versions */
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.version { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font: inherit; color: var(--ink); }
.version span { color: var(--muted); font-size: .88rem; }
.version:hover { border-color: var(--petal); }

/* =====================================================
   FIELDS
   ===================================================== */
.field { display: grid; gap: 8px; }
.field-label { font-weight: 700; font-size: .9rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--petal); flex: none; }
.toggle small { flex-basis: 100%; margin-left: 28px; }
.note { font-size: .9rem; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 10px 14px; }
textarea { resize: vertical; min-height: 60px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.image-field { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.image-field img { width: 140px; height: 96px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line);
  background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0 / 14px 14px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs figure { margin: 0; width: 120px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.thumbs img { width: 100%; height: 76px; object-fit: cover; display: block; }
.thumbs figcaption { display: flex; justify-content: space-between; }
.thumbs figcaption .icon-btn { width: 32px; height: 28px; font-weight: 800; }
.thumbs figcaption .ico { width: 16px; height: 16px; }
.thumb-add { width: 120px; min-height: 108px; display: grid; place-items: center; align-content: center; gap: 4px; border: 2px dashed var(--line); border-radius: 10px; background: none; color: var(--muted); font: 700 .85rem var(--font-body); cursor: pointer; }
.thumb-add:hover { border-color: var(--petal); color: var(--petal-ink); }

.repeater { gap: 10px; }
.rep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rep-item { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.rep-item.open { background: var(--panel); border-color: color-mix(in srgb, var(--petal) 35%, var(--line)); }
.rep-head { display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 2px; }
.rep-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 8px 10px; text-align: left; font: 700 .93rem var(--font-body); color: var(--ink); border-radius: 10px; }
.rep-n { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--soft); color: var(--muted); font-size: .78rem; }
.rep-item.open .rep-n { background: var(--petal); color: #fff; }
.rep-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-acts { display: inline-flex; flex: none; }
.rep-acts .icon-btn { width: 32px; height: 32px; }
.rep-acts .ico { width: 16px; height: 16px; }
.rep-body { padding: 4px 14px 16px; }
.repeater > .btn { justify-self: start; }

/* rich text */
.rt { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; }
.rt:focus-within { border-color: var(--petal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--petal) 22%, transparent); }
.rt-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); background: var(--soft); }
.rt-bar button { font: 700 .82rem var(--font-body); color: var(--ink); background: none; border: 0; border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.rt-bar button.b { font-weight: 900; }
.rt-bar button.i { font-style: italic; font-family: Georgia, serif; }
.rt-bar button:hover { background: var(--panel); }
.rt-bar button.on { background: var(--petal); color: #fff; }
.rt-bar button[disabled] { opacity: .4; cursor: default; background: none; }
.rt-area { min-height: 110px; max-height: 480px; overflow-y: auto; padding: 10px 14px; outline: none; line-height: 1.6; }
.rt-area p { margin: 0 0 10px; }
.rt-area p:last-child { margin-bottom: 0; }
.rt-area ul, .rt-area ol { margin: 0 0 10px; padding-left: 22px; }
.rt-area img { max-width: 100%; max-height: 220px; border-radius: 10px; display: block; margin: 6px 0; }
.rt-area code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.rt-area a { color: var(--petal-ink); }
.rt-area .ph { display: none; }
.rt-src { border: 0; border-radius: 0; font: .86rem/1.5 ui-monospace, Consolas, monospace; min-height: 160px; }

@media (max-width: 820px) {
  .editor-bar { position: static; margin: 0 0 14px; padding: 0 0 12px; background: none; backdrop-filter: none; }
  .editor-acts { width: 100%; }
  .editor-acts #saveBtn { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; box-shadow: 0 6px 20px rgba(60, 30, 55, .3); padding: 12px 24px; }
  .editor-acts #saveBtn[disabled] { display: none; }
  .save-state { flex-basis: 100%; order: 3; }
  .page-settings > summary small { display: none; }
  .add-between:first-child { height: 34px; }
  .editor-title h1 { font-size: 1.25rem; }
  .table-rows > li { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .row-meta { grid-column: 1 / -1; grid-row: 2; }
  .block-sum { display: none; }
  .block-acts [data-bact=copy] { display: none; }
  .block-body { padding: 14px 14px 18px; }
  .add-between .add-block { opacity: 1; }
  .add-between { height: 34px; }
}

/* =====================================================
   NEWS + MENU
   ===================================================== */
.table-rows > li.has-thumb .row-main { grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.row-main > span { display: grid; min-width: 0; }
.row-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; }
.tag.warn-tag { background: #fde8e4; color: var(--danger); }
.menu-layout { display: grid; grid-template-columns: 1fr 260px; gap: 22px; align-items: start; }
.menu-items { display: grid; gap: 10px; }
.menu-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; background: var(--panel); }
.menu-item.group { background: var(--bg); }
.menu-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-head .rep-acts { margin-left: auto; align-items: center; gap: 2px; }
.type-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 800; color: var(--muted); }
.type-tag .ico { width: 16px; height: 16px; color: var(--petal); }
.menu-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 8px; }
.move-into { font-size: .82rem; padding: 5px 8px; border-radius: 999px; }
.menu-children { list-style: none; margin: 12px 0 10px; padding: 0 0 0 14px; border-left: 3px solid var(--line); display: grid; gap: 8px; }
.menu-item.child { padding: 8px 12px 12px; }
.add-row { padding-top: 4px; }
.menu-preview { position: sticky; top: 90px; display: grid; gap: 10px; }
.menu-preview h2 { font-size: 1rem; }
.menu-preview h3 { font-size: .95rem; margin-top: 10px; }
.nav-preview { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 2px; font-weight: 700; font-size: .92rem; }
.nav-preview span { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; color: var(--muted); }
.nav-preview span .ico { width: 18px; height: 18px; }
.nav-preview > span:first-child { background: var(--petal); color: #fff; }
.nav-preview b, .nav-preview i { margin-left: auto; font-style: normal; font-weight: 400; }
.pv-children { margin-left: 22px; padding-left: 8px; border-left: 2px solid var(--line); display: grid; }
.pv-children span { padding: 4px 8px; font-size: .86rem; }
.missing { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.missing li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .9rem; }
@media (max-width: 1000px) {
  .menu-layout { grid-template-columns: 1fr; }
  .menu-preview { position: static; order: -1; }
}

/* notices + color field */
.notice { margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; background: #fff3e2; color: #8a5413; font-size: .92rem; font-weight: 600; max-width: 820px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notice { background: #3b2d1c; color: #f2b46b; } }
.color-field input[type=color] { width: 64px; height: 38px; padding: 3px; cursor: pointer; }
