@font-face {
  font-family: "Lateef";
  src: url("/fonts/Lateef-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lateef";
  src: url("/fonts/Lateef-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lateef";
  src: url("/fonts/Lateef-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Lateef", Tahoma, Arial, sans-serif;
  --bg: #f3faf8;
  --surface: #FAFAFA;
  --text: #0B4548;
  --muted: #5e7470;
  --line: #d8e8e3;
  --accent: #116266;
  --accent-dark: #0D4E52;
  --brand-green: #46CF91;
  --surface-soft: #eef8f4;
  --warn: #9a5b00;
  --warn-bg: #fff6e6;
  --danger: #b42318;
  --radius-card: 20px;
  --radius-sm: 12px;
  --shadow-card: 0 4px 20px rgba(17, 98, 102, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

#authScreen {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.screen {
  display: none;
  min-height: calc(100vh - 36px);
}

.screen.active {
  display: grid;
  align-content: start;
  gap: 14px;
}

.hidden {
  display: none !important;
}

.dashboard {
  display: none;
  height: 100vh;
  grid-template-columns: 300px 1fr;
  overflow: hidden;
}

@supports selector(:has(*)) {
  .dashboard:has(.screen.active) {
    display: grid;
  }
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  background: #116266 url("/images/hero-cta-pattern.svg") no-repeat top center / cover;
  color: #fff;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #46CF91;
  color: #116266;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 27.44px;
  line-height: 1.4;
}

.nav-menu-toggle {
  display: none;
  margin-right: auto;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-drawer {
  display: contents;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tabs button {
  min-height: 42px;
  border-radius: 6px;
  padding: 9px 12px;
  background: transparent;
  color: #dce7e0;
  text-align: right;
  font-weight: 700;
  font-size: 22.4px;
  line-height: 1.3;
}

.nav-tabs button.active,
.nav-tabs button:hover {
  background: rgba(102, 198, 155, 0.18);
  color: #fff;
}

.ghost-button {
  margin-top: auto;
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 14px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-weight: 700;
}

.ai-telegram-button {
  margin-top: 8px;
  min-height: 38px;
  border-radius: 20px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #7c5cfc, #b26bff);
  color: #fff;
  border: none;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(124, 92, 252, 0.35);
}

.ai-telegram-button:hover {
  filter: brightness(1.08);
}

.ai-telegram-button svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.content {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
  overflow-y: auto;
}

@supports selector(:has(*)) {
  .content:has(#ordersListScreen.active) {
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
  }
}

#ordersListScreen.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#ordersListScreen .panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#ordersListScreen .section-title,
.orders-filters,
.orders-pagination {
  flex: none;
}

@media (min-width: 900px) {
  @supports selector(:has(*)) {
    .content:has(#messageScreen.active):has(#alwaseetSidePanel:not(.hidden)) {
      grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    }

    .content:has(#messageScreen.active):has(#alwaseetSidePanel:not(.hidden)) > .topbar {
      grid-column: 1 / -1;
    }
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.subscription-banner {
  padding: 12px 16px;
  border-radius: var(--radius-card);
  font-size: 25.48px;
  font-weight: 700;
  line-height: 1.6;
  /* default: green (more than a week left) */
  border: 1px solid #157a4a;
  background: rgba(21, 122, 74, 0.08);
  color: #12683f;
}

.subscription-banner.is-warning {
  border-color: #c76a00;
  background: rgba(199, 106, 0, 0.10);
  color: #b25f00;
}

.subscription-banner.is-danger {
  border-color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 16px;
}
@media (min-width: 860px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 0;
  }
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(20px, 4vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-align: start;
  position: relative;
}

@media (min-width: 860px) {
  .plan-card.plan-card-side {
    margin-block: 16px;
  }
  .plan-card.plan-card-start {
    border-inline-end: 0;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
  }
  .plan-card.plan-card-end {
    border-inline-start: 0;
    border-start-start-radius: 0;
    border-end-start-radius: 0;
  }
  .plan-card.plan-card-active {
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 1;
  }
}

.plan-card-active { border-color: var(--accent); }

.plan-badge {
  position: absolute;
  top: -12px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 23.52px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
}

.plan-card-header h3 { margin: 0 0 8px; font-size: 2.058rem; }
.plan-price-row { margin: 0 0 6px; }
.plan-price { font-size: 3.724rem; font-weight: 800; color: var(--accent); }
.plan-desc { margin: 0; font-size: 25.48px; color: var(--muted); }

.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.plan-features li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-size: 25.48px;
  color: var(--text);
}
.plan-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--surface-soft);
  color: var(--accent);
}
.plan-check svg { width: 11px; height: 11px; }

.plan-cta { margin-top: auto; width: 100%; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 23.52px;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px)) minmax(0, 1fr);
  gap: 12px;
}

.stat-box {
  min-height: 86px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.stat-box span {
  color: var(--muted);
  font-size: 25.48px;
  font-weight: 700;
}

.stat-box strong {
  display: block;
  margin-top: 8px;
  font-size: 50.96px;
  overflow-wrap: anywhere;
}

.stat-box-wide {
  display: grid;
  align-content: start;
  gap: 10px;
}

.report-section-title {
  min-height: auto;
  grid-column: 1 / -1;
  padding: 12px 16px;
}

.report-section-title span {
  color: var(--text);
  font-size: 29.4px;
}

.report-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-export-actions .secondary-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 23.52px;
}

.report-panel {
  grid-column: 1 / -1;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.report-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.report-panel-header h3 {
  margin: 0;
  font-size: 31.36px;
}

.table-wrap {
  overflow-x: auto;
}

.report-panel table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 25.48px;
}

.report-panel th,
.report-panel td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.report-panel th {
  color: var(--muted);
  font-size: 23.52px;
}

.report-panel td {
  font-weight: 700;
}

.report-cards {
  display: grid;
  gap: 8px;
}

.report-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.report-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.report-card-title {
  font-weight: 800;
  font-size: 27.44px;
}

.report-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.report-card-stat {
  display: grid;
  gap: 2px;
}

.report-card-stat span {
  color: var(--muted);
  font-size: 21.56px;
  font-weight: 700;
}

.report-card-stat strong {
  font-size: 29.4px;
}

.report-stock-badge {
  display: inline-flex;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 21.56px;
  font-weight: 800;
  white-space: nowrap;
}

.report-stock-danger {
  background: #fdf1ef;
  color: var(--danger);
}

.report-stock-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.report-stock-ok {
  background: #eaf7f1;
  color: #247A58;
}

.report-stock-muted {
  background: #f1f2f0;
  color: var(--muted);
}

.report-card-sublist {
  display: grid;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.report-card-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 23.52px;
  color: var(--muted);
}

.report-card-subrow span:first-child {
  color: var(--text);
  font-weight: 700;
}

.priority-card .report-card-line {
  margin: 0;
  font-size: 25.48px;
  color: var(--text);
}

.priority-card .report-card-action {
  margin: 0;
  font-size: 23.52px;
  color: var(--muted);
  font-weight: 700;
}

.most-ordered-list {
  display: grid;
  gap: 6px;
}

.most-ordered-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 25.48px;
}

.most-ordered-rank {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eef6f4;
  color: var(--accent-dark);
  font-size: 21.56px;
  font-weight: 800;
}

.most-ordered-name {
  flex: 1;
  font-weight: 700;
}

.most-ordered-count {
  color: var(--muted);
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-action {
  display: grid;
  gap: 7px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  text-align: right;
  box-shadow: var(--shadow-card);
}

.dashboard-action:hover {
  border-color: rgba(0, 90, 93, 0.45);
  box-shadow: 0 8px 24px rgba(0, 90, 93, 0.1);
}

.dashboard-action strong {
  font-size: 31.36px;
}

.dashboard-action span {
  color: var(--muted);
  font-size: 25.48px;
  font-weight: 700;
  line-height: 1.6;
}

/* ---- Home / shared dashboard components ---- */

.home-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-greeting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.home-greeting-text h2 {
  margin: 0 0 4px;
  font-size: 43.12px;
}

.primary-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 27.44px;
  white-space: nowrap;
}

.primary-cta-button:hover {
  background: var(--accent-dark);
}

.primary-cta-button.subtle {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.stat-growth {
  display: inline-block;
  margin-top: 6px;
  font-size: 23.52px;
  font-weight: 800;
  color: #1a8f5e;
}

.stat-growth-negative {
  color: var(--danger);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 23.52px;
  font-weight: 800;
  color: #1a8f5e;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a8f5e;
  box-shadow: 0 0 0 3px rgba(26, 143, 94, 0.18);
}

.insight-box {
  display: grid;
  gap: 2px;
}

.insight-box .hint-muted {
  font-size: 23.52px;
  font-weight: 600;
}

.home-carousel-panel .report-panel-header {
  margin-bottom: 14px;
}

.live-orders-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.live-order-card {
  scroll-snap-align: start;
  flex: none;
  width: 220px;
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
}

.live-order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 21.56px;
}

.live-order-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 800;
}

.live-order-time {
  color: rgba(255, 255, 255, 0.72);
}

.live-order-name {
  font-size: 29.4px;
}

.live-order-address,
.live-order-item {
  font-size: 23.52px;
  color: rgba(255, 255, 255, 0.78);
}

.chart-holder {
  display: flex;
  justify-content: center;
}

.chart-holder svg {
  max-width: 100%;
  height: auto;
}

.donut-with-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.chart-legend {
  display: grid;
  gap: 10px;
  flex: 1;
  min-width: 180px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 25.48px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.legend-label {
  flex: 1;
  font-weight: 700;
}

.legend-value {
  color: var(--muted);
  font-size: 23.52px;
  white-space: nowrap;
}

.wide-search {
  margin-bottom: 10px;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 23.52px;
  font-weight: 800;
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 25.48px;
}

.mini-table th,
.mini-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.mini-table th {
  color: var(--muted);
  font-size: 23.52px;
}

.hero-card {
  display: grid;
  gap: 14px;
  background: var(--accent) url("/images/hero-cta-pattern.svg") no-repeat top center / cover;
  color: #fff;
  border: none;
}

.hero-eyebrow {
  margin: 0;
  color: var(--brand-green);
  font-size: 23.52px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: 39.2px;
  line-height: 1.5;
  max-width: 480px;
}

.hero-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 8px 0 20px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.hero-cta-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.channel-breakdown {
  display: grid;
  gap: 14px;
}

.channel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.channel-stat {
  display: grid;
  gap: 2px;
}

.channel-stat strong {
  font-size: 43.12px;
}

.channel-stat span {
  color: var(--muted);
  font-size: 23.52px;
  font-weight: 700;
}

.channel-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-soft);
}

.channel-bar span {
  display: block;
  height: 100%;
}

/* ---- Analytics screen ---- */

.difficulty-bars {
  display: grid;
  gap: 16px;
}

.difficulty-bucket-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.difficulty-bucket-head strong {
  font-size: 35.28px;
}

.difficulty-bucket-head span {
  color: var(--muted);
  font-size: 23.52px;
  font-weight: 700;
}

.difficulty-bucket-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.difficulty-bucket-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.conversion-bar {
  display: grid;
  gap: 14px;
}

.conversion-bar-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.conversion-bar-total {
  position: absolute;
  inset: 0;
  background: rgba(0, 90, 93, 0.16);
}

.conversion-bar-fill {
  position: absolute;
  inset: 0;
  background: var(--brand-green);
  border-radius: 999px;
}

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

.recommendation-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 25.48px;
  line-height: 1.6;
}

.recommendation-observation {
  background: #fdf1ef;
  color: #7a291f;
}

.recommendation-action {
  background: #eaf7f1;
  color: #247A58;
}

.recommendation-tag {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 21.56px;
  font-weight: 800;
}

.heatmap-holder {
  overflow-x: auto;
}

.heatmap {
  display: grid;
  gap: 6px;
  min-width: 480px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 8px;
}

.heatmap-row-label {
  font-size: 23.52px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heatmap-row-cells {
  display: grid;
  gap: 6px;
}

.heatmap-cell {
  height: 28px;
  border-radius: 6px;
}

.heatmap-col-label {
  font-size: 21.56px;
  color: var(--muted);
  text-align: center;
}

.heatmap-header-row .heatmap-row-label {
  visibility: hidden;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 21.56px;
  color: var(--muted);
}

.heatmap-legend-swatch {
  width: 90px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef3f1, #116266);
}

.premium-card {
  display: grid;
  gap: 10px;
  background: var(--accent) url("/images/upgrade-card-waves.svg") no-repeat bottom center / cover;
  color: #fff;
  border: none;
}

.premium-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.premium-card h3 {
  margin: 0;
  font-size: 35.28px;
}

.premium-card p {
  margin: 0;
  max-width: 480px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 25.48px;
  line-height: 1.7;
}

.premium-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  width: fit-content;
}

.priority-badge {
  display: inline-flex;
  min-height: 26px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 21.56px;
  font-weight: 800;
  white-space: nowrap;
}

.priority-urgent {
  background: #fdf1ef;
  color: var(--danger);
}

.priority-high {
  background: var(--warn-bg);
  color: var(--warn);
}

.priority-medium {
  background: #eaf1ff;
  color: #1d4ed8;
}

.priority-low {
  background: #eaf7f1;
  color: #247A58;
}

@media (max-width: 1100px) {
  .dashboard {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-tabs {
    display: flex;
  }

  .nav-tabs button {
    min-width: 120px;
    text-align: center;
  }

  .ghost-button,
  .ai-telegram-button {
    margin-top: 0;
    margin-right: auto;
  }

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

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

@media (max-width: 720px) {
  .content {
    padding: 14px;
  }

  .home-greeting-card {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-cta-button {
    justify-content: center;
  }

  .donut-with-legend {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
    padding: 14px 16px;
  }

  .nav-menu-toggle {
    display: flex;
  }

  .nav-drawer {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: #116266;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  }

  .sidebar.nav-open .nav-drawer {
    display: flex;
  }

  .nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .nav-tabs button {
    text-align: right;
    min-width: 0;
  }

  .ghost-button,
  .ai-telegram-button {
    margin: 4px 0 0;
  }
}

.auth-illustration {
  display: block;
  width: min(320px, 70%);
  margin: 0 auto 8px;
}

.app-header {
  min-height: 184px;
  display: grid;
  align-content: end;
  padding: 22px;
  border-radius: var(--radius-card);
  background: #116266 url("/images/upgrade-card-waves.svg") no-repeat bottom center / cover;
  color: #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

#authScreen .app-header {
  position: relative;
  width: min(700px, 100%);
  height: 700px;
  min-height: 700px;
  margin-inline: auto;
  align-content: start;
  background: #116266;
}

#authScreen .app-header-waves {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#authScreen .app-header-waves > div {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#authScreen .app-header-waves svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  display: block;
  animation: wave-scroll 4s linear infinite;
}

#authScreen .app-header-waves .overlay-bottom path {
  fill: #46CF91;
  opacity: 0.2;
}

#authScreen .app-header-waves .overlay-bottom-2 svg {
  animation-duration: 6s;
}

#authScreen .app-header-waves .overlay-bottom-2 path {
  fill: #46CF91;
  opacity: 0.5;
}

#authScreen .app-header-waves .overlay-bottom-3 svg {
  animation-duration: 5s;
}

#authScreen .app-header-waves .overlay-bottom-3 path {
  fill: #46CF91;
  opacity: 0.7;
}

@keyframes wave-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

#authScreenTitle,
#authCardStack {
  position: relative;
  z-index: 1;
}

.app-header p,
.compact-header p {
  margin: 0 0 6px;
  color: #46CF91;
  font-size: 23.52px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 62.72px;
}

h2 {
  font-size: 47.04px;
}

h3,
h4 {
  margin: 0;
  letter-spacing: 0;
}

h3 {
  font-size: 35.28px;
}

h4 {
  font-size: 31.36px;
}

.compact-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  background: var(--bg);
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.panel,
.review-form {
  display: grid;
  gap: 13px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.grow-panel {
  min-height: calc(100vh - 320px);
  grid-template-rows: 1fr auto;
}

.auth-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 4px;
  margin: 18px 0 14px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.auth-notice-danger {
  margin: 0 0 13px;
  color: var(--danger) !important;
  font-size: 56px !important;
  font-weight: 800 !important;
  line-height: 1.25;
  text-align: center;
}

.auth-disabled-forms {
  display: none;
}

.auth-tabs .auth-tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 29.4px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-tabs .auth-tab.is-active {
  background: #fff;
  color: var(--accent);
}

/* Keep the form card in the same position while switching to sign-up. */
#loginTypeTabs.auth-tabs-placeholder {
  visibility: hidden;
  pointer-events: none;
}

#authCardStack {
  position: relative;
  display: grid;
  min-height: 320px;
}

#authCardStack > .auth-card {
  grid-area: 1 / 1;
  align-self: start;
  transition: transform 0.7s ease, opacity 0.7s ease;
}

#authCardStack > .auth-card.slide-out-left {
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
}

#authCardStack > .auth-card.slide-in-from-right {
  transform: translateX(120%);
  opacity: 0;
}

#authCardStack > .auth-card.slide-out-right {
  transform: translateX(120%);
  opacity: 0;
  pointer-events: none;
}

#authCardStack > .auth-card.slide-in-from-left {
  transform: translateX(-120%);
  opacity: 0;
}

#signupCard form {
  display: grid;
  gap: 13px;
}

#usernameForm,
#signupCard {
  background: rgb(255 255 255 / 20%);
}

#usernameForm label,
#usernameForm .hint-muted,
#usernameForm .link-button,
#signupCard label,
#signupCard .hint-muted,
#signupCard .link-button {
  color: #fff;
}

#usernameForm input,
#signupCard input {
  background: transparent;
  border-color: rgb(255 255 255 / 40%);
  color: #fff;
}

#usernameForm input::placeholder,
#signupCard input::placeholder {
  color: rgb(255 255 255 / 65%);
}

#authScreen .panel:not(#usernameForm):not(#signupCard) {
  background: rgb(255 255 255 / 15%);
  border-color: rgb(255 255 255 / 30%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* signup/employee-signup are just the "coming soon" notice now - drop the
   card look entirely so the text sits directly on the header, not boxed. */
#signupCard,
#employeeSignupCard {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 25.48px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font-size: 31.36px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-left: 64px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  background: none;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--accent);
  font-size: 23.52px;
  font-weight: 800;
}

.password-toggle:hover {
  background: var(--surface-soft);
}

#usernameForm .password-toggle,
#signupCard .password-toggle {
  color: #fff;
}

#usernameForm .password-toggle:hover,
#signupCard .password-toggle:hover {
  background: rgb(255 255 255 / 15%);
}

.message-label textarea {
  min-height: 30px;
}

.alwaseet-panel {
  padding: 0;
  overflow: hidden;
  height: calc(100vh - 320px);
  grid-template-rows: auto 1fr;
}

.alwaseet-panel .section-title {
  padding: 14px;
}

.alwaseet-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.readonly-badge {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef6f4;
  color: var(--accent-dark);
  font-size: 23.52px;
  font-weight: 800;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 90, 93, 0.14);
}

.combo {
  position: relative;
}

.combo-btn {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 27.44px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.combo-btn::marker,
.combo-btn::-webkit-details-marker {
  display: none;
}

.combo-btn svg {
  flex: none;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.combo[open] > .combo-btn svg {
  transform: rotate(180deg);
}

.combo[open] > .combo-btn {
  visibility: hidden;
}

.combo-value.is-placeholder {
  color: var(--muted);
  font-weight: normal;
}

.combo-search {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--accent);
  background: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 27.44px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
}

.combo-search:focus {
  outline: none;
}

.combo[open] > .combo-search {
  display: block;
}

.combo-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 90, 93, 0.14);
  padding: 8px;
}

.combo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.combo-list li {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 27.44px;
  color: var(--text);
  cursor: pointer;
}

.combo-list li:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.combo-empty {
  margin: 6px 2px 2px;
  font-size: 25.48px;
  color: var(--muted);
  text-align: center;
}

.combo-create-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: none;
  border: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 27.44px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  text-align: right;
  cursor: pointer;
}

.combo-create-btn:hover {
  background: var(--surface-soft);
}

.combo-create-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.page-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-height: 0;
}

.page-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 6px 6px 12px;
  font-size: 25.48px;
  font-weight: 700;
}

.page-category-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 27.44px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.page-category-chip-remove:hover {
  background: var(--accent);
  color: #fff;
}

.candidate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.candidate-chip {
  min-height: 0;
  border: 1.5px solid var(--warn);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 23.52px;
  font-weight: 800;
  cursor: pointer;
}

.candidate-chip.active {
  background: var(--warn);
  color: #fff;
}

input:disabled,
button:disabled,
textarea:disabled {
  cursor: wait;
  opacity: 0.68;
}

button[type="submit"],
.secondary-button,
.icon-button {
  min-height: 44px;
  border-radius: 6px;
  padding: 9px 14px;
  font-weight: 800;
}

button[type="submit"] {
  background: var(--accent);
  color: #fff;
}

button[type="submit"]:hover,
.secondary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  background: #116266;
  color: #fff;
}

.secondary-button.danger-button {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.secondary-button.danger-button:hover {
  background: #8f1c12;
}

.secondary-button.warning-button {
  background: #b8590a;
  color: #fff;
  border-color: #b8590a;
}

.secondary-button.warning-button:hover {
  background: #944608;
}

.icon-button {
  min-width: 76px;
  background: var(--surface);
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

.danger-button {
  color: var(--danger);
  border-color: #f3d3ce;
}

.danger-button:hover {
  background: #fdf1ef;
}

.products-sort-select {
  width: auto;
  min-height: 44px;
  padding: 9px 10px;
  font-size: 25.48px;
  font-weight: 800;
}

.products-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.products-filters input {
  flex: 2;
  min-width: 160px;
  align-self: end;
}

.products-category-label {
  flex: 1;
  min-width: 140px;
}

.stock-alerts-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fcfa;
}

.stock-alert-card {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stock-alert-card strong {
  font-size: 47.04px;
  line-height: 1;
}

.stock-alert-card span {
  color: var(--muted);
  font-size: 23.52px;
  font-weight: 800;
}

.stock-alert-card-danger {
  border-color: #f3d3ce;
  background: #fdf1ef;
  color: var(--danger);
}

.stock-alert-card-warning {
  border-color: #f6d49a;
  background: var(--warn-bg);
  color: var(--warn);
}

.page-form-toggle {
  width: 100%;
}

.auth-switch {
  margin: 4px 0 0;
  text-align: center;
  font-size: 25.48px;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

#authScreen .app-header > .auth-switch {
  position: absolute;
  z-index: 1;
  right: 22px;
  bottom: 18px;
  left: 22px;
  margin: 0;
  color: #fff;
}

#authScreen .app-header > .auth-switch a {
  color: #116266;
}

.link-button {
  display: block;
  width: 100%;
  margin: -4px 0 8px;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 25.48px;
  text-align: center;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 90, 93, 0.55);
  padding: 16px;
}

.modal-panel {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border-radius: 10px;
}

.modal-panel h3 {
  margin: 0;
  font-size: 35.28px;
}

.modal-close-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 43.12px;
  font-weight: 800;
  line-height: 1;
}

.modal-close-button:hover {
  background: #fdf1ef;
  color: var(--danger);
  border-color: #f3d3ce;
}

.modal-issues-list {
  display: grid;
  gap: 14px;
}

.modal-issue {
  display: grid;
  gap: 7px;
}

.modal-issue-label {
  color: var(--muted);
  font-size: 25.48px;
  font-weight: 800;
}

.modal-actions {
  display: grid;
  gap: 10px;
}

#externalInvoiceForm {
  display: grid;
  gap: 12px;
}

#externalInvoiceForm label {
  display: grid;
  gap: 4px;
  font-size: 25.48px;
  font-weight: 700;
}

.ext-invoice-customer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ext-invoice-lines {
  display: grid;
  gap: 8px;
}

.ext-invoice-line {
  display: grid;
  grid-template-columns: 1fr 1fr 56px 32px;
  gap: 6px;
  align-items: center;
}

.ext-invoice-line select,
.ext-invoice-line input {
  min-width: 0;
  padding: 7px 8px;
  font: inherit;
  border: 1.5px solid var(--line);
  border-radius: 8px;
}

.ext-invoice-line .ext-line-remove {
  padding: 0;
  width: 32px;
  height: 32px;
}

@media (max-width: 560px) {
  .ext-invoice-customer {
    grid-template-columns: 1fr;
  }
  .ext-invoice-line {
    grid-template-columns: 1fr 1fr;
  }
  .ext-invoice-line .ext-line-remove {
    grid-column: 2;
    justify-self: end;
  }
}

.telegram-join-modal {
  position: relative;
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 28px 22px 24px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 22px 70px rgba(0, 45, 48, 0.22);
  text-align: center;
}

.telegram-join-modal .modal-close-button {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
}

.telegram-join-dial {
  --join-progress: 100%;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 60%, transparent 61%),
    conic-gradient(var(--accent) var(--join-progress), #e5eeee 0);
}

.telegram-join-code {
  width: 142px;
  height: 142px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
}

.telegram-join-code span:first-child {
  color: var(--text);
  font-size: 70.56px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.telegram-join-code small {
  color: var(--muted);
  font-size: 25.48px;
  font-weight: 800;
}

.telegram-join-modal p {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 27.44px;
  font-weight: 700;
  line-height: 1.8;
}

.telegram-join-modal p strong {
  display: block;
  color: var(--accent-dark);
  font-size: 29.4px;
}

.telegram-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 23.52px;
  font-weight: 800;
  white-space: nowrap;
}

.telegram-account-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

input.field-missing,
textarea.field-missing {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.13);
}

.combo.field-missing > .combo-btn {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.13);
}

.field-hint {
  color: var(--danger);
  font-size: 23.52px;
  font-weight: 700;
}

.source-message-panel {
  padding: 0;
  overflow: hidden;
}

.source-message-text {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 25.48px;
  line-height: 1.7;
}

.review-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-form-readonly > label {
  opacity: 0.55;
  pointer-events: none;
}

.review-form-readonly input,
.review-form-readonly textarea {
  background: var(--surface-soft);
}

.products-layout {
  display: grid;
  gap: 14px;
}

.products-panel {
  padding: 0;
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

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

.product-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 90, 93, 0.58);
}

.product-form-overlay.hidden {
  display: none;
}

.product-form-panel.is-editing-modal {
  display: flex;
  flex-direction: column;
  width: min(940px, 100%);
  max-height: min(calc(100dvh - 36px), 920px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 90, 93, 0.32);
  border-radius: 8px;
  background: #FAFAFA;
  box-shadow: 0 20px 48px rgba(0, 90, 93, 0.28);
}

.product-form-panel.is-editing-modal .section-title {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef6f4;
  border-bottom-color: rgba(0, 90, 93, 0.18);
}

.product-form-panel.is-editing-modal .section-title h3 {
  color: var(--accent-dark);
}

.product-form-panel.is-editing-modal .product-form {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
  scroll-padding-bottom: 96px;
}

.product-form label:nth-last-of-type(1),
.product-form .wide {
  grid-column: 1 / -1;
}

.inventory-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfa;
}

.section-title-compact {
  grid-column: 1 / -1;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.product-form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

.product-form-actions button {
  flex: 1;
}

.product-image-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-image-preview {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.product-images-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.product-images-list .empty-state {
  grid-column: 1 / -1;
  padding: 10px 0;
}

.product-image-item {
  position: relative;
  display: grid;
  gap: 6px;
}

.product-image-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.product-variants-manage-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.product-canned-replies-manage-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.product-canned-reply-text-input {
  width: 100%;
  min-height: 70px;
  padding: 7px 10px;
  font-size: 25.48px;
  resize: vertical;
}

.product-variant-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 160px) minmax(120px, 160px) auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-variant-name-input {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 25.48px;
}

.variant-stock-field {
  gap: 4px;
  font-size: 21.56px;
}

.variant-stock-field input {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 25.48px;
}

.product-variant-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.color-picker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker-photo {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  color: var(--muted);
  font-size: 19.6px;
  text-align: center;
}

.color-picker-photo.has-photo {
  border-style: solid;
}

.color-picker-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.color-picker-photo input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.color-picker-row input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.color-picker-row input[type="text"] {
  flex: 1;
}

.color-picker-row-remove {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.product-setup-variant-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-setup-variant-row .ps-variant-name-input {
  flex: 1;
  min-width: 120px;
  min-height: 38px;
  padding: 7px 10px;
  font-size: 25.48px;
}

.product-setup-variant-row .variant-stock-field {
  flex: 1;
  min-width: 100px;
  gap: 4px;
  font-size: 21.56px;
}

.product-setup-variant-row .variant-stock-field input {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 25.48px;
}

.color-swatch-slot {
  position: relative;
}

.variant-color-input {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.color-swatch-remove {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 17.64px;
  line-height: 1;
  cursor: pointer;
}

.color-swatch-add {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 27.44px;
  line-height: 1;
  cursor: pointer;
}

.product-image-variant-select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 23.52px;
}

.product-image-remove {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 90, 93, 0.65);
  color: #FAFAFA;
  font-size: 29.4px;
  line-height: 1;
  cursor: pointer;
}

.product-image-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 90, 93, 0.65);
  color: #FAFAFA;
  font-size: 25.48px;
  line-height: 1;
  cursor: pointer;
}

.products-list {
  display: grid;
}

.product-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.product-thumb-wrap {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f7faf7;
}

.product-thumb-empty {
  background: #f7faf7;
}

.product-thumb-colors {
  display: flex;
  gap: 3px;
}

.product-thumb-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.product-edit-button {
  min-width: 0;
  min-height: 32px;
  padding: 5px 10px;
  font-size: 23.52px;
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.page-card-preview {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.page-card-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.page-card-products:empty {
  display: none;
}

.page-card-product {
  background: var(--card-bg, var(--surface));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.page-card-product-image,
.page-card-product-image-empty {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #eef2ee;
  display: block;
}

.page-card-product-info {
  padding: 8px;
}

.page-card-product-info h5 {
  margin: 0 0 3px;
  font-size: 23.52px;
  line-height: 1.35;
  color: var(--card-primary-color, inherit);
}

.page-card-product-price {
  margin: 0;
  color: var(--card-secondary-color, var(--accent-dark));
  font-weight: 800;
  font-size: 22.54px;
}

.profile-panel {
  padding: 0;
  overflow: hidden;
}

.profile-cover {
  position: relative;
  height: 150px;
  background: linear-gradient(135deg, #116266, var(--accent-dark));
}

.profile-avatar-wrap {
  position: absolute;
  bottom: -34px;
  right: 18px;
  width: 84px;
  height: 84px;
}

.profile-avatar-img,
.profile-avatar-placeholder {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface) url("/images/account-avatar-placeholder.svg") no-repeat center / cover;
  border: 3px solid var(--surface);
}

.avatar-upload-button {
  position: absolute;
  bottom: 0;
  left: -4px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--surface);
  cursor: pointer;
}

.profile-info {
  padding: 44px 16px 4px;
  text-align: center;
}

.profile-info h3 {
  margin: 0 0 4px;
}

.profile-info p {
  margin: 0;
  color: var(--muted);
  font-size: 25.48px;
  font-weight: 800;
}

.profile-panel > button {
  margin: 6px 16px 16px;
  width: calc(100% - 32px);
  background: var(--accent);
  color: #fff;
}

.profile-panel > button:hover {
  background: var(--accent-dark);
}

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

.page-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page-item h4 {
  margin: 0 0 4px;
}

.page-link {
  color: var(--accent-dark);
  font-size: 23.52px;
  font-weight: 700;
  word-break: break-all;
}

.page-color-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.page-color-picker input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.page-color-picker .hint-muted {
  grid-column: auto;
  margin: 0;
  flex: 1 1 auto;
  min-width: 90px;
  word-break: normal;
}

.page-color-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.page-color-dot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 25.48px;
  font-weight: 700;
  cursor: pointer;
}

.page-color-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
}

.page-color-dot::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

.page-color-dot::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.page-color-dot::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field-icon {
  display: inline-flex;
  color: var(--muted);
  flex-shrink: 0;
}

.social-icons-hint {
  margin: 4px 0 8px;
}

.social-icons-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.social-icons-empty {
  margin: 0;
  color: var(--muted);
  font-size: 23.52px;
  font-weight: 700;
}

.employee-screens-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.employee-screen-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 25.48px;
  font-weight: 700;
  cursor: pointer;
}

.employee-screen-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.employee-invite-link-row {
  display: flex;
  gap: 8px;
}

.employee-invite-link-row input {
  flex: 1;
}

.invite-code-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 54.88px;
  font-weight: 800;
  letter-spacing: 10px;
  color: var(--accent);
}

.invite-code-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 29.4px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--accent);
  align-self: center;
}

.wizard-step {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.page-products-checklist {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.employee-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-staff-table-scroll {
  overflow-x: auto;
}

.ai-staff-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 25.48px;
}

.ai-staff-table th {
  background: var(--surface-soft);
  color: var(--accent-dark);
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.ai-staff-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ai-staff-table tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

.ai-staff-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 23.52px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.ai-staff-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.progress-ring-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.progress-ring-track {
  stroke: var(--line);
}

.progress-ring-fill {
  stroke: var(--accent);
  transition: stroke-dashoffset 0.3s ease;
}

.progress-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20.58px;
  font-weight: 800;
  color: var(--accent-dark);
}

.social-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: grab;
}

.social-icon-chip.dragging {
  opacity: 0.4;
}

.page-bg-library-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.page-bg-library-actions .hint-muted {
  margin: 0;
  flex: 1 1 auto;
  min-width: 140px;
  word-break: normal;
}

.page-bg-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.page-bg-library-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 6px 0;
  color: var(--muted);
  font-size: 23.52px;
  font-weight: 800;
  text-align: center;
}

.page-bg-library-item {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.page-bg-library-item.selected {
  border-color: var(--accent);
}

.page-scale-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-scale-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.page-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.hint-muted {
  grid-column: 1 / -1;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 23.52px;
  font-weight: 700;
  word-break: break-all;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 25.48px;
  cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.section-subtitle {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 25.48px;
  color: var(--muted);
}

.product-pages-picker {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-page-option {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}

.product-page-option:last-child {
  border-bottom: 0;
}

.ad-products-picker {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}

.ad-products-group {
  margin-bottom: 10px;
}

.ad-products-group-title {
  margin: 8px 0 2px;
  font-size: 23.52px;
  font-weight: 800;
  color: var(--muted);
}

.product-item:last-child {
  border-bottom: 0;
}

.product-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 25.48px;
  line-height: 1.6;
}

.product-meta {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.product-meta span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf7;
  color: var(--accent-dark);
  font-size: 23.52px;
  font-weight: 800;
}

.product-meta .stock-badge-out {
  border-color: #f3d3ce;
  background: #fdf1ef;
  color: var(--danger);
}

.product-meta .stock-badge-low {
  border-color: #f6d49a;
  background: var(--warn-bg);
  color: var(--warn);
}

.product-meta .stock-badge-ok {
  background: #eef6f4;
  color: var(--accent-dark);
}

.product-meta .stock-detail {
  background: #fff;
  color: var(--muted);
}

.product-item .aliases {
  grid-column: 1 / -1;
  margin: 0;
}

.variant-stock-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-stock-chip {
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf7;
  color: var(--accent-dark);
  font-size: 23.52px;
  font-weight: 800;
}

.variant-stock-out {
  border-color: #f3d3ce;
  background: #fdf1ef;
  color: var(--danger);
}

.variant-stock-low {
  border-color: #f6d49a;
  background: var(--warn-bg);
  color: var(--warn);
}

.orders-list {
  display: grid;
}

.orders-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.orders-filters input {
  flex: 2;
  min-width: 200px;
}

.orders-filters select {
  flex: 1;
  min-width: 160px;
}

.orders-custom-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.orders-custom-date-range input {
  min-width: 140px;
}

.orders-cards-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.orders-cards {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.order-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.order-card:hover {
  background: #e2f3ec;
}

.order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-card-date {
  color: var(--muted);
  font-size: 23.52px;
  font-variant-numeric: tabular-nums;
}

.order-card-name {
  font-weight: 800;
  font-size: 29.4px;
}

.order-card-row {
  color: var(--text);
  font-size: 25.48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card-phone {
  font-variant-numeric: tabular-nums;
}

.order-card-address {
  color: var(--muted);
}

.order-card-notes {
  color: var(--warn);
  font-size: 23.52px;
}

.order-card-bottom {
  display: flex;
  justify-content: flex-end;
}

.order-card-source {
  color: var(--muted);
  font-size: 21.56px;
  font-weight: 800;
}

.orders-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.orders-pagination button:disabled {
  opacity: 0.45;
  cursor: default;
}

.order-status {
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 23.52px;
  font-weight: 800;
  white-space: nowrap;
}

.order-status-submitted {
  background: #eef6f4;
  color: var(--accent-dark);
}

.order-status-draft {
  background: var(--warn-bg);
  color: var(--warn);
}

.order-status-failed {
  background: #fdf1ef;
  color: var(--danger);
}

.order-status-pending_review {
  background: #eaf1ff;
  color: #1d4ed8;
}

.order-status-rejected {
  background: #f1f2f0;
  color: var(--muted);
}

.order-credibility {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6f4;
  color: var(--accent-dark);
  font-size: 21.56px;
  font-weight: 800;
  white-space: nowrap;
}

.empty-state {
  padding: 20px 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.empty-state-illustrated {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.empty-state-illustrated img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.empty-state-illustrated p {
  margin: 0;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 23.52px;
  font-weight: 800;
  white-space: nowrap;
}

.feature-pill.is-on {
  background: #eaf7f1;
  color: #247A58;
}

.feature-pill.is-off {
  background: #fff4df;
  color: var(--warn);
}

.feature-pill.is-warn {
  background: #fff4df;
  color: var(--warn);
}

.auto-reply-controls {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.auto-reply-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.style-learning {
  display: grid;
  gap: 6px;
}

.style-learning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 23.52px;
  font-weight: 800;
  color: var(--muted);
}

.style-learning-header strong {
  color: var(--accent-dark);
  font-size: 25.48px;
}

.style-learning-bar {
  height: 8px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
}

.style-learning-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.style-learning .hint-muted {
  font-size: 21.56px;
  line-height: 1.6;
}

.auto-reply-schedule {
  display: grid;
  gap: 8px;
}

.auto-reply-schedule-fields {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.auto-reply-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.auto-reply-day-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 23.52px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.auto-reply-day-chip.is-checked {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #eaf7f1;
}

.auto-reply-day-chip input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.auto-reply-time-range {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.auto-reply-time-range label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 23.52px;
  font-weight: 800;
  color: var(--muted);
}

.auto-reply-time-range input[type="time"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 25.48px;
}

.meta-connection-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.meta-connection-copy {
  display: grid;
  gap: 6px;
}

.meta-connection-copy strong {
  font-size: 29.4px;
}

.meta-connection-copy p {
  margin: 0;
}

.meta-connection-state {
  color: var(--text);
  font-weight: 800;
}

.meta-connection-error {
  color: var(--danger);
  font-weight: 700;
}

.meta-connection-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.review-form .wide,
.page-form .wide,
.actions {
  grid-column: 1 / -1;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  max-width: 724px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: #116266;
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 560px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    overflow-x: hidden;
  }

  .table-wrap,
  .ai-staff-table-scroll,
  .pf-tbl-wrap {
    overflow: visible;
    border: 0;
  }

  .table-wrap table,
  .ai-staff-table,
  .pf-table,
  .report-panel table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
  }

  .table-wrap table thead,
  .ai-staff-table thead,
  .pf-table thead,
  .report-panel table thead {
    display: none;
  }

  .table-wrap table tbody,
  .ai-staff-table tbody,
  .pf-table tbody,
  .report-panel table tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrap table tbody tr,
  .ai-staff-table tbody tr,
  .pf-table tbody tr,
  .report-panel table tbody tr {
    display: grid;
    gap: 0;
    padding: 10px 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .table-wrap table tbody td,
  .ai-staff-table tbody td,
  .pf-table tbody td,
  .report-panel table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: normal;
  }

  .table-wrap table tbody td:last-child,
  .ai-staff-table tbody td:last-child,
  .pf-table tbody td:last-child,
  .report-panel table tbody td:last-child {
    border-bottom: 0;
  }

  table tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 23.52px;
    font-weight: 800;
    text-align: right;
  }

  .pf-table td input {
    width: min(150px, 55vw);
  }

  table tbody td[colspan] {
    display: block;
    text-align: center;
  }

  #authScreen {
    width: calc(100% + 24px);
    height: 100svh;
    margin: -12px;
    padding: 0;
    overflow: hidden;
  }

  #authScreen .auth-illustration {
    display: none;
  }

  #authScreen .app-header {
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    margin: 0;
    padding: 22px 18px;
    border-radius: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .compact-header {
    align-items: flex-start;
  }

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

  .review-form,
  .product-form,
  .page-form,
  .actions,
  .inventory-fields,
  .stock-alerts-summary {
    grid-template-columns: 1fr;
  }

  .product-item,
  .page-item,
  .product-variant-row,
  .meta-connection-item {
    grid-template-columns: 1fr;
  }

  .meta-connection-item {
    display: grid;
  }

  .product-meta {
    justify-content: flex-start;
  }

  .meta-connection-actions {
    justify-content: flex-start;
  }
}

.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  margin: 10px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sub-tabs button {
  min-height: 34px;
  padding: 7px 16px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 25.48px;
  font-weight: 700;
}

.sub-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.sub-tabs button:hover:not(.active) {
  background: var(--surface-soft);
}

.instagram-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.instagram-post-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.instagram-post-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f7faf7;
}

.instagram-post-thumb-empty {
  background: #f7faf7;
}

.instagram-post-info {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.instagram-post-info .hint-muted {
  min-height: 2.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===== product wizard (matrix model) ===== */
.pf-wizard { display: flex; flex-direction: column; gap: 14px; }
.pf-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-step {
  flex: 1; min-width: 110px; text-align: center; font: inherit; font-size: 1.607rem; font-weight: 700;
  padding: 8px 6px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1.5px solid var(--line); color: var(--muted); cursor: pointer;
}
.pf-step.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pf-step.is-done { border-color: var(--accent); color: var(--accent); }
.pf-panel { display: flex; flex-direction: column; gap: 10px; }
.pf-nav { display: flex; gap: 10px; }
.pf-nav .secondary-button { flex: 1; }

.pf-axis { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-soft); display: flex; flex-direction: column; gap: 10px; }
.pf-axis-head { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.pf-axis-head .pf-f { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 4px; font-size: 1.568rem; font-weight: 600; color: var(--muted); }
.pf-axis-head .pf-f input, .pf-axis-head .pf-f select { font: inherit; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.pf-axis-head .icon-button { align-self: end; }

.pf-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pf-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 1.607rem; font-weight: 600; }
.pf-chip-preview { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); flex: 0 0 auto; }
.pf-chip-color { width: 20px; height: 20px; border: 1px solid rgba(0,0,0,.18); border-radius: 50%; padding: 0; background: none; cursor: pointer; overflow: hidden; }
.pf-chip-color::-webkit-color-swatch-wrapper { padding: 0; }
.pf-chip-color::-webkit-color-swatch { border: 0; border-radius: 50%; }
.pf-chip-lbl { border: 0; background: none; font: inherit; font-weight: 600; width: 74px; padding: 0; }
.pf-chip-lbl:focus { outline: 0; border-bottom: 1px solid var(--line); }
.pf-chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.96rem; line-height: 1; padding: 0 2px; }
.pf-chip-plus { width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--line); background: #fff; color: var(--accent); font-size: 1.96rem; font-weight: 700; cursor: pointer; display: inline-grid; place-items: center; }
.pf-chip-add { width: 110px; padding: 6px 9px; font: inherit; font-size: 1.607rem; border: 1.5px solid var(--line); border-radius: 999px; }

.pf-axis-flags { display: flex; gap: 18px; flex-wrap: wrap; }
.pf-axis-flags label { display: flex; align-items: center; gap: 7px; font-size: 1.627rem; font-weight: 600; color: var(--text); cursor: pointer; }
.pf-axis-flags input { width: 16px; height: 16px; accent-color: var(--accent); }

.pf-img-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.pf-img-slot { width: 170px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); }
.pf-img-cap { font-size: 1.568rem; font-weight: 700; margin-bottom: 6px; }
.pf-img-slot img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: var(--surface-soft); display: block; margin-bottom: 6px; }
.pf-img-drop { font-size: 1.47rem; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 8px; padding: 22px 4px; text-align: center; cursor: pointer; display: block; }
.pf-img-drop.is-empty { border-style: solid; border-color: var(--danger); color: var(--danger); background: rgba(180, 35, 24, 0.06); }
.pf-img-drop.is-filled { border-style: solid; border-color: var(--accent); color: var(--accent); background: rgba(0, 90, 93, 0.07); }
.pf-img-drop.is-locked { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.pf-img-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pf-img-thumb { position: relative; width: 66px; height: 66px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-soft); }
.pf-img-slot .pf-img-thumb img { width: 100%; height: 100%; margin-bottom: 0; border-radius: 0; }
.pf-img-thumb button { position: absolute; top: 2px; inset-inline-end: 2px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 23.52px; line-height: 18px; cursor: pointer; }

.pf-img-general { flex-basis: 100%; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pf-img-general-title { font-size: 1.568rem; font-weight: 700; margin-bottom: 8px; }
.pf-img-hint { font-size: 1.372rem; color: var(--muted); margin-top: 6px; }
.pf-nav button:disabled { opacity: 0.45; cursor: not-allowed; }

.pf-tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pf-table { border-collapse: collapse; width: 100%; font-size: 1.666rem; }
.pf-table th, .pf-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.pf-table th { background: var(--surface-soft); font-size: 1.529rem; color: var(--muted); }
.pf-table td input { width: 110px; padding: 6px 8px; font: inherit; border: 1.5px solid var(--line); border-radius: 8px; }
.pf-table .pf-combo { font-weight: 700; }
.pf-table tr.pf-off td:not(:first-child) { opacity: 0.4; }
.pf-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-soft); display: inline-block; }
.pf-empty { color: var(--muted); font-size: 1.666rem; padding: 8px 2px; }
#pfFallbackPrice.hidden { display: none; }
