:root {
  color-scheme: light;
  --bg: #f7f7f1;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-muted: #f1ece6;
  --line: rgba(75, 60, 50, 0.12);
  --text: #221d19;
  --muted: #6f655d;
  --accent: #916540;
  --accent-soft: #aa896c;
  --accent-faint: rgba(145, 101, 64, 0.12);
  --success-soft: rgba(49, 95, 67, 0.12);
  --warning-soft: rgba(163, 95, 37, 0.12);
  --shadow: 0 24px 60px rgba(58, 41, 28, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(170, 137, 108, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(200, 191, 179, 0.28), transparent 30%),
    linear-gradient(180deg, #fbfaf7 0%, #f4eee7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(247, 247, 241, 0.82));
  backdrop-filter: blur(18px);
}

.brand-card {
  padding: 20px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff, #f4ede5);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-card p,
.sidebar-note,
.page-copy p,
.card p,
.stamp,
.note,
.stat span,
.field label {
  color: var(--muted);
}

.brand-card p,
.page-copy p,
.card p,
.stamp,
.note,
.sidebar-note {
  line-height: 1.6;
}

.side-nav {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.side-nav a::before,
.topnav a::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(145, 101, 64, 0.18);
}

.side-nav a:hover,
.side-nav a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(145, 101, 64, 0.18);
  transform: translateX(2px);
}

.side-nav a.is-active::before,
.topnav a.is-active::before {
  background: var(--accent);
}

.sidebar-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(145, 101, 64, 0.08);
  border: 1px solid rgba(145, 101, 64, 0.12);
  font-size: 13px;
}

.app-main {
  padding: 28px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.page-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.header-panel {
  min-width: 240px;
  padding: 18px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #fff, #f3ece4);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.header-panel .label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-panel strong {
  display: block;
  font-size: 18px;
}

.msg {
  padding: 16px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: var(--success-soft);
  border: 1px solid rgba(49, 95, 67, 0.14);
  color: #244834;
  font-weight: 600;
}

.msg.is-hidden {
  display: none;
}

.msg.is-error {
  background: rgba(165, 59, 59, 0.12);
  border-color: rgba(165, 59, 59, 0.18);
  color: #8b2f2f;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.stat strong {
  display: block;
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
}

.card-span-full {
  grid-column: 1 / -1;
}

.stack-layout {
  display: grid;
  gap: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: start;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-xl);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 34%);
  pointer-events: none;
}

.card h2 {
  position: relative;
  margin: 0 0 12px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
}

.label-with-help {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.help-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(145, 101, 64, 0.12);
  border: 1px solid rgba(145, 101, 64, 0.18);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  cursor: help;
}

input[type="text"],
textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.secret-input {
  min-height: 96px;
  font-family: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: rgba(145, 101, 64, 0.45);
  box-shadow: 0 0 0 4px rgba(170, 137, 108, 0.14);
  transform: translateY(-1px);
}

.checks {
  display: grid;
  gap: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid rgba(75, 60, 50, 0.1);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.check:hover {
  transform: translateY(-1px);
  border-color: rgba(145, 101, 64, 0.2);
  background: #f7f1eb;
}

.settings-accordion {
  display: grid;
  gap: 14px;
}

.settings-group,
.settings-subgroup {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
}

.settings-summary,
.settings-subgroup summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
}

.settings-summary::-webkit-details-marker,
.settings-subgroup summary::-webkit-details-marker {
  display: none;
}

.settings-summary h3,
.settings-subcard h3 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.settings-summary p,
.settings-subcard p {
  margin: 0;
}

.settings-summary-toggle {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(145, 101, 64, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.settings-body {
  display: grid;
  gap: 16px;
  padding: 0 20px 20px;
}

.settings-subgroup {
  background: rgba(247, 243, 238, 0.9);
}

.settings-subgroup summary {
  padding: 14px 16px;
  font-weight: 700;
  color: var(--accent);
}

.settings-subgroup > .field-grid,
.settings-subgroup[open] > .field-grid {
  padding: 0 16px 16px;
}

.settings-subcard {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(75, 60, 50, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #916540, #aa896c);
  color: #fffdf8;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(145, 101, 64, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #916540, #aa896c);
  color: #fffdf8;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 30px rgba(145, 101, 64, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(145, 101, 64, 0.22);
}

.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(145, 101, 64, 0.22);
}

.toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2500;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 28px));
}

.toast {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(49, 95, 67, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: #244834;
  box-shadow: 0 18px 40px rgba(33, 28, 22, 0.16);
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
  backdrop-filter: blur(14px);
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.toast.is-error {
  border-color: rgba(165, 59, 59, 0.18);
  color: #8b2f2f;
}

button.is-busy {
  opacity: 0.92;
  transform: translateY(-1px) scale(0.99);
}

button[disabled] {
  opacity: 0.64;
  cursor: wait;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  max-width: 100%;
  max-height: 420px;
  scrollbar-gutter: stable both-edges;
}

.table-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.table-tools input {
  flex: 1 1 220px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}

.table-compact {
  min-width: 0;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(75, 60, 50, 0.08);
  overflow-wrap: anywhere;
}

th {
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.96);
}

th[data-sort]::after {
  content: " ";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 6px;
  border-right: 2px solid rgba(75, 60, 50, 0.28);
  border-bottom: 2px solid rgba(75, 60, 50, 0.28);
  transform: rotate(45deg) translateY(-2px);
}

th {
  min-width: 90px;
}

.table-wrap.is-resizable table {
  table-layout: fixed;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
}

.resize-handle::after {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: rgba(75, 60, 50, 0.18);
}

th.is-sort-asc::after {
  transform: rotate(225deg) translateY(-1px);
}

th.is-sort-desc::after {
  transform: rotate(45deg) translateY(-2px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-faint);
  border: 1px solid rgba(145, 101, 64, 0.12);
  color: #6d4f36;
  font-weight: 600;
}

.pill.success {
  background: var(--success-soft);
  border-color: rgba(49, 95, 67, 0.16);
  color: #2a5c3a;
}

.pill.warning {
  background: rgba(188, 126, 40, 0.12);
  border-color: rgba(188, 126, 40, 0.16);
  color: #8c5a21;
}

.pill.danger {
  background: rgba(165, 59, 59, 0.12);
  border-color: rgba(165, 59, 59, 0.18);
  color: #8b2f2f;
}

.priority {
  background: var(--warning-soft);
  border-color: rgba(163, 95, 37, 0.16);
  color: #8c4d1b;
}

.inline-action {
  display: inline-flex;
}

.action-stack {
  gap: 8px;
  flex-wrap: wrap;
}

table th:last-child,
table td:last-child {
  position: sticky;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
}

.ghost-button {
  padding: 10px 14px;
  background: rgba(145, 101, 64, 0.1);
  color: var(--accent);
  box-shadow: none;
  border: 1px solid rgba(145, 101, 64, 0.14);
}

.ghost-button:hover {
  box-shadow: none;
  background: rgba(145, 101, 64, 0.16);
}

.danger-button {
  background: rgba(165, 59, 59, 0.12);
  color: #8b2f2f;
  border-color: rgba(165, 59, 59, 0.18);
}

.danger-button:hover {
  background: rgba(165, 59, 59, 0.18);
}

.preview-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(75, 60, 50, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.preview-empty {
  color: var(--muted);
}

.muted-inline {
  color: var(--muted);
  white-space: nowrap;
}

.slot-board {
  display: grid;
  gap: 16px;
}

.slot-row {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff, #f5efe8);
  border: 1px solid var(--line);
}

.section-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.slot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.slot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(145, 101, 64, 0.12);
  font-weight: 700;
  color: #5e4b3d;
  box-shadow: 0 10px 20px rgba(58, 41, 28, 0.06);
}

.scheduler-hero,
.scheduler-calendar-card {
  grid-column: 1 / -1;
}

.scheduler-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.scheduler-hero h2 {
  margin-bottom: 8px;
}

.scheduler-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.calendar-legend-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(75, 60, 50, 0.12);
  background: rgba(255, 255, 255, 0.76);
  font-weight: 700;
}

.calendar-legend-pill.planned {
  box-shadow: inset 0 0 0 1px rgba(34, 112, 87, 0.12);
}

.calendar-legend-pill.template {
  opacity: 0.84;
}

.scheduler-calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.scheduler-calendar-desktop {
  display: block;
}

.scheduler-calendar-mobile {
  display: none;
}

.scheduler-calendar-grid {
  display: grid;
  grid-template-columns: 88px repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.calendar-corner,
.calendar-day-header,
.calendar-time,
.calendar-cell {
  border-right: 1px solid rgba(75, 60, 50, 0.08);
  border-bottom: 1px solid rgba(75, 60, 50, 0.08);
}

.calendar-day-header,
.calendar-corner {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(250, 247, 243, 0.96);
}

.calendar-corner {
  min-height: 68px;
}

.calendar-day-header {
  display: grid;
  gap: 4px;
  padding: 14px 12px;
}

.calendar-day-header strong {
  font-size: 14px;
}

.calendar-day-header span,
.calendar-item-meta,
.calendar-mobile-day header span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-time {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 8px;
  background: rgba(250, 247, 243, 0.76);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calendar-cell {
  min-height: 92px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.calendar-item,
.calendar-mobile-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(75, 60, 50, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 241, 235, 0.95));
  box-shadow: 0 10px 18px rgba(58, 41, 28, 0.06);
}

.calendar-item + .calendar-item {
  margin-top: 8px;
}

.calendar-item.is-template,
.calendar-mobile-item.is-template {
  opacity: 0.78;
  box-shadow: none;
}

.calendar-item-time {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.platform-youtube {
  border-left: 4px solid #ff4b3a;
}

.platform-tiktok {
  border-left: 4px solid #221d19;
}

.platform-instagram {
  border-left: 4px solid #dd7b4c;
}

.platform-facebook {
  border-left: 4px solid #3d6bd6;
}

.platform-generic {
  border-left: 4px solid var(--accent);
}

.calendar-mobile-day {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f5efe8);
}

.calendar-mobile-day + .calendar-mobile-day {
  margin-top: 12px;
}

.calendar-mobile-day header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-mobile-list {
  display: grid;
  gap: 10px;
}

.calendar-mobile-item {
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
}

.calendar-item-body {
  display: grid;
  gap: 4px;
}

.calendar-empty {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.topnav {
  display: none;
}

/* ---------- Public / Legal Page Layout (matches admin theme) ---------- */

.public-body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(170, 137, 108, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(200, 191, 179, 0.28), transparent 30%),
    linear-gradient(180deg, #fbfaf7 0%, #f4eee7 100%);
}

.public-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 22px 56px;
  display: grid;
  gap: 22px;
}

.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(247, 247, 241, 0.85));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.public-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: block;
}

.public-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.public-brand-text strong {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.public-brand-text span {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.public-topnav {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.public-topnav a {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.public-topnav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(145, 101, 64, 0.18);
}

.public-topnav a.is-active {
  color: var(--text);
  background: rgba(145, 101, 64, 0.12);
  border-color: rgba(145, 101, 64, 0.2);
}

.public-hero {
  padding: clamp(26px, 4vw, 44px);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff, #f4ede5);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.public-hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.public-hero p.lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.65;
  max-width: 64ch;
}

.public-hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.btn.primary:hover {
  transform: translateY(-1px);
  background: #7d5333;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(145, 101, 64, 0.25);
}

.public-card {
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.public-card h2 {
  margin: 26px 0 10px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.public-card h2:first-child {
  margin-top: 0;
}

.public-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.public-card ul {
  margin: 6px 0 14px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.public-card ul li + li {
  margin-top: 4px;
}

.public-card code {
  background: var(--accent-faint);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: "Consolas", "Menlo", monospace;
}

.public-card strong {
  color: var(--text);
}

.public-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.public-meta-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: rgba(145, 101, 64, 0.08);
  border: 1px solid rgba(145, 101, 64, 0.14);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.public-meta-bar a {
  color: var(--accent);
  font-weight: 600;
}

.public-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.public-footer nav {
  display: inline-flex;
  gap: 14px;
}

.public-footer nav a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.public-footer nav a:hover {
  color: var(--accent);
  border-color: rgba(145, 101, 64, 0.4);
}

@media (max-width: 720px) {
  .public-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .public-topnav {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 560px;
  }

  .settings-summary {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .app-main {
    padding: 20px 14px 110px;
  }

  .page-header {
    flex-direction: column;
  }

  .header-panel {
    width: 100%;
    min-width: 0;
  }

  .topnav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    box-shadow: 0 24px 44px rgba(58, 41, 28, 0.14);
    backdrop-filter: blur(18px);
  }

  .topnav a {
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 10px 8px;
    border-radius: 16px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
  }

  .topnav a.is-active {
    background: rgba(145, 101, 64, 0.1);
    color: var(--text);
  }

  .scheduler-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .settings-body {
    padding: 0 16px 16px;
  }

  .scheduler-calendar-desktop {
    display: none;
  }

  .scheduler-calendar-mobile {
    display: block;
  }

  .toast-host {
    top: auto;
    right: 14px;
    bottom: 88px;
    left: 14px;
    width: auto;
  }
}

@media (max-width: 640px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .stat,
  .brand-card,
  .header-panel {
    border-radius: 20px;
  }

  table {
    min-width: 680px;
    table-layout: auto;
  }

  table th:last-child,
  table td:last-child {
    position: static;
    background: transparent;
  }

  .table-wrap {
    max-height: none;
  }

  th,
  td {
    white-space: normal;
  }

  .topnav a {
    font-size: 11px;
    padding: 9px 6px;
  }

  .scheduler-calendar-card,
  .scheduler-hero {
    padding: 18px;
  }

  .calendar-mobile-item {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 10px;
  }
}
