/* =========================================================
   1. VARIABLES & DESIGN TOKEN
   ========================================================= */
:root {
  --font-sans-latin: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
  --font-sans-nepali: "Mukta", "Noto Sans Devanagari", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: var(--font-sans-latin);
  /* --- Semantic color roles --- */
  --color-bg-canvas: #f8fafc;
  --color-bg-elevated: #ffffff;
  --color-bg-overlay: rgba(15, 23, 42, 0.56);

  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;

  --color-border-default: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-accent-default: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-accent-soft: #eef2ff;

  --color-success-default: #10b981;
  --color-success-soft: #ecfdf5;
  --color-success-strong: #047857;

  --color-warning-default: #f59e0b;
  --color-warning-soft: #fffbeb;
  --color-warning-strong: #b45309;

  --color-danger-default: #ef4444;
  --color-danger-soft: #fef2f2;
  --color-danger-strong: #b91c1c;

  --color-info-default: #2563eb;
  --color-info-soft: #eff6ff;
  --color-info-strong: #1d4ed8;
   
  /* --- Colors: Slate (Modern Neutral) --- */
  --bg-body: var(--color-bg-canvas);
  --bg-surface: var(--color-bg-elevated);
  --bg-subtle: #f1f5f9;
  
  --border-light: var(--color-border-default);
  
  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-tertiary: #94a3b8;
 --text-muted: var(--color-text-tertiary);

  /* --- Brand: Indigo/Blue --- */
  --brand-primary: var(--color-accent-default);
  --brand-hover: var(--color-accent-hover);
  --brand-subtle: var(--color-accent-soft);

  /* --- Semantic Colors --- */
  --danger: var(--color-danger-default);
  --danger-bg: var(--color-danger-soft);
  --danger-text: var(--color-danger-strong);
  
  --success: var(--color-success-default);
  --success-bg: var(--color-success-soft);
  --success-text: var(--color-success-strong);
  
  --warning: var(--color-warning-default);
  --warning-bg: var(--color-warning-soft);
  --warning-text: var(--color-warning-strong);

  /* --- Dimensions --- */
  --header-height: 64px;
  --bottom-nav-height: 64px;
  --container-width: 1200px;
  --touch-target: 48px; /* A11y Minimum */
  
  /* --- Styling --- */
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  
  /* --- Shadows --- */
  --elevation-0: none;
  --elevation-1: 0 6px 16px rgba(15, 23, 42, 0.08);
  --elevation-2: 0 18px 36px rgba(15, 23, 42, 0.14);
  --shadow-sm: var(--elevation-1);
  --shadow-md: var(--elevation-1);
  --shadow-lg: var(--elevation-2);
  
  /* --- Z-Indexes --- */
  --z-sticky: 100;
  --z-overlay: 900;
  --z-toast: 2000;
  
  /* --- Transitions --- */
  --motion-duration-fast: 0.15s;
  --motion-duration-base: 0.22s;
  --motion-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --trans-fast: var(--motion-duration-fast) var(--motion-ease-standard);
  --trans-normal: var(--motion-duration-base) var(--motion-ease-standard);
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.22);
}

/* =========================================================
   2. RESET & BASE
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

html[lang="ne"] {
  --font-body: var(--font-sans-nepali);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  height: auto;
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Safe area for iPhone X+ home bar */
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

html[lang="ne"] body {
  line-height: 1.6;
  letter-spacing: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow-x: hidden;
  overflow-y: auto;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.skip-link:focus-visible {
  position: absolute;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  background: #ffffff;
  color: var(--brand-primary);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  font-weight: 700;
  z-index: var(--z-overlay);
}

/* UX: Prevent accidental double-taps zooming on interactive elements */
a, button, input, select, textarea, label {
  touch-action: manipulation;
}

/* UX: Accessible Focus Rings */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--trans-fast);
}
a:hover { text-decoration: underline; }
a.flash-deal-card:hover,
a.flash-deal-card:hover * {
  text-decoration: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; line-height: 1.2; font-weight: 700; color: var(--text-primary); }
p { margin-bottom: 0.75em; }
p:last-child { margin-bottom: 0; }

.title { font-weight: 700; color: var(--text-primary); line-height: 1.2; margin: 0 0 8px; }
.title.small { font-size: 1.125rem; }
.title.x-small { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); }

.muted { color: var(--text-secondary); }
.lang-fallback { opacity: 0.85; font-size: 0.95em; }
.small { font-size: 0.875rem; }
.x-small { font-size: 0.75rem; }
.error { color: var(--danger); font-size: 13px; font-weight: 500; display: block; margin-top: 6px; }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-danger { color: var(--danger-text); }

/* =========================================================
   3. LAYOUT & CONTAINERS
   ========================================================= */
.page { flex: 1; display: flex; flex-direction: column; }
.page--home { background: var(--bg-body); }
.page--home .page-body { padding-top: 40px; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 48px;
  display: flex; flex-direction: column; gap: 32px;
}

.page-body {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 24px));
}

/* Grids */
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }



.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.divider { height: 1px; background: var(--border-light); width: 100%; margin: 24px 0; }
/* Divider Text */
.divider span {
  display: block; width: fit-content; margin: -10px auto 0;
  background: white; padding: 0 10px; color: var(--text-tertiary);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .layout{ grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 767px) {
  .grid--2, .grid--stack-on-small{ grid-template-columns: 1fr; }
  .page-body { padding: 20px 16px max(40px, calc(env(safe-area-inset-bottom) + 20px)); }
  .container-narrow { padding-bottom: 40px; }   
}

/* =========================================================
   4. ATOMS: BUTTONS, CARDS, FORMS, BADGES
   ========================================================= */

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--control-height, 44px);
  height: auto;
  padding: 10px 18px;
  line-height: 1.3;
  font-weight: 600; font-size: 14px;
  border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; gap: 8px; white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
}
.btn:active { transform: scale(0.97); }

@media (hover: none) and (pointer: coarse) {
  .btn--primary:active {
    background: #0f5932;
  }

  .btn--ghost:active {
    background: #e2e8f0;
  }
}
.btn--primary {
  background: var(--brand-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--brand-hover);
  box-shadow: var(--shadow-md);
}
.btn--primary:disabled { background: var(--text-tertiary); cursor: not-allowed; opacity: 0.7; }
.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: var(--shadow-md);
}
.btn-primary:disabled {
  background: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn--ghost {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.btn-outline,
.btn-ghost {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.btn--ghost:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.6);
}
.btn-outline:hover,
.btn-ghost:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.6);
}

.btn--danger { background: #fff5f5; color: var(--danger); border-color: #fed7d7; }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn--ghost.btn--danger { background: #fff5f5; border-color: #fed7d7; }
.btn-danger {
  background: #fff5f5;
  color: var(--danger);
  border-color: #fed7d7;
}
.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}
.btn-dark {
  background: var(--text-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-dark:hover {
  background: #0b1324;
  box-shadow: var(--shadow-md);
}

.btn.small { height: 36px; font-size: 13px; padding: 0 14px; }
.btn-sm { height: 36px; font-size: 13px; padding: 0 14px; border-radius: var(--radius-sm); }
.btn.btn--tiny { height: 32px; font-size: 12px; padding: 0 12px; border-radius: var(--radius-sm); }
.btn--block { width: 100%; }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
  cursor: wait;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.state-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}
.state-card--info {
  background: color-mix(in srgb, var(--color-info-soft) 42%, #ffffff);
  border-color: color-mix(in srgb, var(--color-info-default) 22%, #ffffff);
}
.state-card--warning {
  background: color-mix(in srgb, var(--color-warning-soft) 48%, #ffffff);
  border-color: color-mix(in srgb, var(--color-warning-default) 24%, #ffffff);
}
.state-card--danger {
  background: color-mix(in srgb, var(--color-danger-soft) 52%, #ffffff);
  border-color: color-mix(in srgb, var(--color-danger-default) 24%, #ffffff);
}
.state-card--success {
  background: color-mix(in srgb, var(--color-success-soft) 50%, #ffffff);
  border-color: color-mix(in srgb, var(--color-success-default) 24%, #ffffff);
}
.state-card__icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 1.125rem;
}
.state-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.state-card__msg {
  color: var(--text-secondary);
  line-height: 1.6;
}
.state-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.btn.btn--success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .btn.small,
  .btn.btn--tiny,
  .dashboard-shell .btn-sm {
    height: 44px;
    min-height: 44px;
    padding: 0 16px;
  }

  .voice-btn,
  .translate-btn {
    min-height: var(--touch-target);
    height: var(--touch-target);
    min-width: var(--touch-target);
  }

  .state-card__actions .btn {
    width: 100%;
  }
}

/* --- Inline action buttons (voice + translate) --- */
.voice-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: white;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--trans-fast), border-color var(--trans-fast), box-shadow var(--trans-fast);
}
.voice-btn svg { width: 16px; height: 16px; }
.voice-btn:hover { background: var(--brand-subtle); border-color: rgba(79, 70, 229, 0.35); }
.voice-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.translate-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: white;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--trans-fast), border-color var(--trans-fast), color var(--trans-fast);
}
.translate-btn:hover { background: var(--brand-subtle); border-color: rgba(79, 70, 229, 0.3); color: var(--brand-primary); }
.translate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Cards --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  position: relative;
  contain: content; /* Rendering Optimization */
  transition: box-shadow var(--trans-normal), transform var(--trans-normal), border-color var(--trans-fast);
}
@media (max-width: 640px) { .card { padding: 16px; } }
@media (hover: hover) {
  .card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(148, 163, 184, 0.6);
    transform: none;
  }
}

.card--hero { background: linear-gradient(to bottom right, #ffffff, #f1f5f9); }

/* --- Forms --- */
.form { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0.01em;
}
.auth-section { display: grid; gap: 16px; }
.auth-card { max-width: 520px; margin: 0 auto; }
.auth-input-group { display: flex; gap: 8px; align-items: stretch; }
.auth-input-group .input { flex: 1; }

.input, textarea.input, select.input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  height: var(--touch-target);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 16px; /* Prevents iOS zoom */
  line-height: 1.2;
  box-shadow: none;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background-color var(--trans-fast);
  appearance: none; /* Reset native styling */
  -webkit-appearance: none;
}
.input::placeholder { color: var(--text-tertiary); }
.voice-input--status {
  color: var(--text-tertiary);
  font-style: italic;
  animation: voice-input-flash 1.15s ease-in-out infinite;
}
.voice-input--status[data-voice-status-state="listening"] {
  color: var(--danger);
}
.voice-input--status[data-voice-status-state="processing"] {
  color: var(--brand-primary);
}
#search-input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
  transition: opacity 0.2s ease, color 0.2s ease;
}
#search-input:focus::placeholder {
  opacity: 0.4;
  color: var(--text-tertiary);
}
.input:hover { border-color: rgba(148, 163, 184, 0.7); }
.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--brand-subtle);
  background-color: #ffffff;
}
.input:disabled { background-color: var(--bg-subtle); color: var(--text-tertiary); cursor: not-allowed; }
input[type="date"].input,
input[type="datetime-local"].input,
input[type="time"].input {
  min-height: var(--touch-target);
  padding-right: 12px;
}
input[type="date"].input::-webkit-calendar-picker-indicator,
input[type="datetime-local"].input::-webkit-calendar-picker-indicator,
input[type="time"].input::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
}
input[type="date"].input::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"].input::-webkit-calendar-picker-indicator:hover,
input[type="time"].input::-webkit-calendar-picker-indicator:hover {
  opacity: 0.9;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.41.59 6 5.17 10.59.59 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}
input[type="file"] {
  font-size: 14px;
  color: var(--text-secondary);
}

textarea.input { height: auto; min-height: 80px; padding: 12px 14px; line-height: 1.5; resize: vertical; }

.input-with-button { display: flex; gap: 8px; }
.input-with-button .input { flex: 1; }
@media (max-width: 640px) { .input-with-button { flex-direction: column; } .input-with-button .btn { width: 100%; } }

.input-onboarding-focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.22) !important;
  transition: box-shadow 0.2s ease;
}

.input-recording { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1); }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox input[type="checkbox"],
.checkbox input[type="radio"],
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
  margin: 0;
}

.checkbox input[type="checkbox"]:focus-visible,
.checkbox input[type="radio"]:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.6);
  outline-offset: 2px;
}

/* --- Badges --- */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge--neutral,
.badge--info,
.badge--success,
.badge--warning,
.badge--danger,
.badge--premium { background: var(--color-bg-elevated); }
.badge--neutral { background: var(--bg-subtle); color: var(--color-text-secondary); border-color: var(--color-border-default); }
.badge--info { background: var(--color-info-soft); color: var(--color-info-strong); border-color: color-mix(in srgb, var(--color-info-default) 24%, white); }
.badge--success{ background: var(--color-success-soft); color: var(--color-success-strong); border-color: color-mix(in srgb, var(--color-success-default) 25%, white); }
.badge--warning{ background: var(--color-warning-soft); color: var(--color-warning-strong); border-color: color-mix(in srgb, var(--color-warning-default) 24%, white); }
.badge--danger{ background: var(--color-danger-soft); color: var(--color-danger-strong); border-color: color-mix(in srgb, var(--color-danger-default) 24%, white); }
.badge--muted { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); border-color: rgba(148, 163, 184, 0.22); }
.badge--ghost { background: transparent; }
.badge--premium { background: var(--color-info-soft); color: var(--color-info-strong); border-color: color-mix(in srgb, var(--color-info-default) 24%, white); }
.badge--plan-premium { background: var(--color-info-soft); color: var(--color-info-strong); border-color: color-mix(in srgb, var(--color-info-default) 24%, white); }
.badge--tiny { height: 20px; padding: 0 5px; font-size: 10px; }

/* --- Tables --- */
.table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); text-align: left; }
.table th { background: var(--bg-subtle); font-size: 12px; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.table td { font-size: 14px; color: var(--text-primary); }
.table td .text-muted,
.table td .muted { color: var(--color-text-secondary); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(148, 163, 184, 0.08); }

/* --- Skeletons --- */
.skeleton {
  background: color-mix(in srgb, var(--brand-primary) 4%, #e2e8f0);
  border-radius: 4px;
  animation: skeleton-fade 1.4s ease-in-out infinite alternate;
}
@keyframes skeleton-fade { from { opacity: 0.74; } to { opacity: 0.88; } }
.skeleton--line { height: 16px; margin-bottom: 8px; }
.skeleton--block { border-radius: var(--radius); }

/* --- Toasts & Alerts --- */
#toast-root {
  position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; padding: 10px 14px; border-radius: 6px; font-size: 13px; color: white;
  box-shadow: var(--shadow-lg); animation: slideUp 0.2s ease-out; background-color: #333;
}
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 768px) {
  #toast-root {
    top: 12px;
    bottom: auto;
    left: 12px;
    right: 12px;
    flex-direction: column-reverse;
  }

  .toast {
    width: 100%;
    text-align: center;
    animation: slideDownMobile 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

@keyframes slideDownMobile {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.inline-alert {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-light);
  background: var(--bg-subtle); box-shadow: var(--shadow-sm); margin: 0 auto 12px;
}
.inline-alert__icon { font-size: 18px; }
.inline-alert__title { margin: 0 0 4px 0; font-weight: 700; color: var(--text-primary); }
.inline-alert__body { margin: 0; color: var(--text-secondary); font-size: 0.9375rem; }
.inline-alert--warning { border-color: #fcd34d; background: #fffbeb; }
@media (max-width: 640px) {
  .inline-alert {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .inline-alert .btn {
    width: 100%;
  }
}

.status-banner {
  display: none; margin: 12px auto; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid var(--border-light);
  background: var(--bg-subtle); max-width: var(--container-width); width: calc(100% - 32px);
  color: var(--text-primary); box-shadow: var(--shadow-sm);
}
.status-banner.is-visible { display: block; }
.status-banner--success { background: var(--success-bg); border-color: rgba(16, 185, 129, 0.35); color: var(--success-text); }
.status-banner--warning { background: var(--warning-bg); border-color: rgba(180, 83, 9, 0.3); color: var(--warning-text); }
.status-banner--danger { background: var(--danger-bg); border-color: rgba(185, 28, 28, 0.35); color: var(--danger-text); }

/* =========================================================
   5. MODULES: HEADER & NAV
   ========================================================= */
.header {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: var(--header-height);
}
.header__inner {
  max-width: var(--container-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 100%;
}
.header__brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-weight: 800; font-size: 18px; white-space: nowrap; }
.logo__mark { width: 28px; height: 28px; background: var(--brand-primary); color: white; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.logo__text { letter-spacing: -0.01em; }

.header__meta { display: flex; gap: 16px; align-items: center; flex-shrink: 0; }

/* Language Switcher Pill */
.header__lang {
  display: inline-grid; grid-template-columns: repeat(2, minmax(72px, 1fr)); align-items: center; gap: 1px; position: relative;
  padding: 4px; background: rgba(148, 163, 184, 0.1); border-radius: 8px; border: 1px solid rgba(148, 163, 184, 0.2);
}
.header__lang::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: calc(50% - 2.5px); height: calc(100% - 4px);
  background: #ffffff; border-radius: 6px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transform: translateX(0);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1); z-index: 0;
}
.header__lang[data-active-lang="ne"]::before { transform: translateX(calc(100% + 1px)); }
.header__lang .btn.lang-switch {
  position: relative; z-index: 1; width: 100%; justify-content: center; height: 32px; min-height: 32px; padding: 0 12px; font-size: 12px; border: none; background: transparent;
  color: #64748b; font-weight: 500; cursor: pointer; border-radius: 4px; transition: color 0.25s;
}
.header__lang .btn.lang-switch[aria-pressed="true"] { color: #4f46e5; font-weight: 600; }

@media (max-width: 1024px) {
  .header__inner { padding: 0 12px; flex-wrap: nowrap; }
  .header__brand { padding: 0; }
  .header__meta { padding: 0; margin-left: auto; gap: 10px; }  
}

/* =========================================================
   8. MODULES: SEARCH & HOME
   ========================================================= */
.search-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding-top: 20px; }
.search-hero__title { font-size: clamp(1.8rem, 5vw, 2.5rem); letter-spacing: -0.02em; margin: 0; font-weight: 800; }
.search-hero__support {
  max-width: 38rem;
  margin: 0 auto;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.search-form { width: 100%; max-width: 640px; margin: 8px auto 0; }
.search-shell { position: relative; width: 100%; }
.search-shortcuts {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}
.search-shortcut {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 14%, var(--border-light));
  background: color-mix(in srgb, var(--brand-subtle) 36%, #ffffff);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}
.search-shortcut:hover {
  background: color-mix(in srgb, var(--brand-subtle) 52%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, var(--border-light));
}
.search-shortcut:active { transform: scale(0.98); }

.super-search {
  position: relative; background: white; border: 1px solid #cbd5e1; border-radius: var(--radius-pill);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); display: flex; align-items: center; height: 56px; padding: 0 12px; transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.super-search:focus-within { border-color: var(--brand-primary); box-shadow: 0 3px 10px rgba(79, 70, 229, 0.12); }
.super-search input { border: none; background: transparent; padding: 0; margin: 0; height: 100%; flex: 1; font-size: 16px; box-shadow: none; outline: none; -webkit-appearance: none; appearance: none; }
.super-search input:focus, .super-search input:focus-visible {outline: none; box-shadow: none; background-color: transparent; }
.super-search input[type="search"]::-webkit-search-cancel-button,
.super-search input[type="search"]::-webkit-search-decoration,
.super-search input[type="search"]::-webkit-search-results-button,
.super-search input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; display: none; }
.super-search input[type="search"]::-ms-clear,
.super-search input[type="search"]::-ms-reveal { display: none; width: 0; height: 0; }
.super-mic {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--trans-fast), color var(--trans-fast), box-shadow var(--trans-fast), transform var(--trans-fast);
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  isolation: isolate;
}
.super-mic svg { width: 28px; height: 28px; }
.super-mic:hover { background-color: rgba(148, 163, 184, 0.12); }
.super-mic:active { transform: scale(0.98); }
.super-clear { color: var(--text-tertiary); display: none; }
.recording-pulse {
  color: var(--danger) !important;
  background-color: var(--danger-bg) !important;
  animation: voice-breathe 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
  border-color: transparent;
}
.voice-processing {
  color: var(--brand-primary) !important;
  background: var(--bg-surface) !important;
  cursor: wait;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.14);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.voice-processing::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(79, 70, 229, 0.85) 90deg,
    transparent 180deg,
    rgba(79, 70, 229, 0.85) 270deg,
    transparent 360deg
  );
  animation: voice-spin 1.4s linear infinite;
  z-index: 0;
}
.voice-processing::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: var(--bg-surface);
  z-index: 1;
}
.voice-processing svg {
  position: relative;
  z-index: 2;
  animation: voice-pulse 1.1s ease-in-out infinite alternate;
}
.voice-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}
.voice-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.6;
}
.voice-status--sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.voice-status[data-state="listening"] {
  color: var(--danger);
}
.voice-status[data-state="processing"] {
  color: var(--brand-primary);
}
.voice-status[data-state="listening"]::before {
  animation: voice-dot 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
}
@keyframes voice-dot {
  0% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.6); opacity: 1; }
  100% { transform: scale(1); opacity: 0.5; }
}
@keyframes voice-input-flash {
  0% { opacity: 0.35; }
  50% { opacity: 1; }
  100% { opacity: 0.35; }
}
@keyframes voice-breathe {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes voice-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes voice-pulse {
  from { opacity: 0.65; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .recording-pulse,
  .voice-processing::before,
  .voice-processing svg,
  .voice-status[data-state="listening"]::before {
    animation: none;
  }
}

.search-results {
  display: none; background: white; border: 1px solid var(--border-light); border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 8px 16px;
  max-height: min(360px, 52vh);
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  z-index: var(--z-overlay);
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); text-align: left;
}
.search-results.is-visible { display: block; animation: slideDown 0.2s ease-out; }
.search-results__list { display: grid; gap: 4px; }
.search-result-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; padding: 12px 12px; transition: background 0.1s; border-radius: 10px; }
.search-result-item__title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.search-result-item:hover, .search-result-item:focus-visible { background: var(--bg-subtle); }
.search-result-item__name { font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.search-result-item__meta { font-size: 0.875rem; color: var(--text-secondary); grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.search-result-item__price { font-weight: 800; color: var(--brand-primary); }
.search-result-item--offer {
  border: 1px solid rgba(79, 70, 229, 0.08);
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.38), rgba(255, 255, 255, 0.92));
}
.search-result-item--ghost { grid-template-columns: 1fr; cursor: default; }
.search-result-item--ghost:hover { background: transparent; }
.search-results__actions { display: flex; justify-content: center; }
#flash-deals-cached-hint { margin: 2px 4px 0; color: var(--text-secondary); }
@media (max-width: 640px) {
  .search-results { left: -6px; right: -6px; border-radius: 18px; }
  .search-result-item { grid-template-columns: 1fr; }
  .search-results__actions .btn { width: 100%; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   9. MODULES: FLASH DEALS
   ========================================================= */
.snap-rail {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 20px 16px; margin: 0 -20px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.snap-rail::-webkit-scrollbar { display: none; }
.snap-card { scroll-snap-align: start; flex: 0 0 min(260px, 80vw); }
@media (min-width: 1024px) { .snap-card { flex-basis: 260px; } }

.flash-deal-card {
  position: relative; border-radius: 12px; overflow: hidden; border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  cursor: pointer; aspect-ratio: 3 / 2;
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  contain: paint;
  transform: translateZ(0);
  backface-visibility: hidden;
  padding: 0;
  margin-bottom: 0;
  transform-origin: center;
 }

/* Subtle “gloss” highlight (no border/ring) */
.flash-deal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.00) 55%
  );
}

.flash-deal-card__img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}
.flash-deal-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 30%, rgba(67, 56, 202, 0.12) 70%, rgba(15, 23, 42, 0.42) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: 16px 16px 18px; color: #f8fafc;
  text-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
  opacity: 0.98;
  transition: background 0.25s ease, opacity 0.25s ease;
  transform: translateZ(0);
}
.flash-deal-card__badge {
  position: absolute; top: 10px; right: 10px; z-index: 2; padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; background: #ef4444;
  color: #ffffff;
  isolation: isolate;
}
.flash-deal-card__badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  z-index: -1;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform, opacity;
  animation: flash-badge-pulse-gpu 7s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.flash-deal-card__meta { color: #0f172a; font-weight: 600; opacity: 0.92; letter-spacing: 0.01em; }
.flash-deal-card__title {
   color: #f8fafc;
   line-height: 1.25;
   margin: 0;
   font-weight: 800;
   letter-spacing: 0.01em; 
   background: rgba(15, 23, 42, 0.12);
   -webkit-backdrop-filter: blur(10px);
   backdrop-filter: blur(10px);
   text-shadow: 0 1px 4px rgba(15, 23, 42, 0.45);
   padding: 6px 10px;
   border-radius: 999px;
   box-shadow: var(--shadow-sm);
   max-width: fit-content;
 }
.flash-deal-card__price-row { color: #e2e8f0; margin: 0; display: flex; align-items: center; gap: 6px; }
.flash-deal-card__price-row::before { content: "•"; opacity: 0.8; }

/* Shop / merchant line: readable on bright images without adding a pill */
.flash-deal-card__shop,
.flash-deal-card__price-row {
  font-size: 0.875rem;         /* slightly larger than x-small */
  font-weight: 700;            /* bolder / more “shop-like” */
  line-height: 1.25;
  color: rgba(248, 250, 252, 0.98);
  letter-spacing: 0.01em;

  /* Contrast on busy + white images (no pill) */
  text-shadow:
    0 1px 2px rgba(15, 23, 42, 0.55),
    0 6px 16px rgba(15, 23, 42, 0.35);

  /* Optional subtle edge for WebKit (helps on pure-white areas) */
  -webkit-text-stroke: 0.25px rgba(15, 23, 42, 0.25);
}

@media (hover: hover) {
   .flash-deal-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    /* keep border stable so it doesn't “outline” on hover */
    border-color: rgba(15, 23, 42, 0.08);
  }

  .flash-deal-card:hover::after {
    opacity: 1;
  }
  .flash-deal-card:hover .flash-deal-card__img {
     transform: scale(1.01);
     filter: saturate(1.01);
   }
 }

/* Skeleton for Flash Deal */
.flash-deal-card--skeleton { background: var(--bg-subtle); border-style: dashed; cursor: default; }
.flash-deal-card--skeleton .flash-deal-card__overlay { background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(226, 232, 240, 0.8)); }

/* Flash deals shell */
.flash-deals { padding: 8px 0 20px; display: grid; gap: 10px; }
.flash-deals__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.flash-deals__header .title { margin: 0; color: var(--text-primary); letter-spacing: 0.02em; }
.flash-deals__link { color: var(--brand-primary); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.flash-deals__link::after { content: "›"; display: inline-block; transform: translateY(-1px); }
.flash-deals__rail { padding-bottom: 0px; }

.flash-deal-card__price {
  /* “Discounted/current price” = modern emerald */
  color: rgba(190, 242, 100, 0.98);
  font-weight: 800;
  letter-spacing: 0.01em;

  /* neutral glass so green stays readable (no green-on-green) */
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);

  /* holds up on bright/white + busy images */
  text-shadow:
    0 1px 2px rgba(15, 23, 42, 0.75),
    0 8px 18px rgba(15, 23, 42, 0.35);
  -webkit-text-stroke: 0.25px rgba(15, 23, 42, 0.28);

  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
 }

.flash-deal-card__price-original {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.95);
  text-decoration: line-through;
  background: rgba(15, 23, 42, 0.68);
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.flash-deal-card__discount {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: rgba(239, 68, 68, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 2px 10px;
  border-radius: 999px;
  box-shadow:
    0 6px 14px rgba(239, 68, 68, 0.2),
    0 1px 4px rgba(15, 23, 42, 0.18);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  transform: translateZ(0);
  will-change: transform;
  animation: discount-pop 6.5s ease-in-out infinite;
 }

@keyframes flash-badge-pulse-gpu {
  0%, 82%, 100% { transform: scale(1); opacity: 0; }
  6% { transform: scale(1.02); opacity: 0.22; }
  18% { transform: scale(1.08); opacity: 0; }
}

@keyframes discount-pop {
  0%, 88%, 100% { transform: translateZ(0) scale(1); }
  6% { transform: translateZ(0) scale(1.008); }
  12% { transform: translateZ(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .flash-deal-card__discount,
  .flash-deal-card__badge::before { animation: none; }
}

/* =========================================================
   10. MODULES: PUBLIC PROFILE
   ========================================================= */
.public-biz { margin: 32px auto 80px; padding: 0 20px; max-width: 1000px; }
.public-biz__hero { background: white; border: 1px solid var(--border-light); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 20px; align-items: stretch; margin-bottom: 32px; }
.public-biz__hero-top { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: 12px; }
.public-biz__hero-left { display: flex; gap: 16px; align-items: center; min-width: 0; flex: 1; }
.public-biz__hero-text { min-width: 0; }
.public-biz__hero-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.public-biz__logo { width: 80px; height: 80px; border-radius: 12px; border: 1px solid var(--border-light); overflow: hidden; flex-shrink: 0; background: var(--bg-subtle); }
.public-biz__logo-img { width: 100%; height: 100%; object-fit: cover; }
.public-biz__logo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(14, 165, 233, 0.12));
  color: var(--brand-primary);
  font-size: 1.75rem;
  font-weight: 800;
}
.public-biz__name { font-size: 22px; font-weight: 800; line-height: 1.1; margin: 0 0 4px; color: var(--text-primary); }
.public-biz__name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.public-biz__verification { letter-spacing: 0.04em; text-transform: uppercase; }
.public-biz__location { margin: 0; color: var(--text-secondary); }
.public-biz__tagline { margin: 10px 0 0; color: var(--text-secondary); line-height: 1.6; }
.public-biz__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.95fr);
  gap: 24px;
  align-items: start;
}
.public-biz__main { display: grid; gap: 28px; }
.public-biz__sidebar {
  display: grid;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
}
.public-biz__section { padding: 16px 0; }
.public-biz__section + .public-biz__section { border-top: 1px solid var(--border-light); }
.public-biz__card { display: grid; gap: 12px; }
.public-biz__card--center { justify-items: center; text-align: center; padding: 24px; }
.list { display: grid; gap: 10px; margin: 0; padding: 0; }
.list--unstyled { list-style: none; }
.list--unstyled li {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}
.list--unstyled li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.list--unstyled strong {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.list--unstyled a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}


.billing-plan__group {
  display: grid;
  gap: 10px;
}

.billing-plan__providers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-plan__provider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.billing-plan__note {
  margin: 0;
}

.billing-manage-sheet {
  display: grid;
  gap: 12px;
}

.billing-manage-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.billing-manage-sheet__status {
  white-space: nowrap;
}

.billing-manage-sheet__provider-group {
  display: grid;
  gap: 8px;
}

.billing-manage-sheet__trust-cue {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.billing-state {
  display: grid;
  gap: 10px;
}

.billing-state-card {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.billing-state-card__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.billing-state-card--loading {
  background: color-mix(in srgb, var(--brand-primary) 4%, #fff);
}

.billing-state-card--error {
  border-color: color-mix(in srgb, var(--color-danger-default) 28%, #fff);
  background: color-mix(in srgb, var(--color-danger-soft) 45%, #fff);
}

.billing-state-card--empty {
  background: color-mix(in srgb, var(--surface-muted) 70%, #fff);
}

.billing-status {
  min-height: 1.25rem;
}

.billing-status--info {
  color: var(--text-secondary);
}

.billing-status--success {
  color: var(--color-success-default);
}

.billing-status--error {
  color: var(--color-danger-default);
}

.billing-state__cards {
  display: grid;
  gap: 8px;
}

.billing-flow-guide {
  display: grid;
  gap: 10px;
}

.billing-flow-guide__item {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.billing-flow-guide__item.is-complete {
  border-color: color-mix(in srgb, var(--color-success-default) 40%, white);
  background: color-mix(in srgb, var(--color-success-soft) 45%, white);
}

.billing-flow-guide__item.is-attention {
  border-color: color-mix(in srgb, var(--color-danger-default) 30%, white);
  background: color-mix(in srgb, var(--color-danger-soft) 40%, white);
}

.billing-flow-guide__title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.billing-flow-guide__body {
  font-size: 0.84rem;
  color: var(--text-primary);
}

.plan-selection__cards {
  display: grid;
  gap: 8px;
}

.plan-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.plan-card--cta {
  gap: 10px;
}

.plan-card--verified {
  background: color-mix(in srgb, #dbeafe 35%, #fff);
}

.plan-card--premium {
  background: color-mix(in srgb, #fde68a 35%, #fff);
}

.plan-card__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card--selected {
  border-color: var(--brand-primary);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.12);
}

.plan-card__header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.plan-card__title {
  font-weight: 700;
  margin: 0;
}

.plan-card__price {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.plan-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.plan-card__badge {
  font-size: 0.7rem;
}

.plan-card__summary {
  margin: 0;
  line-height: 1.35;
}

.plan-card__action {
  width: 100%;
}

.plan-card__action.is-loading,
.billing-credit-grid__btn.is-loading {
  opacity: 0.9;
}

.billing-balance-hero {
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, white);
  background: color-mix(in srgb, var(--brand-primary) 6%, white);
  border-radius: 12px;
  padding: 12px;
}

.billing-balance-hero__count {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.billing-credit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.billing-credit-grid__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
}

@media (max-width: 640px) {
  .billing-manage-sheet__header {
    flex-direction: column;
    align-items: flex-start;
  }

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

.is-hidden {
  display: none !important;
}

.billing-history {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.receipt-modal {
  display: flex;
  flex-direction: column;
  max-width: 520px;
  width: min(92vw, 520px);
  max-height: min(86dvh, 640px);
  border: 1px solid color-mix(in srgb, var(--border-light) 78%, white);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.receipt-modal::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.receipt-modal__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  background: color-mix(in srgb, #ffffff 94%, var(--bg-subtle));
  border-bottom: 1px solid color-mix(in srgb, var(--border-light) 78%, white);
}

.receipt-modal__close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans-fast), border-color var(--trans-fast), box-shadow var(--trans-fast), color var(--trans-fast);
}

.receipt-modal__close:hover {
  background: var(--bg-subtle);
  border-color: color-mix(in srgb, var(--brand-primary) 24%, white);
  color: var(--text-primary);
}

.receipt-modal__close:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--brand-primary) 40%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-subtle) 70%, white);
}

.receipt-modal__body {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding: 16px 20px 20px;
  margin-top: 0;
}

.receipt-modal__row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.receipt-modal__value {
  font-weight: 600;
  word-break: break-word;
}

.receipt-modal__label {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.receipt-modal__mono {
  font-family: "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 500;
}

@media (max-width: 560px) {
  .receipt-modal {
    width: min(calc(100vw - 16px), 520px);
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .receipt-modal__header {
    padding: 16px 16px 12px;
  }

  .receipt-modal__body {
    padding: 14px 16px 18px;
  }

  .receipt-modal__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Action Bar Container */
.contact-actions-bar {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px 16px 4px; /* Shadow clearance + less tall row */
  margin: 0 -4px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
}

/* The Button Shell - World Class Polish */
.action-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  
  transition:
    transform 0.18s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.18s ease,
    filter 0.18s ease;
   
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  background: #f8fafc;
  
  box-shadow: var(--shadow-sm);
  position: relative;

  /* GPU acceleration for 120fps smoothness */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Hover highlight (static + subtle; remove sweeping “shine”) */
.action-icon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255, 255, 255, 0.28),
    transparent 58%
  );
  transition: opacity 0.18s ease;
}


.action-icon-btn:hover {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: #cbd5f5;
  box-shadow: var(--shadow-md);
}

.action-icon-btn:hover::before {
  opacity: 1;
}

/* Active: Tap */
.action-icon-btn:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
  transition-duration: 0.08s;
}

/* The Icon - Optical Sizing */
.action-icon-btn svg {
  width: 22px; /* Official glyph optical balance */
  height: 22px;
  fill: currentColor;
  display: block;
  filter: none;
  transition: filter 0.18s ease;
}

.action-icon-btn:hover svg {
  filter: none;
}


/* --- Minimal Brand Tones --- */

/* Call */
.btn-phone {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.btn-phone:hover {
  background: #ecfdf5;
}

/* Maps */
.btn-map {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.btn-map:hover {
  background: #e0f2fe;
}

/* WhatsApp */
.btn-whatsapp {
  background: #ecfdf5;
  color: #16a34a;
  border-color: #bbf7d0;
 }

.btn-whatsapp:hover {
  background: #dcfce7;
}

/* Messenger */
 .btn-messenger {
  background: #eef2ff;
  color: #2563eb;
  border-color: #c7d2fe;
 }

.btn-messenger:hover {
  background: #e0e7ff;
}

/* Facebook */
 .btn-facebook {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
 }
 
.btn-facebook:hover {
  background: #dbeafe;
}

/* TikTok */
 .btn-tiktok {
  background: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
}

.btn-tiktok:hover {
  background: #f1f5f9;
  filter: none;
 }

@media (prefers-reduced-motion: reduce) {
  .action-icon-btn,
  .action-icon-btn::before,
  .action-icon-btn svg {
    transition: none !important;
  }
  .action-icon-btn:hover,
  .action-icon-btn:active {
    transform: none !important;
    filter: none !important;
  }
}

/* Mobile: Preserve Touch Elegance */
@media (max-width: 480px) {
  .contact-actions-bar {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .action-icon-btn {
    width: 48px;
    height: 48px;
  }
  
  .action-icon-btn svg {
    width: 21px;
    height: 21px;
   }
 }

/* Accessibility: Ensure focus states are premium too */
.action-icon-btn:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.5);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .public-biz { margin: 24px auto 56px; padding: 0 16px; }
  .public-biz__layout { grid-template-columns: 1fr; }
  .public-biz__sidebar { position: static; }
  .public-biz__hero {
    gap: 16px;
    padding: 20px 18px 18px;
  }
  .public-biz__hero-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .public-biz__hero-left { align-items: flex-start; }
  .public-biz__hero-right {
    width: 100%;
    justify-content: flex-start;
  }
  .public-biz__logo { width: 64px; height: 64px; }
  .public-biz__name { font-size: 20px; }
  .public-biz__card--center { padding: 20px; }
  .contact-actions-bar {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom) + 12px);
    z-index: 4;
    margin: 2px -2px 0;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .public-biz__hero-right .btn {
    min-height: 44px;
  }
}

/* =========================================================
   11. MOBILE BOTTOM NAV (Thumb Zone)
   ========================================================= */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: grid; grid-template-columns: repeat(5, 1fr); z-index: 900; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.06); overflow: visible;
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .dashboard-shell .mobile-header,
  .dashboard-shell .bottom-nav,
  .bottom-nav {
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}

.bottom-nav__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; border: none; background: none;
  color: var(--text-tertiary); font-size: 11px; font-weight: 600; gap: 4px; padding: 8px 0 6px;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  opacity: 0.78;
}
.bottom-nav__item::before {
  content: "";
  position: absolute;
  top: 6px;
  width: 46px;
  height: 30px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.bottom-nav__item > * { position: relative; z-index: 1; }
.bottom-nav__item svg { width: 26px; height: 26px; fill: currentColor; }
.bottom-nav__item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}
.bottom-nav__item[aria-pressed="true"], .bottom-nav__item.is-active { color: var(--brand-primary); opacity: 1; }
.bottom-nav__item[aria-pressed="true"]::before, .bottom-nav__item.is-active::before {
  background: rgba(79, 70, 229, 0.12);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.18);
}
.bottom-nav__item[aria-pressed="true"]::after, .bottom-nav__item.is-active::after { background: currentColor; }
.bottom-nav__item:active { transform: translateY(1px); }
.bottom-nav__item:active .icon-box,
.bottom-nav__item:active svg {
  transform: scale(0.92);
  transition-duration: 0.05s;
}


/* =========================================================
   12. MISC UTILITIES
   ========================================================= */
.hidden { display: none !important; }
.logo-uploader { display: flex; gap: 20px; align-items: center; background: var(--bg-subtle); padding: 16px; border-radius: 8px; border: 1px solid var(--border-light); }
.logo-uploader__preview {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), transform var(--trans-fast);
}
.logo-uploader__preview:hover {
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.logo-uploader__image { width: 100%; height: 100%; object-fit: contain; }
.logo-uploader__placeholder { text-align: center; font-size: 12px; color: var(--text-tertiary); padding: 6px; }
@media (max-width: 640px) {
  .logo-uploader { flex-direction: column; align-items: flex-start; }
  .logo-uploader__preview { width: 80px; height: 80px; flex-basis: 80px; }
}
.map { width: 100%; height: 300px; background: var(--bg-subtle); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-light); margin-top: 8px; }
.map.map--placeholder-state {
  height: auto;
  min-height: 240px;
  overflow: visible;
}
.map__placeholder {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  text-align: left;
}
.map__placeholder-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.map__placeholder-copy { max-width: 520px; }
.map__title {
  font-weight: 600;
  margin: 0 0 4px;
}
.map__toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
}
.map__advanced {
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: white;
  padding: 8px 12px;
}
.map__advanced summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
}
.map__advanced-body {
  margin-top: 12px;
  display: grid;
  gap: 16px;
}
.map__option {
  display: grid;
  gap: 6px;
}
@media (max-width: 640px) {
  .map__placeholder-header { flex-direction: column; align-items: stretch; }
  .map__placeholder-header .btn { width: 100%; }
}
.footer { margin-top: auto; border-top: 1px solid var(--border-light); padding: 32px 0; text-align: center; color: var(--text-tertiary); font-size: 13px; background: white; }

/* =========================================================
   13. Auth provider button variants
   ========================================================= */
.btn__icon{
  width:18px;
  height:18px;
  margin-right:8px;
  vertical-align:middle;
}
.btn--google{
  position:relative;
  font-weight:500;
  background:white;
  color:#3c4043;
  border:1px solid #dadce0;
}
.btn--facebook{
  background:#1877F2;
  border:none;
  color:white;
}
.btn--tiktok{
  background:#000;
  border:none;
  color:white;
}

/* =========================================================
   14. SMART CALENDAR (Bilingual Datepicker)
   ========================================================= */
.smart-calendar-wrapper {
  position: relative;
  width: 100%;
}

.smart-calendar-field {
  width: 100%;
}

.smart-calendar-native-hidden {
  display: none !important;
}

.smart-calendar-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b' width='18' height='18'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2zm-7 5h5v5h-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.smart-calendar-status {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.smart-calendar-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft) 88%, #ffffff);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, #ffffff);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.smart-calendar-hint {
  margin-top: 0;
  flex: 1 1 160px;
  line-height: 1.45;
}

.smart-calendar-layer {
  position: fixed;
  inset: 0;
  z-index: 11000;
  pointer-events: none;
}

.smart-calendar-layer.is-open {
  pointer-events: auto;
}

.smart-calendar-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.05);
  z-index: 11010;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 0;
  animation: fadeInDown 0.15s ease-out;
  user-select: none;
  transform: translateZ(0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  min-height: 0;
}

.smart-calendar-popup::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffffff;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
 }

.smart-calendar-popup.is-open { display: flex; }
.smart-calendar-popup.is-top {
  animation: fadeInUp 0.15s ease-out;
  box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.15);
  transform-origin: bottom center;
  background: #ffffff;
  transform: translateZ(0.1px);
}
.smart-calendar-popup.is-sheet {
  animation: fadeInDown 0.15s ease-out;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* Ensure contents are always above the background */
.smart-calendar-popup > * {
  position: relative;
  z-index: 2;
  background: #ffffff;
}

@keyframes fadeInDown { from { opacity: 0; transform: translateY(-8px) translateZ(0); } to { opacity: 1; transform: translateY(0) translateZ(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px) translateZ(0.1px); } to { opacity: 1; transform: translateY(0) translateZ(0.1px); } }
 
.sc-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 16px 16px 12px;
  background: color-mix(in srgb, #ffffff 96%, var(--bg-subtle));
  border-bottom: 1px solid var(--border-light);
  border-radius: 16px 16px 0 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.sc-header--loading {
  margin-bottom: 8px;
}
.sc-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.sc-title-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.sc-title { font-weight: 800; font-size: 15px; color: var(--text-primary); cursor: pointer; border-radius: 8px; padding: 4px 8px; transition: background 0.1s; min-width: 0; text-align: center; }
.sc-title:hover { background: var(--bg-subtle); }
.sc-mode-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft) 86%, #ffffff);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, #ffffff);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.sc-nav { background: #ffffff; border: 1px solid var(--border-light); border-radius: 10px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); transition: background var(--trans-fast), border-color var(--trans-fast), color var(--trans-fast), box-shadow var(--trans-fast); }
.sc-nav:hover { background: var(--bg-subtle); color: var(--text-primary); }
.sc-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background var(--trans-fast), border-color var(--trans-fast), color var(--trans-fast), box-shadow var(--trans-fast), transform var(--trans-fast);
}
.sc-close:hover {
  background: var(--bg-subtle);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, white);
  color: var(--text-primary);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}
.sc-loading {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px 32px;
  text-align: center;
  color: var(--text-secondary);
}
.sc-loading__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}
.sc-loading__hint {
  font-size: 0.75rem;
}

.sc-body {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  padding: 0 16px 18px;
  background: #ffffff;
}

.sc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: minmax(18px, auto) repeat(6, minmax(38px, 1fr));
  gap: 6px;
  text-align: center;
  flex: 0 0 auto;
  padding-top: 16px;
  align-content: stretch;
}
.sc-day-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2px;
}
.sc-cell {
  position: relative;
  min-height: 44px;
  height: auto;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.14s ease;
  color: var(--text-primary);
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  font-weight: 600;
  padding: 0;
}
.sc-cell:hover:not(.empty),
.sc-cell:focus-visible {
  background: color-mix(in srgb, var(--bg-subtle) 92%, #ffffff);
  border-color: color-mix(in srgb, var(--border-light) 72%, #ffffff);
}
.sc-cell.empty {
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.sc-cell.today {
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-subtle) 62%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-primary) 26%, #ffffff);
  font-weight: 800;
}
.sc-cell.today::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.sc-cell.selected {
  background: var(--brand-primary);
  color: white;
  font-weight: 700;
  border-color: var(--brand-primary);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.22);
}
.sc-cell.selected:hover,
.sc-cell.selected:focus-visible {
  background: var(--brand-primary);
  color: white;
}
.sc-cell.selected.today {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px color-mix(in srgb, var(--brand-primary) 28%, #ffffff), 0 8px 16px rgba(79, 70, 229, 0.24);
}
.sc-cell.selected.today::after {
  background: #ffffff;
}

.sc-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: color-mix(in srgb, #ffffff 96%, var(--bg-subtle));
  border-radius: 0 0 16px 16px;
  box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.sc-footer--end {
  align-items: flex-end;
}
.sc-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}
.sc-footer--end .sc-footer-actions {
  width: auto;
}
.sc-footer-actions--mobile {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: stretch;
}
.sc-mobile-summary {
  display: none;
}
.smart-calendar-popup.is-step-flow .sc-mobile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0 10px;
  margin: 0 0 8px;
}
.sc-mobile-summary__item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--border-light) 84%, white);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast), transform var(--trans-fast);
}
.sc-mobile-summary__item:hover,
.sc-mobile-summary__item:focus-visible {
  border-color: color-mix(in srgb, var(--brand-primary) 24%, white);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  outline: none;
}
.sc-mobile-summary__item.active {
  border-color: color-mix(in srgb, var(--brand-primary) 34%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-subtle) 84%, #ffffff), #ffffff);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}
.sc-mobile-summary__label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.sc-mobile-summary__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
  line-height: 1.25;
  color: var(--text-primary);
}
.sc-mobile-summary__item.active .sc-mobile-summary__label,
.sc-mobile-summary__item.active .sc-mobile-summary__value {
  color: var(--brand-primary);
}
.smart-calendar-popup.is-step-flow .sc-grid {
  padding-top: 8px;
}
.smart-calendar-popup.is-step-flow .sc-time-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.smart-calendar-popup.is-step-flow .sc-footer-actions--mobile .btn {
  min-height: 44px;
}
.sc-time-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.sc-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  align-items: end;
  gap: 12px;
  min-width: 0;
}
.sc-time-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.sc-meridiem-wrap {
  display: grid;
  gap: 0;
  min-width: 0;
  align-self: end;
}
.sc-time-field__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sc-time-control {
  display: grid;
  grid-template-columns: 42px minmax(64px, 1fr) 42px;
  align-items: center;
  gap: 8px;
  padding: 6px;
  min-width: 0;
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border-light) 88%, white);
  background: color-mix(in srgb, var(--bg-subtle) 78%, #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
}
.sc-time-control--compact {
  min-width: 0;
}
.sc-time-control:focus-within {
  border-color: color-mix(in srgb, var(--brand-primary) 48%, white);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.sc-time-step {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: #ffffff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: background var(--trans-fast), color var(--trans-fast), transform var(--trans-fast);
}
.sc-time-step:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.sc-time-step:active {
  transform: scale(0.96);
}
.sc-time-input {
  width: 100%;
  min-width: 64px;
  min-height: 44px;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--border-light) 92%, white);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  padding: 0 10px;
  outline: none;
  -moz-appearance: textfield;
  color: var(--text-primary);
  user-select: text;
}
.sc-time-input:focus {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--brand-primary) 44%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-subtle) 72%, white);
}
.sc-time-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sc-meridiem {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  justify-self: stretch;
  min-width: 0;
}
.sc-meridiem__btn {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--border-light);
  background: white;
  color: var(--text-secondary);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 800;
  padding: 0 10px;
  cursor: pointer;
  transition: all var(--trans-fast);
}
.sc-meridiem__btn[aria-pressed="true"] {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.24);
}

.sc-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 11000; display: none; backdrop-filter: blur(2px); }
.sc-backdrop.is-open { display: block; }

@media (max-width: 767px) {
  .smart-calendar-popup {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: none; border-radius: 20px 20px 0 0;
    border: none; transform: translateY(100%) translateZ(0); transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 11010;
    background: #ffffff;
    height: min(94dvh, 720px);
    max-height: calc(100dvh - 8px);
  }
  .smart-calendar-popup.is-open {
    transform: translateY(0) translateZ(0);
  }
  .smart-calendar-popup.is-top { bottom: 0; top: auto; animation: none; box-shadow: 0 -4px 20px rgba(0,0,0,0.1); transform: translateY(0) translateZ(0); }
  .sc-header {
    padding: max(20px, env(safe-area-inset-top)) 16px 14px;
    border-radius: 20px 20px 0 0;
  }
  .sc-body {
    padding: 0 16px 16px;
  }
  .sc-mobile-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 0 12px;
    margin: 0 0 10px;
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #ffffff 78%, rgba(255, 255, 255, 0.92) 100%);
  }
  .sc-grid {
    gap: 4px;
    padding-top: 14px;
  }
  .sc-cell { min-height: 44px; font-size: 14px; }
  .sc-footer {
    gap: 10px;
    padding: 12px 16px max(20px, env(safe-area-inset-bottom));
    border-radius: 0;
  }
  .sc-time-panel {
    gap: 10px;
  }
  .sc-time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .sc-time-control {
    grid-template-columns: 42px minmax(56px, 1fr) 42px;
    gap: 8px;
    min-height: 58px;
  }
  .sc-time-step {
    width: 42px;
    height: 42px;
  }
  .sc-time-input {
    min-height: 44px;
    font-size: 1.25rem;
  }
  .sc-meridiem-wrap {
    grid-column: 1 / -1;
  }
  .sc-meridiem {
    justify-self: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .sc-meridiem__btn {
    min-height: 42px;
    padding: 0 10px;
  }
  .sc-footer-actions {
    justify-content: stretch;
  }
  .sc-footer-actions .btn {
    flex: 1 1 0;
    width: auto;
  }
  .sc-footer-actions--mobile .btn {
    min-height: 48px;
    font-size: 0.9rem;
    padding-inline: 10px;
  }
  .sc-footer--end .sc-footer-actions {
    width: 100%;
  }
  .sc-title-wrap {
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .sc-mobile-summary {
    grid-template-columns: 1fr;
  }

  .sc-footer-actions--mobile .btn {
    font-size: 0.84rem;
    padding-inline: 8px;
  }
}

/* Desktop Sidebar */
.os-sidebar {
  display: none; width: var(--sidebar-width); background: var(--bg-body); border-right: 1px solid var(--border);
  flex-direction: column; padding: 20px; z-index: 20;
}
.os-sidebar-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.25rem; margin-bottom: 32px; padding: 0 12px; }
/* Mobile Header */

/* Main Viewport */

/* Mobile Bottom Nav */
.os-bottom-nav {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-height);
  background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  z-index: 30; padding-bottom: env(safe-area-inset-bottom);
}

/* Sheet (Slide-over Modal) */
/* Desktop Sheet */
@media (min-width: 768px) {
  .os-sidebar { display: flex; }
  .os-bottom-nav{ display: none; }
}

/* Dashboard shell: business console layout */
.dashboard-shell {
  --primary: var(--color-accent-default);
  --primary-dark: var(--color-accent-hover);
  --primary-soft: var(--color-accent-soft);
  --secondary: var(--color-text-tertiary);
  --success: var(--color-success-default);
  --success-soft: var(--color-success-soft);
  --success-text: var(--color-success-strong);
  --warning: var(--color-warning-default);
  --warning-soft: var(--color-warning-soft);
  --warning-text: var(--color-warning-strong);
  --danger: var(--color-danger-default);
  --danger-text: var(--color-danger-strong);
  --bg-body: #f4f7fb;
  --bg-surface: var(--color-bg-elevated);
  --border: #dbe4ee;
  --border-hover: #c7d3df;
  --text-main: var(--color-text-primary);
  --text-muted: var(--color-text-secondary);
  --text-light: #64748b;
  --header-height: 56px;
  --nav-height: 80px;
  --sidebar-width: 280px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: var(--elevation-1);
  --shadow-md: var(--elevation-1);
  --shadow-lg: var(--elevation-2);
  --motion-fast: var(--motion-duration-fast);
  --motion-base: var(--motion-duration-base);
  --ease-standard: var(--motion-ease-standard);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 20px);
  --icon: 20px;
  --control-height: 48px;
  --control-height-sm: 40px;
  --control-height-xs: 36px;
  --control-radius: 12px;
  --shell-content-max-width: 1040px;
  --surface-hover: #eef2f7;
  --sheet-transition-duration: 0.22s;
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: "Inter", "Mukta", "Noto Sans Devanagari", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-width: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.admin-shell {
  --shell-content-max-width: 1180px;
}

.dashboard-shell *,
.dashboard-shell *::before,
.dashboard-shell *::after {
  box-sizing: border-box;
}

.dashboard-shell h1,
.dashboard-shell h2,
.dashboard-shell h3,
.dashboard-shell h4,
.dashboard-shell p {
  margin: 0;
}

.dashboard-shell h1,
.dashboard-shell h2,
.dashboard-shell h3,
.admin-shell h1,
.admin-shell h2,
.admin-shell h3 {
  line-height: 1.14;
  letter-spacing: -0.01em;
}

.dashboard-shell p,
.dashboard-shell label,
.dashboard-shell td,
.dashboard-shell th,
.dashboard-shell button,
.dashboard-shell a,
.admin-shell p,
.admin-shell label,
.admin-shell td,
.admin-shell th,
.admin-shell button,
.admin-shell a {
  line-height: 1.45;
}

.dashboard-shell a,
.admin-shell a {
  color: var(--primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.dashboard-shell .text-xs { font-size: 0.75rem; }
.dashboard-shell .text-sm { font-size: 0.875rem; }
.dashboard-shell .text-lg { font-size: 1.125rem; }
.dashboard-shell .text-xl { font-size: 1.25rem; }
.dashboard-shell .text-2xl { font-size: 1.5rem; }
.dashboard-shell .text-3xl { font-size: 1.875rem; }
.dashboard-shell .font-bold { font-weight: 700; }
.dashboard-shell .font-medium { font-weight: 500; }
.dashboard-shell .uppercase { text-transform: uppercase; }
.dashboard-shell .tracking-wider { letter-spacing: 0.05em; }
.dashboard-shell .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-shell .text-center { text-align: center; }
.dashboard-shell .text-muted { color: var(--color-text-secondary); }
.dashboard-shell .text-light { color: var(--text-light); }
.dashboard-shell .text-danger { color: var(--danger-text); }
.dashboard-shell .text-primary { color: var(--primary); }
.dashboard-shell .flex { display: flex; }
.dashboard-shell .items-center { align-items: center; }
.dashboard-shell .gap-1 { gap: 4px; }
.dashboard-shell .gap-2 { gap: 8px; }
.dashboard-shell .gap-3 { gap: 12px; }
.dashboard-shell .flex-1 { flex: 1; }
.dashboard-shell .w-full { width: 100%; }
.dashboard-shell .relative { position: relative; }
.dashboard-shell .absolute { position: absolute; }
.dashboard-shell .hidden { display: none !important; }
.dashboard-shell .mb-3 { margin-bottom: 12px; }
.dashboard-shell .mb-4 { margin-bottom: 16px; }
.dashboard-shell .px-1 { padding-left: 4px; padding-right: 4px; }

.dashboard-shell button { font: inherit; color: inherit; }
.dashboard-shell button,
.dashboard-shell [role="button"] { touch-action: manipulation; }
.dashboard-shell :focus { outline: none; }
.dashboard-shell :focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 10px;
}

.dashboard-shell button,
.dashboard-shell .btn,
.dashboard-shell .nav-item,
.dashboard-shell .nav-pill,
.dashboard-shell .segment-btn,
.dashboard-shell .os-tab,
.dashboard-shell .action-icon-btn {
  transition: background-color var(--motion-base) var(--ease-standard), color var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.dashboard-shell .btn:active,
.dashboard-shell .nav-item:active,
.dashboard-shell .nav-pill:active,
.dashboard-shell .user-pill:active,
.dashboard-shell .admin-more-item:active {
  transform: none;
}

.dashboard-shell button:disabled,
.dashboard-shell .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

:is(.dashboard-shell, .admin-shell) a.is-disabled,
:is(.dashboard-shell, .admin-shell) .btn[aria-disabled="true"] {
  opacity: 0.48;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  text-decoration: none;
}

.dashboard-shell .btn,
.dashboard-shell .input,
.dashboard-shell select.input,
.dashboard-shell textarea.input,
.dashboard-shell .lang-btn,
.dashboard-shell .header-btn,
.dashboard-shell .nav-item,
.dashboard-shell .nav-pill,
.dashboard-shell .admin-more-item {
  border-radius: var(--control-radius);
}

.dashboard-shell .input,
.dashboard-shell select.input,
.dashboard-shell textarea.input {
  min-height: var(--control-height);
}

.dashboard-shell .header-btn,
.dashboard-shell .lang-btn,
.dashboard-shell .btn,
.dashboard-shell .nav-item,
.dashboard-shell .admin-more-item {
  min-height: 44px;
}

.dashboard-shell .icon-ph{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: var(--icon);
  height: var(--icon);
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: middle;
}
.dashboard-shell .icon-ph svg{
  width:100%;
  height:100%;
  display:block;
  stroke: currentColor;
  vector-effect: non-scaling-stroke;
}
.dashboard-shell .icon-sm { width: 16px; height: 16px; }
.dashboard-shell .icon-md { width: 20px; height: 20px; }
.dashboard-shell .icon-lg { width: 24px; height: 24px; }

.dashboard-shell .nav-item .icon-ph { width: 20px; height: 20px; }
.dashboard-shell .nav-pill .icon-ph { width: 24px; height: 24px; }
.dashboard-shell .fab .icon-ph { width: 24px; height: 24px; }
.dashboard-shell .btn .icon-ph { width: 18px; height: 18px; }
.dashboard-shell .badge .icon-ph { width: 14px; height: 14px; }

.dashboard-shell .sidebar {
  display: none;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(244, 247, 251, 0.98) 100%);
  border-right: 1px solid var(--border);
  flex-direction: column;
  padding: 16px 16px 24px;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 20;
}
.dashboard-shell .sidebar-brand {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 24px;
  color: var(--text-main);
}
.dashboard-shell .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  box-shadow: 0 8px 18px rgba(79,70,229,.20);
}
.dashboard-shell .sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dashboard-shell .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;  
  border-radius: var(--control-radius);
  color: var(--color-text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--motion-base) var(--ease-standard), color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard);
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
}
@media (hover:hover){
  .dashboard-shell .nav-item:hover {
    background: var(--bg-surface);
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    border-color: var(--border);
  }
}
.dashboard-shell .nav-item.active {
  background: color-mix(in srgb, var(--primary-soft) 88%, #ffffff);
  border-color: color-mix(in srgb, var(--primary) 24%, #ffffff);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.dashboard-shell .sidebar-user-copy {
  overflow: hidden;
}

.dashboard-shell .account-sheet-profile {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--bg-body);
}

.dashboard-shell .account-sheet-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-md);
  border: 2px solid #fff;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--primary);
}

.dashboard-shell .account-sheet-section {
  padding-top: 24px;
}

.dashboard-shell .account-sheet-section .segment-control {
  margin-bottom: 24px;
}

.dashboard-shell .account-sheet-logout {
  width: 100%;
  color: var(--danger-text);
  border-color: rgba(239,68,68,0.25);
  background: var(--danger-soft);
}

.dashboard-shell .user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  cursor: pointer;
  transition: background var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard);
  text-align: left;
  margin-top: auto;
  position: sticky;
  bottom: calc(16px + var(--safe-bottom));
  z-index: 2;
}
@media (hover:hover){
  .dashboard-shell .user-pill:hover {
    background: #F1F5F9;
    border-color: var(--border-hover);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }
}
.dashboard-shell .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--primary);
}

.dashboard-shell .mobile-header {
  min-height: calc(var(--header-height) + var(--safe-top));
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid rgba(219, 228, 238, 0.96);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.dashboard-shell .header-btn {
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.dashboard-shell .lang-btn {
  min-height: var(--control-height-sm);
  padding: 6px 12px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--secondary);
  cursor: pointer;
  transition: background-color var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
}
@media (max-width: 767px) {
  .dashboard-shell .header-btn {
    width: 44px;
    height: 44px;
  }
  .dashboard-shell .lang-btn {
    min-height: 44px;
    padding: 10px 14px;
  }
}
@media (hover:hover){
  .dashboard-shell .lang-btn:hover { background: #F1F5F9; border-color: var(--border-hover); }
}

.dashboard-shell .main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  height: 100%;
}
.dashboard-shell .content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(16px, 3vw, 28px);
  padding-bottom: calc(var(--nav-height) + 24px + var(--safe-bottom));
  max-width: var(--shell-content-max-width);
  margin: 0 auto;
  width: 100%;
  height: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: none;
  min-height: 0;
  contain: content;
}
.dashboard-shell .content-scroll::-webkit-scrollbar { display: none; }

.dashboard-shell .content-scroll.is-routing {
  transition: opacity 80ms var(--ease-standard);
}

.dashboard-shell .content-scroll.is-routing-skeleton {
  opacity: 0.998;
}

.dashboard-shell .content-scroll.route-enter {
  animation: dashboardRouteFadeIn 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.dashboard-shell .content-scroll.route-swapping {
  overflow: hidden;
}

/* Keep tab resume smooth without resetting long-lived view animations. */
.dashboard-shell.tab-resume-stabilize .content-scroll.is-routing,
.dashboard-shell.tab-resume-stabilize .content-scroll.is-routing-skeleton,
.dashboard-shell.tab-resume-stabilize .content-scroll.route-enter,
.dashboard-shell.tab-resume-stabilize .sheet-overlay,
.dashboard-shell.tab-resume-stabilize .sheet-panel {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

@keyframes dashboardRouteFadeIn {
  from {
    opacity: 0.985;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-shell .content-scroll.route-enter {
    animation: none;
  }
}

.dashboard-shell .bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.95);
  border-top: 1px solid rgba(219, 228, 238, 0.96);
  z-index: 30;
  display: flex;
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.dashboard-shell .nav-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  gap: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color var(--motion-base) var(--ease-standard);
  min-height: calc(var(--nav-height) - var(--safe-bottom));
  padding: 8px 4px;
  text-align: center;
}
.dashboard-shell .nav-pill.active { color: var(--primary); }
.dashboard-shell .nav-pill .icon-box {
  padding: 8px 18px;
  border-radius: 999px;
  transition: background var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
}
.dashboard-shell .nav-pill .text-xs {
  line-height: 1.2;
}
.dashboard-shell .nav-pill.active .icon-box {
  background: color-mix(in srgb, var(--primary-soft) 90%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 22%, #ffffff);
}

.dashboard-shell .fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  right: 20px;
  z-index: 40;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--text-main);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform .16s ease, background .2s ease;
  will-change: transform;
}
@media (hover:hover){
  .dashboard-shell .fab:hover { transform: translateY(-1px) scale(1.01); background: var(--primary); }
}
.dashboard-shell .fab:active { transform: scale(0.98); }

@media (min-width: 768px) {
  .dashboard-shell .sidebar { display: flex; }
  .dashboard-shell .mobile-header { display: none; }
  .dashboard-shell .bottom-nav { display: none; }
  .dashboard-shell .fab { display: flex; bottom: 30px; right: 30px; }
  .dashboard-shell .content-scroll { padding: clamp(28px, 4vw, 48px); padding-bottom: clamp(28px, 4vw, 48px); margin: 0 auto; }
}

@media (max-width: 767px) {
  .dashboard-shell .text-xs {
    font-size: 0.8125rem;
  }

  .dashboard-shell .content-scroll {
    padding: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: calc(var(--nav-height) + 18px + var(--safe-bottom));
  }

  .admin-shell .os-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-shell .os-card-header .btn {
    width: 100%;
  }

  .dashboard-shell .profile-row:not(.profile-row--header) {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .dashboard-shell .profile-row:not(.profile-row--header) .btn {
    width: 100%;
  }
}

.dashboard-shell .messages-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.dashboard-shell .topic-chip {
  display: block;
  cursor: pointer;
}
.dashboard-shell .topic-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  background: transparent;
}
.dashboard-shell .topic-card .icon-ph { color: var(--text-muted); }
.dashboard-shell .topic-chip input:checked + .topic-card {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dashboard-shell .topic-chip input:checked + .topic-card .icon-ph { color: var(--primary); }
.dashboard-shell .topic-chip input:focus-visible + .topic-card {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.dashboard-shell .message-textarea-wrapper {
  position: relative;
}
.dashboard-shell .message-textarea {
  padding-bottom: 44px;
}
.dashboard-shell .message-voice-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}
.dashboard-shell .message-voice-btn:hover { background: var(--primary-soft); color: var(--primary); }
.dashboard-shell .message-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dashboard-shell .message-attachment input[type="file"] {
  display: none;
}
.dashboard-shell .message-attachment__name {
  font-size: 0.75rem;
  color: var(--text-light);
}
.dashboard-shell .messages-empty-card {
  text-align: center;
  padding: 40px 20px;
}
.dashboard-shell .messages-empty-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.dashboard-shell .glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.dashboard-shell .glass-card h3 {
  margin-bottom: 8px;
}
.dashboard-shell .glass-card h3 + p,
.dashboard-shell .glass-card p + p {
  margin-top: 6px;
}
@media (hover:hover){
  .dashboard-shell .glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  }
}




/* --- Dashboard Profile view (CSP-safe, no inline styles) --- */
.dashboard-shell .profile-plan-card { border-color: rgba(238, 242, 255, 0.9); }

.dashboard-shell .profile-plan-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-shell .profile-plan-meta {
  background: var(--bg-body);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.dashboard-shell .profile-row {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bg-body);
}

.dashboard-shell .profile-row--header {
  justify-content: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-body);
}

.dashboard-shell .profile-row--clickable { cursor: pointer; }

.dashboard-shell .profile-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-shell .u-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dashboard-shell .u-dot--success { background: var(--success); }

.dashboard-shell .share-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
}

.dashboard-shell .social-preview {
  width: 240px;
  aspect-ratio: 9 / 16;
  background: #f1f5f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dashboard-shell .social-preview__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-shell .grid-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 768px) { .dashboard-shell .grid-stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

:is(.dashboard-shell, .admin-shell) .sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--sheet-transition-duration) var(--ease-standard);
  will-change: opacity;
}
:is(.dashboard-shell, .admin-shell) .sheet-overlay.open { opacity: 1; pointer-events: auto; }

@media (max-width: 767px) {
  :is(.dashboard-shell, .admin-shell) .sheet-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(15, 23, 42, 0.52);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal {
  width: min(100%, 480px);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

.modal__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal__body {
  color: var(--text-secondary);
  margin-top: 8px;
}

.modal__actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .modal {
    width: 100%;
    border-radius: 14px;
  }

  .modal__actions {
    justify-content: stretch;
  }

  .modal__actions .btn {
    flex: 1 1 0;
  }
}

html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.modal-open,
:is(.dashboard-shell, .admin-shell).modal-open {
  overflow: hidden;
  width: 100%;
}

body[data-sheet-open="true"] {
  overscroll-behavior: none;
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  :is(.dashboard-shell, .admin-shell) .sheet-overlay {
    background: rgba(15, 23, 42, 0.58);
  }
}

:is(.dashboard-shell, .admin-shell) .sheet-panel {
  position: fixed;
  background: var(--bg-surface);
  z-index: calc(var(--z-overlay) + 1);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.12);
  transition: transform var(--sheet-transition-duration) var(--ease-standard);
  will-change: transform;
  backface-visibility: hidden;
  contain: layout paint;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
@media (min-width: 768px) {
  :is(.dashboard-shell, .admin-shell) .sheet-panel { inset: 0 0 0 auto; width: min(640px, 100vw); border-left: 1px solid var(--border); transform: translateX(102%); }
  :is(.dashboard-shell, .admin-shell) .sheet-panel.open { transform: translateX(0); }
}
@media (max-width: 767px) {
  :is(.dashboard-shell, .admin-shell) .sheet-panel { inset: max(8px, env(safe-area-inset-top)) 0 0 0; max-height: calc(100dvh - max(8px, env(safe-area-inset-top))); border-radius: 24px 24px 0 0; transform: translateY(102%); }
  :is(.dashboard-shell, .admin-shell) .sheet-panel.open { transform: translateY(0); }
}

@media (max-width: 767px) {
  :is(.dashboard-shell, .admin-shell) .sheet-panel::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: color-mix(in srgb, var(--text-muted) 36%, transparent);
    pointer-events: none;
  }

  :is(.dashboard-shell, .admin-shell) .sheet-header {
    padding-top: 20px;
  }
}

:is(.dashboard-shell, .admin-shell) .sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 68px;
  padding: 0 clamp(16px, 4vw, 24px);
  background: color-mix(in srgb, var(--bg-surface) 95%, #ffffff);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 76%, white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:is(.dashboard-shell, .admin-shell) .sheet-header > .flex {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  padding-right: 4px;
}

:is(.dashboard-shell, .admin-shell) .sheet-header h3 {
  line-height: 1.2;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(.dashboard-shell, .admin-shell) .sheet-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
:is(.dashboard-shell, .admin-shell) .sheet-close {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--border) 92%, white);
  cursor: pointer;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
@media (hover:hover){
  :is(.dashboard-shell, .admin-shell) .sheet-close:hover {
    background: color-mix(in srgb, var(--bg-body) 74%, #ffffff);
    border-color: var(--border-hover);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  }
}
:is(.dashboard-shell, .admin-shell) .sheet-close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 62%, white);
  outline-offset: 2px;
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft) 72%, white);
}
:is(.dashboard-shell, .admin-shell) .sheet-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: clamp(16px, 4vw, 24px);
  padding-bottom: calc(24px + var(--safe-bottom));
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
:is(.dashboard-shell, .admin-shell) .sheet-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg-surface) 96%, #ffffff);
  padding: 16px clamp(16px, 4vw, 24px);
  border-top: 1px solid var(--border);
  padding-bottom: calc(16px + var(--safe-bottom));
  box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:is(.dashboard-shell, .admin-shell) .sheet-footer:empty {
  display: none;
}

@media (max-width: 767px) {
  :is(.dashboard-shell, .admin-shell) .sheet-close {
    width: 48px;
    height: 48px;
  }

  :is(.dashboard-shell, .admin-shell) .sheet-footer .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.dashboard-shell, .admin-shell) .sheet-overlay,
  :is(.dashboard-shell, .admin-shell) .sheet-panel {
    transition: none;
  }
}

.dashboard-shell .input-group { position: relative; margin-bottom: 16px; }
.dashboard-shell .input-std,
.dashboard-shell .input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  padding: 0 12px;
  font-size: 0.95rem;
  transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard);
  background: var(--bg-surface);
  color: var(--text-main);
}
.dashboard-shell .input-std:hover,
.dashboard-shell .input:hover {
  border-color: var(--border-hover);
}
.dashboard-shell textarea.input,
.dashboard-shell textarea.input-std {
  height: auto;
  min-height: 96px;
  padding: 12px;
}
.dashboard-shell .input-std:focus,
.dashboard-shell .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }
.dashboard-shell .input.is-invalid,
.input.is-invalid {
  border-color: var(--danger) !important;
}
.dashboard-shell .input.is-invalid:focus,
.dashboard-shell .input.is-invalid:focus-visible,
.input.is-invalid:focus,
.input.is-invalid:focus-visible {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.dashboard-shell .label-std,
.dashboard-shell .label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: none;
  margin-bottom: 6px;
  display: block;
  margin-left: 0;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.dashboard-shell .btn-primary:focus-visible,
.dashboard-shell .btn--primary:focus-visible,
.dashboard-shell .btn-outline:focus-visible,
.dashboard-shell .btn--ghost:focus-visible,
.dashboard-shell .btn-dark:focus-visible,
.dashboard-shell .nav-item:focus-visible,
.dashboard-shell .nav-pill:focus-visible,
.dashboard-shell .input:focus-visible,
.dashboard-shell .input-std:focus-visible,
.dashboard-shell .lang-btn:focus-visible,
.dashboard-shell .header-btn:focus-visible,
.dashboard-shell .user-pill:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.dashboard-shell .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  min-height: 24px;
  border-radius: 8px;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.dashboard-shell .badge--neutral { background: var(--bg-subtle); color: var(--color-text-secondary); border-color: var(--color-border-default); }
.dashboard-shell .badge--info { background: var(--color-info-soft); color: var(--color-info-strong); border-color: color-mix(in srgb, var(--color-info-default) 24%, white); }
.dashboard-shell .badge--success { background: var(--color-success-soft); color: var(--color-success-strong); border-color: color-mix(in srgb, var(--color-success-default) 25%, white); }
.dashboard-shell .badge--warning { background: var(--color-warning-soft); color: var(--color-warning-strong); border-color: color-mix(in srgb, var(--color-warning-default) 24%, white); }
.dashboard-shell .badge--danger { background: var(--color-danger-soft); color: var(--color-danger-strong); border-color: color-mix(in srgb, var(--color-danger-default) 24%, white); }
.dashboard-shell .badge--premium { background: var(--color-info-soft); color: var(--color-info-strong); border-color: color-mix(in srgb, var(--color-info-default) 24%, white); }
.dashboard-shell .badge--primary { background: var(--color-accent-soft); color: var(--color-accent-default); border-color: color-mix(in srgb, var(--color-accent-default) 24%, white); }

.dashboard-shell .badge-green { background: var(--color-success-soft); color: var(--color-success-strong); border-color: color-mix(in srgb, var(--color-success-default) 25%, white); }
.dashboard-shell .badge-amber { background: var(--color-warning-soft); color: var(--color-warning-strong); border-color: color-mix(in srgb, var(--color-warning-default) 24%, white); }
.dashboard-shell .badge-gray { background: var(--bg-subtle); color: var(--color-text-secondary); border-color: var(--color-border-default); }

.dashboard-shell .verified-credit-box {
  display: block;
  padding: 14px;
  margin: 12px 0 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--color-info-default) 22%, white);
  background: var(--color-info-soft);
}

.dashboard-shell .verified-credit-box__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.dashboard-shell .verified-credit-box__steps {
  margin: 10px 0 0 18px;
  padding: 0;
  line-height: 1.45;
}

.dashboard-shell .verified-credit-box__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
}

.dashboard-shell .toggle {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background 0.25s ease;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,0.05);
}
.dashboard-shell .toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.dashboard-shell .toggle.active { background: var(--success); }
.dashboard-shell .toggle.active::after { transform: translateX(20px); }

.dashboard-shell .segment-control {
  background: #F1F5F9;
  padding: 4px;
  border-radius: var(--radius-md);
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border: 1px solid rgba(226,232,240,0.7);
}
.dashboard-shell .segment-btn {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--secondary);
  border-radius: 10px;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
  border: none;
  cursor: pointer;
  background: transparent;
}
.dashboard-shell .segment-btn.active { background: white; color: var(--text-main); box-shadow: var(--shadow-sm); }

.dashboard-shell .segment-btn:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.dashboard-shell .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  height: var(--control-height);
  border-radius: var(--control-radius);
  font-weight: 700;
  font-size: 0.875rem;
  transition: background-color var(--motion-base) var(--ease-standard), color var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
  cursor: pointer;
  border: 1px solid transparent;
  gap: 10px;
  padding: 0 16px;
  user-select: none;
  line-height: 1.2;
}
.dashboard-shell .btn:active { filter: brightness(0.99); }
.dashboard-shell .btn-primary { background: var(--primary); color: white; border-color: transparent; box-shadow: var(--shadow-sm); }
@media (hover:hover){ .dashboard-shell .btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); } }
.dashboard-shell .btn-outline { background: white; border: 1px solid var(--border); color: var(--text-main); box-shadow: none; }
@media (hover:hover){ .dashboard-shell .btn-outline:hover { background: #F8FAFC; border-color: var(--border-hover); box-shadow: var(--shadow-sm); } }
.dashboard-shell .btn-dark { background: var(--text-main); color: white; border-color: transparent; }
@media (hover:hover){ .dashboard-shell .btn-dark:hover { background: #1E293B; box-shadow: var(--shadow-md); } }
.dashboard-shell .btn-sm { min-height: var(--control-height-sm); height: var(--control-height-sm); font-size: 0.75rem; padding: 0 12px; border-radius: 10px; }
@media (max-width: 767px) {
  .dashboard-shell .btn-sm {
    min-height: var(--touch-target);
    height: auto;
    padding: 8px 14px;
  }
  .dashboard-shell .btn--tiny {
    min-height: var(--touch-target);
    height: auto;
    padding: 8px 14px;
  }   
  .dashboard-shell .segment-btn {
    min-height: var(--touch-target);
    padding: 12px 12px;
    font-size: 0.8rem;
  }

  .dashboard-shell .toggle {
    min-height: var(--touch-target);
    height: var(--touch-target);
    width: 64px;
  }

  .dashboard-shell .toggle::after {
    width: 28px;
    height: 28px;
    top: 8px;
    left: 8px;
  }

  .dashboard-shell .toggle.active::after { transform: translateX(20px); }

}

.dashboard-shell .offer-card { background: var(--warning-soft); border: 1px dashed var(--warning); }
.dashboard-shell .offer-card .toggle.active { background: var(--warning); }


.dashboard-shell .animate-in { animation: dashboardSurfaceFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes dashboardSurfaceFadeIn { from { opacity: 0.988; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .dashboard-shell .nav-item,
  .dashboard-shell .user-pill,
  .dashboard-shell .content-scroll.is-routing,
  .dashboard-shell .nav-pill,
  .dashboard-shell .nav-pill .icon-box,
  .dashboard-shell .btn,
  :is(.dashboard-shell, .admin-shell) .sheet-overlay,
  :is(.dashboard-shell, .admin-shell) .sheet-panel,
  .dashboard-shell .animate-in {
    transition: none;
    animation: none;
  }
}

.dashboard-shell .desktop-only { display: none; }
@media (min-width: 768px) { .dashboard-shell .desktop-only { display: inline-flex; } }

.dashboard-shell .link-action {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
}

.dashboard-shell .link-action--micro { font-size: 11px; }

.dashboard-shell .voice-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-shell .voice-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.dashboard-shell .voice-btn:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 20%, #ffffff);
}

.dashboard-shell .voice-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dashboard-shell .translate-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-shell .translate-btn:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 20%, #ffffff);
  color: var(--primary);
}

.dashboard-shell .btn--primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}
@media (hover:hover){
  .dashboard-shell .btn--primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
  }
}
.dashboard-shell .btn--ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-main);
}
@media (hover:hover){
  .dashboard-shell .btn--ghost:hover {
    background: #F8FAFC;
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
  }
}
.dashboard-shell .btn--tiny { min-height: var(--control-height-xs); height: var(--control-height-xs); font-size: 0.75rem; padding: 0 12px; border-radius: 10px; }
.dashboard-shell .btn--danger { color: var(--danger-text); border-color: rgba(239, 68, 68, 0.3); }

.dashboard-shell .card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.dashboard-shell .form { display: flex; flex-direction: column; gap: 12px; }
.dashboard-shell .form.small .input { height: 40px; }
.dashboard-shell .form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.dashboard-shell .form-card__header { display: flex; flex-direction: column; gap: 4px; }
.dashboard-shell .field-group { display: grid; gap: 6px; }
.dashboard-shell .media-uploader { display: grid; gap: 12px; }
.dashboard-shell .media-uploader__preview {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #f8fafc;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dashboard-shell .media-uploader__preview:hover {
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.dashboard-shell .media-uploader__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.dashboard-shell .media-uploader__img.is-visible { display: block; }
.dashboard-shell .media-uploader__placeholder { color: var(--text-light); font-size: 0.8rem; }
.dashboard-shell .media-uploader__controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dashboard-shell .media-uploader__note { font-size: 0.7rem; color: var(--text-light); flex-basis: 100%; margin: 0; }

.tag-picker-native-hidden {
  display: none !important;
}

:is(.dashboard-shell, .admin-shell) .sheet-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

:is(.dashboard-shell, .admin-shell) .sheet-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(16px, 3.2vw, 22px);
  display: grid;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

:is(.dashboard-shell, .admin-shell) .sheet-form-card__header,
:is(.dashboard-shell, .admin-shell) .form-card__header {
  display: grid;
  gap: 4px;
}

:is(.dashboard-shell, .admin-shell) .sheet-form-intro,
:is(.dashboard-shell, .admin-shell) .form-section-lead {
  display: grid;
  gap: 6px;
}

:is(.dashboard-shell, .admin-shell) .sheet-form-intro {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--primary, var(--brand-primary)) 14%, var(--border, var(--border-light)));
  background: color-mix(in srgb, var(--primary-soft, var(--brand-subtle)) 50%, #ffffff);
}

:is(.dashboard-shell, .admin-shell) .sheet-form-intro__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
}

:is(.dashboard-shell, .admin-shell) .sheet-form-intro__body,
:is(.dashboard-shell, .admin-shell) .form-section-lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

:is(.dashboard-shell, .admin-shell) .sheet-form .grid {
  gap: 16px;
}

:is(.dashboard-shell, .admin-shell) .sheet-form .field-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

:is(.dashboard-shell, .admin-shell) .sheet-form .label {
  display: block;
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-primary);
}

:is(.dashboard-shell, .admin-shell) .sheet-form .input,
:is(.dashboard-shell, .admin-shell) .sheet-form select.input,
:is(.dashboard-shell, .admin-shell) .sheet-form textarea.input,
:is(.dashboard-shell, .admin-shell) .tag-picker__input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border, var(--border-light)) 88%, white);
  background: color-mix(in srgb, var(--bg-surface) 96%, #ffffff);
  color: var(--text-primary);
  transition: border-color var(--motion-fast, 0.18s) var(--ease-standard, ease), box-shadow var(--motion-fast, 0.18s) var(--ease-standard, ease), background-color var(--motion-fast, 0.18s) var(--ease-standard, ease);
}

:is(.dashboard-shell, .admin-shell) .sheet-form .input:hover,
:is(.dashboard-shell, .admin-shell) .sheet-form select.input:hover,
:is(.dashboard-shell, .admin-shell) .sheet-form textarea.input:hover,
:is(.dashboard-shell, .admin-shell) .tag-picker__input:hover {
  border-color: color-mix(in srgb, var(--primary, var(--brand-primary)) 22%, var(--border, var(--border-light)));
}

:is(.dashboard-shell, .admin-shell) .sheet-form .input:focus,
:is(.dashboard-shell, .admin-shell) .sheet-form select.input:focus,
:is(.dashboard-shell, .admin-shell) .sheet-form textarea.input:focus,
:is(.dashboard-shell, .admin-shell) .tag-picker__input:focus {
  border-color: color-mix(in srgb, var(--primary, var(--brand-primary)) 58%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft, var(--brand-subtle)) 68%, white);
  background: #ffffff;
}

:is(.dashboard-shell, .admin-shell) .sheet-form textarea.input {
  min-height: 120px;
  resize: vertical;
}

:is(.dashboard-shell, .admin-shell) .sheet-field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

:is(.dashboard-shell, .admin-shell) .sheet-field-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

:is(.dashboard-shell, .admin-shell) .field-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border, var(--border-light)) 84%, white);
  background: color-mix(in srgb, var(--bg-surface) 96%, #ffffff);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--motion-fast, 0.18s) var(--ease-standard, ease), background-color var(--motion-fast, 0.18s) var(--ease-standard, ease), color var(--motion-fast, 0.18s) var(--ease-standard, ease), box-shadow var(--motion-fast, 0.18s) var(--ease-standard, ease);
  position: relative;
}

:is(.dashboard-shell, .admin-shell) .field-action.voice-btn,
:is(.dashboard-shell, .admin-shell) .field-action.translate-btn {
  width: auto;
  height: auto;
  min-width: 0;
}

:is(.dashboard-shell, .admin-shell) .field-action:hover {
  background: color-mix(in srgb, var(--primary-soft, var(--brand-subtle)) 58%, #ffffff);
  border-color: color-mix(in srgb, var(--primary, var(--brand-primary)) 26%, white);
  color: var(--primary, var(--brand-primary));
}

:is(.dashboard-shell, .admin-shell) .field-action:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--primary, var(--brand-primary)) 44%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft, var(--brand-subtle)) 72%, white);
}

:is(.dashboard-shell, .admin-shell) .field-action:disabled {
  opacity: 0.66;
  cursor: wait;
}

:is(.dashboard-shell, .admin-shell) .field-action svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 auto;
}

:is(.dashboard-shell, .admin-shell) .field-action__text {
  white-space: nowrap;
}

:is(.dashboard-shell, .admin-shell) .field-action.is-loading {
  color: transparent;
  pointer-events: none;
}

:is(.dashboard-shell, .admin-shell) .field-action.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--primary, var(--brand-primary)) 35%, white);
  border-right-color: transparent;
  animation: spin 0.65s linear infinite;
}

:is(.dashboard-shell, .admin-shell) .field-help,
:is(.dashboard-shell, .admin-shell) .field-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

:is(.dashboard-shell, .admin-shell) .field-counter {
  font-variant-numeric: tabular-nums;
}

:is(.dashboard-shell, .admin-shell) .field-counter.is-warning {
  color: #b45309;
  font-weight: 700;
}

:is(.dashboard-shell, .admin-shell) .sheet-form .panel-subtle {
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
}

:is(.dashboard-shell, .admin-shell) .sheet-form .label.u-flex {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.82rem;
}

:is(.dashboard-shell, .admin-shell) .tag-picker {
  position: relative;
  display: grid;
  gap: 8px;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--border, var(--border-light)) 88%, white);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface) 96%, #ffffff);
  transition: border-color var(--motion-fast, 0.18s) var(--ease-standard, ease), box-shadow var(--motion-fast, 0.18s) var(--ease-standard, ease), background-color var(--motion-fast, 0.18s) var(--ease-standard, ease);
  cursor: text;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__control:focus-within {
  border-color: color-mix(in srgb, var(--primary, var(--brand-primary)) 58%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft, var(--brand-subtle)) 68%, white);
  background: #ffffff;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 6px 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft, var(--brand-subtle)) 68%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--primary, var(--brand-primary)) 18%, white);
  color: var(--primary, var(--brand-primary));
  max-width: 100%;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__chip-label {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__chip-remove {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary, var(--brand-primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__input {
  flex: 1 1 180px;
  min-width: 120px;
  min-height: 36px;
  height: 36px;
  padding: 0 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__input:focus {
  box-shadow: none;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__input:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

:is(.dashboard-shell, .admin-shell) .tag-picker__count {
  font-weight: 700;
  color: var(--text-secondary);
}

:is(.dashboard-shell, .admin-shell) .tag-picker__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 24;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--border, var(--border-light)) 88%, white);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  padding: 8px;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__menu-title {
  padding: 6px 8px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

:is(.dashboard-shell, .admin-shell) .tag-picker__menu-list {
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__option {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--motion-fast, 0.18s) var(--ease-standard, ease), color var(--motion-fast, 0.18s) var(--ease-standard, ease);
}

:is(.dashboard-shell, .admin-shell) .tag-picker__option:hover,
:is(.dashboard-shell, .admin-shell) .tag-picker__option.is-active {
  background: color-mix(in srgb, var(--primary-soft, var(--brand-subtle)) 58%, #ffffff);
}

:is(.dashboard-shell, .admin-shell) .tag-picker__option-copy {
  display: grid;
  gap: 2px;
}

:is(.dashboard-shell, .admin-shell) .tag-picker__option-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

:is(.dashboard-shell, .admin-shell) .tag-picker__option-meta {
  font-size: 0.76rem;
  color: var(--text-tertiary);
}

:is(.dashboard-shell, .admin-shell) .tag-picker__empty {
  padding: 12px;
  font-size: 0.84rem;
  color: var(--text-tertiary);
}

@media (max-width: 767px) {
  :is(.dashboard-shell, .admin-shell) .sheet-form-card {
    border-radius: 18px;
    padding: 16px;
  }

  :is(.dashboard-shell, .admin-shell) .sheet-field-head {
    align-items: stretch;
  }

  :is(.dashboard-shell, .admin-shell) .sheet-field-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  :is(.dashboard-shell, .admin-shell) .field-action {
    min-height: 44px;
    padding: 0 14px;
  }

  :is(.dashboard-shell, .admin-shell) .tag-picker__control {
    min-height: 56px;
  }

  :is(.dashboard-shell, .admin-shell) .tag-picker__input {
    min-height: 40px;
    height: 40px;
    flex-basis: 100%;
  }

  :is(.dashboard-shell, .admin-shell) .tag-picker__chip {
    min-height: 38px;
  }

  :is(.dashboard-shell, .admin-shell) .tag-picker__chip-label {
    max-width: 70vw;
  }

  :is(.dashboard-shell, .admin-shell) .tag-picker__menu {
    position: static;
    box-shadow: none;
    margin-top: 4px;
  }
}

.dashboard-shell .offer-balance-shell {
  display: grid;
  gap: 10px;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
}
.dashboard-shell .offer-balance-shell__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard-shell .offer-balance-shell__head > div {
  min-width: 0;
}
.dashboard-shell .offer-balance-shell__buy-pack {
  border-radius: 999px;
}
@media (hover:hover){
  .dashboard-shell .offer-balance-shell__buy-pack:hover {
    background: #fff;
    border-color: #94a3b8;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
  }
}
.dashboard-shell .offer-balance-shell__buy-pack-plus {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 400;
  margin-top: -2px;
}
.dashboard-shell .offer-balance-shell__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dashboard-shell .offer-balance-stat {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dashboard-shell .offer-balance-stat__label {
  font-size: 0.72rem;
  line-height: 1.2;
  color: #64748b;
}
.dashboard-shell .offer-balance-stat strong {
  font-size: 0.84rem;
  line-height: 1;
  color: #0f172a;
}
.dashboard-shell .offer-list-item[aria-pressed="true"] {
  border-color: rgba(79, 70, 229, 0.45);
}
.dashboard-shell .offer-list {
  display: grid;
  gap: 10px;
}
.dashboard-shell .offer-list-shell {
  margin-top: 10px;
}
.dashboard-shell .offer-list-shell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}
.dashboard-shell .offer-list-shell__post-btn {
  margin-block: 8px;
}
.dashboard-shell .offer-list-item {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard);
  cursor: pointer;
}
.dashboard-shell .offer-list-item__main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dashboard-shell .offer-list-item__media {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f8fafc;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}
.dashboard-shell .offer-list-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dashboard-shell .offer-list-item__media.is-placeholder { background: #f1f5f9; }
.dashboard-shell .offer-list-item__content {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.dashboard-shell .offer-list-item:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.4);
  outline-offset: 2px;
}
.dashboard-shell .offer-list-item.is-selected {
  border-color: rgba(79, 70, 229, 0.45);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.12);
}
@media (hover:hover){
  .dashboard-shell .offer-list-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
  }
}

.dashboard-shell .offer-list-item__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: stretch;
  overflow-x: auto;
  padding: 2px 0;
}
.dashboard-shell .offer-icon-action {
  border: 1px solid rgba(219, 228, 238, 0.95);
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 8px 10px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 60px;
  min-height: 46px;
  color: #334155;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.dashboard-shell .offer-icon-action__icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}
.dashboard-shell .offer-icon-action__icon .icon-ph {
  font-size: 1rem;
}
.dashboard-shell .offer-icon-action__label {
  color: inherit;
  white-space: nowrap;
}
.dashboard-shell .offer-icon-action:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.3);
  outline-offset: 1px;
}
@media (hover:hover){
  .dashboard-shell .offer-icon-action:hover {
    color: #0f172a;
    background: rgba(148, 163, 184, 0.12);
  }
}
.dashboard-shell .offer-icon-action--accent {
  color: #4f46e5;
}
@media (hover:hover){
  .dashboard-shell .offer-icon-action--accent:hover {
    color: #3730a3;
    background: rgba(99, 102, 241, 0.12);
  }
}
.dashboard-shell .offer-icon-action--danger {
  color: #b91c1c;
}
@media (hover:hover){
  .dashboard-shell .offer-icon-action--danger:hover {
    color: #991b1b;
    background: rgba(248, 113, 113, 0.14);
  }
}
.dashboard-shell .offer-list-item__title-row,
.dashboard-shell .offer-list-item__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.dashboard-shell .offer-list-item__price-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dashboard-shell .offer-list-item__title {
  font-size: 1.03rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-main);
}
.dashboard-shell .offer-list-item__price {
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.2;
  color: #334155;
}
.dashboard-shell .offer-list-item__price-strike {
  text-decoration: line-through;
  color: #94a3b8;
}
.dashboard-shell .offer-list-item__subline {
  margin-top: -2px;
}
.dashboard-shell .offer-list-item__state-inline {
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.dashboard-shell .offer-list-item__state-inline.offer-chip--success { background: rgba(16, 185, 129, 0.12); color: #047857; border-color: rgba(16, 185, 129, 0.28); }
.dashboard-shell .offer-list-item__state-inline.offer-chip--neutral { background: rgba(148, 163, 184, 0.14); color: #334155; border-color: rgba(148, 163, 184, 0.3); }
.dashboard-shell .offer-list-item__state-inline.offer-chip--danger { background: rgba(239, 68, 68, 0.11); color: #b91c1c; border-color: rgba(239, 68, 68, 0.3); }
.dashboard-shell .offer-empty-state {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  background: var(--bg-body);
}
.dashboard-shell .offer-empty-state__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dashboard-shell .form {
  gap: 14px;
}
.dashboard-shell .form-card {
  border-radius: 16px;
}
.dashboard-shell .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  .dashboard-shell .offer-list-item__actions {
    gap: 10px;
  }
  .dashboard-shell .offer-icon-action {
    gap: 5px;
    min-width: 62px;
    min-height: 46px;
    font-size: 0.74rem;
  }
  .dashboard-shell .offer-icon-action__icon {
    width: 26px;
    height: 26px;
  }
  .dashboard-shell .offer-icon-action__icon .icon-ph {
    font-size: 1.05rem;
  }
}

@media (max-width: 767px) {
   .dashboard-shell .offer-balance-shell__stats {
    gap: 5px;
  }
  .dashboard-shell .offer-list-shell__head {
    align-items: stretch;
    margin-bottom: 20px;
  }
  .dashboard-shell .offer-list-shell__post-btn {
    width: 100%;
    margin-block: 6px;
  }
  .dashboard-shell .offer-balance-shell__buy-pack {
    width: auto;
    align-self: center;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .dashboard-shell .offer-balance-shell__head {
    flex-wrap: nowrap;
    align-items: center;
  }
  .dashboard-shell .offer-list-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-shell .offer-list-item__actions {
    justify-content: flex-start;
    gap: 6px;
  }
  .dashboard-shell .offer-icon-action {
    min-width: 60px;
    min-height: 46px;
    padding-inline: 8px;
  }
  .dashboard-shell .offer-list-item__meta-row {
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
  }
  .dashboard-shell .offer-list-item__price-line {
    min-width: 0;
    flex-shrink: 1;
  }
  .dashboard-shell .offer-list-item__price {
    white-space: nowrap;
  }
  .dashboard-shell .offer-list-item__price-strike {
    margin-left: auto;
    font-size: 0.85rem;
  }
}

body.modal-open .content-scroll,
:is(.dashboard-shell, .admin-shell).modal-open .content-scroll {
  overflow: hidden;
}

/* Admin OS additions */
.admin-shell .os-view {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.admin-shell .os-card-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.dashboard-shell .os-results-slot,
.admin-shell .os-results-slot {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.admin-shell .glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  overflow: visible;
  min-width: 0;
  transition: border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
}

@media (hover:hover){
  .admin-shell .glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  }
}

.admin-shell .os-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.admin-shell .os-card-header > :first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-shell .os-card-header > :last-child {
  flex: 0 0 auto;
}

.admin-shell .os-status-chip {
  padding: 6px 12px;
  background: var(--color-accent-soft);
  border: 1px solid color-mix(in srgb, var(--color-accent-default) 20%, white);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

.admin-shell .os-stat {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 118px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border) 68%, white);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.94) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.admin-shell .os-stat .text-xs {
  letter-spacing: 0.03em;
}

.admin-shell .os-stat .text-2xl {
  line-height: 1.05;
  letter-spacing: -0.02em;
}

@media (max-width: 767px) {
  .admin-shell .os-stat {
    min-height: 0;
    padding: 14px;
    border-radius: 16px;
  }
}

.admin-shell .os-table-wrap {
  position: relative;
  display: block;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--border) 55%, white);
  background: var(--color-bg-elevated);
  margin-top: 12px;
  max-width: 100%;
}

.admin-shell .ops-table-body-empty {
  padding: 14px 14px 16px;
}

.admin-shell .ops-table-actions {
  padding: 0 14px 14px;
}

.admin-shell .os-table-wrap:focus-visible {
  box-shadow: var(--focus-ring);
}

.admin-shell .os-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.admin-shell .os-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.admin-shell .os-table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-text-tertiary) 55%, transparent);
  border-radius: 999px;
}

.admin-shell .os-table {
  width: max-content;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: max(560px, 100%);
  table-layout: auto;
}

.admin-shell .os-table th,
.admin-shell .os-table td {
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, white);
  text-align: left;
  vertical-align: middle;
}

@media (max-width: 767px) {
  .admin-shell .os-table th,
  .admin-shell .os-table td {
    padding: 14px 16px;
    min-height: 44px;
  }
}

.admin-shell .os-table th {
  background: #F8FAFC;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

.admin-shell .os-table th.col-status,
.admin-shell .os-table td.col-status {
  width: 110px;
}

.admin-shell .os-table th.col-actions,
.admin-shell .os-table td.col-actions {
  width: 88px;
  text-align: right;
}

.admin-shell .os-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-shell .os-view,
.admin-shell .os-card-stack,
.admin-shell .glass-card {
  min-width: 0;
  max-width: 100%;
}

.admin-shell .os-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--color-bg-elevated) 94%, var(--color-bg-canvas));
}

.admin-shell .os-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.06);
}

.admin-shell .os-table .btn {
  min-height: var(--control-height-sm);
  padding: 0 14px;
  white-space: nowrap;
}

.admin-shell .os-form-grid {
  display: grid;
  gap: 14px;
}

.admin-shell .os-mobile-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--color-info-default) 20%, white);
  background: color-mix(in srgb, var(--color-info-soft) 68%, white);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.admin-shell .os-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-shell .os-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 68%, white);
}

.admin-shell .os-sheet-section {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-shell .os-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-shell .os-tab-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.admin-shell .os-tab-row::-webkit-scrollbar {
  display: none;
}

.admin-shell .os-tab {
  flex: 0 0 auto;
  min-height: var(--control-height-sm);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--motion-base) var(--ease-standard), background var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
}

@media (max-width: 767px) {
  .admin-shell .os-tab {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.85rem;
  }
}

.admin-shell .os-tab.active {
  background: var(--primary-soft);
  border-color: rgba(79, 70, 229, 0.36);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-shell .os-sheet-panel {
  display: none;
  min-width: 0;
}

.admin-shell .os-sheet-panel:not(.is-hidden) {
  display: block;
}

.admin-shell .os-code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  min-height: 80px;
  overflow-x: auto;
  margin-top: 12px;
}

.admin-shell .os-code-block.is-loading {
  opacity: 0.7;
}

.admin-shell .os-code-block.is-empty {
  display: none;
}

.admin-shell .skeleton-line {
  height: 12px;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  margin-bottom: 12px;
  animation: skeleton-fade 1.4s ease-in-out infinite alternate;
}

.admin-shell .skeleton-line--short {
  width: 60%;
}

.admin-shell .skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-shell .skeleton-card {
  height: 72px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.25);
  animation: skeleton-fade 1.4s ease-in-out infinite alternate;
}

.admin-shell .skeleton-table {
  margin-top: 12px;
}

.admin-shell .skeleton-row {
  height: 16px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  margin-bottom: 10px;
  animation: skeleton-fade 1.4s ease-in-out infinite alternate;
}

.admin-shell .admin-more-dialog {
  display: none;
  flex-direction: column;
  border: none;
  border-radius: 18px;
  padding: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: min(82dvh, 420px);
  overflow: hidden;
  color: var(--text-main);
  background: var(--bg-surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.admin-shell .admin-more-dialog[open] {
  display: flex;
}

.admin-shell .admin-more-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.admin-shell .admin-more-dialog__header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: color-mix(in srgb, var(--bg-surface) 96%, #ffffff);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.admin-shell .admin-more-dialog__body {
  padding: 16px 20px 20px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
}

.admin-shell .admin-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--control-radius);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  font-weight: 600;
  min-height: 44px;
  transition: background var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard), color var(--motion-base) var(--ease-standard);
}

@media (hover:hover){
  .admin-shell .admin-more-item:hover {
    background: #EEF2FF;
    border-color: rgba(79, 70, 229, 0.28);
  }
}

.admin-shell .admin-more-item--danger {
  color: var(--danger-text);
  border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 767px) {
  .admin-shell .admin-more-dialog {
    margin: auto 12px calc(24px + env(safe-area-inset-bottom));
  }

  .admin-shell .os-sheet-header > * {
    width: 100%;
  }

  .admin-shell .os-badge-row {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .admin-shell .admin-more-dialog[open] {
    display: none;
  }
}

@media (max-width: 640px) {
  :is(.dashboard-shell, .admin-shell) .btn-group {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    width: 100%;
  }

  :is(.dashboard-shell, .admin-shell) .btn-group > * {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .dashboard-shell .messages-topic-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* ===== Phase 13: utility classes + auth verify page styles (CSP-friendly) ===== */
.u-icon-18 { width: 18px !important; height: 18px !important; }

.u-h100 { height: 100px !important; }
.u-h200 { height: 200px !important; }
.u-h300 { height: 300px !important; }

.u-mb16 { margin-bottom: 16px !important; }
.u-mb24 { margin-bottom: 24px !important; }
.u-mt16 { margin-top: 16px !important; }
.u-my20 { margin-top: 20px !important; margin-bottom: 20px !important; }
.u-mx-auto { margin-left: auto !important; margin-right: auto !important; }

.u-w50p { width: 50% !important; }
.u-w60p { width: 60% !important; }

.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-pad-lg { padding: 32px !important; }
.text-center { text-align: center !important; }


/* --- CSP-safe layout utilities (no inline styles) --- */
.u-flex { display: flex !important; }
.u-flex-col { flex-direction: column !important; }
.u-flex-wrap { flex-wrap: wrap !important; }
.u-flex-wrap-reverse { flex-wrap: wrap-reverse !important; }
.u-items-center { align-items: center !important; }
.u-items-start { align-items: flex-start !important; }
.u-items-end { align-items: flex-end !important; }
.u-justify-between { justify-content: space-between !important; }
.u-justify-center { justify-content: center !important; }
.u-justify-start { justify-content: flex-start !important; }
.u-justify-end { justify-content: flex-end !important; }

.u-grid { display: grid !important; }
.u-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

.u-gap-4 { gap: 4px !important; }
.u-gap-6 { gap: 6px !important; }
.u-gap-8 { gap: 8px !important; }
.u-gap-10 { gap: 10px !important; }
.u-gap-12 { gap: 12px !important; }
.u-gap-14 { gap: 14px !important; }
.u-gap-16 { gap: 16px !important; }
.u-gap-18 { gap: 18px !important; }
.u-gap-20 { gap: 20px !important; }
.u-gap-24 { gap: 24px !important; }
.u-gap-32 { gap: 32px !important; }

.u-text-left { text-align: left !important; }
.u-cursor-pointer { cursor: pointer !important; }
.u-line-through { text-decoration: line-through !important; }
.u-whitespace-nowrap { white-space: nowrap !important; }
.u-prewrap { white-space: pre-wrap !important; }
.u-break-word { word-break: break-word !important; overflow-wrap: anywhere !important; }
.u-lh-150 { line-height: 1.5 !important; }
.u-border-none { border: none !important; }

.u-w100 { width: 100% !important; }
.u-w40p { width: 40% !important; }
.u-w48p { width: 48% !important; }
.u-w55p { width: 55% !important; }
.u-w60p { width: 60% !important; }
.u-w64p { width: 64% !important; }
.u-w70p { width: 70% !important; }
.u-maxw-220 { max-width: 220px !important; }
.u-maxw-300 { max-width: 300px !important; }
.u-minw-100 { min-width: 100px !important; }

.u-h6 { height: 6px !important; }
.u-h12 { height: 12px !important; }
.u-h14 { height: 14px !important; }
.u-h18 { height: 18px !important; }
.u-h80 { height: 80px !important; }

.u-m0 { margin: 0 !important; }
.u-relative { position: relative !important; }
.vanity-spinner { position: absolute; right: 10px; top: 10px; font-size: 12px; color: var(--text-tertiary); }
.panel-subtle { padding: 16px; background: var(--bg-subtle); border-radius: 8px; border: 1px solid var(--border-light); }



.u-mt2 { margin-top: 2px !important; }
.u-mt4 { margin-top: 4px !important; }
.u-mt6 { margin-top: 6px !important; }
.u-mt8 { margin-top: 8px !important; }
.u-mt10 { margin-top: 10px !important; }
.u-mt12 { margin-top: 12px !important; }
.u-mt14 { margin-top: 14px !important; }
.u-mb0 { margin-bottom: 0 !important; }
.u-mb4 { margin-bottom: 4px !important; }
.u-mb6 { margin-bottom: 6px !important; }
.u-mb8 { margin-bottom: 8px !important; }
.u-mb10 { margin-bottom: 10px !important; }
.u-mb12 { margin-bottom: 12px !important; }
.u-mb14 { margin-bottom: 14px !important; }
.u-mb16 { margin-bottom: 16px !important; }
.u-mb20 { margin-bottom: 20px !important; }
.u-mb24 { margin-bottom: 24px !important; }
.u-mx12 { margin-left: 12px !important; margin-right: 12px !important; }
.u-mx-auto { margin-left: auto !important; margin-right: auto !important; }
.u-ml6 { margin-left: 6px !important; }
.u-mr4 { margin-right: 4px !important; }
.u-my2 { margin-top: 2px !important; margin-bottom: 2px !important; }
.u-mt-auto { margin-top: auto !important; }
.u-p12 { padding: 12px !important; }

.u-aspect-9-16 { aspect-ratio: 9 / 16 !important; }

.card-pad-12 { padding: 12px !important; }
.card-pad-14 { padding: 14px !important; }
.card-pad-16 { padding: 16px !important; }
.card-pad-20 { padding: 20px !important; }
.card-pad-24 { padding: 24px !important; }
.card--ghost { border: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; }

.font-semibold { font-weight: 600 !important; }

/* Percent width helpers (quantized 10% steps) */
.u-w0 { width: 0% !important; }
.u-w10 { width: 10% !important; }
.u-w20 { width: 20% !important; }
.u-w30 { width: 30% !important; }
.u-w40 { width: 40% !important; }
.u-w50 { width: 50% !important; }
.u-w60 { width: 60% !important; }
.u-w70 { width: 70% !important; }
.u-w80 { width: 80% !important; }
.u-w90 { width: 90% !important; }
.u-w100 { width: 100% !important; }

/* Min-height helpers (rounded / clamped in JS) */
.u-minh100 { min-height: 100px !important; }
.u-minh200 { min-height: 200px !important; }
.u-minh300 { min-height: 300px !important; }
.u-minh400 { min-height: 400px !important; }
.u-minh500 { min-height: 500px !important; }
.u-minh600 { min-height: 600px !important; }
.u-minh700 { min-height: 700px !important; }
.u-minh800 { min-height: 800px !important; }
.u-minh900 { min-height: 900px !important; }
.u-minh1000 { min-height: 1000px !important; }
.u-minh1100 { min-height: 1100px !important; }
.u-minh1200 { min-height: 1200px !important; }

/* Off-screen helper (for Turnstile & a11y) */
.u-offscreen {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Drag/drop highlight without inline style writes */
.u-drop-highlight {
  background: rgba(236, 253, 245, 0.9) !important;
  transition: background-color 0.25s ease;
}

/* Flash success highlight without inline style writes */
.u-flash-success {
  background: rgba(236, 253, 245, 0.9) !important;
  transition: background-color 0.25s ease;
}

.auth-input-group { display: flex; gap: 8px; margin-top: 16px; }

.auth-card { max-width: 420px; margin-left: auto; margin-right: auto; }

.debug-console {
  background: #1e293b;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  padding: 10px;
  margin-top: 20px;
  border-radius: 6px;
  text-align: left;
  overflow-x: auto;
  white-space: pre-wrap;
}


/* --- Dashboard hub / cards --- */
.dashboard-shell .hub-title { color: var(--text-main); margin-bottom: 4px; }
.dashboard-shell .card-gradient-slate {
  background: linear-gradient(to bottom right, #ffffff, #f8fafc);
}
.dashboard-shell .hub-guided-card {
  border: 2px solid var(--primary-soft);
  background: #fffbeb;
}
.dashboard-shell .hub-guided-kicker {
  color: #92400e;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dashboard-shell .hub-guided-muted { color: #92400e; }
.dashboard-shell .hub-next-step-card {
  border: 1px solid #fcd34d;
  background: #fff7d6;
}
.dashboard-shell .hub-next-step-text { color: #78350f; }
.dashboard-shell .hub-step-circle {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}
.dashboard-shell .hub-step-circle--todo { background: rgba(15,23,42,0.08); color: var(--text-muted); }
.dashboard-shell .hub-step-circle--done { background: rgba(16,185,129,0.18); color: var(--success-text); }
.dashboard-shell .hub-step-label { display: block; font-weight: 700; }
.dashboard-shell .hub-step-sub { display: block; font-size: 12px; opacity: 0.85; }
.dashboard-shell .hub-onboarding-hidden {
  border: 1px dashed var(--border);
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard-shell .hub-flag-card--danger {
  background: rgba(254, 242, 242, 0.9);
  border-color: rgba(239, 68, 68, 0.35);
}
.dashboard-shell .hub-flag-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
  display: inline-block;
}
.dashboard-shell .hub-add-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: 110px;
  text-align: center;
}
.dashboard-shell .hub-add-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dashboard-shell .hub-glass-button {
  width: 100%;
  cursor: pointer;
  text-align: left;
  appearance: none;
  font: inherit;
}
.dashboard-shell button.hub-glass-button:hover {
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}
.dashboard-shell .btn--left { justify-content: flex-start !important; text-align: left !important; }

/* QR button inside dashboard overview */
.dashboard-shell .qr-btn {
  width: 40px;
  height: 40px;
  background: var(--text-main);
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.dashboard-shell .qr-panel {
  width: min(100%, 420px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-shell .qr-holder {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: min(62vh, 520px);
}

.dashboard-shell .qr-img {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  object-fit: contain;
}

/* --- Analytics bars --- */
.dashboard-shell .analytics-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  overflow: hidden;
}
.dashboard-shell .analytics-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

/* --- Billing cards (plans sheet) --- */
.dashboard-shell .billing-pending-card {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(255, 247, 237, 0.9);
}
.dashboard-shell .billing-eligibility-card--active {
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(236, 253, 245, 0.9);
}
.dashboard-shell .billing-eligibility-card--inactive {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(254, 242, 242, 0.9);
}

/* --- Profile rows & social preview --- */
.dashboard-shell .profile-row {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bg-body);
}
.dashboard-shell .profile-row--clickable { cursor: pointer; }
.dashboard-shell .profile-hero-card { border-color: rgba(238, 242, 255, 0.9); overflow: hidden; }
.dashboard-shell .profile-hero-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dashboard-shell .profile-hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--success);
  display: inline-block;
}
.dashboard-shell .profile-info-box {
  background: var(--bg-body);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  display: flex;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.dashboard-shell .profile-section-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-body);
  display: flex;
  align-items: center;
  gap: 12px;
}
.dashboard-shell .profile-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dashboard-shell .social-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
}
.dashboard-shell .social-preview {
  width: 240px;
  aspect-ratio: 9 / 16;
  background: #f1f5f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.dashboard-shell .social-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

/* --- Messaging UI --- */
.msg-thread {
  display: grid;
  gap: 20px;
}
.msg-thread__header {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, #dbe4f0);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--brand-primary) 12%, transparent) 0, transparent 42%),
    linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--bg-subtle) 70%, #ffffff) 100%);
}
.msg-thread__eyebrow,
.msg-list-item__eyebrow {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.msg-thread__header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.msg-thread__subject {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}
.msg-thread__status,
.msg-list-item__status {
  text-transform: capitalize;
}
.msg-thread__header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.msg-thread__meta-chip {
  min-width: 160px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.82);
}
.msg-thread__meta-chip strong {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.msg-thread__meta-chip span {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
}
.msg-thread__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}
.msg-thread__body::-webkit-scrollbar {
  width: 8px;
}
.msg-thread__body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}
.msg-thread__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.msg-thread__divider::before,
.msg-thread__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.28);
}
.msg-thread__item {
  display: flex;
  width: 100%;
}
.msg-thread__item--self {
  justify-content: flex-end;
}
.msg-thread__item--other {
  justify-content: flex-start;
}
.msg-thread__item-shell {
  max-width: min(100%, 34rem);
  display: grid;
  gap: 8px;
}
.msg-thread__item--self .msg-thread__item-shell {
  justify-items: end;
}
.msg-thread__item--other .msg-thread__item-shell {
  justify-items: start;
}
.msg-thread__item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.msg-thread__item--self .msg-thread__item-meta {
  justify-content: flex-end;
}
.msg-thread__item--other .msg-thread__item-meta {
  justify-content: flex-start;
}
.msg-role {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.msg-role--self {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-hover) 100%);
}
.msg-role--admin {
  color: color-mix(in srgb, var(--brand-primary) 78%, #0f172a);
  background: color-mix(in srgb, var(--brand-primary) 12%, #ffffff);
}
.msg-role--owner {
  color: var(--text-primary);
  background: color-mix(in srgb, #e2e8f0 70%, #ffffff);
}
.msg-thread__timestamp {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}
.msg-bubble {
  width: fit-content;
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid transparent;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}
.msg-bubble--self {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-hover) 100%);
  border-color: color-mix(in srgb, var(--brand-primary) 55%, #ffffff);
}
.msg-bubble--admin {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-primary) 18%, #ffffff);
}
.msg-bubble--owner {
  color: var(--text-primary);
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.35);
}
.msg-bubble__text {
  white-space: pre-wrap;
  line-height: 1.65;
  word-break: break-word;
}
.msg-bubble__attach {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.msg-bubble--admin .msg-bubble__attach,
.msg-bubble--owner .msg-bubble__attach {
  border-top-color: rgba(148, 163, 184, 0.22);
}
.msg-attach-link {
  max-width: 100%;
  text-decoration: none;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}
.msg-bubble--admin .msg-attach-link,
.msg-bubble--owner .msg-attach-link {
  background: rgba(255, 255, 255, 0.78);
}
.msg-attach-link__eyebrow {
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}
.msg-attach-link__name {
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.msg-thread__empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: color-mix(in srgb, var(--bg-subtle) 72%, #ffffff);
  color: var(--text-secondary);
  text-align: center;
}
.msg-thread__reply {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--bg-subtle) 78%, #ffffff) 100%);
}
.msg-thread__reply-head {
  display: grid;
  gap: 4px;
}
.msg-thread__reply-title {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-primary);
}
.msg-thread__reply-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.msg-reply-textarea {
  min-height: 96px;
  margin-bottom: 0;
  resize: vertical;
  font-family: inherit;
  border-radius: 16px;
}
.msg-reply-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.msg-reply-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.55);
  background: #ffffff;
  color: var(--text-primary);
  cursor: pointer;
}
.msg-reply-file input[type="file"] {
  display: none;
}
.msg-reply-file__cta {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}
.msg-reply-file__name {
  max-width: min(36vw, 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary);
}
.msg-reply-submit {
  min-width: 120px;
}

/* Dashboard messages list item */
.msg-inbox-list {
  display: grid;
  gap: 14px;
}
.msg-list-item {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  margin-bottom: 0;
  background:
    linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--bg-subtle) 68%, #ffffff) 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.msg-list-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--bg-subtle) 68%, #ffffff) 100%);
  transition: transform 140ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.msg-list-btn:hover {
  background:
    linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--brand-primary) 6%, #ffffff) 100%);
  border-color: color-mix(in srgb, var(--brand-primary) 24%, #dbe4f0);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.msg-list-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 65%, #ffffff 35%);
  outline-offset: 2px;
}

.btn--whatsapp {
  border-radius: 99px;
  padding: 4px 10px;
  color: #166534;
  background: #dcfce7;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
button.msg-list-item {
  width: 100%;
  cursor: pointer;
  text-align: left;
  appearance: none;
  font: inherit;
}
.msg-list-item__top,
.msg-list-item__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.msg-list-item__subject-wrap {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.msg-list-item__subject {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}
.msg-list-item__footer {
  align-items: center;
  flex-wrap: wrap;
}
.msg-list-item__timestamp {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.msg-list-item__action {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-primary);
}
.msg-back-wrap {
  margin-top: 12px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.msg-thread-card {
  border-radius: 20px;
}

@media (max-width: 640px) {
  .msg-thread__header,
  .msg-thread__reply,
  .msg-list-item {
    padding: 16px;
  }

  .msg-thread__header-row,
  .msg-list-item__top {
    flex-direction: column;
    align-items: stretch;
  }

  .msg-thread__header-meta {
    display: grid;
  }

  .msg-thread__meta-chip {
    min-width: 0;
  }

  .msg-thread__body {
    max-height: 42vh;
  }

  .msg-thread__item-shell {
    max-width: 100%;
  }

  .msg-reply-file,
  .msg-reply-submit {
    width: 100%;
  }

  .msg-reply-file {
    justify-content: space-between;
  }

  .msg-reply-file__name {
    max-width: 46vw;
  }
}

/* Public verified badge */
.verified-badge {
  border-radius: 999px;
  padding: 4px 10px;
  color: #166534;
  background: #dcfce7;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Generic card tones */
.card-tone--success { border: 1px solid rgba(16,185,129,0.35); background: rgba(236,253,245,0.9); }
.card-tone--danger { border: 1px solid rgba(239,68,68,0.35); background: rgba(254,242,242,0.9); }

/* Smaller ghost buttons (used for offer translation) */
.btn.btn--micro { height: 30px; padding: 0 10px; font-size: 11px; }

.u-mt24 { margin-top: 24px !important; }


/* Alert cards (CSP-safe replacement for inline styled notices) */
.alert-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.alert-card--warning {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(255, 247, 237, 0.9);
}

.alert-card--success {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(236, 253, 245, 0.9);
}

.alert-card--danger {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(254, 242, 242, 0.9);
}

/* Simple bars (use u-w{0..100} width utility classes) */
.bar-track {
  height: 6px;
  background: var(--bg-body);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.radius-14 { border-radius: 14px !important; }

.text-13 { font-size: 13px !important; }

.leading-15 { line-height: 1.5 !important; }

.text-tertiary { color: var(--text-tertiary) !important; }

/* Quantized min-height helpers (used to stabilize view transitions without inline styles) */
.minh-100 { min-height: 100px; }
.minh-200 { min-height: 200px; }
.minh-300 { min-height: 300px; }
.minh-400 { min-height: 400px; }
.minh-500 { min-height: 500px; }
.minh-600 { min-height: 600px; }
.minh-700 { min-height: 700px; }
.minh-800 { min-height: 800px; }
.minh-900 { min-height: 900px; }
.minh-1000 { min-height: 1000px; }
.minh-1100 { min-height: 1100px; }
.minh-1200 { min-height: 1200px; }
.minh-1300 { min-height: 1300px; }
.minh-1400 { min-height: 1400px; }
.minh-1500 { min-height: 1500px; }
.minh-1600 { min-height: 1600px; }
.minh-1700 { min-height: 1700px; }
.minh-1800 { min-height: 1800px; }
.minh-1900 { min-height: 1900px; }
.minh-2000 { min-height: 2000px; }
.minh-2100 { min-height: 2100px; }
.minh-2200 { min-height: 2200px; }
.minh-2300 { min-height: 2300px; }
.minh-2400 { min-height: 2400px; }

/* Mobile comfort tuning for Nepal-first handheld usage. */
@media (max-width: 767px) {
  .title.small {
    font-size: 1.1875rem;
  }

  .small,
  .inline-alert__body,
  .status-banner,
  .toast {
    font-size: 0.9375rem;
  }

  .x-small,
  .badge,
  .voice-status {
    font-size: 0.8125rem;
  }

  .label {
    font-size: 0.8125rem;
    margin-bottom: 8px;
  }

  .btn {
    padding: 12px 18px;
    font-size: 0.9375rem;
  }

  .btn.small,
  .btn-sm,
  .btn.btn--tiny {
    font-size: 0.875rem;
  }

  .header__lang .btn.lang-switch {
    min-height: 38px;
    height: 38px;
    padding: 0 12px;
    font-size: 0.8125rem;
    font-weight: 700;
  }

  .search-hero__support {
    font-size: 0.95rem;
  }

  .search-shortcuts {
    justify-content: flex-start;
  }

  .search-shortcut {
    font-size: 0.875rem;
    min-height: 46px;
  }

  .bottom-nav__item {
    gap: 5px;
    padding: 10px 0 8px;
    font-size: 0.78rem;
  }

  .bottom-nav__item::before {
    width: 48px;
    height: 32px;
  }

  .super-search {
    height: 60px;
    padding: 0 14px;
  }

  .super-mic {
    width: 48px;
    height: 48px;
  }

  .search-result-item {
    padding: 14px 12px;
  }

  .search-result-item__meta {
    gap: 8px;
    font-size: 0.9375rem;
  }

  .card,
  .state-card,
  .inline-alert,
  .status-banner,
  .logo-uploader {
    border-radius: 14px;
  }

  .logo-uploader {
    gap: 14px;
    padding: 18px;
  }

  .logo-uploader__preview {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
  }

  .logo-uploader__placeholder {
    font-size: 0.8125rem;
  }

  .table th {
    font-size: 0.75rem;
  }

  .table td {
    font-size: 0.9375rem;
  }

  .dashboard-shell .content-scroll {
    padding: 18px;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    padding-bottom: calc(var(--nav-height) + 22px + var(--safe-bottom));
  }

  .dashboard-shell .nav-pill {
    gap: 4px;
    padding: 8px 2px;
  }

  .dashboard-shell .nav-pill .icon-box {
    padding: 8px 14px;
  }

  .dashboard-shell .nav-pill .text-xs {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
    line-height: 1.15;
  }

  .dashboard-shell .offer-list-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dashboard-shell .offer-list-item__actions {
    width: 100%;
    justify-content: flex-start;
    overflow: visible;
  }

  .dashboard-shell .offer-icon-action {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    padding: 10px;
    font-size: 0.78rem;
  }

  .dashboard-shell .offer-list-item__state-inline {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  .admin-shell .glass-card {
    padding: 16px;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] {
    border: 0;
    background: transparent;
    margin-top: 0;
    overflow: visible;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table,
  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table tbody,
  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table tr,
  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td {
    display: block;
    width: 100%;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table thead {
    display: none;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table tbody {
    display: grid;
    gap: 12px;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table tbody tr {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--border) 72%, white);
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table tbody tr:hover {
    background: #ffffff;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td {
    padding: 0;
    border: 0;
    min-height: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td + td {
    margin-top: 10px;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td::before {
    content: attr(data-column-label);
    display: block;
    margin-bottom: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td.col-actions {
    margin-top: 14px;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td.col-actions::before {
    display: none;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td.col-actions .btn {
    width: 100%;
    min-height: 46px;
  }

  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table th.col-status,
  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td.col-status,
  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table th.col-actions,
  .admin-shell .os-table-wrap[data-mobile-cards="true"] .os-table td.col-actions {
    width: auto;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .card,
  .state-card {
    padding: 18px;
  }

  .header__lang {
    grid-template-columns: repeat(2, minmax(68px, 1fr));
  }

  .header__lang .btn.lang-switch {
    min-height: 40px;
    height: 40px;
    font-size: 0.875rem;
  }

  .voice-btn,
  .translate-btn {
    min-height: var(--touch-target);
  }

  .voice-btn {
    width: var(--touch-target);
    height: var(--touch-target);
  }

  .voice-btn svg {
    width: 18px;
    height: 18px;
  }

  .translate-btn {
    padding: 0 14px;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
  }

  .auth-card {
    max-width: 100%;
  }
}
