:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --ink: #142033;
  --muted: #65758b;
  --line: #d9e2ec;
  --brand: #12a875;
  --brand-2: #0a7e9a;
  --warn: #b7791f;
  --danger: #d83a4a;
  --ok: #149a66;
  --shadow: 0 18px 50px rgba(20, 32, 51, 0.12);
  --radius: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(18, 168, 117, .08), transparent 260px),
    var(--bg);
  letter-spacing: 0;
}
body.dialog-lock { overflow: hidden; }
body.mobile-menu-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  width: 260px;
  height: 100vh;
  padding: 18px;
  background: #112032;
  color: #eef7ff;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand, .brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand small, .brand-lockup small {
  display: block;
  color: rgba(238, 247, 255, .65);
  margin-top: 2px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
}
.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: block;
  border-radius: 8px;
}
.brand-mark.large { width: 52px; height: 52px; font-size: 1.35rem; }
.nav-list { display: grid; gap: 6px; }
.nav-list a, .mobile-nav a {
  border-radius: var(--radius);
  color: rgba(238, 247, 255, .76);
}
.nav-list a {
  padding: 11px 12px;
}
.nav-list a.active,
.nav-list a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}
.sidebar-logout { margin-top: auto; }

.app-main {
  flex: 1;
  min-width: 0;
  padding-bottom: 40px;
}
.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 28px 10px;
}
.topbar h1, .panel h2, .auth-panel h2 {
  margin: 0;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-2);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-menu-button {
  display: none;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  align-items: center;
  justify-content: center;
}
.user-chip {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}
.user-chip:hover {
  color: var(--ink);
  border-color: var(--brand);
}
.content {
  width: min(1420px, calc(100% - 56px));
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.panel, .metric, .device-card, .stream-card, .list-card, .auth-panel, .auth-visual, .onboard-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 20px; }
.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(110deg, rgba(18, 168, 117, .13), rgba(10, 126, 154, .10)),
    var(--surface);
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.metric {
  padding: 16px;
  display: grid;
  gap: 8px;
}
.metric span { color: var(--muted); font-size: .88rem; }
.metric strong { font-size: 1.45rem; }
.metric small { color: var(--muted); font-weight: 700; }

.btn {
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}
.btn:hover { filter: brightness(.96); }
.btn.ghost {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.danger { background: var(--danger); }
.btn.small { min-height: 34px; padding: 7px 10px; font-size: .88rem; }
.btn.full, .full { width: 100%; }
.icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn {
  position: relative;
  width: 40px;
  min-width: 40px;
  padding: 0;
  gap: 0;
}
.icon-btn.small {
  width: 34px;
  min-width: 34px;
  padding: 0;
}
.icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 80;
  max-width: 180px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #112032;
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .12s ease, transform .12s ease;
}
.icon-btn[data-tooltip]:hover::after,
.icon-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}
textarea {
  min-height: 112px;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(18, 168, 117, .18);
  border-color: var(--brand);
}
label span { font-weight: 700; font-size: .9rem; }
.required-mark {
  color: var(--danger);
  font-weight: 900;
}
.field-error {
  color: var(--danger);
  font-size: .82rem;
  font-style: normal;
  font-weight: 800;
}
.form-stack { display: grid; gap: 12px; }
.form-stack.slim { gap: 8px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid.compact { gap: 10px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.inline-form, .create-bar, .upload-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}
.create-bar, .upload-panel {
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  margin-bottom: 16px;
}
.create-bar input, .upload-panel input, .upload-panel select { width: auto; min-width: 160px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check-row input { width: auto; min-height: auto; }
.check-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.subscription-status-card {
  align-items: flex-start;
}
.subscription-status-card p {
  margin: 4px 0 0;
}
.segmented {
  display: inline-flex;
  background: #dfe8f1;
  border-radius: var(--radius);
  padding: 4px;
}
.segmented label { display: flex; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.segmented input:checked + span {
  background: #fff;
  color: var(--brand-2);
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .85rem; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
  font-size: .78rem;
}
.status.online { background: rgba(20, 154, 102, .12); color: var(--ok); }
.status.idle { background: rgba(183, 121, 31, .13); color: var(--warn); }
.status.warning { background: rgba(183, 121, 31, .13); color: var(--warn); }
.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 999px;
  background: var(--warn);
}
.status-dot.online { background: var(--ok); box-shadow: 0 0 0 5px rgba(20, 154, 102, .12); }
.status-dot.archived { background: var(--danger); }

.flash {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 700;
}
.flash.success { background: rgba(20, 154, 102, .12); color: var(--ok); }
.flash.error { background: rgba(216, 58, 74, .12); color: var(--danger); }

.list-grid, .stream-grid, .device-grid, .slide-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.list-card, .stream-card, .device-card {
  padding: 16px;
  display: grid;
  gap: 14px;
}
.list-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.list-card h3, .stream-card h3, .device-card h3 { margin: 0 0 4px; }
.list-card p, .stream-card p, .device-card p { margin: 0; color: var(--muted); }
.company-card {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
}
.company-card:hover {
  border-color: rgba(18, 168, 117, .55);
  transform: translateY(-1px);
}
.company-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
}
.company-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.company-logo-badge,
.company-logo-preview {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(18, 168, 117, .14), rgba(10, 126, 154, .12));
  color: var(--brand-2);
  font-weight: 900;
}
.company-logo-badge.large {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  font-size: 1.3rem;
}
.company-logo-badge.tiny {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: .82rem;
}
.company-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.company-logo-badge img,
.company-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}
.company-logo-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.company-logo-editor label {
  flex: 1;
  min-width: 0;
}
.company-logo-preview {
  width: 86px;
  height: 64px;
  flex-basis: 86px;
  font-size: 1.4rem;
  background: #fff;
}
.ai-settings {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(10, 126, 154, .18);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(18, 168, 117, .08), rgba(10, 126, 154, .07)),
    #fff;
}
.ai-settings-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.ai-settings h3 {
  margin: 0;
  font-size: 1.1rem;
}
.ai-settings p {
  margin: 4px 0 0;
}
.ai-question-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ai-question {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .86);
}
.ai-question label {
  display: grid;
  gap: 6px;
}
.company-card-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.company-card-facts div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}
.company-card-facts dt {
  margin-bottom: 4px;
  font-size: .76rem;
  font-weight: 800;
}
.company-card-facts dd {
  text-align: left;
  font-size: .9rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.company-subscription {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.company-subscription > div > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.company-subscription strong {
  display: block;
  line-height: 1.3;
}
.company-subscription .pill-row .status {
  display: inline-flex;
  margin-bottom: 0;
}
.company-card-limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.company-card-limits span {
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(10, 126, 154, .08);
  color: var(--brand-2);
  font-size: .82rem;
  font-weight: 800;
}
.pill-row, .card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.device-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}
.devices-panel {
  display: grid;
  gap: 16px;
}
.device-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.device-stats div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.device-stats span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}
.device-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
}
.device-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.device-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.device-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.device-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  max-height: 68vh;
  overflow: auto;
}
.device-table {
  min-width: 1280px;
}
.device-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: inset 0 -1px 0 var(--line);
}
.device-table th,
.device-table td {
  padding: 9px 10px;
}
.device-table tbody tr:hover {
  background: rgba(18, 168, 117, .05);
}
.device-table tbody tr.is-archived {
  background: rgba(216, 58, 74, .04);
}
.device-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.device-state.dot-only {
  width: 28px;
  justify-content: center;
}
.device-primary {
  display: grid;
  gap: 4px;
  min-width: 180px;
}
.device-primary strong {
  line-height: 1.25;
}
.device-primary code {
  color: var(--muted);
  font-size: .78rem;
  overflow-wrap: anywhere;
}
.device-meta {
  display: grid;
  gap: 3px;
  min-width: 130px;
}
.device-meta strong {
  font-size: .88rem;
}
.device-meta span {
  color: var(--muted);
  font-size: .78rem;
}
.device-compact-form select {
  min-width: 170px;
}
.device-name-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  min-width: 250px;
}
.device-table input,
.device-table select {
  min-height: 34px;
  padding: 6px 9px;
}
.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 170px;
}
.streams-panel {
  display: grid;
  gap: 16px;
}
.stream-create-bar {
  margin-bottom: 0;
}
.stream-format-panel {
  display: grid;
  gap: 14px;
}
.stream-format-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.stream-format-summary span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}
.stream-format-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.stream-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.stream-toolbar {
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(180px, 1fr) auto;
}
.stream-table {
  min-width: 1060px;
}
.stream-name-form {
  grid-template-columns: minmax(160px, 1fr) 34px;
  min-width: 230px;
}
.stream-actions {
  min-width: 190px;
}
.stream-devices-panel {
  display: grid;
  gap: 16px;
}
.stream-device-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stream-device-toolbar {
  grid-template-columns: minmax(240px, 1.4fr) minmax(170px, .8fr) minmax(180px, 1fr) auto;
}
.stream-device-table {
  min-width: 1120px;
}
.stream-device-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 44px;
}
.mini-list, .detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}
.mini-list div, .detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}
dt { color: var(--muted); }
dd { margin: 0; text-align: right; }
.subscription-switch {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.subscription-switch h3 {
  margin: 0;
  font-size: 1.15rem;
}
.subscription-switch .btn {
  justify-self: end;
  min-width: 220px;
}
.plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.plan-option {
  position: relative;
  display: block;
  cursor: pointer;
}
.plan-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.plan-body {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
  min-height: 168px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.plan-body::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  border: 2px solid #b8c6d6;
  border-radius: 999px;
  background: #fff;
}
.plan-option:hover .plan-body {
  border-color: rgba(18, 168, 117, .7);
  transform: translateY(-1px);
}
.plan-option input[type="radio"]:disabled + .plan-body {
  cursor: not-allowed;
  opacity: .58;
  background: #f6f8fb;
}
.plan-option input[type="radio"]:disabled + .plan-body::after {
  border-color: #d3dce7;
  background: #eef3f8;
}
.plan-option:has(input[type="radio"]:disabled):hover .plan-body {
  border-color: var(--line);
  transform: none;
}
.plan-option input[type="radio"]:focus-visible + .plan-body {
  outline: 3px solid rgba(18, 168, 117, .18);
  outline-offset: 2px;
}
.plan-option input[type="radio"]:checked + .plan-body {
  border-color: var(--brand);
  background: linear-gradient(180deg, rgba(18, 168, 117, .08), #fff 62%);
  box-shadow: 0 12px 28px rgba(20, 32, 51, .12), 0 0 0 3px rgba(18, 168, 117, .14);
}
.plan-option input[type="radio"]:checked + .plan-body::after {
  border-color: var(--brand);
  background: radial-gradient(circle at center, var(--brand) 0 5px, #fff 6px);
}
.plan-card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding-right: 30px;
}
.plan-name {
  display: block;
  margin-bottom: 8px;
  line-height: 1.25;
}
.plan-period {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(10, 126, 154, .1);
  color: var(--brand-2);
  font-size: .78rem;
  font-weight: 800;
}
.plan-price {
  text-align: right;
  color: var(--brand-2);
}
.plan-price strong {
  display: block;
  font-size: 1.22rem;
  line-height: 1.1;
}
.plan-price span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.plan-limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.plan-limits span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}
.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.profile-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 20px;
  align-items: start;
}
.profile-hero-panel h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
}
.profile-layout {
  display: grid;
  gap: 18px;
}
.profile-layout .section-head {
  margin-bottom: 16px;
}
.profile-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}
.profile-facts div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.profile-facts dd {
  min-width: 0;
  text-align: right;
  word-break: break-word;
}
.profile-check {
  align-self: end;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.profile-actions {
  display: flex;
  justify-content: flex-end;
}
.profile-actions.split-actions {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.danger-zone {
  border-color: rgba(216, 58, 74, .32);
  background:
    linear-gradient(110deg, rgba(216, 58, 74, .08), rgba(255, 255, 255, 0) 62%),
    var(--surface);
}
.danger-zone .eyebrow {
  color: var(--danger);
}
.account-delete-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: 20px;
  align-items: start;
}
.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.profile-summary-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.profile-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.profile-summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}
.account-delete-pills {
  margin-top: 14px;
}
.account-delete-form {
  max-width: 720px;
}
.billing-warning {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(183, 121, 31, .28);
  border-radius: var(--radius);
  background: rgba(183, 121, 31, .09);
}
.billing-warning strong {
  color: var(--warn);
}
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state.compact { padding: 24px 12px; }
.copy-box {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  word-break: break-all;
  font-size: .86rem;
}

.stream-edit-head .section-head { margin-bottom: 0; }
.stream-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.stream-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}
.stream-stat-chip strong {
  color: var(--ink);
  font-size: .9rem;
}
.stream-stat-chip.is-active {
  background: rgba(20, 154, 102, .12);
  color: var(--ok);
}
.stream-stat-chip.is-idle {
  background: rgba(183, 121, 31, .13);
  color: var(--warn);
}
.slide-order-form { display: none; }
.slide-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(17, 32, 50, .52);
}
.slide-dialog.is-open,
.slide-dialog[open],
.slide-dialog:target {
  display: grid;
}
.dialog-panel {
  width: min(820px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.slide-dialog.has-ai-editor .dialog-panel {
  width: min(1180px, 100%);
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.dialog-head h2 { margin: 0; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.slide-order-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.slide-upload-form {
  display: grid;
  gap: 16px;
}
.form-wide { grid-column: 1 / -1; }
.slide-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.slide-type-grid legend {
  margin-bottom: 8px;
  font-weight: 800;
}
.slide-type-option {
  position: relative;
  cursor: pointer;
}
.slide-type-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}
.slide-type-option span {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.slide-type-option small {
  color: var(--muted);
  font-weight: 700;
}
.ai-type-option span {
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  min-height: 92px;
  background:
    linear-gradient(135deg, rgba(18, 168, 117, .16), rgba(10, 126, 154, .12)),
    #fff;
}
.ai-type-option img {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.quick-ai-type-option span {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 92px;
  background:
    linear-gradient(135deg, rgba(18, 168, 117, .2), rgba(251, 188, 5, .14)),
    #fff;
}
.quick-ai-type-option .icon {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  color: var(--brand);
  stroke-width: 2;
  fill: rgba(18, 168, 117, .12);
}
.google-review-type-option span {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 92px;
  background:
    linear-gradient(135deg, rgba(251, 188, 5, .18), rgba(66, 133, 244, .12)),
    #fff;
}
.google-review-type-option .icon {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  color: #fbbc05;
  stroke-width: 2;
  fill: rgba(251, 188, 5, .18);
}
.slide-type-option input:checked + span {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 168, 117, .12);
}
.ai-generate-fields,
.ai-generated-picker,
.quick-ai-fields,
.google-review-fields,
.weekly-menu-fields {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(10, 126, 154, .18);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(18, 168, 117, .08), rgba(10, 126, 154, .07)),
    #fff;
}
.quick-ai-intro h3 {
  margin: 0 0 6px;
}
.quick-ai-intro p:last-child {
  margin-bottom: 0;
}
.google-review-intro {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.google-review-intro h3 {
  margin: 0 0 6px;
}
.google-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.weekly-menu-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.weekly-menu-day {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
}
.weekly-menu-day h4 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
}
.weekly-menu-day label:last-child {
  grid-column: 1 / -1;
}
.weekly-background-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(18, 168, 117, .18);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
}
.weekly-background-box.compact {
  padding: 12px;
}
.weekly-background-box h4 {
  margin: 0 0 4px;
}
.weekly-background-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.weekly-background-grid .check-row {
  align-self: end;
}
.weekly-background-preview {
  width: min(360px, 100%);
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 900;
  text-decoration: none;
}
.weekly-background-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(17, 32, 50, .12);
}
.weekly-menu-inline-editor {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(10, 126, 154, .18);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(18, 168, 117, .07), rgba(10, 126, 154, .06)),
    #fff;
}
.weekly-menu-inline-editor summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}
.weekly-menu-inline-editor summary small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.weekly-menu-edit-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.weekly-menu-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.weekly-menu-edit-days {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.weekly-menu-edit-day {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.78);
}
.weekly-menu-edit-day h4 {
  grid-column: 1 / -1;
  margin: 0;
}
.weekly-menu-edit-day label:last-child {
  grid-column: 1 / -1;
}
.ai-credit-strip,
.ai-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.ai-credit-strip {
  padding: 10px 12px;
  border: 1px solid rgba(18, 168, 117, .22);
  border-radius: var(--radius);
  background: rgba(18, 168, 117, .08);
}
.ai-credit-strip.is-empty {
  border-color: rgba(216, 58, 74, .24);
  background: rgba(216, 58, 74, .08);
}
.ai-credit-strip span {
  color: var(--muted);
  font-weight: 800;
}
.ai-quick-grid,
.ai-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ai-copy-grid .form-wide {
  grid-column: 1 / -1;
}
.ai-logo-check {
  justify-content: flex-start;
}
.ai-generate-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(10, 126, 154, .24);
  border-radius: var(--radius);
  background: rgba(10, 126, 154, .08);
}
.ai-generate-progress strong,
.ai-generate-progress span {
  display: block;
}
.ai-generate-progress span {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}
.upload-progress-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(10, 126, 154, .24);
  border-radius: var(--radius);
  background: rgba(10, 126, 154, .08);
}
.upload-progress-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}
.upload-progress-head strong,
.upload-progress-head span {
  font-weight: 900;
}
.upload-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(10, 126, 154, .14);
}
.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .2s ease;
}
.slide-upload-form.is-uploading {
  cursor: progress;
}
.slide-upload-form.is-uploading .dialog-actions .btn:not([data-slide-submit]) {
  pointer-events: auto;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 3px solid rgba(10, 126, 154, .18);
  border-top-color: var(--brand-2);
  border-radius: 999px;
  animation: spin .75s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.slide-upload-form.is-generating {
  cursor: wait;
}
.ai-variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ai-variant-shell {
  display: grid;
  gap: 8px;
}
.ai-variant-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}
.ai-variant-card input {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 18px;
  min-height: 18px;
}
.ai-variant-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #112032;
}
.ai-background-grid.is-portrait {
  grid-template-columns: repeat(2, minmax(160px, 260px));
  justify-content: start;
}
.ai-background-grid.is-portrait .ai-variant-card img {
  aspect-ratio: 9 / 16;
}
.ai-background-grid.is-square .ai-variant-card img {
  aspect-ratio: 1 / 1;
}
.ai-background-grid.is-classic .ai-variant-card img {
  aspect-ratio: 4 / 3;
}
.ai-variant-card span {
  font-weight: 900;
}
.ai-variant-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18, 168, 117, .12);
}
.ai-zoom-link {
  justify-self: start;
}
.ai-layout-editor {
  gap: 18px;
}
.ai-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}
.ai-layout-editor.is-poster-ai .ai-editor-grid {
  grid-template-columns: 1fr;
}
.ai-layout-editor.is-poster-ai .ai-variant-card img,
.ai-layout-editor.is-poster-ai .ai-editor-stage > img {
  object-fit: fill;
}
.ai-editor-preview {
  min-width: 0;
}
.ai-editor-stage {
  --ai-scale: 1;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #07111d;
  touch-action: none;
}
.ai-editor-stage > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ai-editor-layers {
  position: absolute;
  inset: 0;
}
.ai-editor-layer {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  display: block;
  min-width: 44px;
  min-height: 34px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  line-height: 1.18;
  white-space: pre-wrap;
  text-shadow: 0 2px 9px rgba(0,0,0,.55);
  cursor: move;
  user-select: none;
  touch-action: none;
  overflow: hidden;
}
.ai-editor-layer.has-box {
  padding: calc(14px * var(--ai-scale)) calc(22px * var(--ai-scale));
  text-shadow: none;
}
.ai-editor-layer.is-logo {
  display: grid;
  place-items: center;
  padding: calc(12px * var(--ai-scale));
  background: rgba(255,255,255,.92);
}
.ai-editor-layer.is-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.ai-editor-layer.is-active {
  border-color: #35d7a2;
  box-shadow: 0 0 0 3px rgba(53, 215, 162, .2);
}
.ai-editor-layer.is-hidden-layer {
  opacity: .24;
}
.ai-editor-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.ai-editor-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ai-editor-controls label,
.ai-editor-panel > label {
  min-width: 0;
}
.ai-editor-panel textarea {
  min-height: 96px;
  resize: vertical;
}
.ai-editor-panel input[type="range"] {
  padding: 0;
}
.ai-nudge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ai-nudge-grid .btn {
  min-height: 42px;
}
.slide-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  max-height: 68vh;
  overflow: auto;
}
.slide-table {
  min-width: 1440px;
}
.slide-table-head,
.slide-table-row {
  display: grid;
  grid-template-columns: 48px 104px minmax(220px, .72fr) minmax(760px, 1.9fr) 46px;
  align-items: center;
  gap: 10px;
}
.slide-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.slide-table-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.slide-table-row:last-child { border-bottom: 0; }
.slide-table-row:hover { background: rgba(18, 168, 117, .04); }
.slide-table-row.dragging {
  opacity: .55;
  background: rgba(10, 126, 154, .08);
}
.drag-handle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  cursor: grab;
  font-weight: 900;
}
.drag-handle:active { cursor: grabbing; }
.slide-thumb {
  width: 76px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #112032;
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
}
.slide-thumb img,
.slide-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slide-preview-btn {
  padding: 0;
  cursor: zoom-in;
}
.slide-preview-btn:hover,
.slide-preview-btn:focus-visible {
  outline: 3px solid rgba(18, 168, 117, .18);
  border-color: var(--brand);
}
.slide-summary {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.slide-summary strong,
.slide-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.slide-summary > span:not(.status) {
  color: var(--muted);
  font-size: .8rem;
}
.slide-summary .status { justify-self: start; }
.slide-inline-form {
  display: grid;
  grid-template-columns: minmax(150px, 1.15fr) 70px 132px 118px 82px 72px 36px;
  align-items: end;
  gap: 8px;
}
.slide-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.slide-field span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
}
.slide-field input,
.slide-field select {
  min-height: 34px;
  padding: 6px 8px;
}
.slide-active {
  align-self: center;
  margin-top: 18px;
  white-space: nowrap;
}
.slide-delete-form {
  display: flex;
  justify-content: flex-end;
}
.media-preview-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 32, 50, .72);
}
.media-preview-panel {
  width: min(1180px, 100%);
  max-height: calc(100vh - 44px);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  background: #0f1d2d;
  box-shadow: var(--shadow);
}
.media-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
}
.media-preview-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.media-preview-stage {
  display: grid;
  place-items: center;
  min-height: 220px;
  max-height: calc(100vh - 132px);
  overflow: hidden;
  border-radius: 7px;
  background: #000;
}
.media-preview-stage img,
.media-preview-stage video {
  max-width: 100%;
  max-height: calc(100vh - 132px);
  display: block;
  object-fit: contain;
}
.small-panel { box-shadow: none; padding: 14px; }
.assign-list { display: grid; gap: 8px; }
.assign-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-shell, .player-shell {
  min-height: 100vh;
}
.auth-shell {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(18, 168, 117, .18), rgba(10, 126, 154, .13)),
    #edf3f8;
}
.auth-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
}
.auth-card.narrow { width: min(860px, 100%); }
.auth-card.register-card { width: min(1040px, 100%); }
.auth-visual, .auth-panel { padding: 28px; }
.auth-visual {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(17, 32, 50, .92), rgba(18, 168, 117, .72)),
    url("ind4-logo.png") center / 60% no-repeat;
  color: #fff;
}
.auth-visual h1 { font-size: clamp(2rem, 4vw, 4rem); line-height: 1; margin: 0; }
.auth-panel {
  align-self: center;
  color: var(--ink);
}
.auth-button-stack {
  display: grid;
  gap: 8px;
}
.auth-links {
  margin-top: 14px;
  text-align: center;
  font-weight: 800;
}
.auth-links a { color: var(--brand-2); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.mobile-nav,
.mobile-nav-backdrop {
  display: none;
}

.player-shell { background: #000; color: #fff; overflow: hidden; }
.player-root { position: fixed; inset: 0; background: #000; }
.player-layer-stack, .player-layer, .player-fit-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.player-fit-bg {
  display: none;
  opacity: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(28px);
  transform: scale(1.08);
  transition: opacity .45s ease;
}
.player-fit-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .24);
}
.player-layer {
  display: none;
  opacity: 0;
  object-fit: contain;
  background: #000;
  border: 0;
}
.player-layer.fit-contain,
.player-layer.fit-blur-contain { object-fit: contain; }
.player-layer.fit-cover { object-fit: cover; }
.player-layer.fit-stretch { object-fit: fill; }
.google-review-layer {
  padding: clamp(36px, 5vw, 92px);
  background:
    radial-gradient(circle at 18% 18%, rgba(66, 133, 244, .24), transparent 32%),
    radial-gradient(circle at 82% 72%, rgba(52, 168, 83, .18), transparent 34%),
    linear-gradient(135deg, #050914, #0b1728 46%, #071114);
  color: #fff;
  overflow: hidden;
}
.google-review-layer.theme-premium_light {
  background: linear-gradient(135deg, #f8fbff, #eaf2f8 55%, #ffffff);
  color: #122033;
}
.google-review-layer.theme-restaurant {
  background:
    radial-gradient(circle at 68% 30%, rgba(255, 172, 79, .24), transparent 32%),
    linear-gradient(135deg, #150b08, #2a110d 48%, #06120e);
}
.google-review-layer.theme-minimal {
  background: #07111f;
}
.google-review-shell {
  position: relative;
  z-index: 1;
  width: min(1640px, 100%);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: clamp(28px, 4vw, 70px);
  min-height: 0;
  overflow: hidden;
}
.google-review-layer.layout-rating .google-review-shell {
  grid-template-columns: 1fr;
  text-align: center;
}
.google-review-main {
  display: grid;
  gap: clamp(16px, 2vw, 28px);
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  align-content: center;
}
.google-review-kicker {
  margin: 0;
  color: #34d399;
  font-weight: 900;
  font-size: clamp(1.1rem, 1.45vw, 1.8rem);
  text-transform: uppercase;
}
.google-review-title {
  margin: 0;
  max-width: 1120px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: clamp(3.4rem, 6.2vw, 7.6rem);
  line-height: .94;
  letter-spacing: 0;
}
.google-review-layer.layout-combo .google-review-title {
  font-size: clamp(2.9rem, 5.4vw, 6.4rem);
}
.google-review-rating-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(14px, 2vw, 28px);
}
.layout-rating .google-review-rating-row {
  justify-content: center;
}
.google-review-score {
  font-size: clamp(4.2rem, 8vw, 9rem);
  line-height: .9;
}
.google-review-layer.layout-combo .google-review-score {
  font-size: clamp(3.8rem, 6.9vw, 7.2rem);
}
.google-review-stars {
  color: #fbbc05;
  font-size: clamp(2.2rem, 4vw, 5rem);
  letter-spacing: 0;
  white-space: nowrap;
}
.google-review-count {
  padding: .55em .85em;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  font-weight: 900;
  font-size: clamp(1rem, 1.4vw, 1.55rem);
}
.theme-premium_light .google-review-count {
  border-color: rgba(18, 32, 51, .14);
  background: rgba(18, 32, 51, .06);
}
.google-review-quote {
  margin: 0;
  padding: clamp(24px, 3vw, 44px);
  border-left: 8px solid #34d399;
  border-radius: 12px;
  background: rgba(255,255,255,.10);
  box-shadow: 0 32px 100px rgba(0,0,0,.18);
  min-height: 0;
  overflow: hidden;
}
.theme-premium_light .google-review-quote {
  background: #fff;
}
.google-review-quote blockquote {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
  font-size: clamp(1.45rem, 2.35vw, 3rem);
  line-height: 1.12;
  font-weight: 900;
}
.google-review-layer.layout-combo .google-review-quote blockquote {
  -webkit-line-clamp: 5;
}
.google-review-quote figcaption {
  margin-top: 18px;
  color: rgba(255,255,255,.72);
  font-size: clamp(1.05rem, 1.6vw, 1.8rem);
  font-weight: 800;
}
.theme-premium_light .google-review-quote figcaption,
.theme-premium_light .google-review-muted,
.theme-premium_light .google-review-source {
  color: rgba(18, 32, 51, .62);
}
.google-review-muted {
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: clamp(1.1rem, 1.6vw, 1.8rem);
}
.google-review-source {
  margin: 0;
  color: rgba(255,255,255,.58);
  font-size: clamp(.85rem, 1vw, 1.2rem);
  font-weight: 800;
}
.google-review-qr {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(20px, 2.5vw, 34px);
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  color: #122033;
  text-align: center;
  box-shadow: 0 30px 90px rgba(0,0,0,.28);
  max-height: 72vh;
  align-self: center;
}
.google-review-qr-box {
  width: min(260px, 18vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.google-review-qr svg {
  width: 100%;
  height: 100%;
}
.google-review-qr strong {
  font-size: clamp(1.2rem, 1.6vw, 2rem);
}
.google-review-qr span {
  color: #65758b;
  font-weight: 800;
}
.weekly-menu-layer {
  padding: clamp(30px, 4.5vw, 82px);
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(52, 211, 153, .18), transparent 31%),
    radial-gradient(circle at 18% 82%, rgba(251, 191, 36, .13), transparent 34%),
    linear-gradient(135deg, #07111d, #0f1f32 52%, #07140f);
}
.weekly-menu-layer.theme-warm_restaurant {
  background:
    radial-gradient(circle at 80% 20%, rgba(249, 115, 22, .24), transparent 30%),
    linear-gradient(135deg, #160d08, #2b140a 46%, #081411);
}
.weekly-menu-layer.theme-premium_light {
  background: linear-gradient(135deg, #fbf8f2, #eef5f8 56%, #fff);
  color: #132034;
}
.weekly-menu-layer.theme-minimal {
  background: #07111f;
}
.weekly-menu-layer.has-background {
  position: absolute;
  background:
    linear-gradient(135deg, rgba(4, 9, 18, .8), rgba(4, 18, 15, .72)),
    var(--weekly-bg-image),
    #07111f;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.weekly-menu-layer.has-background::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(52, 211, 153, .18), transparent 32%),
    linear-gradient(90deg, rgba(5, 12, 22, .78), rgba(5, 12, 22, .55) 46%, rgba(5, 12, 22, .72));
  pointer-events: none;
}
.weekly-menu-layer.theme-premium_light.has-background::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,.88), rgba(255,255,255,.74) 48%, rgba(255,255,255,.82));
}
.weekly-menu-shell {
  position: relative;
  z-index: 1;
  width: min(1700px, 100%);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(18px, 2.4vw, 34px);
  min-height: 0;
}
.weekly-menu-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 52px);
}
.weekly-menu-kicker {
  margin: 0 0 .3em;
  color: #34d399;
  font-weight: 900;
  font-size: clamp(1rem, 1.35vw, 1.55rem);
  text-transform: uppercase;
}
.theme-premium_light .weekly-menu-kicker {
  color: #0e9f6e;
}
.weekly-menu-title {
  margin: 0;
  font-size: clamp(3rem, 5.6vw, 7rem);
  line-height: .92;
}
.weekly-menu-muted,
.weekly-menu-note {
  margin: .65em 0 0;
  color: rgba(255,255,255,.72);
  font-size: clamp(1rem, 1.45vw, 1.65rem);
  font-weight: 700;
}
.theme-premium_light .weekly-menu-muted,
.theme-premium_light .weekly-menu-note {
  color: rgba(19, 32, 52, .68);
}
.weekly-menu-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(520px, 40vw);
}
.weekly-menu-meta span,
.weekly-menu-meta strong {
  padding: .55em .8em;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  font-weight: 900;
  font-size: clamp(.95rem, 1.2vw, 1.4rem);
}
.weekly-menu-meta strong {
  background: #12a875;
  border-color: #12a875;
  color: #fff;
}
.theme-premium_light .weekly-menu-meta span {
  border-color: rgba(19,32,52,.14);
  background: rgba(19,32,52,.06);
}
.weekly-menu-body {
  min-height: 0;
  overflow: hidden;
}
.weekly-menu-table-wrap {
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.09);
  box-shadow: 0 32px 100px rgba(0,0,0,.2);
}
.theme-premium_light .weekly-menu-table-wrap {
  border-color: rgba(19,32,52,.12);
  background: rgba(255,255,255,.72);
}
.weekly-menu-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.weekly-menu-table th,
.weekly-menu-table td {
  padding: clamp(9px, 1.25vw, 20px);
  border-bottom: 1px solid rgba(255,255,255,.12);
  text-align: left;
  vertical-align: top;
  font-size: clamp(.9rem, 1.24vw, 1.55rem);
  line-height: 1.17;
}
.weekly-menu-table thead th {
  color: #34d399;
  font-size: clamp(.82rem, 1vw, 1.22rem);
  text-transform: uppercase;
}
.weekly-menu-table tbody th {
  width: 13%;
  color: #fff;
  font-size: clamp(1rem, 1.45vw, 1.8rem);
}
.theme-premium_light .weekly-menu-table th,
.theme-premium_light .weekly-menu-table td {
  border-color: rgba(19,32,52,.1);
}
.theme-premium_light .weekly-menu-table tbody th {
  color: #132034;
}
.weekly-menu-daily-card {
  height: 100%;
  display: grid;
  align-content: center;
  gap: clamp(22px, 3vw, 42px);
  padding: clamp(28px, 4vw, 70px);
  border-radius: 16px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
}
.weekly-menu-day-kicker {
  margin: 0;
  color: #34d399;
  font-size: clamp(2rem, 4.5vw, 6rem);
  line-height: .95;
  font-weight: 900;
}
.weekly-menu-daily-list {
  display: grid;
  gap: clamp(12px, 1.6vw, 22px);
}
.weekly-menu-daily-row {
  display: grid;
  grid-template-columns: minmax(120px, 18%) 1fr;
  gap: clamp(14px, 2vw, 32px);
  align-items: start;
  padding-bottom: clamp(10px, 1.3vw, 18px);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.weekly-menu-daily-row span {
  color: rgba(255,255,255,.66);
  font-size: clamp(1rem, 1.25vw, 1.5rem);
  font-weight: 900;
  text-transform: uppercase;
}
.weekly-menu-daily-row strong {
  font-size: clamp(1.6rem, 3vw, 4rem);
  line-height: 1.04;
}
.theme-premium_light .weekly-menu-daily-card {
  background: rgba(255,255,255,.78);
  border-color: rgba(19,32,52,.12);
}
.theme-premium_light .weekly-menu-daily-row {
  border-color: rgba(19,32,52,.12);
}
.theme-premium_light .weekly-menu-daily-row span {
  color: rgba(19,32,52,.62);
}
.weekly-menu-layer.layout-daily_focus {
  padding: clamp(22px, 3.2vw, 56px);
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-shell {
  gap: clamp(10px, 1.35vw, 24px);
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-head {
  align-items: start;
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-title {
  font-size: clamp(2.4rem, 4.35vw, 5.7rem);
  line-height: .96;
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-muted,
.weekly-menu-layer.layout-daily_focus .weekly-menu-note {
  font-size: clamp(.86rem, 1.02vw, 1.2rem);
  line-height: 1.25;
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-meta span,
.weekly-menu-layer.layout-daily_focus .weekly-menu-meta strong {
  font-size: clamp(.82rem, .98vw, 1.14rem);
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-daily-card {
  align-content: start;
  gap: clamp(8px, 1.1vw, 16px);
  padding: clamp(18px, 2.3vw, 38px);
  overflow: hidden;
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-day-kicker {
  font-size: clamp(1.8rem, 3.25vw, 4.2rem);
  line-height: 1;
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-daily-list {
  min-height: 0;
  overflow: hidden;
  gap: clamp(5px, .7vw, 11px);
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-daily-row {
  grid-template-columns: minmax(96px, 16%) minmax(0, 1fr);
  gap: clamp(9px, 1.15vw, 18px);
  padding-bottom: clamp(5px, .7vw, 10px);
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-daily-row span {
  font-size: clamp(.72rem, .82vw, 1rem);
  line-height: 1.12;
}
.weekly-menu-layer.layout-daily_focus .weekly-menu-daily-row strong {
  font-size: clamp(1.18rem, 1.95vw, 2.65rem);
  line-height: 1.06;
  overflow-wrap: anywhere;
}
.player-message {
  position: absolute;
  inset: auto 24px 24px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(0,0,0,.62);
}
.player-root.has-empty-state .player-message {
  display: none !important;
}
.player-free-logo {
  position: absolute;
  right: clamp(18px, 2.8vw, 44px);
  bottom: clamp(18px, 2.8vw, 44px);
  z-index: 15;
  max-width: min(18vw, 260px);
  max-height: min(12vh, 120px);
  object-fit: contain;
  padding: clamp(8px, 1vw, 14px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background: rgba(3, 7, 18, .74);
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.player-free-logo[hidden] { display: none !important; }
.player-empty {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(1, 7, 20, .96), rgba(5, 15, 30, .98)),
    #030712;
}
.player-empty[hidden] {
  display: none !important;
}
.player-root.has-empty-state .player-layer-stack {
  opacity: .16;
}
.player-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.75), transparent 82%);
  opacity: .55;
}
.player-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 32%, rgba(23, 222, 167, .08) 38%, transparent 46% 100%),
    linear-gradient(90deg, transparent, rgba(26, 147, 255, .16), transparent);
  transform: translateX(-22%);
  animation: playerSweep 9s ease-in-out infinite;
}
.player-empty-card {
  position: relative;
  z-index: 1;
  width: min(1160px, 92vw);
  display: grid;
  justify-items: center;
  gap: clamp(12px, 1.7vw, 22px);
  text-align: center;
  padding: clamp(18px, 3.2vw, 54px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 32px 120px rgba(0,0,0,.36);
}
.player-empty-logo-wrap {
  width: min(880px, 78vw);
  display: grid;
  place-items: center;
  aspect-ratio: 1681 / 910;
  padding: clamp(8px, 1.4vw, 18px);
  border-radius: 12px;
  background-color: rgba(0,0,0,.22);
  background-image: url("disi-logo-screen.png"), url("disi-logo.png");
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-size: contain, contain;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .24);
  animation: playerLogoFloat 5.8s ease-in-out infinite;
}
.player-empty-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.player-empty-kicker {
  margin: clamp(10px, 2vw, 18px) 0 0;
  color: #35d7a2;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.player-empty h1 {
  margin: 0;
  max-width: 920px;
  color: #fff;
  font-size: clamp(2.4rem, 5.8vw, 6rem);
  line-height: 1;
  text-shadow: 0 16px 54px rgba(0,0,0,.46);
}
.player-empty p {
  margin: 0;
}
.player-empty-card > p:not(.player-empty-kicker) {
  max-width: 840px;
  color: rgba(238, 247, 255, .78);
  font-size: clamp(1.05rem, 1.75vw, 1.65rem);
  font-weight: 700;
  line-height: 1.35;
}
.player-empty-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-top: clamp(4px, 1vw, 12px);
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(238, 247, 255, .9);
  font-weight: 900;
}
.player-empty-pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #35d7a2;
  box-shadow: 0 0 0 0 rgba(53, 215, 162, .5);
  animation: playerPulse 1.8s ease-out infinite;
}
.player-empty-footer {
  position: absolute;
  right: clamp(20px, 3vw, 42px);
  bottom: clamp(18px, 3vw, 38px);
  z-index: 1;
  color: rgba(238, 247, 255, .46);
  font-size: .95rem;
  font-weight: 800;
  text-transform: uppercase;
}
@keyframes playerPulse {
  70% { box-shadow: 0 0 0 13px rgba(53, 215, 162, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 215, 162, 0); }
}
@keyframes playerSweep {
  0%, 100% { transform: translateX(-28%); opacity: .55; }
  50% { transform: translateX(24%); opacity: .9; }
}
@keyframes playerLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (max-width: 900px) {
  .player-empty-card { border-radius: 14px; }
  .player-empty-card > p:not(.player-empty-kicker) { font-size: 1.25rem; }
}
@media (max-width: 560px) {
  .player-empty { padding: 14px; }
  .player-empty-card { width: 100%; }
  .player-empty h1 { line-height: 1.04; }
  .player-empty-card > p:not(.player-empty-kicker) { font-size: 1.05rem; }
  .player-empty-status { border-radius: 8px; }
  .player-free-logo { max-width: 42vw; max-height: 82px; }
}
.device-onboard {
  min-height: 100vh;
  height: 100vh;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(135deg, #112032, #0a7e9a);
}
.onboard-panel { width: min(560px, 100%); padding: 28px; }
.device-pair-panel {
  width: min(1120px, 100%);
  display: grid;
  gap: 18px;
}
.device-pair-hero {
  max-width: 840px;
  display: grid;
  gap: 12px;
  color: #fff;
}
.device-pair-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: .98;
}
.device-pair-hero .muted,
.device-pair-hero .brand-lockup small {
  color: rgba(238, 247, 255, .76);
}
.device-pair-hero .eyebrow { color: #9be7d3; }
.device-pair-hero .copy-box {
  width: min(720px, 100%);
  color: #eef7ff;
  border-color: rgba(238, 247, 255, .28);
  background: rgba(255, 255, 255, .1);
}
.device-pair-grid {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(320px, 1.15fr);
  gap: 16px;
}
.pair-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.pair-card h2 { margin: 0 0 6px; }
.qr-pair-card { text-align: center; }
.qr-frame {
  width: min(360px, 100%);
  margin: 0 auto;
  padding: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.qr-svg {
  width: min(320px, 100%);
  height: auto;
  display: block;
}

@media (max-width: 1080px) {
  .metric-grid, .list-grid, .stream-grid, .device-grid, .slide-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .device-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stream-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stream-toolbar,
  .stream-device-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slide-type-grid,
  .google-review-grid,
  .weekly-menu-edit-grid,
  .weekly-background-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stream-device-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .device-toolbar label:first-child,
  .device-toolbar-actions { grid-column: 1 / -1; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-visual { min-height: 340px; }
  .device-pair-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .app-main,
  .content {
    min-width: 0;
    max-width: 100%;
  }
  .topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 14px 12px 10px;
    align-items: center;
    gap: 10px;
  }
  .mobile-menu-button { display: inline-flex; }
  .topbar-title { min-width: 0; }
  .topbar h1 {
    font-size: 1.55rem;
    line-height: 1.08;
  }
  .topbar-actions { justify-content: flex-end; }
  .topbar-actions .btn {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 10px;
  }
  .topbar-actions .user-chip { display: none; }
  .content {
    width: 100%;
    padding: 0 12px 24px;
    gap: 12px;
  }
  .content > *,
  .panel,
  .hero-panel,
  .streams-panel,
  .devices-panel,
  .stream-edit-head,
  .stream-format-panel,
  .stream-devices-panel,
  .company-card,
  .list-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .panel { padding: 14px; }
  .form-grid,
  .form-stack,
  .inline-form,
  .section-head,
  .company-title,
  .topbar-actions,
  .ai-settings,
  .ai-question,
  .plan-card,
  .subscription-switch,
  .slide-upload-form,
  .quick-ai-fields,
  .ai-generated-picker,
  .ai-editor-stage,
  .ai-editor-grid,
  .google-review-grid,
  .weekly-background-box,
  .weekly-background-grid,
  .weekly-menu-edit-grid,
  .weekly-menu-edit-days {
    min-width: 0;
    max-width: 100%;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  input[type="file"] {
    max-width: 100%;
    min-width: 0;
  }
  .hero-panel, .section-head, .two-column, .profile-hero-panel, .account-delete-panel { display: grid; grid-template-columns: 1fr; }
  .metric-grid, .list-grid, .stream-grid, .device-grid, .slide-edit-grid { grid-template-columns: 1fr; }
  .profile-summary-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .device-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-toolbar { grid-template-columns: 1fr; }
  .stream-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stream-toolbar,
  .stream-device-toolbar { grid-template-columns: 1fr; }
  .stream-format-form { grid-template-columns: 1fr; }
  .stream-format-summary { justify-content: flex-start; }
  .stream-device-stats { grid-template-columns: 1fr; }
  .ai-editor-grid { grid-template-columns: 1fr; }
  .ai-editor-panel { order: 2; }
  .ai-editor-preview { order: 1; }
  .ai-editor-controls { grid-template-columns: 1fr; }
  .ai-nudge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .device-toolbar label:first-child,
  .device-toolbar-actions { grid-column: auto; }
  .device-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .device-toolbar-actions .icon-btn,
  .section-head .icon-btn {
    width: 40px;
    justify-self: start;
  }
  .device-list-head { display: grid; }
  .device-table-wrap { max-height: none; }
  .company-card-head,
  .company-card-facts,
  .company-card-limits,
  .ai-question-grid {
    grid-template-columns: 1fr;
  }
  .company-title {
    min-width: 0;
    align-items: flex-start;
  }
  .company-title h2,
  .hero-panel h2,
  .section-head h2 {
    overflow-wrap: anywhere;
  }
  .company-logo-editor {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
  }
  .company-logo-preview {
    width: 76px;
    height: 58px;
    flex-basis: 76px;
  }
  .mini-list div,
  .detail-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  dd {
    text-align: left;
    overflow-wrap: anywhere;
  }
  .inline-form, .create-bar, .upload-panel { display: grid; grid-template-columns: 1fr; }
  .create-bar input, .upload-panel input, .upload-panel select { width: 100%; min-width: 0; }
  .plan-list { grid-template-columns: 1fr; }
  .plan-card-head {
    grid-template-columns: 1fr;
    padding-right: 28px;
  }
  .plan-price { text-align: left; }
  .plan-limits { grid-template-columns: 1fr; }
  .subscription-switch .btn {
    width: 100%;
    min-width: 0;
  }
  .slide-dialog {
    padding: 12px;
    place-items: start center;
    overflow: auto;
  }
  .dialog-panel,
  .slide-dialog.has-ai-editor .dialog-panel {
    width: min(100%, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    padding: 16px;
  }
  .device-onboard {
    place-items: start center;
    padding: 14px;
  }
  .device-pair-hero h1 { font-size: 2.35rem; }
  .pair-card { padding: 16px; }
  .dialog-head,
  .dialog-actions,
  .slide-order-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .slide-type-grid,
  .ai-variant-grid,
  .ai-quick-grid,
  .ai-copy-grid,
  .google-review-grid,
  .weekly-menu-edit-grid,
  .weekly-background-grid,
  .weekly-menu-edit-days { grid-template-columns: 1fr; }
  .weekly-menu-inline-editor summary { display: grid; }
  .ai-copy-grid .form-wide { grid-column: auto; }
  .ai-credit-strip,
  .ai-result-head { display: grid; }
  .google-review-shell {
    grid-template-columns: 1fr;
    align-content: center;
  }
  .google-review-qr {
    justify-self: start;
    grid-template-columns: auto minmax(0, 1fr);
    text-align: left;
  }
  .google-review-qr-box {
    grid-row: span 2;
    width: min(170px, 34vw);
  }
  .upload-progress-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .upload-progress-head [data-upload-cancel] {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .slide-table-wrap { max-height: none; overflow-x: visible; }
  .slide-table { min-width: 0; }
  .slide-table-head { display: none; }
  .slide-table-row {
    grid-template-columns: 38px 86px minmax(0, 1fr);
    align-items: start;
  }
  .slide-inline-form {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .slide-field.wide,
  .slide-delete-form {
    grid-column: 1 / -1;
  }
  .slide-inline-form .icon-btn {
    width: 40px;
    min-width: 40px;
    justify-self: start;
  }
  .slide-active { margin-top: 0; }
  .slide-delete-form .icon-btn {
    width: 40px;
    min-width: 40px;
  }
  .media-preview-dialog { padding: 10px; }
  .media-preview-panel { max-height: calc(100vh - 20px); }
  .auth-shell { padding: 12px; align-items: start; }
  .auth-visual { min-height: 240px; padding: 20px; }
  .auth-panel { padding: 20px; }
  .table-wrap {
    width: 100%;
    max-width: 100%;
  }
  .table-wrap:not(.slide-table-wrap) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .slide-table-wrap {
    overflow-x: visible;
  }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 88;
    background: rgba(8, 17, 28, .44);
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
  }
  .mobile-nav.mobile-drawer {
    position: fixed;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: min(320px, calc(100vw - 42px));
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 8px;
    padding: 16px;
    border-radius: 0;
    background: #112032;
    box-shadow: var(--shadow);
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform .18s ease;
  }
  .mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }
  .mobile-nav-head .brand {
    padding: 0;
    color: #eef7ff;
    font-weight: inherit;
  }
  .mobile-nav.mobile-drawer a {
    padding: 12px;
    text-align: left;
    font-size: .96rem;
    font-weight: 800;
  }
  .mobile-nav.mobile-drawer a.active { background: rgba(255,255,255,.12); color: #fff; }
  .mobile-nav-logout {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .1);
  }
  .mobile-nav-logout .btn {
    width: 100%;
  }
  body.mobile-menu-open .mobile-nav.mobile-drawer {
    transform: translateX(0);
  }
  body.mobile-menu-open .mobile-nav-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 900px) {
  .weekly-menu-editor {
    grid-template-columns: 1fr;
  }
  .weekly-menu-day,
  .weekly-menu-edit-day {
    grid-template-columns: 1fr;
  }
}
