/* ===== Design system: CSS custom properties ===== */
:root {
  --bg: #060913;
  --bg-elev: #0d1429;
  --panel: rgba(14, 23, 49, 0.74);
  --panel-solid: #0f1732;
  --border: rgba(150, 178, 255, 0.24);
  --text: #e9efff;
  --muted: #9bb0e6;
  --cyan: #42e9ff;
  --violet: #8d6bff;
  --magenta: #ff58da;
  --ok: #9df8b0;
  --warn: #ffd987;
  --err: #ff95b3;
  --popup: #171e2e;
  --input-bg: #282c34;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
  --radius: 14px;
}

body[data-theme="light"] {
  --bg: #f4f7ff;
  --bg-elev: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --border: rgba(72, 102, 185, 0.22);
  --text: #17213e;
  --muted: #56638a;
  --cyan: #0f92d0;
  --violet: #6248de;
  --magenta: #c12eb1;
  --ok: #17833b;
  --warn: #9a6200;
  --err: #a7204b;
  --popup: #ffffff;
  --input-bg: #ffffff;
  --shadow: 0 14px 34px rgba(23, 35, 73, 0.14);
}

/* ===== Base ===== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 15% 10%, #1a2550 0, var(--bg) 46%, var(--bg) 100%);
  pointer-events: none;
}

body[data-theme="light"]::before {
  background: radial-gradient(circle at 20% 0%, #d9e7ff 0, var(--bg) 42%, var(--bg) 100%);
}

/* ===== Background effects ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(66, 233, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 233, 255, 0.08) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  z-index: 0;
}

.bg-orb {
  position: fixed;
  width: 320px;
  height: 320px;
  filter: blur(42px);
  pointer-events: none;
  opacity: 0.42;
  z-index: 0;
}
.orb-a { top: -110px; right: -60px; background: radial-gradient(circle, var(--magenta), transparent 70%); }
.orb-b { left: -110px; bottom: -130px; background: radial-gradient(circle, var(--cyan), transparent 70%); }

/* ===== Glass effect ===== */
.glass {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

/* ===== Layout ===== */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  min-height: 100vh;
  padding: 14px;
  transition: grid-template-columns 0.2s ease;
}
.layout.sidebar-collapsed {
  grid-template-columns: 62px 1fr;
}

/* ===== Sidebar ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  overflow: visible;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(130deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 14px var(--cyan);
  flex-shrink: 0;
}
.brand h1 { margin: 0; font-size: 1rem; letter-spacing: 0.04em; outline: none; }
.brand:focus, .brand *:focus { outline: none; }
.brand p  { margin: 2px 0 0; font-size: 0.78rem; color: var(--muted); }

/* Brand header in website mode */
.brand-website { gap: 10px; }
.brand-website .brand-text { min-width: 0; flex: 1; }
.brand-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.brand-website-name {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.brand-external-link {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8em;
  opacity: 0.7;
  transition: opacity 0.12s, color 0.12s;
  text-decoration: none;
}
.brand-external-link:hover {
  opacity: 1;
  color: var(--cyan);
}
.brand-external-link i.icon { margin: 0; }

/* Platform link in nav bottom */
.nav-platform-link {
  color: var(--muted) !important;
  font-size: 0.86rem;
  margin-bottom: 4px;
}
.nav-platform-link:hover {
  color: var(--text) !important;
}

/* ===== Sidebar collapse toggle ===== */
.collapse-toggle {
  all: unset;
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.collapse-toggle:hover {
  background: rgba(66, 233, 255, 0.1);
  color: var(--text);
}
.collapse-toggle i.icon {
  margin: 0;
  font-size: 0.8em;
}

.nav-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 -6px;
  padding: 0 6px;
}
.nav-scrollable::-webkit-scrollbar { width: 4px; }
.nav-scrollable::-webkit-scrollbar-track { background: transparent; }
.nav-scrollable::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
  flex-shrink: 0;
}

.menu { display: grid; gap: 2px; }
.menu-title {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 4px 0 4px;
  padding: 0 4px;
}
.menu-item > i.icon,
.nav-bottom-trigger > i.icon:not(.flyout-chevron),
.flyout-logout-btn > i.icon {
  width: 1.4em;
  text-align: center;
  font-size: 0.95em;
  opacity: 0.7;
  margin: 0 2px 0 0;
}
.menu-item {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.menu-item:hover {
  border-color: rgba(150, 178, 255, 0.35);
  color: var(--text);
  text-decoration: none;
}
.menu-item.active {
  background: rgba(66, 233, 255, 0.12);
  border-color: var(--cyan);
  color: var(--text);
  text-decoration: none;
}
.menu-item.active > i.icon,
.menu-item:hover > i.icon {
  opacity: 1;
}
.menu-item.disabled-item {
  color: var(--muted);
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
/* Draft status banner in sidebar */
.draft-status-banner {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  margin-bottom: 0;
}
.draft-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.draft-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.draft-status-text {
  font-weight: 600;
  white-space: nowrap;
}
.draft-status-published {
  background: rgba(33, 186, 69, 0.12);
}
.draft-status-published .draft-status-dot {
  background: #21ba45;
}
.draft-status-published .draft-status-text {
  color: #21ba45;
}
.draft-status-draft {
  background: rgba(242, 182, 29, 0.15);
}
.draft-status-draft .draft-status-dot {
  background: #f2b61d;
}
.draft-status-draft .draft-status-text {
  color: #f2b61d;
}
.draft-status-never {
  background: rgba(150, 150, 150, 0.12);
}
.draft-status-never .draft-status-dot {
  background: #999;
}
.draft-status-never .draft-status-text {
  color: #999;
}
.draft-publish-btn.ui.button {
  flex-shrink: 0;
}
/* ===== Sidebar collapsed state ===== */
.sidebar-collapsed .sidebar {
  padding: 12px 8px;
}
.sidebar-collapsed .nav-label,
.sidebar-collapsed .brand-text,
.sidebar-collapsed .brand-subtitle,
.sidebar-collapsed .flyout-chevron,
.sidebar-collapsed .brand-external-link,
.sidebar-collapsed .brand-name-row {
  display: none;
}
.sidebar-collapsed .brand {
  justify-content: center;
  padding-top: 8px;
  flex-wrap: wrap;
}
.sidebar-collapsed .collapse-toggle {
  margin-left: 0;
}
.sidebar-collapsed .brand-dot {
  width: 18px;
  height: 18px;
  margin-bottom: 4px;
}
.sidebar-collapsed .menu-item {
  justify-content: center;
  padding: 9px 6px;
}
.sidebar-collapsed .menu-item > i.icon,
.sidebar-collapsed .nav-bottom-trigger > i.icon:not(.flyout-chevron) {
  margin: 0;
  font-size: 1.1em;
}
.sidebar-collapsed .nav-bottom-trigger {
  justify-content: center;
}
.sidebar-collapsed .nav-platform-link {
  justify-content: center;
}
.sidebar-collapsed .draft-status-banner {
  background: transparent;
  border: none;
  justify-content: center;
  padding: 7px 0;
  gap: 0;
}
.sidebar-collapsed .draft-status-text,
.sidebar-collapsed .draft-publish-btn,
.sidebar-collapsed .draft-status-indicator > *:not(.draft-status-dot) {
  display: none;
}
/* Tooltips in collapsed mode — CSS-only via title attribute */
.sidebar-collapsed .menu-item,
.sidebar-collapsed .nav-bottom-trigger,
.sidebar-collapsed .nav-platform-link {
  position: relative;
}
.sidebar-collapsed .menu-item:hover::after,
.sidebar-collapsed .nav-bottom-trigger:hover::after,
.sidebar-collapsed .nav-platform-link:hover::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--popup);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: var(--shadow);
}

/* Hide collapse toggle on mobile */
@media (max-width: 768px) {
  .sidebar-collapse-toggle { display: none; }
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .brand-subtitle { display: revert; }
}

/* ===== Deploy status card (Revisions page) ===== */
.deploy-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--popup);
  overflow: hidden;
}
.deploy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.deploy-card-status {
  display: flex;
  align-items: center;
  gap: 10px;
}
.deploy-card-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.deploy-card-label {
  font-weight: 700;
  font-size: 1rem;
}
.deploy-card-actions {
  display: flex;
  gap: 8px;
}
.deploy-card-changes {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.deploy-change-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--muted);
}
.deploy-change-item i.icon {
  font-size: 0.9em;
  margin: 0;
  opacity: 0.7;
}
.deploy-card-note {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
/* States */
.deploy-card--live .deploy-card-dot { background: #21ba45; box-shadow: 0 0 8px rgba(33,186,69,0.5); }
.deploy-card--live .deploy-card-label { color: #21ba45; }
.deploy-card--pending .deploy-card-dot { background: #f2b61d; box-shadow: 0 0 8px rgba(242,182,29,0.5); }
.deploy-card--pending .deploy-card-label { color: #f2b61d; }
.deploy-card--never .deploy-card-dot { background: #999; }
.deploy-card--never .deploy-card-label { color: var(--muted); }
.deploy-card--loading .deploy-card-dot { background: var(--muted); opacity: 0.4; }
.draft-status-toast {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-bottom: 4px;
  text-align: center;
}
.draft-status-toast.success {
  background: rgba(33, 186, 69, 0.15);
  color: #21ba45;
}
.draft-status-toast.error {
  background: rgba(219, 40, 40, 0.15);
  color: #db2828;
}

/* ===== Sidebar bottom triggers & flyout menus ===== */
.nav-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flyout-wrapper {
  position: relative;
}

.nav-bottom-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  text-align: left;
}
.nav-bottom-trigger:hover {
  background: rgba(66, 233, 255, 0.06);
  border-color: rgba(66, 233, 255, 0.3);
  color: var(--text);
}
.nav-bottom-username {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
i.icon.flyout-chevron {
  margin-left: auto;
  margin-right: 0;
  font-size: 0.65em;
  opacity: 0.5;
  width: auto;
  transition: opacity 0.15s ease;
}
/* Flyout panel — hidden by default, shown on hover */
.flyout-panel {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  min-width: 220px;
  max-width: 280px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--popup);
  box-shadow: var(--shadow);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}
/* Bridge gap between trigger and panel so hover doesn't break */
.flyout-panel::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 0;
  bottom: 0;
  width: 12px;
}
.flyout-wrapper:hover > .flyout-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.flyout-wrapper:hover > .nav-bottom-trigger {
  background: rgba(66, 233, 255, 0.09);
  border-color: rgba(66, 233, 255, 0.44);
  color: var(--text);
}
.flyout-wrapper:hover > .nav-bottom-trigger .flyout-chevron {
  opacity: 1;
}
.flyout-panel .menu-title {
  margin: 0 0 6px;
}
.flyout-panel .menu {
  display: grid;
  gap: 2px;
}

.flyout-logout-form {
  margin: 0;
}
.flyout-logout-btn {
  width: 100%;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  color: #e05050;
}
.flyout-logout-btn:hover {
  background: rgba(255, 80, 80, 0.12) !important;
  border-color: rgba(255, 80, 80, 0.3) !important;
  color: #ff4040;
}
.flyout-logout-btn > i.icon {
  opacity: 0.9;
}

/* Nav footer buttons (reused in flyout) */
.nav-footer-btn {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nav-footer-btn:hover {
  background: rgba(66, 233, 255, 0.06);
  border-color: rgba(66, 233, 255, 0.44);
  color: var(--text);
}
.nav-footer-btn--active {
  border-color: rgba(157, 248, 176, 0.5);
  color: var(--ok);
  background: rgba(157, 248, 176, 0.08);
}
.nav-footer-btn--active:hover {
  border-color: rgba(157, 248, 176, 0.7);
  background: rgba(157, 248, 176, 0.12);
  color: var(--ok);
}
.nav-footer-btn--logout {
  color: var(--muted);
  border-color: transparent;
}
.nav-footer-btn--logout:hover {
  color: var(--err);
  border-color: rgba(255, 149, 179, 0.34);
  background: rgba(255, 149, 179, 0.06);
}

.mobile-sidebar-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 8;
  display: none !important;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 7, 20, 0.6);
  border: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}

/* ===== Website switcher in sidebar ===== */
.website-switcher {
  padding: 0;
}
.website-switcher label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.website-switcher .ui.dropdown {
  width: 100%;
  background: rgba(10, 17, 38, 0.8);
  border: 1px solid rgba(155, 176, 230, 0.33);
  color: var(--text);
  border-radius: 10px;
  padding: 0;
  font-size: 0.88rem;
  font-family: inherit;
}
.website-switcher .ui.selection.dropdown > .divider.text {
  color: var(--text);
}
body[data-theme="light"] .website-switcher .ui.dropdown {
  background: rgba(255, 255, 255, 0.9);
}
body[data-theme="light"] .website-switcher .ui.selection.dropdown > .divider.text {
  color: var(--text);
}

/* ===== Content area ===== */
.admin-content {
  display: flex;
  flex-direction: column;
}
.admin-content > * + * {
  margin-top: 14px;
}
.admin-content > .content-header + * {
  margin-top: 0;
}

/* ===== Content header (merged with content box below) ===== */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}
/* When a panel.glass or file-manager-layout directly follows content-header, merge them */
.content-header:has(+ .panel.glass),
.content-header:has(+ .file-manager-layout) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
  box-shadow: none;
}
.content-header + .panel.glass {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.content-header + .file-manager-layout > .panel.glass:first-child {
  border-top-left-radius: 0;
}
/* Merge tabs / deploy-card flush with header inside panel.glass */
.panel.glass > .design-tabs:first-child {
  margin: -8px -16px 0;
  padding: 8px 16px;
}
.panel.glass > .deploy-card:first-child {
  padding: 0;
}
.eyebrow {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
}
h2 { margin: 4px 0 0; font-size: 1.3rem; }
.crumbs { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ===== Fix double borders/padding on Fomantic .ui.input wrapper ===== */
.ui.input {
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* ===== Unified sizing for inputs & dropdowns ===== */
.ui.input > input,
.ui.form input[type="text"],
.ui.form input[type="email"],
.ui.form input[type="password"],
.ui.form input[type="number"],
.ui.form input[type="url"],
.ui.form input[type="date"],
.ui.form textarea,
.ui.selection.dropdown {
  font-size: 0.88rem;
  padding: 0.52em 0.8em !important;
  line-height: 1.21em;
  min-height: 0 !important;
  box-sizing: border-box;
  border-radius: 8px;
}

.ui.selection.dropdown {
  padding-right: 2.1em !important;
}
.ui.selection.dropdown > .text,
.ui.selection.dropdown > .default.text {
  line-height: 1.21em;
}

.ui.selection.dropdown .menu > .item {
  padding: 0.52em 0.8em !important;
  font-size: 0.88rem;
  line-height: 1.21em;
}

.ui.selection.dropdown > .dropdown.icon {
  top: 50% !important;
  transform: translateY(-50%);
  margin-top: 0 !important;
  padding: 0 0.8em !important;
}

.ui.button {
  font-size: 0.88rem;
  padding: 0.55em 1.1em;
}

.ui.form .field > label,
.ui.form label {
  font-size: 0.82rem;
  color: var(--muted) !important;
}

/* ===== Fomantic UI button overrides ===== */
.ui.button {
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.ui.button:hover {
  background: rgba(66, 233, 255, 0.06);
  border-color: rgba(66, 233, 255, 0.44);
  color: var(--text);
}
.ui.primary.button {
  background: var(--cyan);
  border: 1px solid var(--cyan);
  color: #fff;
  font-weight: 600;
}
body[data-theme="dark"] .ui.primary.button {
  color: #0a1126;
}
.ui.primary.button:hover {
  background: color-mix(in srgb, var(--cyan) 85%, #fff);
  border-color: color-mix(in srgb, var(--cyan) 85%, #fff);
  color: #fff;
}
body[data-theme="dark"] .ui.primary.button:hover {
  color: #0a1126;
}
.ui.negative.button,
.ui.red.button,
.ui.negative.button.basic {
  background: rgba(255, 149, 179, 0.12);
  border: 1px solid rgba(255, 149, 179, 0.34);
  color: var(--err);
  border-radius: 8px;
  font-weight: 500;
}
.ui.negative.button:hover,
.ui.red.button:hover,
.ui.negative.button.basic:hover {
  background: rgba(255, 149, 179, 0.2);
  border-color: var(--err);
  color: var(--err);
}
.ui.positive.button {
  background: rgba(157, 248, 176, 0.12);
  border: 1px solid rgba(157, 248, 176, 0.34);
  color: var(--ok);
  border-radius: 8px;
  font-weight: 500;
}
.ui.positive.button:hover {
  background: rgba(157, 248, 176, 0.2);
  border-color: rgba(157, 248, 176, 0.5);
  color: var(--ok);
}
body[data-theme="dark"] .ui.input > input,
body[data-theme="dark"] .ui.input > textarea,
body[data-theme="dark"] .ui.form input,
body[data-theme="dark"] .ui.form input[type="text"],
body[data-theme="dark"] .ui.form input[type="email"],
body[data-theme="dark"] .ui.form input[type="password"],
body[data-theme="dark"] .ui.form input[type="number"],
body[data-theme="dark"] .ui.form input[type="url"],
body[data-theme="dark"] .ui.form input[type="date"],
body[data-theme="dark"] .ui.form textarea {
  background: var(--input-bg) !important;
  border: 1px solid rgba(150, 178, 255, 0.18) !important;
  color: var(--text);
  font-family: inherit;
  border-radius: 8px;
}
body[data-theme="dark"] .ui.form .field > .selection.dropdown {
  background: var(--input-bg) !important;
  border: 1px solid rgba(150, 178, 255, 0.18) !important;
  color: var(--text);
  font-family: inherit;
  border-radius: 8px;
}
body[data-theme="dark"] .ui.input > input:focus,
body[data-theme="dark"] .ui.input > textarea:focus,
body[data-theme="dark"] .ui.form input:focus,
body[data-theme="dark"] .ui.form textarea:focus {
  border-color: rgba(66, 233, 255, 0.5) !important;
  box-shadow: 0 0 0 2px rgba(66, 233, 255, 0.1);
  background: var(--input-bg) !important;
  color: var(--text);
}
body[data-theme="dark"] .ui.selection.dropdown {
  background: var(--input-bg) !important;
  border: 1px solid rgba(150, 178, 255, 0.18) !important;
  color: var(--text);
  border-radius: 8px;
}
body[data-theme="dark"] .ui.selection.dropdown:hover {
  border-color: rgba(150, 178, 255, 0.30) !important;
}
body[data-theme="dark"] .ui.selection.dropdown .menu {
  background: var(--input-bg) !important;
  border: 1px solid rgba(150, 178, 255, 0.18) !important;
  border-top: none !important;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
body[data-theme="dark"] .ui.selection.dropdown .menu > .item {
  color: var(--text);
  border-top: 1px solid rgba(150, 178, 255, 0.08);
  background: transparent !important;
}
body[data-theme="dark"] .ui.selection.dropdown .menu > .item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text);
}
body[data-theme="dark"] .ui.selection.dropdown .menu > .item.active {
  background: rgba(66, 233, 255, 0.10) !important;
  color: var(--text);
  font-weight: 600;
}
body[data-theme="dark"] .ui.selection.dropdown > .dropdown.icon,
body[data-theme="dark"] .ui.selection.dropdown > .delete.icon,
body[data-theme="dark"] .ui.selection.dropdown > .search.icon {
  color: var(--muted);
}
body[data-theme="dark"] .ui.selection.dropdown > .default.text {
  color: var(--muted);
}
body[data-theme="dark"] .ui.selection.dropdown > .divider.text,
body[data-theme="dark"] .ui.selection.visible.dropdown > .text:not(.default) {
  color: var(--text);
}
body[data-theme="dark"] .ui.checkbox label,
body[data-theme="dark"] .ui.checkbox + label {
  color: var(--text);
}
body[data-theme="dark"] .ui.checkbox label::before {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(150, 178, 255, 0.18);
}
body[data-theme="dark"] .ui.checkbox input:checked ~ label::before {
  background: var(--violet);
  border-color: var(--violet);
}
body[data-theme="dark"] .ui.form .field > label,
body[data-theme="dark"] .ui.form .fields .field > label,
body[data-theme="dark"] .ui.form .field.required > label,
body[data-theme="dark"] .ui.form label {
  color: var(--muted);
  font-size: 0.82rem;
}
body[data-theme="dark"] .ui.calendar .ui.popup {
  background: var(--popup);
  border: 1px solid var(--border);
  color: var(--text);
}
body[data-theme="dark"] .ui.calendar .ui.popup table td {
  color: var(--text);
}
body[data-theme="dark"] .ui.dimmer {
  background: rgba(0, 0, 0, 0.75);
}
body[data-theme="dark"] .ui.modal {
  background: var(--popup);
  color: var(--text);
}
body[data-theme="dark"] .ui.modal > .header {
  background: var(--popup);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
body[data-theme="dark"] .ui.modal > .content {
  background: var(--popup);
  color: var(--text);
}
body[data-theme="dark"] .ui.modal > .actions {
  background: var(--popup);
  border-top: 1px solid var(--border);
}
body[data-theme="dark"] .ui.warning.message {
  background: rgba(255, 217, 135, 0.1);
  border: 1px solid rgba(255, 217, 135, 0.4);
  color: var(--warn);
  box-shadow: none;
}
body[data-theme="dark"] .ui.message.info {
  background: rgba(66, 233, 255, 0.08);
  border: 1px solid rgba(66, 233, 255, 0.3);
  color: var(--text);
  box-shadow: none;
}

/* ===== Form controls (legacy: used by HtmlCodeEditor/TinyMceEditor) ===== */
.input {
  background: var(--input-bg);
  border: 1px solid rgba(150, 178, 255, 0.18);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  width: 100%;
}
body[data-theme="light"] .input {
  background: rgba(255, 255, 255, 0.9);
}
.input:focus {
  border-color: rgba(66, 233, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(66, 233, 255, 0.1);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.code-editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  min-height: 180px;
}

/* ===== CodeMirror 6 editor ===== */
.code-editor-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.code-editor-wrap .cm-editor {
  font-size: 0.85rem;
  min-height: var(--cm-min-height, 200px);
}
.code-editor-wrap .cm-editor .cm-scroller {
  min-height: var(--cm-min-height, 200px);
}
.code-editor-wrap .cm-editor.cm-focused {
  outline: none;
  box-shadow: 0 0 0 2px rgba(66, 233, 255, 0.15);
}
body[data-theme="light"] .code-editor-wrap .cm-editor .cm-gutters {
  background: rgba(239, 245, 255, 0.9);
  border-right: 1px solid var(--border);
}
body[data-theme="light"] .code-editor-wrap .cm-editor {
  background: rgba(255, 255, 255, 0.9);
}

.drag-handle {
  width: 44px;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}

.section-dnd {
  border: 1px dashed rgba(155, 176, 230, 0.35);
  border-radius: 12px;
  padding: 10px;
}

.section-editor {
  background: transparent;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
.form-grid .full { grid-column: 1 / -1; }

/* ===== Post editor two-column layout ===== */
.post-editor {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 20px;
  align-items: start;
}
.post-editor-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-editor-sidebar .title-image-preview,
.post-editor-sidebar .title-image-placeholder {
  max-width: 100%;
}
.post-sidebar-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.post-sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.post-sidebar-gallery {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.post-sidebar-gallery .post-image-gallery {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  grid-column: auto;
}
.post-sidebar-gallery .file-grid {
  grid-template-columns: 1fr;
}
.post-sidebar-gallery .file-card .file-thumb img {
  object-fit: cover;
}
.post-sidebar-gallery .post-image-gallery .toolbar {
  gap: 6px;
}
.post-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 1120px) {
  .post-editor { grid-template-columns: 1fr; }
  .post-sidebar-split { grid-template-columns: 1fr; }
}

/* ===== Dashboard ===== */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.dashboard-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 16px 12px;
  min-height: 100px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.dashboard-stat-card:hover {
  border-color: rgba(66, 233, 255, 0.44);
  background: rgba(66, 233, 255, 0.06);
  color: var(--text);
}
.dashboard-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}
.dashboard-stat-value-sm {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}
.dashboard-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.dashboard-stat-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.dashboard-stat-row.secondary {
  margin-top: 2px;
}
.dashboard-stat-period {
  font-size: 0.75rem;
  color: var(--muted);
}
.dashboard-trend {
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 2px;
}
.dashboard-trend.trend-up { color: #21ba45; }
.dashboard-trend.trend-down { color: #db2828; }
@media (max-width: 900px) {
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}
.dashboard-layout {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 20px;
  align-items: start;
}
.dashboard-main { min-width: 0; }
.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Publish status widget */
.dashboard-publish-status {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dashboard-publish-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dashboard-publish-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dashboard-publish-text {
  font-weight: 700;
  font-size: 0.95rem;
}
.dashboard-publish-date {
  font-size: 0.82rem;
  color: var(--muted);
  padding-left: 22px;
}
/* Publish status states */
.dashboard-publish-published {
  background: rgba(33, 186, 69, 0.10);
  border-color: rgba(33, 186, 69, 0.3);
}
.dashboard-publish-published .dashboard-publish-dot { background: #21ba45; box-shadow: 0 0 8px rgba(33,186,69,0.5); }
.dashboard-publish-published .dashboard-publish-text { color: #21ba45; }
.dashboard-publish-draft {
  background: rgba(242, 182, 29, 0.10);
  border-color: rgba(242, 182, 29, 0.3);
}
.dashboard-publish-draft .dashboard-publish-dot { background: #f2b61d; box-shadow: 0 0 8px rgba(242,182,29,0.5); }
.dashboard-publish-draft .dashboard-publish-text { color: #f2b61d; }
.dashboard-publish-never {
  background: rgba(150, 150, 150, 0.08);
  border-color: rgba(150, 150, 150, 0.25);
}
.dashboard-publish-never .dashboard-publish-dot { background: #999; }
.dashboard-publish-never .dashboard-publish-text { color: #999; }
.dashboard-publish-unknown .dashboard-publish-dot { background: var(--muted); opacity: 0.4; }
.dashboard-publish-unknown .dashboard-publish-text { color: var(--muted); }
/* Website info panel */
.dashboard-info-panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
}
.dashboard-info-panel h4 { margin: 0 0 10px; font-size: 0.92rem; }
.dashboard-info-panel .design-table { min-width: auto; }
.dashboard-info-panel .design-table td { padding: 5px 8px; font-size: 0.82rem; }
@media (max-width: 1120px) {
  .dashboard-layout { grid-template-columns: 1fr; }
}
/* Post list in sidebar panels */
.dashboard-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dashboard-post-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.dashboard-post-list li:last-child { border-bottom: none; }
.dashboard-post-list a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}
.dashboard-post-list.stacked li {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dashboard-post-meta {
  font-size: 0.72rem;
  color: var(--muted);
}
.dashboard-panel-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

/* ===== Panels ===== */
.panel { padding: 16px; }
.stack { display: grid; gap: 12px; }

.panel-inline {
  border: 1px solid rgba(155, 176, 230, 0.24);
  border-radius: 10px;
  padding: 10px;
  background: rgba(10, 17, 38, 0.45);
}
body[data-theme="light"] .panel-inline {
  background: rgba(239, 245, 255, 0.9);
}
.panel-inline h4 { margin: 0 0 8px; }

/* ===== Tables ===== */
.table-wrap { overflow: auto; }
table.design-table { width: 100%; border-collapse: collapse; min-width: 500px; }
table.design-table th,
table.design-table td {
  border-bottom: 1px solid rgba(155, 176, 230, 0.2);
  text-align: left;
  padding: 10px 8px;
  font-size: 0.88rem;
}
table.design-table th {
  color: var(--muted);
  font-size: 0.79rem;
  letter-spacing: 0.03em;
  font-weight: 600;
}
table.design-table.clickable tbody tr { cursor: pointer; }
table.design-table tbody tr:hover {
  background: rgba(66, 233, 255, 0.06);
}

/* ===== Links ===== */
a { color: var(--cyan); }
a:hover { color: var(--cyan); opacity: 0.85; }

/* ===== Tags ===== */
.ui.label {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.76rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
.ui.label.green  { color: var(--ok)  !important; border-color: var(--ok)  !important; background: transparent !important; }
.ui.label.yellow { color: var(--warn) !important; border-color: var(--warn) !important; background: transparent !important; }
.ui.label.red    { color: var(--err)  !important; border-color: var(--err)  !important; background: transparent !important; }
.ui.label.teal   { color: #00b5ad !important; border-color: #00b5ad !important; background: transparent !important; }
.ui.label.orange { color: #f2711c !important; border-color: #f2711c !important; background: transparent !important; }

/* ===== Tabs ===== */
.design-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}
.design-tabs button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  text-decoration: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.design-tabs button:hover {
  border-color: rgba(150, 178, 255, 0.35);
  color: var(--text);
}
.design-tabs button.active {
  background: rgba(66, 233, 255, 0.12);
  border-color: var(--cyan);
  color: var(--text);
}

/* ===== Toolbar ===== */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== Filter bar ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===== Callout ===== */
.callout {
  border: 1px solid rgba(255, 217, 135, 0.4);
  color: var(--warn);
  background: rgba(255, 217, 135, 0.1);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.85rem;
}
.callout-error {
  border: 1px solid rgba(255, 149, 179, 0.4);
  color: var(--err);
  background: rgba(255, 149, 179, 0.1);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.85rem;
}

/* ===== Split layouts ===== */
.split-3 {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 10px;
}
.hint { color: var(--muted); font-size: 0.8rem; }

/* ===== Misc ===== */
.hidden { display: none !important; }
h3 { font-size: 1.05rem; margin: 0 0 4px; }
h6 { font-size: 0.9rem; margin: 12px 0 6px; color: var(--text); }
hr { border-color: var(--border); opacity: 0.5; }

/* ===== Login page ===== */
.login-page {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  display: grid;
  gap: 20px;
}
.login-card form {
  display: grid;
  gap: 14px;
}
.login-card label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ===== Settings page sections ===== */
.settings-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }

.settings-info h6 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
}
.settings-info p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 280px;
}

.settings-fields { min-width: 0; }

.settings-section.danger .settings-info h6 { color: var(--err); }
.settings-section.danger { border-bottom: none; }

@media (max-width: 900px) {
  .settings-section { grid-template-columns: 1fr; gap: 12px; }
}

/* ===== Section headings (used in website detail) ===== */
.section-heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin: 8px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* ===== Addresses list ===== */
.address-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(155, 176, 230, 0.12);
  font-size: 0.88rem;
}
.address-item b { color: var(--text); }
.address-primary { color: var(--ok); font-size: 0.78rem; }

/* ===== File manager layout ===== */
.file-manager-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.file-manager-layout.has-details {
  grid-template-columns: 1fr 320px;
}
.file-manager-files { }
.file-manager-details { align-self: start; overflow-wrap: break-word; min-width: 0; }

/* Breadcrumb navigation */
.fm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}
.fm-breadcrumb-item {
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background 0.12s;
  white-space: nowrap;
}
.fm-breadcrumb-item:hover {
  background: rgba(66, 233, 255, 0.09);
  color: var(--text);
}
.fm-breadcrumb-sep {
  color: var(--muted);
  font-size: 0.8em;
  user-select: none;
}
.fm-breadcrumb-sep i.icon { margin: 0; }

/* Folder cards (inline in file grid) */
.folder-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px 8px;
  background: rgba(10, 17, 38, 0.3);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.folder-card:hover { border-color: var(--cyan); }
body[data-theme="light"] .folder-card {
  background: rgba(230, 240, 255, 0.9);
}
.folder-card-icon {
  font-size: 1.8em;
  color: var(--warn);
  margin-bottom: 4px;
}
.folder-card-icon i.icon { margin: 0; }
.folder-card .file-name { font-size: 0.82rem; word-break: break-all; }
.folder-card-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.folder-card:hover .folder-card-actions { opacity: 1; }
.folder-card-actions .ui.button { padding: 4px 6px; }
.folder-card-rename { padding: 0 4px; }

/* File upload area */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  transition: border-color 0.15s;
}
.file-upload-area:hover { border-color: var(--cyan); }
.file-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted, #aaa);
  font-size: 0.88rem;
}
.file-upload-label:hover { color: var(--text); }

/* File cards */
.file-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(10, 17, 38, 0.45);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.file-card:hover { border-color: var(--cyan); }
.file-card.selected { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(66, 233, 255, 0.2); }
body[data-theme="light"] .file-card {
  background: rgba(239, 245, 255, 0.9);
}
.file-card .file-thumb {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
  margin-bottom: 6px;
}
body[data-theme="light"] .file-card .file-thumb {
  background: rgba(0, 0, 0, 0.05);
}
.file-card .file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.file-card .file-name { font-size: 0.82rem; word-break: break-all; margin-top: auto; }
.file-card .file-size { font-size: 0.76rem; color: var(--muted); }
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

/* ===== Folder list ===== */
.folder-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.folder-list a, .folder-list button {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.folder-list a:hover, .folder-list button:hover,
.folder-list a.active, .folder-list button.active {
  background: rgba(66, 233, 255, 0.09);
}


/* ===== Blazor essentials ===== */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--ok); }
.invalid { outline: 1px solid var(--err); }
.validation-message { color: var(--err); font-size: 0.82rem; }

.blazor-error-boundary {
  background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

#blazor-error-ui {
  color-scheme: light only;
  background: var(--panel-solid);
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  color: var(--text);
  border-top: 1px solid var(--border);
}
#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

body[data-editorial="on"] .panel,
body[data-editorial="on"] .content-header {
  border-color: rgba(157, 248, 176, 0.45);
}

/* Editorial mode — hide non-editorial nav items */
body[data-editorial="on"] .nav-website .menu-title { display: none; }
body[data-editorial="on"] .nav-hide-editorial { display: none; }

/* ===== Responsive ===== */
@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; }
  .mobile-sidebar-toggle { display: inline-block !important; }
  .sidebar {
    position: fixed;
    top: 14px;
    left: 14px;
    width: min(320px, calc(100vw - 28px));
    height: calc(100vh - 28px);
    transform: translateX(-120%);
    transition: transform 0.2s ease;
    z-index: 6;
    background: var(--panel-solid);
  }
  .layout.sidebar-open .sidebar { transform: translateX(0); }
  .layout.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .admin-content { margin-top: 44px; }
  .split-3, .form-grid, .file-manager-layout, .file-manager-layout.has-details { grid-template-columns: 1fr; }
}

.progress { height: 6px; background: #334155; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress .bar { width: 100%; height: 100%; background: linear-gradient(90deg,#22c55e,#3b82f6); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { opacity: .5;} 50% {opacity:1;} 100% {opacity:.5;} }

/* ===== Title image picker ===== */
.title-image-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.title-image-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 300px;
}
.title-image-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.title-image-placeholder {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: border-color 0.15s;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.title-image-placeholder:hover {
  border-color: var(--cyan);
  color: var(--text);
}
.title-image-actions {
  display: flex;
  gap: 6px;
}

/* ===== Post image gallery ===== */
.post-image-gallery {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  grid-column: 1 / -1;
}
.post-gallery-card {
  position: relative;
}
.post-gallery-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 6px;
}
.post-gallery-actions .ui.button {
  padding: 4px 8px;
  font-size: 0.78rem;
}

/* ===== Floating toast notifications ===== */
.toast-container {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(400px, calc(100vw - 2.4rem));
}
.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  animation: toast-in 0.35s ease-out;
}
.toast-success {
  background: var(--popup);
  border-left-color: var(--ok);
  color: var(--text);
}
.toast-error {
  background: var(--popup);
  border-left-color: var(--err);
  color: var(--text);
}
.toast-msg { flex: 1; }
.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.toast-close:hover { color: var(--text); }
.toast-exit { animation: toast-out 0.4s ease-in forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}
