
  :root {
    --radius-card: 14px;
    --radius-pill: 999px;
  }

  [data-theme="green-dark"] {
    --bg-deep: #010c08;
    --bg-card: #021911;
    --bg-card-raised: #043322;
    --bg-pill: #06402b;
    --line: #1e5340;
    --text-1: #f3ead8;
    --text-2: #c9bfa9;
    --text-3: #8d9a8c;
    --accent: #f0c94e;
    --accent-dim: #c9a93f;
    --accent-text-on: #2b2208;
    --orange: #e07a3e;
    --orange-deep: #b85a26;
    --orange-text-on: #2b1503;
    --highlight: #8c3b3f;
    --highlight-soft: #160c0b;
    --highlight-border: #a8494e;
  }

  [data-theme="green-light"] {
    --bg-deep: #f2f5f4;
    --bg-card: #ffffff;
    --bg-card-raised: #e6ebe9;
    --bg-pill: #cdd8d4;
    --line: #9bb2aa;
    --text-1: #021911;
    --text-2: #06402b;
    --text-3: #50796a;
    --accent: #06402b;
    --accent-dim: #043322;
    --accent-text-on: #ffffff;
    --orange: #c9602a;
    --orange-deep: #a04c20;
    --orange-text-on: #ffffff;
    --highlight: #8c3b3f;
    --highlight-soft: #fbeceb;
    --highlight-border: #8c3b3f;
  }

  [data-theme="red-dark"] {
    --bg-deep: #1c0507;
    --bg-card: #2a0a0e;
    --bg-card-raised: #3a0f14;
    --bg-pill: #4a0a12;
    --line: #5c1620;
    --text-1: #f8f3ec;
    --text-2: #d9b8b8;
    --text-3: #a37070;
    --accent: #c9a84c;
    --accent-dim: #b08f3a;
    --accent-text-on: #2b2208;
    --orange: #e4c97a;
    --orange-deep: #c9a84c;
    --orange-text-on: #2b1f04;
    --highlight: #6b0f1a;
    --highlight-soft: #2a0a0e;
    --highlight-border: #8b1520;
  }

  [data-theme="red-light"] {
    --bg-deep: #f8f3ec;
    --bg-card: #ffffff;
    --bg-card-raised: #f5e6c0;
    --bg-pill: #f0dca8;
    --line: #e4c97a;
    --text-1: #1c0507;
    --text-2: #7a4040;
    --text-3: #b08080;
    --accent: #6b0f1a;
    --accent-dim: #4a0a12;
    --accent-text-on: #ffffff;
    --orange: #8b1520;
    --orange-deep: #6b0f1a;
    --orange-text-on: #ffffff;
    --highlight: #6b0f1a;
    --highlight-soft: #f5e6c0;
    --highlight-border: #6b0f1a;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--bg-deep);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-1);
    display: flex;
    justify-content: center;
    padding: 24px 12px 60px;
    transition: background 0.2s, color 0.2s;
  }

  html[dir="rtl"] body, [data-lang="ku"] body, [data-lang="ar"] body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  }

  .serif { font-family: Georgia, 'Times New Roman', serif; }
  [data-lang="ku"] .serif, [data-lang="ar"] .serif { font-family: 'Vazirmatn', Georgia, serif; }

  .phone {
    width: 100%;
    max-width: 390px;
    background: var(--bg-deep);
    border-radius: 28px;
    border: 1px solid var(--line);
    overflow: hidden;
  }

  @media (min-width: 640px) {
    body { padding: 40px 24px 80px; align-items: flex-start; }
    .phone { max-width: 900px; border-radius: 20px; }
    .header { padding: 32px 36px 20px; }
    .title { font-size: 30px; }
    .badge-flame { width: 72px; height: 72px; font-size: 34px; }
    .search-wrap { padding: 18px 36px 0; max-width: 440px; }
    html[dir="ltr"] .search-wrap i { left: 50px; }
    html[dir="rtl"] .search-wrap i { right: 50px; }
    .cats { padding: 20px 36px 16px; gap: 22px; }
    .cat-btn { width: 76px; }
    .cat-img { width: 68px; height: 68px; font-size: 28px; }
    .cat-label { font-size: 12.5px; }
    .menu-list { padding: 0 36px 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .item-icon { height: 150px; font-size: 28px; }
    .cart-bar { padding: 0 36px 24px; display: flex; justify-content: flex-end; }
    .cart-bar-btn { max-width: 360px; }
    .cart-panel { padding: 0 36px 28px; display: flex; justify-content: flex-end; }
    .cart-card { width: 100%; max-width: 360px; }
  }

  @media (min-width: 1024px) {
    .phone { max-width: 1140px; }
    .menu-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }

  input[type="text"] {
    width: 100%;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-card);
    color: var(--text-1);
    padding: 0 14px;
    font-size: 14px;
    outline: none;
  }
  html[dir="ltr"] input[type="text"] { padding-left: 38px; }
  html[dir="rtl"] input[type="text"] { padding-right: 38px; }
  input[type="text"]::placeholder { color: var(--text-3); }
  input[type="text"]:focus { border-color: var(--accent-dim); }

  button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-1);
  }
  button:active { transform: scale(0.97); }

  .header { padding: 22px 20px 14px; border-bottom: 1px solid var(--line); }
  .header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
  .header-top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .loc-label { font-size: 11px; letter-spacing: 0.04em; color: var(--text-3); text-transform: uppercase; }
  .loc-value { font-size: 13px; color: var(--text-2); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
  .badge-flame {
    width: 58px; height: 58px; border-radius: 50%;
    background: var(--highlight-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--orange);
    font-size: 28px;
    border: 1px solid var(--highlight);
    flex-shrink: 0;
  }
  .icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-1);
    flex-shrink: 0;
    font-size: 18px;
  }
  .title { font-size: 24px; font-weight: 400; color: var(--text-1); margin-bottom: 4px; }
  .meta-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
  .meta-row span { display: flex; align-items: center; gap: 4px; }
  .meta-row .dot { color: var(--line); }
  .meta-row .open { color: var(--accent); }

  .search-wrap { position: relative; padding: 14px 20px 0; }
  html[dir="ltr"] .search-wrap i { position: absolute; left: 34px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 16px; }
  html[dir="rtl"] .search-wrap i { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 16px; }

  .cats { display: flex; gap: 16px; padding: 16px 20px 14px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cat-btn { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; }
  .cat-img {
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 2px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    color: var(--text-1);
    overflow: hidden;
  }
  .cat-label { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
  .cat-btn.active .cat-img { border-color: var(--accent); }
  .cat-btn.active .cat-label { color: var(--accent); font-weight: 600; }

  .menu-list { padding: 0 20px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .item-card {
    display: flex; flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 12px;
    min-width: 0;
  }
  .item-icon {
    width: 100%; height: 120px;
    border-radius: 10px;
    background: var(--bg-card-raised);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    color: var(--orange);
    margin-bottom: 10px;
    overflow: hidden;
  }
  .item-info { min-width: 0; margin-bottom: 10px; }
  .item-name { font-size: 13.5px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; line-height: 1.3; }
  .item-desc {
    font-size: 11.5px; color: var(--text-3); line-height: 1.4; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .item-price { font-size: 13px; font-weight: 600; color: var(--accent); }

  .item-card-foot { display: flex; align-items: center; justify-content: flex-end; }
  .qty-controls { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
  .round-btn { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; }
  .add-btn {
    background: var(--orange); color: var(--orange-text-on);
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
  }
  .minus-btn, .plus-btn { background: var(--bg-card-raised); border: 1px solid var(--line); color: var(--text-1); }
  .qty-num { font-size: 13px; font-weight: 600; min-width: 14px; text-align: center; }

  .cart-bar { position: sticky; bottom: 0; padding: 0 20px 18px; margin-top: 4px; }
  .cart-bar-btn {
    width: 100%;
    background: var(--highlight);
    border: 1px solid var(--highlight-border);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; font-weight: 600;
    color: var(--text-1);
  }
  [data-theme="green-light"] .cart-bar-btn, [data-theme="red-light"] .cart-bar-btn { color: #ffffff; }
  .cart-bar-left { display: flex; align-items: center; gap: 10px; }
  .cart-count {
    background: var(--accent); color: var(--accent-text-on);
    border-radius: 50%; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
  }

  .cart-panel { display: none; padding: 0 20px 20px; }
  .cart-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
  .cart-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .cart-card-head h2 { font-size: 17px; font-weight: 600; color: var(--text-1); }
  .close-btn { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-2); }

  .cart-item-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
  .cart-item-name { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
  .cart-item-sub { font-size: 12px; color: var(--text-3); }
  .cart-item-total { font-size: 14px; font-weight: 600; color: var(--accent); }

  .cart-empty { text-align: center; padding: 28px 0; color: var(--text-3); font-size: 14px; }

  .summary { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
  .summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }
  .summary-total {
    display: flex; justify-content: space-between;
    font-size: 16px; font-weight: 700; color: var(--text-1);
    padding-top: 10px; margin-top: 4px;
    border-top: 1px solid var(--line);
  }
  .summary-total .val { color: var(--accent); }

  .checkout-btn {
    width: 100%; margin-top: 16px;
    background: var(--accent); color: var(--accent-text-on);
    border-radius: 12px; padding: 14px;
    font-size: 14px; font-weight: 700;
  }

  .badge-pop {
    display: inline-block;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.03em;
    background: var(--bg-pill); color: var(--orange);
    border: 1px solid var(--orange-deep);
    padding: 2px 7px; border-radius: var(--radius-pill);
    margin-top: 4px;
  }

  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-overlay.open { display: flex; }
  .settings-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    width: 100%;
    max-width: 360px;
    max-height: 85vh;
    overflow-y: auto;
  }
  .settings-section { margin-bottom: 18px; }
  .settings-section:last-child { margin-bottom: 0; }
  .settings-label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
  .lang-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lang-btn {
    border: 1px solid var(--line);
    background: var(--bg-card-raised);
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 13px;
    text-align: center;
  }
  .lang-btn.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
  .theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .theme-btn {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    display: flex; align-items: center; gap: 8px;
  }
  .theme-btn.active { border-color: var(--accent); border-width: 2px; }
  .theme-swatch { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--line); }
  .theme-btn span { font-size: 12.5px; }
  .mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mode-btn {
    border: 1px solid var(--line);
    background: var(--bg-card-raised);
    border-radius: 10px;
    padding: 9px 6px;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .mode-btn.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }

  .onboard-overlay {
    width: 100%;
    max-width: 390px;
    background: var(--bg-deep);
    border-radius: 28px;
    border: 1px solid var(--line);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
  }
  .onboard-flame {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--highlight-soft);
    border: 1px solid var(--highlight);
    color: var(--orange);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 18px;
  }
  .onboard-title { font-size: 19px; font-weight: 500; text-align: center; margin-bottom: 4px; }
  .onboard-sub { font-size: 13px; color: var(--text-2); text-align: center; margin-bottom: 26px; }
  .onboard-section { margin-bottom: 22px; }
  .onboard-section:last-of-type { margin-bottom: 28px; }
  .onboard-continue {
    width: 100%;
    background: var(--accent); color: var(--accent-text-on);
    border-radius: 12px;
    padding: 14px;
    font-size: 14px; font-weight: 700;
  }
  .onboard-continue:disabled { opacity: 0.45; cursor: not-allowed; }

  @media (min-width: 640px) {
    .onboard-overlay { max-width: 420px; padding: 40px 32px; }
  }

  /* ---- Table bar & call waiter button ---- */
  .table-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-card-raised);
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-1);
  }

  .table-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
  }

  .table-bar-label strong {
    color: var(--text-1);
    font-size: 15px;
  }

  .call-waiter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: var(--accent-text-on);
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-family: inherit;
  }

  .call-waiter-btn:active {
    transform: scale(0.96);
  }

  .call-waiter-btn.calling {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .call-waiter-btn.called {
    background: var(--bg-card-raised);
    color: var(--text-2);
    border: 1px solid var(--line);
  }

  @keyframes bell-ring {
    0%,100% { transform: rotate(0deg); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
  }

  .call-waiter-btn .ti-bell.ringing {
    animation: bell-ring 0.5s ease;
  }
