/* Admin look. Colours, font and shapes follow the page editor (Puck), so the
   admin and the editor feel like one app. The site's own red only appears in
   the logo mark and in previews of site content. */

@import url('https://rsms.me/inter/inter.css');

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --hover: #f5f5f5;
  --border: #dcdcdc;
  --border-soft: #efefef;
  --text: #181818;
  --text-2: #404040;
  --muted: #767676;
  /* Settings > Admin colour replaces --accent (inc/settings.php adds a
     <style> after this file); the other shades follow it. */
  --accent: #0158ad;
  --accent-hover: color-mix(in srgb, var(--accent) 78%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 11%, white);
  --accent-softer: color-mix(in srgb, var(--accent) 5%, white);
  --danger: #ac1f35;
  --danger-soft: #f6eaec;
  --success: #0c680c;
  --success-soft: #ddf3e0;
  --warn: #8a4b00;
  --warn-soft: #fbeed8;
  --brand-red: #e0402d;
  --paper: #f2f1ef;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.16);
  --sidebar: 232px;
  font-family: InterVariable, Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
button { font-family: inherit; }

.admin-icon { width: 18px; height: 18px; flex-shrink: 0; display: block; }

/* ---------- Sidebar ---------- */
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.admin-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
}
.admin-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.admin-brand-logo {
  height: 30px;
  width: auto;
  max-width: 64px;
  object-fit: contain;
  flex-shrink: 0;
}
.admin-brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.admin-brand-name small { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
/* a newer Sahl is out (see Settings) */
.update-dot { width: 7px; height: 7px; border-radius: 50%; background: #ed5618; flex-shrink: 0; }
.admin-menu-btn {
  display: none;
  border: none;
  background: none;
  color: var(--text);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}
.admin-menu-btn .admin-icon { width: 22px; height: 22px; }
.admin-nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 10px 14px;
  min-height: 0;
}
.admin-nav-main, .admin-nav-bottom { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-bottom { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
}
.admin-nav a:hover { background: var(--hover); color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.admin-nav small { color: var(--muted); font-weight: 400; margin-left: 2px; }

.admin-main {
  margin-left: var(--sidebar);
  padding: 32px 40px 64px;
  max-width: calc(var(--sidebar) + 1080px);
}

@media (max-width: 800px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    width: auto;
    inset: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-brand { padding: 10px 12px 10px 16px; }
  .admin-menu-btn { display: inline-flex; }
  .admin-nav { display: none; padding-top: 0; }
  .admin-sidebar.is-open .admin-nav { display: flex; gap: 8px; }
  .admin-main { margin-left: 0; padding: 20px 16px 48px; }
}

/* ---------- Toasts ---------- */
.admin-toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.admin-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 10px 10px 10px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.18s ease-out;
}
.admin-toast-error { background: var(--danger); }
.admin-toast button {
  border: none;
  background: none;
  color: inherit;
  opacity: 0.7;
  padding: 2px;
  cursor: pointer;
}
.admin-toast button:hover { opacity: 1; }
.admin-toast .admin-icon { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- "Update database" bar ---------- */
.update-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-softer);
  font-size: 14px;
}

/* ---------- Page heading ---------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-head p { margin: 4px 0 0; color: var(--muted); }

h2.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 12px;
}
.section-head h2 { margin: 0; }
.section-head a { font-size: 13px; text-decoration: none; font-weight: 500; }
.section-head a:hover { text-decoration: underline; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.stack > * + * { margin-top: 32px; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--hover); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger-soft); }
.btn-ghost { background: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); }
.btn-small { font-size: 13px; padding: 5px 10px; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.6; cursor: default; }
.btn-primary .admin-icon, .btn-secondary .admin-icon { width: 16px; height: 16px; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--hover); color: var(--text); }
.btn-icon .admin-icon { width: 18px; height: 18px; }
.item-row .btn-icon { height: auto; }

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 16px 0 6px;
}
input[type=text], input[type=number], input[type=date], input[type=time],
input[type=month], input[type=password], input[type=search], input[type=email], textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type=file] { font-family: inherit; font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  padding: 6px 12px;
  margin-right: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--hover); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
textarea { resize: vertical; line-height: 1.5; }
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.row3 {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 0 16px;
}
@media (max-width: 600px) {
  .row2, .row3 { grid-template-columns: 1fr; }
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 4px;
}
.checkbox-row label { margin: 0; font-weight: 500; }
.form-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-actions .dialog-msg { align-self: center; }
.empty-state {
  color: var(--muted);
  padding: 32px 20px;
  text-align: center;
}

.details-wrap summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 10px 0 6px;
  cursor: pointer;
}

.video-row, .item-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

.cover-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cover-thumb {
  width: 64px;
  height: 96px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--hover);
  flex-shrink: 0;
}
.cover-thumb-empty { visibility: hidden; }
.cover-row-controls { flex: 1 1 auto; min-width: 0; }
.cover-row-controls .hint { word-break: break-all; }

/* ---------- Status pills ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-published { background: var(--success-soft); color: var(--success); }
.status-draft { background: var(--border-soft); color: var(--text-2); }
.status-archived { background: var(--border-soft); color: var(--muted); }
.status-changes { background: var(--warn-soft); color: var(--warn); }

/* ---------- "⋯" menus ---------- */
.row-menu { position: relative; }
.row-menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 170px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  z-index: 30;
}
.row-menu.is-open .row-menu-list { display: block; }
.row-menu-list a, .row-menu-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.row-menu-list a:hover, .row-menu-list button:hover { background: var(--hover); }
.row-menu-list .danger { color: var(--danger); }
.row-menu-list .danger:hover { background: var(--danger-soft); }
.row-menu-list .admin-icon { width: 16px; height: 16px; }

/* ---------- Row lists (pages now, blog posts later) ---------- */
.row-list { overflow: visible; }
.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-soft);
}
.list-row:first-child { border-top: none; }
.list-row-main { flex: 1 1 auto; min-width: 0; }
.list-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 15px;
}
.list-row-title a { color: var(--text); text-decoration: none; }
.list-row-title a:hover { color: var(--accent); }
.list-row-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.list-row-actions { display: flex; align-items: center; gap: 6px; }
.list-row-when { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) {
  .list-row-when { display: none; }
}

/* ---------- Home ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1000px) {
  .home-grid { grid-template-columns: 1fr; }
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.quick-action:hover { border-color: var(--accent); }
.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.quick-action small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

/* ---------- Dialogs ---------- */
.book-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  background: var(--surface);
  color: var(--text);
}
.book-dialog[open] {
  display: flex;
  flex-direction: column;
}
.book-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.dialog-head h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.dialog-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 20px 22px;
}
.dialog-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 0 0 12px 12px;
}
.dialog-msg {
  flex: 1 1 auto;
  font-size: 13px;
  color: var(--muted);
}
.new-page-dialog { width: min(480px, calc(100vw - 32px)); }
@media (max-width: 600px) {
  .book-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  .dialog-foot { border-radius: 0; }
}

/* ---------- Text field with a button beside it ---------- */
.input-with-button {
  display: flex;
  gap: 8px;
}
.input-with-button input { flex: 1 1 auto; min-width: 0; }
.input-with-button button { flex: 0 0 auto; }
/* ---------- Settings ---------- */
.settings-tabs { margin-bottom: 20px; flex-wrap: wrap; }
.settings-tabs button { position: relative; }
/* unsaved changes on that tab */
.settings-tabs button.is-dirty::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
}
.settings-panel > .card + .card,
.look-controls > .card + .card { margin-top: 16px; }
.settings-card-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.settings-card-hint { margin: 0 0 10px; }
.color-row > input, .color-row > select, .color-row > textarea { max-width: 480px; }
.module-row { padding: 8px 0; }
.module-row + .module-row { border-top: 1px solid var(--border-soft); }
.module-row .hint { margin: 4px 0 0 26px; }
/* Save stays in reach at the bottom of the window */
.settings-savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.sahl-about { margin-top: 24px; }

/* Look: settings on the left, the preview stays in view on the right */
.look-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.look-preview { position: sticky; top: 16px; }
.look-preview .site-preview { height: 300px; }
@media (max-width: 1100px) {
  .look-layout { grid-template-columns: 1fr; }
  .look-preview { position: static; order: -1; }
}
.theme-list { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-chip:hover { background: var(--hover); }
.theme-chip.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); font-weight: 600; }
.theme-swatches {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.theme-swatches span { width: 10px; height: 10px; border-radius: 50%; }
.theme-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.theme-actions .hint { margin: 0; }
.font-manage { margin-top: 12px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.font-manage summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.font-manage[open] summary { margin-bottom: 8px; }
.favicon-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: start; }
@media (max-width: 800px) {
  .favicon-layout { grid-template-columns: 1fr; }
}
.upload-form .row2 { align-items: end; }
.upload-form label:first-child { margin-top: 0; }

.settings-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 28px 0 10px;
}
.settings-sub:first-child { margin-top: 0; }

/* colour rows: label on the left, picker on the right */
.color-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.color-row strong { display: block; font-weight: 600; }
.color-row .hint { display: block; margin: 0; }
.color-row .checkbox-row { margin: 0; }
.color-row > .seg { justify-self: start; }
@media (max-width: 600px) {
  .color-row { grid-template-columns: 1fr; gap: 6px; }
}
.color-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-field input[type=color] {
  width: 40px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
.color-field input[type=text] {
  width: 104px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  text-transform: lowercase;
}
.color-field input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  flex-shrink: 0;
}
button.swatch:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--border); }

/* segmented buttons (background type, direction, fit, text colour) */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 8px;
  background: var(--border-soft);
}
.seg button {
  font: inherit;
  font-weight: 500;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.bg-options { margin-top: 10px; }
.bg-image { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bg-image img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.bg-image label { margin: 0; }
.overlay-slider { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.overlay-slider input { flex: 1 1 auto; max-width: 260px; accent-color: var(--accent); }

.site-preview {
  display: block;
  width: 100%;
  height: 260px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--hover);
}
.warning {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  font-weight: 500;
}

.link-row { grid-template-columns: 1fr 2fr auto; }
#socialRows .link-row { grid-template-columns: 160px 1fr auto; }
@media (max-width: 600px) {
  .link-row, #socialRows .link-row { grid-template-columns: 1fr 1fr auto; }
}
.switch-row { margin-top: 0; }
.switch-row label { font-weight: 600; color: var(--text); }

/* fonts */
.font-list { display: flex; flex-direction: column; }
.font-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
}
.font-item:first-child { border-top: none; }
.font-item-sample { font-size: 24px; font-weight: 700; min-width: 180px; }
.font-item-meta { flex: 1 1 auto; font-size: 13px; color: var(--muted); }
.font-item-meta strong { color: var(--text); font-weight: 600; }
.add-font { margin-top: 12px; }
.upload-font-row { grid-template-columns: 2fr 1.5fr 2fr; }
@media (max-width: 600px) {
  .font-item { flex-wrap: wrap; }
  .font-item-sample { min-width: 0; }
}

/* site icon preview: a browser tab, a large copy, a phone home-screen tile */
.favicon-preview { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.tab-mock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  padding: 9px 12px;
  border-radius: 10px 10px 0 0;
  background: var(--border-soft);
  font-size: 13px;
  color: var(--text-2);
}
.tab-mock img { width: 16px; height: 16px; }
.tab-mock span { flex: 1 1 auto; }
.tab-mock .admin-icon { width: 14px; height: 14px; color: var(--muted); }
.favicon-large { width: 64px; height: 64px; }
.favicon-phone { width: 60px; height: 60px; border-radius: 14px; box-shadow: var(--shadow); }
.bg-image .icon-preview svg { width: 26px; height: 26px; }

.icon-pick-dialog { width: min(720px, calc(100vw - 32px)); height: min(620px, calc(100vh - 48px)); }
.icon-pick-search { display: flex; gap: 8px; padding: 12px 20px 0; }
.icon-pick-search select { width: auto; }
.icon-pick-note { padding: 6px 20px 0; }
.icon-pick-grid {
  flex: 1 1 auto;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 6px;
  padding: 8px 20px 20px;
  align-content: start;
}
.icon-pick-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.icon-pick-grid button:hover { border-color: var(--accent); background: var(--accent-soft); }
.icon-pick-grid svg { width: 26px; height: 26px; }
.icon-pick-grid small { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.accent-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.accent-presets button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 500;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.accent-presets button:hover { background: var(--hover); }
.accent-presets button.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.accent-presets .swatch { width: 18px; height: 18px; cursor: inherit; }

/* ---------- About Sahl (bottom of Settings) ---------- */
.sahl-about { display: flex; gap: 20px; align-items: flex-start; }
.sahl-about-logo { width: 64px; height: auto; flex-shrink: 0; margin-top: 2px; }
.sahl-about-main { flex: 1 1 auto; min-width: 0; }
.sahl-about-text { margin: 12px 0 0; }
.update-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-pick img { height: 36px; width: auto; max-width: 96px; object-fit: contain; }
.logo-pick label { margin: 0; cursor: pointer; }
.update-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.update-status .hint { display: block; margin-top: 2px; }
.update-notes {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--hover);
  font-size: 13px;
  white-space: pre-line;
}

/* ---------- Modules ---------- */

/* ---------- Icons ---------- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.icon-tile {
  position: relative;
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.icon-tile .btn-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  opacity: 0;
}
.icon-tile:hover .btn-icon, .icon-tile .btn-icon:focus-visible { opacity: 1; }
.icon-tile .btn-icon:hover { color: var(--danger); background: var(--danger-soft); }
@media (hover: none) {
  .icon-tile .btn-icon { opacity: 1; }
}
.icon-tile-previews { display: flex; gap: 8px; margin-bottom: 4px; }
.icon-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--paper);
  color: #1a1a1a;
}
.icon-preview-red { background: var(--brand-red); color: #fff; }
.icon-preview svg { width: 26px; height: 26px; }
.icon-tile-name { font-size: 13px; font-weight: 600; word-break: break-word; }
.icon-tile-meta { font-size: 12px; color: var(--muted); }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
}
.login-shell .admin-brand a { font-size: 18px; }
.login-form {
  padding: 28px;
  width: min(360px, 100%);
}
.login-form h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.login-form > p { margin: 0 0 8px; color: var(--muted); }
.login-form button { width: 100%; margin-top: 20px; padding: 10px; }
.link-btn { border: none; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.account-card { max-width: 760px; }
.account-current { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.login-alt { margin: 14px 0 0; text-align: center; font-size: 13px; }
.login-form .hint { display: block; margin-top: 4px; }
.login-notice {
  color: var(--success);
  background: var(--success-soft);
  font-weight: 500;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 12px 0 0;
}
.login-error {
  color: var(--danger);
  background: var(--danger-soft);
  font-weight: 500;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 12px 0 0;
}
