/* =========================================================================
   Cameo4ever — shared styles for the public site and the admin area.
   Change the design tokens below to restyle everything at once.
   ========================================================================= */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --ink: #2b2420;
  --ink-2: #5d534c;
  --muted: #8a7f76;
  --line: #e6ddd1;
  --accent: #7b2d26;        /* deep carnelian */
  --accent-ink: #ffffff;
  --accent-soft: #f6e9e4;
  --gold: #a8823f;
  --success: #2f6b3f;
  --warn: #8a5a00;
  --danger: #a12a22;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(43, 36, 32, .06), 0 4px 16px rgba(43, 36, 32, .06);
  --shadow-lg: 0 10px 40px rgba(43, 36, 32, .16);
  --container: 1240px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--ink-2); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; color: var(--gold); font-weight: 700; margin-bottom: .6em; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { margin: .25em 0; }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }
.section { padding: 40px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 16px; border-radius: var(--radius-sm); font: 600 .95rem var(--font-body);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #64231d; border-color: #64231d; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: #e7c4c0; background: #fff; }
.btn-danger:hover { background: #fbeceb; border-color: var(--danger); }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }
.btn-sm { padding: 4px 10px; font-size: .85rem; }
.btn.disabled { opacity: .4; pointer-events: none; }

input[type=text], input[type=search], input[type=number], input[type=password], input[type=email], input[type=tel], input[type=url], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 1px;
}
textarea { width: 100%; min-height: 140px; resize: vertical; }
label { font-weight: 600; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--muted); }
label.inline input[type=number] { width: 96px; }

/* ---------- Header / footer ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; color: var(--ink); }
.brand-tag { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.header-search { display: flex; gap: 8px; flex: 1; max-width: 520px; margin-left: auto; }
.header-search input { flex: 1; }
.nav-toggle { display: none; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 8px; }
.main-nav a { color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.main-nav a:hover { background: var(--surface-2); text-decoration: none; }
.main-nav a.active { background: var(--accent-soft); color: var(--accent); }
.main-nav .nav-admin { margin-left: auto; }

.site-footer { margin-top: 64px; background: var(--surface); border-top: 1px solid var(--line); padding: 32px 0; }
.footer-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-title { font-weight: 700; margin-bottom: 6px; }
.footer-meta { text-align: right; }

/* ---------- Home ---------- */
.hero { background: linear-gradient(135deg, #f4ebe0 0%, #faf7f2 60%); border-bottom: 1px solid var(--line); }
.hero-inner { padding-top: 56px; padding-bottom: 56px; max-width: 860px; margin-left: auto; margin-right: auto; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.catalog-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.catalog-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.catalog-card-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.catalog-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.catalog-card-body { padding: 16px 18px 18px; }
.catalog-card-body p { color: var(--ink-2); margin-bottom: 8px; }
.meta { font-size: .9rem; color: var(--gold); font-weight: 600; }

/* ---------- Breadcrumb, layout with sidebar ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; color: var(--muted); padding: 18px 0 8px; }
.breadcrumb .sep { color: var(--line); }
.with-sidebar { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.sidebar { position: sticky; top: 130px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; max-height: calc(100vh - 150px); overflow: auto; }
.sidebar-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.page-head { margin: 8px 0 20px; }
.page-head .lead { margin-bottom: 4px; }
details.about { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; }
details.about summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.about[open] summary { margin-bottom: 10px; }

/* Expandable catalog tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 6px; }
.tree summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: "▸"; color: var(--muted); font-size: .8rem; width: 10px; transition: transform .15s; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree-leaf { display: flex; align-items: center; gap: 6px; padding: 4px 0 4px 16px; }
.tree a { color: var(--ink); flex: 1; }
.tree a.current { color: var(--accent); font-weight: 700; }
.tree .count { font-size: .78rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 8px; }

.subcatalogs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.subcatalog { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; color: var(--ink); }
.subcatalog img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); }
.subcatalog span { display: flex; flex-direction: column; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 20px; }
.filters input[type=search] { flex: 1 1 220px; }
.result-count { color: var(--muted); }

/* ---------- Item cards ---------- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.item-card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.item-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.item-card-img { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.item-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.item-card.is-sold .item-card-img img { filter: grayscale(.6); opacity: .8; }
.photo-count { z-index: 1; position: absolute; right: 8px; bottom: 8px; background: rgba(43, 36, 32, .72); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.item-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.item-no { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.item-card-title { font-family: var(--font-body); font-size: .98rem; font-weight: 600; line-height: 1.35; margin: 4px 0 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-card-foot { margin-top: auto; }
.price { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.item-card-wrap { display: flex; flex-direction: column; gap: 4px; }
.card-catalog { font-size: .82rem; padding-left: 4px; }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.badge-sold { z-index: 1; position: absolute; left: 8px; top: 8px; background: var(--ink); color: #fff; letter-spacing: .08em; text-transform: uppercase; }
.badge-available { background: #e6f2e9; color: var(--success); }
.badge-hidden { background: #fbf0d9; color: var(--warn); }
.badge-sold-inline { background: var(--ink); color: #fff; }

/* Pager */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 32px 0 0; }
.pager a, .pager span { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pager .gap { border: none; background: none; }

/* ---------- Item detail ---------- */
.item-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.item-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.gallery-main { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; cursor: zoom-in; aspect-ratio: 1 / 1; }
.gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 10px; }
.thumb { position: relative; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); cursor: pointer; aspect-ratio: 1 / 1; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--accent); }
.item-info h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin-top: 6px; }
.item-price { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); margin: 4px 0 16px; }
.item-price.sold { color: var(--ink-2); }
.item-description { font-size: 1.05rem; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 18px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 14, .92); display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.lightbox figure { margin: 0; max-width: min(92vw, 1100px); max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox figcaption { color: #ddd; margin-top: 10px; }
.lightbox button { background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 999px; width: 48px; height: 48px; font-size: 1.8rem; cursor: pointer; flex: none; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lightbox-close { position: absolute; top: 16px; right: 16px; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.contact-aside { position: sticky; top: 130px; }
.contact-form .form-actions .muted { font-size: .9rem; }
.contact-item { display: flex; gap: 14px; align-items: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 16px; }
.contact-item img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.contact-item a { color: var(--ink); font-weight: 600; }
.contact-thanks h2 { color: var(--success); }
.check-list li { padding-left: 22px; position: relative; margin: 8px 0; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.item-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.main-nav .nav-contact { margin-left: auto; }
.main-nav .nav-contact + .nav-admin { margin-left: 0; }

/* ---------- Alerts ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid; margin: 0 0 16px; }
.alert-success { background: #eaf4ec; border-color: #c4dfca; color: var(--success); }
.alert-warn { background: #fbf3e2; border-color: #ecd9ae; color: var(--warn); }
.alert-error { background: #fbeceb; border-color: #efc7c3; color: var(--danger); }
.field-error, .validation-summary-errors { color: var(--danger); font-size: .9rem; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }

/* =========================================================================
   Admin
   ========================================================================= */
.admin-body { background: #f5f2ee; }
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--ink); color: #eee; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.admin-side .brand-name { color: #fff; font-size: 1.35rem; padding: 0 8px; }
.admin-side .brand-tag { color: #b9ada3; padding: 0 8px 16px; display: block; }
.admin-side nav a { display: block; color: #e9e2dc; padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 600; }
.admin-side nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.admin-side nav a.active { background: var(--accent); color: #fff; }
.admin-side .side-sep { border-top: 1px solid rgba(255, 255, 255, .12); margin: 12px 0; }
.admin-main { padding: 24px 28px 64px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font-size: 2rem; }
.admin-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel h2 { font-size: 1.35rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .9rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field .hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; }
.field input[type=checkbox], .field input[type=radio] { width: auto; flex: none; }
.field .check { justify-content: flex-start; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.form-actions .spacer { flex: 1; }

table.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.table tr:hover td { background: #fcfaf7; }
.table .thumb-cell { width: 64px; }
.table .thumb-cell img { width: 48px; min-width: 48px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.table .title-cell { max-width: 520px; }
.table .title-cell a { color: var(--ink); font-weight: 600; }
.table .row-actions { white-space: nowrap; text-align: right; }
.table input.pos { width: 64px; padding: 4px 6px; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 260px); }

/* Drag and drop */
.drag-handle { cursor: grab; color: var(--muted); user-select: none; font-size: 1.1rem; padding: 0 4px; }
.drag-handle:active { cursor: grabbing; }
[data-sort-item].dragging { opacity: .45; }
[data-sort-item].dragging td { background: var(--accent-soft) !important; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); margin-top: 12px; box-shadow: var(--shadow-lg); }
.save-bar .spacer { flex: 1; }

/* Catalog tree editor */
.cat-tree, .cat-tree ul { list-style: none; margin: 0; padding: 0; }
.cat-tree ul { margin-left: 28px; min-height: 6px; }
.cat-tree ul:empty { min-height: 0; }
.dragging-active .cat-tree ul:empty { min-height: 26px; border: 1px dashed var(--line); border-radius: var(--radius-sm); margin: 4px 0 4px 28px; }
.cat-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin: 6px 0; }
.cat-row img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.cat-row .name { font-weight: 700; }
.cat-row .info { flex: 1; min-width: 0; }
.cat-row .info .muted { font-size: .85rem; }
.cat-row .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Image manager */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.image-tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.image-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; background: var(--surface-2); }
.image-tile .tile-top { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.image-tile input[type=text] { font-size: .85rem; padding: 4px 6px; }
.image-tile.marked-delete { opacity: .45; border-color: var(--danger); }
.image-tile.marked-delete img { filter: grayscale(1); }
.primary-tag { background: var(--accent); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 999px; }
.drop-zone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); background: #fdfcfa; }
.drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.upload-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: center; }
.upload-previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; }

.login-card { max-width: 400px; margin: 10vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }

/* Admin inbox */
.nav-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--gold); color: #fff; font-size: .75rem; text-align: center; }
.messages-table tr.unread td { background: #fffaf0; }
.messages-table tr.unread a { font-weight: 700; }
.msg-snippet { font-size: .88rem; max-width: 560px; overflow: hidden; text-overflow: ellipsis; }
.message-layout { display: grid; gap: 18px; max-width: 900px; }
.message-body { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.6; background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px 18px; }
.form-actions form { margin: 0; }
.message-layout .facts { border-top: 0; padding-top: 0; }

/* Settings */
.settings-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-status > div:first-of-type { flex: 1; min-width: 240px; }
.settings-last { flex-basis: 100%; padding-left: 26px; font-size: .9rem; }
.status-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--muted); }
.status-dot.ok { background: var(--success); }
.status-dot.warn { background: #d69a1f; }
.switch-row { font-size: 1.05rem; }
.switch-row input { width: 18px; height: 18px; }
.port-ssl > div { display: flex; flex-direction: column; gap: 5px; }
.port-ssl > div input { width: 120px; }
.port-ssl .check { margin-top: 4px; }
.settings-form .panel h2 { margin-bottom: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .with-sidebar { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .contact-aside { position: static; }
  .sidebar { position: static; max-height: none; }
  .item-detail { grid-template-columns: 1fr; gap: 24px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-side .side-sep { display: none; }
  .admin-main { padding: 18px 16px 48px; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .header-row { flex-wrap: wrap; gap: 10px; }
  .header-search { order: 3; max-width: none; flex-basis: 100%; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .main-nav { display: none; flex-direction: column; }
  .main-nav.open { display: flex; }
  .main-nav .nav-admin, .main-nav .nav-contact { margin-left: 0; }
  .footer-row { grid-template-columns: 1fr; }
  .footer-meta { text-align: left; }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .item-nav .muted { display: none; }
  .brand-tag { display: none; }
}
