/* Würth Content — editor UI
   Quiet, workshop-plain editor; the live preview pane on the right is the
   one place with weight: it mirrors the eshop so editors see what they ship. */
:root {
  --red: #cc0000;
  --red-dark: #a30000;
  --red-tint: #fbeaea;
  --ink: #1e2124;
  --text: #33383d;
  --muted: #6a7178;
  --line: #d5d9dd;
  --line-soft: #e8ebee;
  --paper: #f6f7f8;
  --panel: #ffffff;
  --graphite: #2b2f33;
  --ok: #1e7a46;
  --ok-tint: #e5f3eb;
  --warn: #8f5000;
  --warn-tint: #fff3df;
  --focus: #0057b8;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--paper); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 650; }
a { color: var(--red); }
button { font: inherit; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #aeb4ba; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-danger { color: var(--red); }
.icon-btn {
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; padding: 0;
}
.icon-btn:hover { color: var(--ink); border-color: #aeb4ba; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 18px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 15px; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; background: var(--red); border-radius: 3px; position: relative; overflow: hidden; }
.brand-mark::after { content: ""; position: absolute; left: 5px; right: 5px; top: 10px; height: 2px; background: #fff; }
.sites { display: flex; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; }
.sites button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 4px; font-weight: 600; color: var(--muted); cursor: pointer; }
.sites button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
/* ---------- find a page ---------- */
.search { position: relative; flex: 0 1 420px; min-width: 200px; }
.search input {
  width: 100%; height: 34px; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 64px 0 32px; font: inherit; color: var(--ink); background: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a7178' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.search input:focus { outline: none; border-color: var(--focus); background-color: #fff; box-shadow: 0 0 0 3px rgba(0,87,184,.15); }
.search input::-webkit-search-cancel-button { display: none; }
.search-key {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none;
  font: 600 11px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; background: #fff;
}
.search input:focus + .search-key, .search input:not(:placeholder-shown) + .search-key { display: none; }
.search-results {
  position: absolute; left: 0; right: 0; top: 40px; z-index: 30; list-style: none; margin: 0; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(20,25,30,.16); max-height: min(70vh, 520px); overflow-y: auto; min-width: 360px;
}
.search-results li[role=option] {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 4px; cursor: pointer;
}
.search-results li[role=option][aria-selected="true"], .search-results li[role=option]:hover { background: var(--red-tint); }
.search-results .thumb { width: 36px; height: 26px; border-radius: 3px; background: var(--line-soft) center/cover no-repeat; flex: 0 0 auto; }
.search-results .txt { flex: 1 1 auto; min-width: 0; }
.search-results .txt b { display: block; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .txt small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .kind { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.search-results .head { padding: 8px 9px 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
.search-results .none { padding: 12px 10px; color: var(--muted); }
mark { background: #ffe59a; color: inherit; border-radius: 2px; padding: 0 1px; }
@media (max-width: 1100px) { .search-key { display: none; } }

.status { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status .pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-weight: 600; margin-right: 8px; font-size: 12px; }
.pill-draft { background: var(--warn-tint); color: var(--warn); }
.pill-live { background: var(--ok-tint); color: var(--ok); }
.pill-saving { background: var(--line-soft); color: var(--muted); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: 40px; min-width: 240px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(20,25,30,.12); padding: 6px; display: flex; flex-direction: column;
}
.menu-pop button, .menu-pop a {
  text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 4px; color: var(--ink);
  text-decoration: none; cursor: pointer; width: 100%; font-size: 13px;
}
.menu-pop button:hover, .menu-pop a:hover { background: var(--paper); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 0; }
.menu-pop form { margin: 0; }
.menu-user { padding: 6px 10px; font-size: 12px; color: var(--muted); }

.conflict {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px;
  background: var(--warn-tint); color: var(--warn); font-weight: 600; border-bottom: 1px solid #f0d4a8;
}

/* ---------- three panes ---------- */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 420px; height: calc(100vh - 56px); }
.side { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 12px 0 24px; }
.editor { overflow-y: auto; padding: 24px 32px 80px; outline: none; }
.preview { overflow-y: auto; background: var(--graphite); padding: 18px; color: #c9cfd5; }
@media (max-width: 1280px) { .shell { grid-template-columns: 240px minmax(0, 1fr); } .preview { display: none; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; height: auto; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .top { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .status { order: 5; flex-basis: 100%; }
}

/* ---------- sidebar ---------- */
.side-group { padding: 8px 12px 4px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px; }
.side-head h2 { font-size: 13px; color: var(--muted); font-weight: 650; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list button {
  width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 4px;
  display: flex; align-items: center; gap: 8px; color: var(--ink); cursor: pointer;
}
.side-list button:hover { background: var(--paper); }
.side-list button[aria-current="true"] { background: var(--red-tint); color: var(--red-dark); font-weight: 600; }
.side-list .lbl { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-list .thumb { width: 28px; height: 21px; border-radius: 3px; background: var(--line-soft) center/cover no-repeat; flex: 0 0 auto; }
.side-list .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: 0 0 auto; }
.side-list .sched { font-size: 11px; color: var(--muted); }
.side-search { width: 100%; height: 30px; margin: 2px 0 6px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }

/* ---------- editor ---------- */
.ed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; max-width: 860px; }
.ed-head h1 { font-size: 22px; line-height: 1.25; word-break: break-word; }
.ed-head p { margin: 4px 0 0; color: var(--muted); }
.ed-head .acts { display: flex; gap: 8px; flex: 0 0 auto; }
.sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 6px; margin-bottom: 16px; max-width: 860px; }
.sec > h2 { font-size: 15px; margin-bottom: 4px; }
.sec > .hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; font-size: 13px; }
.field > small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.field input[type=text], .field input[type=url], .field input[type=date], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; font: inherit; color: var(--ink); background: #fff;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input::placeholder, .field textarea::placeholder { color: #9aa1a8; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(0,87,184,.15); }
.field.bad input, .field.bad textarea { border-color: var(--red); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 600; color: var(--ink); font-size: 13px; }
.inherit { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }

.img-field { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; }
.img-thumb { width: 96px; height: 64px; border-radius: 4px; border: 1px solid var(--line); background: var(--paper) center/cover no-repeat; display: grid; place-items: center; color: #9aa1a8; font-size: 11px; }
.img-ctrl { display: flex; flex-direction: column; gap: 6px; }
.img-ctrl .row { display: flex; gap: 6px; }

/* ordered card list */
.reflist { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.reflist:empty { display: none; }
.refrow { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-top: 1px solid var(--line-soft); background: #fff; }
.refrow:first-child { border-top: 0; }
.refrow.dragging { opacity: .4; }
.refrow.over { box-shadow: inset 0 2px 0 var(--focus); }
.refrow .grip { cursor: grab; color: #9aa1a8; user-select: none; }
.refrow .thumb { width: 48px; height: 32px; border-radius: 3px; background: var(--line-soft) center/cover no-repeat; flex: 0 0 auto; }
.refrow .meta { flex: 1 1 auto; min-width: 0; }
.refrow .meta b { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.refrow .meta small { color: var(--muted); }
.refrow .tag { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--line-soft); color: var(--muted); }
.refrow .tag.warn { background: var(--warn-tint); color: var(--warn); }
.refrow .acts { display: flex; gap: 4px; }
.addrow { display: flex; gap: 8px; margin-bottom: 14px; }
.addrow select { flex: 1 1 auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; font: inherit; }
.empty-note { padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); margin-bottom: 12px; font-size: 13px; }

/* offers table */
.drops { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 13px; }
.drops th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); font-size: 12px; }
.drops td { padding: 5px 4px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.drops input { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; font: inherit; min-width: 0; }
.drops td.art { width: 150px; }
.drops td.price { width: 110px; }
.drops td.date { width: 128px; }
.drops td.acts { width: 96px; white-space: nowrap; }
.drops .found { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 11px; color: var(--muted); }
.drops .found img { width: 22px; height: 22px; object-fit: contain; background: #fff; border-radius: 2px; }
.drops .found.miss { color: var(--red); font-weight: 600; }
.drops tr.sched-off td { background: #fafafa; }

.usedby { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.usedby button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px; cursor: pointer; font-size: 12px; }
.feeds code { display: block; padding: 8px 10px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 4px; margin: 4px 0 12px; word-break: break-all; }

/* ---------- preview pane (the eshop in miniature) ---------- */
.pv-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.pv-head h2 { color: #fff; font-size: 13px; font-weight: 600; }
.pv-head small { color: #8d959d; }
.pv-page { background: #f4f5f7; border-radius: 4px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.pv-hero { position: relative; min-height: 150px; padding: 18px 16px; color: #fff; background: radial-gradient(120% 140% at 82% 30%, #3a3f45 0%, #1a1d21 55%, #0e1013 100%) center/cover no-repeat; }
.pv-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,17,20,.95) 0%, rgba(15,17,20,.8) 50%, rgba(15,17,20,.3) 100%); }
.pv-hero > * { position: relative; }
.pv-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; border: 1px solid rgba(255,255,255,.3); border-radius: 99px; padding: 2px 8px 2px 3px; margin-bottom: 8px; }
.pv-badge i { display: inline-block; height: 14px; min-width: 14px; border-radius: 99px; background: #fff center/contain no-repeat; }
.pv-hero h3 { color: #fff; font-size: 17px; line-height: 1.1; font-weight: 800; }
.pv-hero p { margin: 6px 0 0; font-size: 10px; color: #d6d9dd; max-width: 260px; }
.pv-cta { display: inline-block; margin-top: 8px; background: var(--red); color: #fff; font-size: 9px; font-weight: 700; padding: 4px 8px; border-radius: 3px; }
.pv-search { margin-top: 10px; height: 18px; width: 70%; background: #fff; border-radius: 3px; }
.pv-sec { padding: 10px 12px; }
.pv-sec h4 { margin: 0 0 6px; font-size: 11px; color: #252525; }
.pv-sec h4 em { font-style: normal; color: var(--red); }
.pv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pv-card { position: relative; aspect-ratio: 4/3; background: #dedede center/cover no-repeat; border-radius: 2px; overflow: hidden; }
.pv-card.wide { grid-column: span 2; aspect-ratio: auto; }
.pv-card.thin { grid-column: 1 / -1; aspect-ratio: 16/3; }
.pv-card span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px; font-size: 7px; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.8), transparent); }
.pv-res { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.pv-res .r { background: #fff; border: 1px solid #dedede; border-radius: 3px; overflow: hidden; font-size: 8px; color: #252525; }
.pv-res .r.full { grid-column: 1 / -1; }
.pv-res .r i { display: block; aspect-ratio: 876/350; background: #dedede center/cover no-repeat; }
.pv-res .r b { display: block; padding: 3px 5px; font-weight: 600; }
.pv-drops { display: flex; gap: 4px; overflow: hidden; }
.pv-drop { flex: 0 0 22%; background: #fff; border: 1px solid #dedede; border-radius: 2px; padding: 4px; font-size: 7px; color: #252525; }
.pv-drop i { display: block; aspect-ratio: 1; background: #f4f5f7 center/contain no-repeat; margin-bottom: 2px; }
.pv-drop b { color: var(--red); display: block; }
.pv-kam { display: flex; gap: 8px; align-items: center; background: #fff; margin: 8px 12px 0; padding: 6px 8px; border-radius: 3px; border: 1px solid rgba(204,0,0,.28); font-size: 9px; color: #252525; }
.pv-kam i { width: 22px; height: 22px; border-radius: 50%; background: #b9c1ca center/cover no-repeat; flex: 0 0 auto; }
.pv-note { margin-top: 10px; font-size: 12px; color: #8d959d; }

/* ---------- modal + toast ---------- */
.modal { border: 0; border-radius: 8px; padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 64px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal::backdrop { background: rgba(20,24,28,.45); }
.modal-in { padding: 22px 24px; }
.modal-in h2 { font-size: 18px; margin-bottom: 6px; }
.modal-in > p { color: var(--muted); margin: 0 0 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.msgs { list-style: none; margin: 0 0 12px; padding: 0; max-height: 260px; overflow-y: auto; }
.msgs li { padding: 6px 10px; border-radius: 4px; margin-bottom: 4px; font-size: 13px; }
.msgs .e { background: var(--red-tint); color: var(--red-dark); }
.msgs .w { background: var(--warn-tint); color: var(--warn); }
.msgs .c { background: var(--paper); color: var(--ink); }
.vlist { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.vlist li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--line-soft); }
.vlist li:first-child { border-top: 0; }
.vlist .v { font-weight: 700; color: var(--ink); width: 44px; }
.vlist .m { flex: 1 1 auto; min-width: 0; }
.vlist .m small { display: block; color: var(--muted); }
.vlist .live { font-size: 11px; font-weight: 700; color: var(--ok); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 55vh; overflow-y: auto; }
.media-grid button { border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 4px; cursor: pointer; text-align: left; font-size: 11px; color: var(--muted); }
.media-grid button:hover { border-color: var(--focus); }
.media-grid i { display: block; aspect-ratio: 4/3; background: var(--paper) center/contain no-repeat; margin-bottom: 4px; }
textarea.import { width: 100%; min-height: 220px; font: 12px/1.4 Consolas, "Cascadia Mono", monospace; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.field-inline { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.field-inline input { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; font: inherit; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; font-weight: 600; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.bad { background: var(--red-dark); }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--graphite); }
.login { background: var(--panel); border-radius: 8px; padding: 32px 32px 28px; width: min(400px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-mark { width: 40px; height: 40px; background: var(--red); border-radius: 5px; position: relative; margin-bottom: 18px; }
.login-mark span { position: absolute; left: 9px; right: 9px; top: 19px; height: 3px; background: #fff; }
.login h1 { font-size: 22px; }
.login-sub { color: var(--muted); margin: 6px 0 20px; }
.login-form label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 14px; font-size: 13px; }
.login-form input { display: block; width: 100%; margin-top: 4px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 10px; font: inherit; }
.login-form .btn { width: 100%; justify-content: center; height: 40px; margin-top: 4px; }
.err { background: var(--red-tint); color: var(--red-dark); padding: 8px 12px; border-radius: 4px; font-weight: 600; margin: 0 0 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
