:root {
  --bg: #FFF8F2;
  --surface: #FFFFFF;
  --text: #3B2A26;
  --muted: #7A6660;
  --border: #EADBD3;
  --primary: #B83A63;
  --primary-hover: #9E2F54;
  --primary-soft: #FBE3EA;
  --brand-bg: #F9E1E2;
  --brand-bg-2: #FCEBDD;
  --error: #C62828;
  --warn-bg: #FFF4D6;
  --warn-text: #7A5A00;
  --info-bg: #E8F3FF;
  --info-text: #1F4E79;
  --focus: 0 0 0 3px rgba(184, 58, 99, 0.25);
  --radius: 14px;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  /* Status colors (fixed, from PRD) */
  --status-new: #F5C542;
  --status-prep: #F39C4A;
  --status-delivered: #3FA36B;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.page {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .page { grid-template-columns: 1.05fr 1fr; }
}

/* ---------- Language toggle ---------- */
.lang-toggle {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 2;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
}
.lang-toggle:hover { border-color: var(--primary); color: var(--primary); }
.lang-toggle:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Brand panel ---------- */
.brand {
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.7) 0 40px, transparent 41px),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,0.5) 0 70px, transparent 71px),
    linear-gradient(160deg, var(--brand-bg), var(--brand-bg-2));
  padding: 56px 16px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand-inner { max-width: 420px; }

.brand-logo {
  width: 64px;
  height: 64px;
  background: var(--surface);
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(184, 58, 99, 0.18);
}

.brand-name {
  margin: 14px 0 6px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.brand-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.brand-features { display: none; }

@media (min-width: 900px) {
  .brand { padding: 48px; }
  .brand-inner { text-align: start; }
  .brand-logo { width: 84px; height: 84px; border-radius: 24px; }
  .brand-name { font-size: 38px; margin-top: 22px; }
  .brand-tagline { font-size: 18px; }

  .brand-features {
    display: grid;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 32px 0 0;
  }
  .brand-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 500;
  }
}

.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot-yellow { background: var(--status-new); }
.dot-orange { background: var(--status-prep); }
.dot-green { background: var(--status-delivered); }

/* ---------- Auth card ---------- */
.auth {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 16px 32px;
}

@media (min-width: 900px) {
  .auth { align-items: center; padding: 72px 48px 48px; }
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 20px;
  padding: 24px 20px;
  margin-top: -16px;
  box-shadow: 0 10px 30px rgba(59, 42, 38, 0.08);
  border: 1px solid var(--border);
}

@media (min-width: 900px) {
  .card { padding: 36px 32px; margin-top: 0; }
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 0;
  border-radius: 9px;
  font-weight: 500;
}
.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(59, 42, 38, 0.1);
}
.tab:focus-visible { outline: none; box-shadow: var(--focus); }

.card-title {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color .15s, border-color .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .6; cursor: default; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 0;
  margin-top: 8px;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-google {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-google:hover { border-color: var(--primary); background: var(--primary-soft); }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--primary);
  font-weight: 500;
  font-size: 14px;
}
.link:hover { text-decoration: underline; }
.link:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin: 18px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Form fields ---------- */
.field { margin-bottom: 14px; }

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  color: var(--text);
  background: var(--surface);
  text-align: start;
}
html[dir="rtl"] input[dir="ltr"] { text-align: right; }
input::placeholder, textarea::placeholder { color: #B8A7A0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error); }
textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A6660' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-inline-end: 36px;
}
html[dir="ltr"] select { background-position: right 14px center; }

.password-wrap { position: relative; }
.password-wrap input { padding-inline-end: 48px; }

.eye {
  position: absolute;
  top: 50%;
  inset-inline-end: 6px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.eye.on { color: var(--primary); }
.eye:focus-visible { outline: none; box-shadow: var(--focus); }

.error {
  margin: 4px 0 0;
  min-height: 0;
  color: var(--error);
  font-size: 13px;
}
.error:empty { display: none; }

.notice {
  margin: 4px 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  background: var(--info-bg);
  color: var(--info-text);
}
.notice[data-kind="warn"] { background: var(--warn-bg); color: var(--warn-text); }

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

.price-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* =========================================================
   App screens (home, order form)
   ========================================================= */
body.app { background: var(--bg); }

.muted { color: var(--muted); }
.flip-rtl { transform: none; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 248, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-inline { position: static; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

a.btn { text-decoration: none; }

.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px dashed var(--primary);
}
.btn-outline:hover { background: var(--primary-soft); }

.link-danger { color: var(--error); }

/* ---------- Order form ---------- */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.section-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
}

.grid-2, .grid-3 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.field-wide { grid-column: 1 / -1; }
.opt { color: var(--muted); font-weight: 400; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 4px;
}
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented label {
  margin: 0;
  text-align: center;
  padding: 10px 0;
  border-radius: 9px;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
}
.segmented input:checked + label {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(59, 42, 38, 0.1);
}
.segmented input:focus-visible + label { box-shadow: var(--focus); }
.segmented + .error { margin-bottom: 8px; }
.segmented ~ .grid-2 { margin-top: 12px; }

.items { display: grid; gap: 12px; margin-bottom: 12px; }
.items:empty { display: none; }

.item-card {
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--primary);
  border-radius: 12px;
  padding: 12px 14px;
  background: #FFFCFA;
}
.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.item-title { margin: 0; font-size: 16px; font-weight: 600; }
.item-fields { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .item-fields { grid-template-columns: 1fr 1fr; } }

.tier-colors { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tier-row { display: flex; align-items: center; gap: 8px; }
.tier-label { margin: 0; white-space: nowrap; font-weight: 400; color: var(--muted); }

.product-picker {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.picker-title { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 40px;
  font-weight: 500;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip:focus-visible { outline: none; box-shadow: var(--focus); }

.remaining {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 4px;
}
.remaining-value { font-size: 18px; color: var(--primary); direction: ltr; }

.form-footer {
  position: sticky;
  bottom: 0;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.form-footer .btn-primary { margin-top: 0; }
.form-error { margin: 0 0 8px; color: var(--error); font-size: 14px; text-align: center; }
.form-error:empty { display: none; }

/* ---------- Status colors (fixed, PRD) ---------- */
.status-new       { --st-bg: #FFF3C4; --st-fg: #7A5A00; --st-accent: #F5C542; }
.status-confirmed { --st-bg: #DCEBFF; --st-fg: #1F4E9A; --st-accent: #4A8FE7; }
.status-prep      { --st-bg: #FFE6D2; --st-fg: #8A4300; --st-accent: #F39C4A; }
.status-ready     { --st-bg: #EDE3FF; --st-fg: #5B3A9E; --st-accent: #9B6BE0; }
.status-delivered { --st-bg: #DDF3E5; --st-fg: #1E6B40; --st-accent: #3FA36B; }
.status-cancelled { --st-bg: #FDE2E2; --st-fg: #A32121; --st-accent: #E05252; }

.status-pill[data-status="new"]       { background-color: #FFF3C4; color: #7A5A00; }
.status-pill[data-status="confirmed"] { background-color: #DCEBFF; color: #1F4E9A; }
.status-pill[data-status="prep"]      { background-color: #FFE6D2; color: #8A4300; }
.status-pill[data-status="ready"]     { background-color: #EDE3FF; color: #5B3A9E; }
.status-pill[data-status="delivered"] { background-color: #DDF3E5; color: #1E6B40; }
.status-pill[data-status="cancelled"] { background-color: #FDE2E2; color: #A32121; }

select.status-pill {
  width: auto;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 4px 12px;
  padding-inline-end: 30px;
  font-size: 14px;
  font-weight: 600;
  background-position: left 10px center;
  flex: none;
}
html[dir="ltr"] select.status-pill { background-position: right 10px center; }
select.status-pill-lg { min-height: 42px; font-size: 15px; padding-inline-start: 16px; }

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.status-row label { margin: 0; }

/* ---------- Weekly list ---------- */
.btn-sm { width: auto; min-height: 38px; padding: 0 16px; font-size: 15px; margin: 0; }
.mobile-only { display: none; }
@media (max-width: 639px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: grid; }
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 12px;
}
.week-nav .icon-btn { border: 1px solid var(--border); background: var(--surface); }
.week-label {
  flex: 1;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 8px;
}
.week-label strong { font-size: 17px; direction: ltr; unicode-bidi: isolate; }
.week-label .muted { font-size: 14px; }
.week-label .link { flex-basis: 100%; order: 3; }

.week { display: grid; gap: 14px; }
.week[aria-busy="true"] .day { opacity: .6; }

.day-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.day-date { color: var(--muted); font-weight: 400; font-size: 14px; }
.today-badge {
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 1px 10px;
  align-self: center;
}
.day.is-today .day-name { color: var(--primary); }
.day.is-past .day-head { color: var(--muted); }
.empty-day {
  margin: 0;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 14px;
}

.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 5px solid var(--st-accent, var(--border));
  border-radius: 12px;
  padding: 6px 10px;
  padding-inline-start: 4px;
}
.order-row:hover { border-color: var(--primary); border-inline-start-color: var(--st-accent); }
.order-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}
.order-link:focus-visible { outline: none; box-shadow: var(--focus); }
.order-time {
  min-width: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  direction: ltr;
  text-align: center;
}
.order-main { flex: 1; display: grid; min-width: 0; }
.order-name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-sub { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.allergy-badge {
  justify-self: start;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--error);
  background: #FDECEC;
  border-radius: 6px;
  padding: 1px 8px;
}
.order-row.is-closed .order-name,
.order-row.is-closed .order-sub { opacity: .65; }
.order-row.status-cancelled .order-name { text-decoration: line-through; }

/* ---------- Reminder banner ---------- */
.reminder {
  background: #FFF4D6;
  border: 1px solid #F5D98A;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: #6B4E00;
}
.reminder-head { display: flex; align-items: center; gap: 8px; }
.reminder-list { margin: 6px 0 0; padding-inline-start: 28px; }
.reminder-list a { color: inherit; }

/* ---------- Floating "new order" button (mobile) ---------- */
.fab {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  inset-inline-end: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  place-items: center;
  box-shadow: 0 8px 20px rgba(184, 58, 99, 0.35);
  z-index: 10;
}
.fab:active { transform: scale(.96); }
.fab:focus-visible { outline: none; box-shadow: var(--focus), 0 8px 20px rgba(184, 58, 99, 0.35); }
body.app .container { padding-bottom: 96px; }

.account {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

/* ---------- Settings ---------- */
.section-hint { margin: -6px 0 14px; font-size: 14px; }
.label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.logo-row { display: flex; align-items: center; gap: 16px; }
.logo-preview {
  width: 88px; height: 88px; flex: none;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  overflow: hidden;
}
.logo-preview.empty { border-style: dashed; background: var(--bg); }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: grid; gap: 8px; justify-items: start; }
.file-btn { position: relative; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { box-shadow: var(--focus); }

.btn-outline-solid {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
  gap: 6px;
}
.btn-outline-solid:hover { background: var(--primary-soft); }

/* ---------- Summary page ---------- */
body.summary-page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.summary-notice { margin: 10px 16px 0; }
.summary-notice .link { margin-inline-start: 4px; }
.summary-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.summary-scaler { position: absolute; transform-origin: 0 0; }
.summary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.summary-actions .btn { margin: 0; font-size: 15px; padding: 0 10px; }
.btn-whatsapp { background: #25D366; color: #fff; border: 0; }
.btn-whatsapp:hover:not(:disabled) { background: #1EBE5A; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  z-index: 20;
  text-align: center;
}

/* The card itself: fixed 360px design, rendered to an image as-is. */
.summary-card {
  width: 360px;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 20px 20px 16px;
  font-family: var(--font);
  color: #3B2A26;
  box-shadow: 0 10px 30px rgba(59, 42, 38, 0.12);
  font-size: 14px;
  line-height: 1.45;
}
.sc-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px solid #FBE3EA;
}
.sc-logo { width: 52px; height: 52px; object-fit: contain; }
.sc-biz { font-size: 20px; font-weight: 700; color: #B83A63; }
.sc-title { text-align: center; margin: 12px 0 10px; }
.sc-title h2 { margin: 0; font-size: 13px; font-weight: 500; color: #7A6660; letter-spacing: .02em; }
.sc-customer { font-size: 18px; font-weight: 600; }

.summary-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.summary-card dt { color: #7A6660; }
.summary-card dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.sc-facts { background: #FFF8F2; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.sc-items { display: grid; gap: 8px; margin-bottom: 10px; }
.sc-item { border: 1px solid #EADBD3; border-inline-start: 4px solid #B83A63; border-radius: 10px; padding: 8px 12px; }
.sc-item h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.sc-item dl { font-size: 13px; }

.sc-allergies {
  background: #FDECEC;
  color: #A32121;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.sc-money { border-top: 1px dashed #EADBD3; padding-top: 8px; }
.sc-money dd { text-align: end; direction: ltr; }
html[dir="rtl"] .sc-money dd { text-align: left; }
.sc-money .sc-due { font-size: 16px; font-weight: 700; color: #B83A63; padding-top: 4px; }

.sc-foot { margin: 12px 0 0; text-align: center; font-size: 12px; color: #7A6660; }

/* ---------- Product catalog ---------- */
.picker-manage { display: inline-block; margin-top: 10px; font-size: 14px; }

.settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.settings-link > span { display: grid; gap: 2px; }
.settings-link .muted { font-size: 14px; }
.settings-link:hover { border-color: var(--primary); }

.product-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.product-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--primary);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
}
.product-row:hover { border-color: var(--primary); }
.product-main { flex: 1; display: grid; min-width: 0; }
.product-main .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: var(--muted); flex: none; }

.field-editors { display: grid; gap: 12px; margin-bottom: 12px; }
.field-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px 4px;
  background: #FFFCFA;
}
.fe-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.fe-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 600;
}
.fe-actions { display: flex; gap: 4px; }
.icon-btn.small {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  padding: 0;
}
.icon-btn.small:disabled { opacity: .35; cursor: default; }
.icon-btn.small.danger { color: var(--error); }
.fe-note { font-size: 13px; margin: 0 0 10px; }

.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; margin: 0 0 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--primary); }

.delete-product { display: block; margin: 8px auto 4px; }

/* "Other" free-text input under a select */
.other-input { margin-top: 8px; }

/* ---------- Week / month switch ---------- */
.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin: 0 auto 14px;
  max-width: 280px;
}
.view-switch a {
  text-align: center;
  padding: 8px 0;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.view-switch a[aria-current="page"] { background: var(--primary); color: #fff; }
.view-switch a:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Monthly calendar ---------- */
.month-label { direction: inherit; }
.cal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  margin-bottom: 16px;
}
.cal[aria-busy="true"] .cal-grid { opacity: .6; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekdays span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-cell {
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--bg);
  padding: 4px 3px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  text-align: start;
  color: var(--text);
  overflow: hidden;
}
.cal-cell:hover { border-color: var(--border); }
.cal-cell:focus-visible { outline: none; box-shadow: var(--focus); }
.cal-cell.is-other { opacity: .45; }
.cal-cell.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.cal-num { font-size: 13px; font-weight: 600; line-height: 1; padding: 2px 3px; align-self: flex-start; border-radius: 999px; }
.cal-cell.is-today .cal-num { background: var(--primary); color: #fff; padding: 3px 6px; }
.cal-chips { display: grid; gap: 2px; min-width: 0; }
.cal-chip {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  border-radius: 4px;
  padding: 1px 4px;
  background: var(--st-bg);
  color: var(--st-fg);
  border-inline-start: 3px solid var(--st-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-more { font-size: 11px; color: var(--muted); padding: 0 4px; }

/* On phones, chips become colored dots */
@media (max-width: 639px) {
  .cal { padding: 6px 4px; }
  .cal-cell { min-height: 52px; align-items: center; }
  .cal-num { align-self: center; }
  .cal-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-chip { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; font-size: 0; background: var(--st-accent); }
  .cal-more { font-size: 10px; padding: 0; line-height: 8px; }
}
@media (min-width: 640px) { .cal-cell { min-height: 92px; } }

.cal-day .day-head { margin-top: 4px; }
.cal-day .order-list { margin-bottom: 10px; }
.cal-add { margin-top: 10px; }
.cal-more { direction: ltr; unicode-bidi: isolate; }

/* ---------- Install guide ---------- */
.install { max-width: 520px; padding-top: 32px; }
.install-head { text-align: center; margin-bottom: 18px; }
.install-icon { border-radius: 22px; box-shadow: 0 8px 20px rgba(184, 58, 99, 0.18); }
.install-head h1 { margin: 14px 0 6px; font-size: 24px; }
.install-head p { margin: 0; }
.install-done { text-align: center; font-weight: 500; }
.install-tabs button {
  border: 0;
  background: transparent;
  padding: 8px 0;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 500;
}
.install-tabs button[aria-selected="true"] { background: var(--primary); color: #fff; }
.install-tabs { grid-template-columns: repeat(3, 1fr); max-width: 360px; }
.install-os .notice p { margin: 0 0 8px; }
.install-btn { margin-bottom: 14px; }
.install-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.install-steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
}
.install-steps li::before {
  content: counter(step);
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}
.install-steps li > span:first-child { flex: 1; }
.step-icon { flex: none; }
.kebab { font-size: 26px; font-weight: 700; line-height: 1; width: 26px; text-align: center; }
.install-actions { margin-top: 24px; text-align: center; }
.install-later { font-size: 13px; margin: 10px 0 0; }

/* Install guide: mock browser address bar showing where the install icon is */
.install-steps li.step-with-figure { flex-wrap: wrap; }
.install-steps li.step-with-figure > span:first-child { flex: 1 1 calc(100% - 50px); }
.addr-mock {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 42px;
  background: #F1F3F4;
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
  color: #5F6368;
  font-size: 13px;
  min-width: 0;
}
.addr-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #202124; }
.addr-install {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: #3C4043;
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary);
  flex: none;
}
.step-note { flex: 1 1 100%; margin-inline-start: 42px; font-size: 13px; }

/* ---------- Bottom sheet dialog (add to calendar) ---------- */
dialog.sheet {
  border: 0;
  border-radius: 20px;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 24px));
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
dialog.sheet::backdrop { background: rgba(59, 42, 38, .45); }
@media (max-width: 639px) {
  dialog.sheet { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; }
}
.sheet-hint { font-size: 14px; margin: 0 0 12px; }
.sheet-option {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  color: var(--text);
}
.sheet-option:hover { border-color: var(--primary); }
.sheet-option:focus-visible { outline: none; box-shadow: var(--focus); }
.sheet-option .muted { font-size: 13px; }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; line-height: 1.7; }
.legal article h2 { font-size: 20px; margin: 28px 0 8px; }
.legal article p, .legal article li { font-size: 16px; color: var(--text); }
.legal article ul { padding-inline-start: 22px; margin: 8px 0; }
.legal article li { margin-bottom: 6px; }
.legal-updated { color: var(--muted); font-size: 14px !important; }
.legal-note { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.legal-note .link { font-size: 13px; }

/* Choice buttons (select shown as buttons, e.g. number cake toppings) */
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-group input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice {
  margin: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 18px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
}
.choice:hover { border-color: var(--primary); }
.choice-group input:checked + .choice { background: var(--primary); border-color: var(--primary); color: #fff; }
.choice-group input:focus-visible + .choice { box-shadow: var(--focus); }

/* Cholov Yisroel */
.milk-check { margin-top: 12px; }
.milk-badge {
  justify-self: start;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #1F4E9A;
  background: #DCEBFF;
  border-radius: 6px;
  padding: 1px 8px;
}
.order-main .allergy-badge + .milk-badge { margin-top: 3px; }
.sc-milk { background: #DCEBFF; color: #1F4E9A; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-weight: 600; }
.sc-notes { margin: 6px 0 0; font-size: 13px; color: #5A4640; }
