:root {
  color-scheme: only light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202522;
  background: #F6F7F3;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.topbar {
  min-height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #DDE3DD;
}
.brand { font-weight: 750; text-decoration: none; }
nav { display: flex; gap: 18px; align-items: center; }
nav a, .link-button { text-decoration: none; font: inherit; color: #6B746F; }
.inline-form { display: inline-flex; margin: 0; }
.link-button { border: 0; background: none; cursor: pointer; padding: 0; }
.page { width: min(1180px, calc(100% - 32px)); margin: 36px auto; }
.hero-card, .panel, .auth-card {
  background: #fff;
  border: 1px solid #DDE3DD;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}
.auth-card { max-width: 430px; margin: 70px auto; }
.form-panel { max-width: 720px; margin-inline: auto; }
.item-form-panel { max-width: 900px; }
h1 { margin: 4px 0 12px; font-size: clamp(28px, 5vw, 42px); }
h2 { margin: 10px 0 6px; font-size: 20px; }
p { line-height: 1.55; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; color: #6B746F; }
.muted { color: #6B746F; }
.small { font-size: 13px; }
label { display: grid; gap: 7px; margin-top: 18px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  border: 1px solid #D4DDD6;
  border-radius: 11px;
  padding: 12px 13px;
  color: #1F4D3A;
  background: #fff;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(17, 24, 39, .12); border-color: #1F4D3A; }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.checkbox-label { display: flex; align-items: center; gap: 9px; }
.primary-button, .secondary-button, .danger-button {
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}
.primary-button { margin-top: 22px; border: 0; background: #1F4D3A; color: #fff; }
.secondary-button { border: 1px solid #D4DDD6; background: #fff; color: #3F4943; }
.danger-button { border: 1px solid #fecaca; background: #fff; color: #b91c1c; }
.button-link { display: inline-flex; align-items: center; justify-content: center; }
.no-margin { margin-top: 0; }
.form-actions, .card-actions, .filter-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.placeholder-box { margin-top: 24px; padding: 18px; border-radius: 12px; background: #F8F9F6; border: 1px dashed #C9D3CB; }
.flash { max-width: 760px; margin: 0 auto 16px; padding: 12px 14px; border-radius: 10px; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-success { background: #DCE8E1; color: #1F4D3A; }
.flash-warning { background: #E8EEE9; color: #315C4A; }
.field-error { color: #b91c1c; font-size: 14px; margin: 5px 0 0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.stats-grid, .action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.stat-card, .action-card { border: 1px solid #DDE3DD; border-radius: 14px; padding: 18px; text-decoration: none; background: #fff; }
.stat-card { display: grid; gap: 8px; }
.stat-card span, .action-card span { color: #6B746F; line-height: 1.45; }
.stat-card strong { font-size: 30px; }
.action-card { display: grid; gap: 8px; }
.action-card:hover, .stat-card:hover { border-color: #89938D; }
.action-card-disabled { background: #F8F9F6; opacity: .7; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid #DDE3DD; text-align: left; vertical-align: middle; }
th { color: #6B746F; font-size: 13px; }
.actions-cell { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.row-muted { opacity: .62; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; background: #E9F0EB; color: #315C4A; padding: 5px 9px; font-size: 12px; font-weight: 750; }
.badge-success { background: #DCE8E1; color: #1F4D3A; }
.badge-muted { background: #EEF2EE; color: #6B746F; }
.empty-state { padding: 32px; text-align: center; color: #6B746F; border: 1px dashed #C9D3CB; border-radius: 14px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.filter-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; align-items: end; padding: 18px; background: #F8F9F6; border-radius: 14px; margin-bottom: 22px; }
.filter-grid label { margin-top: 0; }
.filter-actions { margin-top: 0; }
.item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.item-card { overflow: hidden; border: 1px solid #DDE3DD; border-radius: 15px; background: #fff; }
.item-card-inactive { opacity: .65; }
.item-photo { height: 190px; display: grid; place-items: center; background: #EEF2EE; color: #89938D; }
.item-photo a, .item-photo img { width: 100%; height: 100%; display: block; }
.item-photo img { object-fit: cover; }
.item-card-body { padding: 16px; }
.item-card-head { display: flex; gap: 6px; flex-wrap: wrap; }
.item-meta { margin: 3px 0; color: #6B746F; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-editor { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; margin-top: 20px; }
.photo-editor img { width: 180px; height: 180px; border-radius: 14px; object-fit: cover; border: 1px solid #DDE3DD; }
.photo-fields label { margin-top: 0; }
@media (max-width: 900px) {
  .stats-grid, .action-grid, .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; align-items: flex-start; gap: 12px; }
  nav { gap: 10px; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
  .page { margin-top: 20px; }
  .hero-card, .panel, .auth-card { padding: 20px; border-radius: 14px; }
  .page-heading { display: grid; }
  .stats-grid, .action-grid, .item-grid, .filter-grid, .two-columns { grid-template-columns: 1fr; }
  .photo-editor { grid-template-columns: 1fr; }
  .photo-editor img { width: 100%; height: 240px; }
  .actions-cell { min-width: 250px; justify-content: flex-start; }
}
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.template-card { border: 1px solid #DDE3DD; border-radius: 15px; padding: 20px; background: #fff; }
.template-card-inactive { opacity: .65; }
.template-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.template-card-head h2 { margin-top: 12px; }
.template-count { min-width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #EEF2EE; font-size: 22px; }
.builder-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.builder-summary > div { display: grid; gap: 6px; padding: 16px; border-radius: 13px; background: #F8F9F6; border: 1px solid #DDE3DD; }
.builder-summary span { color: #6B746F; font-size: 13px; }
.builder-summary strong { font-size: 20px; }
.builder-section { margin-top: 30px; padding-top: 28px; border-top: 1px solid #DDE3DD; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.category-block { margin-top: 22px; }
.category-block h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.compact-list { display: grid; gap: 9px; }
.compact-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, .8fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid #DDE3DD; border-radius: 12px; background: #fff; }
.compact-item-main { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.quantity-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.quantity-form input { min-width: 120px; }
.template-filter-grid { grid-template-columns: 2fr 1fr 1fr auto; }
.catalog-pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pick-card { display: grid; grid-template-columns: 92px 1fr; min-height: 128px; overflow: hidden; border: 1px solid #DDE3DD; border-radius: 13px; background: #fff; }
.pick-card-selected { border-color: #A9C7B5; background: #EEF5F1; }
.pick-photo { display: grid; place-items: center; min-height: 128px; background: #EEF2EE; color: #89938D; font-size: 12px; }
.pick-photo img { width: 100%; height: 100%; object-fit: cover; }
.pick-body { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 12px; }
.pick-form { display: grid; gap: 8px; width: 100%; margin-top: auto; }
.pick-form input { padding: 9px 10px; }
@media (max-width: 900px) {
  .template-grid, .catalog-pick-grid { grid-template-columns: 1fr 1fr; }
  .compact-row { grid-template-columns: 1fr; }
  .template-filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .template-grid, .catalog-pick-grid, .builder-summary, .template-filter-grid { grid-template-columns: 1fr; }
  .pick-card { grid-template-columns: 82px 1fr; }
  .quantity-form { grid-template-columns: 1fr; }
  .heading-actions { width: 100%; }
  .heading-actions a { flex: 1; }
}
/* Telegram Mini App */
.hidden { display: none !important; }
.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; }
.miniapp-body { background: var(--app-bg); color: var(--ink); padding-bottom: env(safe-area-inset-bottom); }
.miniapp-topbar { position: sticky; top: 0; z-index: 50; min-height: 58px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.miniapp-topbar > div { display: grid; gap: 2px; }
.miniapp-brand { color: var(--muted-ink); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.miniapp-user { max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-ink); font-size: 13px; }
.miniapp-page { width: min(760px, 100%); margin: 0 auto; padding: 18px 14px 110px; }
.miniapp-heading, .editor-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.miniapp-heading { margin-bottom: 18px; }
.miniapp-heading h1, .miniapp-form-card h1, .review-heading h1 { font-size: 28px; margin: 3px 0 6px; }
.miniapp-back { display: inline-flex; margin-bottom: 14px; color: var(--accent); text-decoration: none; font-weight: 700; }
.miniapp-state-card, .miniapp-form-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.05); }
.miniapp-state-card { max-width: 520px; margin: 44px auto; text-align: center; }
.miniapp-state-card .primary-button, .miniapp-state-card .secondary-button { margin-top: 14px; }
.loading-ring { width: 34px; height: 34px; margin: 0 auto 14px; border: 3px solid #D4DDD6; border-top-color: #1F4D3A; border-radius: 50%; animation: mini-spin .8s linear infinite; }
@keyframes mini-spin { to { transform: rotate(360deg); } }
.mobile-list-stack { display: grid; gap: 12px; }
.mobile-list-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.mobile-list-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.mobile-list-card h2 { margin: 9px 0 3px; font-size: 20px; }
.selected-number { min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #E9EFEA; font-size: 20px; }
.compact-actions { margin-top: 14px; }
.compact-actions > * { flex: 1; }
.template-choice-fieldset { margin: 24px 0 0; padding: 0; border: 0; }
.template-choice-fieldset legend { margin-bottom: 11px; font-weight: 800; }
.template-choice-grid { display: grid; gap: 10px; }
.template-choice-card { display: grid; grid-template-columns: 22px 1fr; gap: 11px; align-items: start; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); cursor: pointer; }
.template-choice-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.template-choice-card span { display: grid; gap: 4px; }
.template-choice-card small { color: var(--muted-ink); line-height: 1.35; }
.miniapp-full-button { width: 100%; min-height: 50px; margin-top: 24px; }
.editor-page { width: min(920px, 100%); padding-inline: 10px; }
.editor-title-row { margin-bottom: 8px; }
.editor-title-row .miniapp-back { margin: 0; }
.save-state { color: var(--muted-ink); font-size: 12px; font-weight: 700; }
.save-state.saving { color: #1F4D3A; }
.save-state.error { color: #b91c1c; }
.inline-title-field { margin: 0 0 14px; }
.inline-title-field input { border: 0; padding: 6px 2px 12px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: inherit; font-size: 25px; font-weight: 800; }
.template-strip-section { margin-bottom: 14px; padding: 13px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.compact-section-heading { margin-bottom: 10px; }
.compact-section-heading > div { display: grid; gap: 2px; }
.template-chip-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.template-chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; background: #fff; color: inherit; cursor: pointer; font-weight: 700; }
.template-chip span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 4px; border-radius: 999px; background: #E9F0EB; color: #315C4A; font-size: 11px; }
.template-chip-done { background: #DCE8E1; color: #1F4D3A; border-color: #A9C7B5; }
.editor-tools { display: grid; grid-template-columns: minmax(180px, 1.3fr) auto minmax(150px, .7fr); gap: 9px; align-items: center; margin-bottom: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sticky-tools { position: sticky; top: 69px; z-index: 40; box-shadow: 0 8px 18px rgba(15,23,42,.06); }
.search-field { margin: 0; }
.search-field input, .editor-tools select { padding: 10px; }
.segmented-control { display: flex; padding: 3px; border-radius: 11px; background: #E9EFEA; }
.segmented-control button { border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--muted-ink); cursor: pointer; font-size: 12px; font-weight: 750; }
.segmented-control button.active { background: #fff; color: var(--accent); box-shadow: 0 1px 4px rgba(15,23,42,.12); }
.mini-item-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.mini-item-card { display: grid; grid-template-columns: 108px 1fr; min-height: 148px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; transition: border-color .15s, box-shadow .15s, opacity .15s; }
.mini-item-card.is-selected { border-color: #5F8A73; box-shadow: inset 0 0 0 1px #5F8A73; }
.mini-item-card.is-busy { opacity: .6; pointer-events: none; }
.mini-item-photo { display: grid; place-items: center; width: 100%; min-height: 148px; padding: 0; border: 0; background: #E9EFEA; color: #748078; cursor: zoom-in; }
.mini-item-photo:disabled { cursor: default; }
.mini-item-photo img { width: 100%; height: 100%; object-fit: cover; }
.mini-item-content { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; padding: 11px; }
.mini-category-label { color: var(--muted-ink); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mini-item-content h3 { margin: 5px 0 3px; font-size: 16px; line-height: 1.2; }
.mini-item-controls { display: grid; grid-template-columns: minmax(72px, .75fr) minmax(86px, 1fr); gap: 7px; width: 100%; margin-top: auto; }
.quantity-input { padding: 8px; }
.item-toggle-button { border: 0; border-radius: 9px; padding: 8px; background: var(--accent); color: #fff; font-weight: 750; cursor: pointer; }
.remove-label { display: none; }
.is-selected .item-toggle-button { background: #fee2e2; color: #991b1b; }
.is-selected .add-label { display: none; }
.is-selected .remove-label { display: inline; }
.item-error { min-height: 15px; margin: 4px 0 0; color: #b91c1c; font-size: 11px; line-height: 1.2; }
.editor-bottom-bar { position: fixed; left: 50%; bottom: 0; z-index: 60; width: min(920px, 100%); transform: translateX(-50%); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
.editor-bottom-bar > div { display: grid; }
.editor-bottom-bar span { color: var(--muted-ink); font-size: 11px; }
.editor-bottom-bar strong { font-size: 24px; }
.photo-modal { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 44px 18px 24px; background: rgba(0,0,0,.86); color: #fff; }
.photo-modal img { max-width: 100%; max-height: 76vh; border-radius: 14px; object-fit: contain; }
.photo-modal strong { margin-top: 14px; font-size: 18px; }
.photo-modal-close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border: 0; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 28px; cursor: pointer; }
.review-heading { margin-bottom: 20px; }
.review-groups { display: grid; gap: 16px; }
.review-category { padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.review-category h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.review-category h2 span { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 999px; background: #E9EFEA; font-size: 13px; }
.review-items { display: grid; gap: 8px; }
.review-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding-top: 8px; border-top: 1px solid #E8ECE8; }
.review-item:first-child { padding-top: 0; border-top: 0; }
.review-photo { width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #E9EFEA; color: #748078; font-size: 9px; }
.review-photo img { width: 100%; height: 100%; object-fit: cover; }
.review-item > div:nth-child(2) { display: grid; gap: 3px; }
.review-item > div:nth-child(2) span { color: var(--muted-ink); font-size: 12px; }
.review-item b { min-width: 40px; text-align: right; font-size: 17px; }
.confirm-form { position: sticky; bottom: 0; padding-top: 16px; background: var(--app-bg); }
@media (max-width: 720px) {
  .editor-tools { grid-template-columns: 1fr; }
  .sticky-tools { top: 59px; }
  .mini-item-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .miniapp-page { padding-inline: 10px; }
  .miniapp-state-card, .miniapp-form-card { padding: 17px; }
  .miniapp-heading { align-items: flex-start; }
  .miniapp-heading .primary-button { padding: 10px 12px; }
  .mini-item-card { grid-template-columns: 92px 1fr; min-height: 138px; }
  .mini-item-photo { min-height: 138px; }
  .segmented-control { overflow-x: auto; }
  .segmented-control button { flex: 1; white-space: nowrap; }
}

.confirmation-state {
  text-align: center;
}

.confirmation-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #DCE8E1;
  font-size: 32px;
  font-weight: 800;
}

.confirmation-warning .confirmation-mark {
  background: #E8EEE9;
}

.confirmation-actions {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 22px;
}


.action-card-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
}
.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
}
.empty-state {
  padding: 1.25rem;
  border: 1px dashed var(--border, #D6DED8);
  border-radius: 12px;
  color: var(--muted, #6B746F);
  background: #FAFBF8;
}

/* Unified Apple Catering interface */
:root {
  --app-bg: #F6F7F3;
  --surface: #FFFFFF;
  --surface-soft: #FAFBF8;
  --ink: #202522;
  --muted-ink: #6B746F;
  --line: #DDE3DD;
  --accent: #1F4D3A;
  --accent-hover: #173A2C;
  --green: #1F4D3A;
  --green-soft: #DCE8E1;
  --danger: #B54747;
  --shadow: 0 14px 36px rgba(31, 77, 58, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--app-bg);
}
body { background: var(--app-bg); color: var(--ink); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 76px;
  padding: 0;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  width: min(1220px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand b { font-size: 15px; }
.brand small { margin-top: 4px; color: var(--muted-ink); font-size: 11px; font-weight: 700; }
.app-nav { display: flex; justify-content: center; gap: 4px; }
.app-nav a {
  padding: 10px 13px;
  border-radius: 10px;
  color: #59645E;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: .15s ease;
}
.app-nav a:hover { background: #EEF3EF; color: var(--ink); }
.app-nav a.active { background: #1F4D3A; color: #fff; }
.account-menu { display: flex; align-items: center; gap: 12px; }
.account-name { padding: 8px 11px; border-radius: 10px; background: #EEF3EF; font-size: 13px; font-weight: 750; }
.link-button { color: var(--muted-ink); font-weight: 700; }
.link-button:hover { color: var(--ink); }
.page { width: min(1160px, calc(100% - 32px)); margin: 34px auto 64px; }
.panel, .auth-card, .hero-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.welcome-card {
  min-height: 520px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 56px;
  padding: clamp(32px, 6vw, 72px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #F6F7F3;
  box-shadow: var(--shadow);
}
.welcome-copy { max-width: 620px; }
.welcome-copy h1 { max-width: 720px; margin: 12px 0 18px; font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -.045em; }
.welcome-copy p { max-width: 570px; margin: 0; color: var(--muted-ink); font-size: 18px; }
.welcome-visual { position: relative; min-height: 330px; }
.visual-card { position: absolute; border: 1px solid rgba(44, 48, 40, .1); background: #fff; box-shadow: 0 24px 60px rgba(40, 42, 35, .14); }
.visual-card-main { inset: 20px 14px 40px 34px; padding: 34px; border-radius: 28px; transform: rotate(3deg); }
.visual-card-main span { display: block; height: 48px; margin-bottom: 18px; border-radius: 14px; background: #E7EEE9; }
.visual-card-main span:first-child { width: 66%; background: var(--accent); }
.visual-card-main span:last-child { width: 78%; }
.visual-card-small { right: -10px; bottom: 4px; width: 150px; height: 116px; border-radius: 22px; transform: rotate(-7deg); background: var(--green); }
.section-kicker, .card-label {
  display: inline-flex;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
h1 { color: var(--ink); letter-spacing: -.025em; }
.page-heading, .dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-heading h1, .dashboard-head h1 { margin: 7px 0 6px; font-size: clamp(34px, 5vw, 50px); }
.page-subtitle, .dashboard-head p { margin: 0; color: var(--muted-ink); font-size: 16px; }
.dashboard-grid, .settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dashboard-card, .settings-card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 26px rgba(31,77,58,.045);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dashboard-card:hover, .settings-card:hover, .action-card:hover, .stat-card:hover { transform: translateY(-2px); border-color: #BFCFC4; box-shadow: var(--shadow); }
.dashboard-card-primary { background: #1F4D3A; color: #fff; border-color: #1F4D3A; }
.dashboard-card > div, .settings-card { display: grid; gap: 6px; }
.dashboard-card strong, .settings-card strong { font-size: 21px; }
.dashboard-card span:not(.card-icon):not(.card-number), .settings-card small { color: var(--muted-ink); line-height: 1.45; }
.dashboard-card-primary span:not(.card-icon) { color: rgba(255,255,255,.72); }
.card-icon, .card-number, .settings-count {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #E7EEE9;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
}
.dashboard-card-primary .card-icon { background: var(--accent); }
.settings-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.settings-card { min-height: 190px; }
.primary-button, .secondary-button, .danger-button, .button {
  min-height: 42px;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  transition: .15s ease;
}
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: #ffffff; }
.primary-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.secondary-button, .button-secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover, .button-secondary:hover { background: #F1F4F0; border-color: #C1CEC4; }
.danger-button { border-color: #E5C9C9; color: var(--danger); }
input, select, textarea {
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31, 77, 58, .16); border-color: #1F4D3A; }
.advanced-options { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.advanced-options summary { cursor: pointer; color: var(--muted-ink); font-weight: 750; }
.advanced-options label { margin-top: 14px; }
.action-grid, .stats-grid { gap: 14px; }
.action-card, .stat-card, .template-card, .item-card, .data-card, .import-panel {
  border-color: var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.compact-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stat-card strong { color: var(--ink); }
.badge { background: #EDF2EE; color: #59645E; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-muted { background: #F1F3F1; color: #6B746F; }
.filter-grid { border: 1px solid var(--line); background: var(--surface-soft); }
.item-card, .template-card { box-shadow: 0 6px 20px rgba(31,77,58,.035); }
.item-photo, .pick-photo { background: #E9EFEA; }
.builder-summary { grid-template-columns: minmax(180px, 260px); }
.builder-summary > div { border-color: var(--line); background: var(--surface-soft); }
.import-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: 26px;
  background: #F1F5F1;
  box-shadow: var(--shadow);
}
.import-copy { max-width: 700px; }
.import-copy h2 { margin: 8px 0 7px; font-size: 27px; }
.import-copy p, .data-card p { margin: 0; color: var(--muted-ink); }
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.data-card { min-height: 190px; padding: 22px; border: 1px solid var(--line); }
.data-card h2 { margin-top: 0; }
.data-card form, .data-card .card-actions { margin-top: 22px; }
.stack-form { display: grid; gap: 10px; }
.data-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; margin-top: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.data-summary a { margin-left: auto; color: var(--green); font-weight: 800; }
.flash { border: 1px solid transparent; box-shadow: 0 8px 22px rgba(31,77,58,.05); }
.empty-mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 18px; background: var(--accent); font-size: 30px; font-weight: 800; }

/* Mini App navigation and visual cleanup */
.miniapp-body { background: var(--app-bg); }
.miniapp-topbar {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(78px, 1fr) auto minmax(78px, 1fr);
  padding: 8px 13px;
  background: rgba(255,255,255,.97);
}
.miniapp-home { justify-self: start; padding: 8px 9px; border-radius: 9px; color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 800; }
.miniapp-home:hover { background: #E9EFEA; }
.miniapp-title { display: grid; justify-items: center; gap: 2px; line-height: 1.05; }
.miniapp-title span { color: var(--muted-ink); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.miniapp-title strong { font-size: 14px; }
.miniapp-user { justify-self: end; }
.miniapp-heading { align-items: center; }
.miniapp-heading h1 { margin: 0; }
.miniapp-state-card, .miniapp-form-card, .mobile-list-card, .template-strip-section, .editor-tools, .review-category { border-color: var(--line); box-shadow: 0 7px 24px rgba(31,77,58,.045); }
.miniapp-state-card p { color: var(--muted-ink); }
.mobile-list-card { border-radius: 18px; }
.selected-number { background: #E9EFEA; }
.template-choice-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: #EEF5F1; }
.template-chip-done { background: var(--green-soft); color: var(--green); border-color: #A9C7B5; }
.mini-item-card.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.item-toggle-button { background: var(--accent); }
.editor-bottom-bar .primary-button { margin-top: 0; }

@media (max-width: 960px) {
  .topbar-inner { grid-template-columns: auto 1fr; gap: 14px; padding: 10px 0; }
  .app-nav { grid-column: 1 / -1; order: 3; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .account-menu { justify-self: end; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-card { grid-template-columns: 1fr; min-height: 0; }
  .welcome-visual { display: none; }
}
@media (max-width: 720px) {
  .page { width: min(100% - 20px, 1160px); margin-top: 20px; }
  .topbar-inner { width: min(100% - 20px, 1220px); }
  .brand small { display: none; }
  .account-name { display: none; }
  .dashboard-head, .page-heading, .import-panel { align-items: flex-start; flex-direction: column; }
  .dashboard-head .primary-button, .page-heading > .primary-button { width: 100%; }
  .dashboard-grid, .settings-grid, .data-grid, .compact-stats { grid-template-columns: 1fr; }
  .dashboard-card, .settings-card { min-height: 145px; }
  .welcome-card { padding: 28px 22px; border-radius: 22px; }
  .welcome-copy h1 { font-size: 40px; }
  .panel, .auth-card, .hero-card { padding: 20px; }
  .data-summary a { width: 100%; margin-left: 0; }
}
@media (max-width: 430px) {
  .app-nav a { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .miniapp-topbar { grid-template-columns: 82px 1fr 58px; }
  .miniapp-user { max-width: 58px; font-size: 11px; }
  .miniapp-home { padding-left: 2px; }
}

/* Batch 10: calm, state-preserving interactions */
.flash {
  position: fixed;
  top: 92px;
  right: 24px;
  z-index: 250;
  width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 14px 48px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 77, 58, .16);
  animation: flash-in .18s ease-out;
}
.flash-success { border-color: #BFD3C5; background: #F4F8F5; color: #214E39; }
.flash-warning { border-color: #D8D3C5; background: #FAF9F5; color: #5E584A; }
.flash-error { border-color: #E2C4C4; background: #FFF7F7; color: #8F3535; }
.flash-close {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: currentColor;
  font-size: 22px;
  cursor: pointer;
  opacity: .65;
}
.flash-close:hover { background: rgba(0,0,0,.05); opacity: 1; }
.flash-leaving { opacity: 0; transform: translateY(-8px); transition: .18s ease; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }

.is-submitting { opacity: .72; pointer-events: none; }
.dashboard-card-primary .card-icon {
  background: rgba(255,255,255,.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
}

.catalog-heading-actions { align-items: center; }
.view-switch {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #F2F5F1;
}
.view-switch a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.view-switch a:hover { color: var(--ink); }
.view-switch a.active { background: #fff; color: var(--accent); box-shadow: 0 2px 8px rgba(31,77,58,.09); }
.live-filter-grid { align-items: end; }
.live-filter-actions { justify-content: flex-end; align-items: center; }
.filter-live-note { color: var(--muted-ink); font-size: 12px; white-space: nowrap; }

.catalog-view-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.catalog-view-list .item-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 112px;
  overflow: hidden;
}
.catalog-view-list .item-photo { min-height: 112px; height: 100%; border-radius: 0; }
.catalog-view-list .item-card-body {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) minmax(150px, 1fr) auto;
  grid-template-areas: "copy badges actions" "copy status actions";
  align-items: center;
  gap: 8px 18px;
  padding: 14px 16px;
}
.catalog-view-list .item-card-copy { grid-area: copy; min-width: 0; }
.catalog-view-list .item-card-head { grid-area: badges; justify-content: flex-start; }
.catalog-view-list .item-status { grid-area: status; margin: 0; }
.catalog-view-list .card-actions { grid-area: actions; justify-content: flex-end; flex-wrap: nowrap; }
.catalog-view-list .item-card h2 { margin: 0 0 4px; font-size: 18px; }
.catalog-view-list .item-meta, .catalog-view-list .clamp-2 { margin: 2px 0; }

.create-list-card { padding-bottom: 20px; }
.create-list-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.create-list-heading h1 { margin-bottom: 7px; }
.create-list-heading p { margin: 0; max-width: 620px; }
.create-selection-total {
  min-width: 76px;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #E8F0EA;
  color: var(--accent);
}
.create-selection-total strong { font-size: 23px; line-height: 1; }
.create-selection-total span { margin-top: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.create-name-field { margin-bottom: 24px; }
.template-accordion-list { display: grid; gap: 10px; }
.template-accordion {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.template-accordion.has-selection { border-color: #9FB8A7; box-shadow: 0 0 0 1px rgba(31,77,58,.06); }
.template-accordion-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 13px;
}
.template-master-choice {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.template-master-choice > input,
.template-item-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.template-checkmark,
.template-item-check {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1.5px solid #B9C5BD;
  border-radius: 7px;
  background: #fff;
  transition: .15s ease;
}
.template-master-choice input:checked + .template-checkmark,
.template-item-choice input:checked + .template-item-check { border-color: var(--accent); background: var(--accent); }
.template-master-choice input:checked + .template-checkmark::after,
.template-item-choice input:checked + .template-item-check::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 900; }
.template-master-choice input:indeterminate + .template-checkmark { border-color: var(--accent); background: #DCE8E1; }
.template-master-choice input:indeterminate + .template-checkmark::after { content: "–"; color: var(--accent); font-size: 17px; font-weight: 900; }
.template-summary-copy, .template-item-copy { display: grid; min-width: 0; gap: 3px; }
.template-summary-copy strong { font-size: 16px; }
.template-summary-copy small, .template-item-copy small { color: var(--muted-ink); font-size: 12px; line-height: 1.35; }
.template-expand-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: #EEF3EF;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
.template-chevron { font-size: 18px; transition: transform .15s ease; }
.template-expand-button[aria-expanded="true"] .template-chevron { transform: rotate(180deg); }
.template-items-panel { padding: 0 13px 13px; border-top: 1px solid #EDF0ED; background: #FAFBF8; }
.template-bulk-actions { display: flex; gap: 14px; padding: 11px 2px 9px; }
.text-action { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 850; cursor: pointer; }
.text-action-muted { color: var(--muted-ink); }
.template-item-list { display: grid; gap: 7px; }
.template-item-choice {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 51px;
  margin: 0;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}
.template-item-choice:has(input:checked) { border-color: #C7D7CC; background: #F4F8F5; }
.template-item-check { width: 20px; height: 20px; border-radius: 6px; }
.template-item-copy strong { font-size: 14px; }
.compact-empty-state { padding: 12px; }
.create-continue-button { position: sticky; bottom: 10px; margin-top: 18px; box-shadow: 0 10px 26px rgba(31,77,58,.18); }

@media (max-width: 900px) {
  .catalog-view-list .item-card-body {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "copy badges" "status actions";
  }
  .catalog-view-list .card-actions { flex-wrap: wrap; }
  .filter-live-note { display: none; }
}
@media (max-width: 640px) {
  .flash { top: 72px; right: 12px; width: calc(100vw - 24px); }
  .catalog-heading-actions { width: 100%; justify-content: space-between; }
  .view-switch span { display: none; }
  .catalog-view-list .item-card { grid-template-columns: 72px minmax(0, 1fr); }
  .catalog-view-list .item-card-body { display: block; padding: 12px; }
  .catalog-view-list .item-card-head, .catalog-view-list .item-status { margin-top: 8px; }
  .catalog-view-list .card-actions { margin-top: 10px; justify-content: flex-start; }
  .create-list-heading { align-items: center; }
  .create-list-heading p { font-size: 13px; }
  .template-accordion-summary { grid-template-columns: minmax(0, 1fr) auto; }
  .template-expand-button span:first-child { display: none; }
  .template-expand-button { width: 38px; justify-content: center; }
}


/* Mini App: fixed Apple Catering light palette */
html:has(.miniapp-body) {
  color-scheme: only light;
  background: var(--app-bg);
}
.miniapp-body {
  color-scheme: only light;
  background: var(--app-bg) !important;
  color: var(--ink) !important;
  -webkit-text-size-adjust: 100%;
}
.miniapp-body *,
.miniapp-body *::before,
.miniapp-body *::after {
}
.miniapp-body h1,
.miniapp-body h2,
.miniapp-body h3,
.miniapp-body strong,
.miniapp-body b,
.miniapp-body legend,
.miniapp-body label,
.miniapp-body p,
.miniapp-body span,
.miniapp-body div {
  color: inherit;
}
.miniapp-body .muted,
.miniapp-body .small,
.miniapp-body .item-meta,
.miniapp-body .mini-category-label,
.miniapp-body .save-state,
.miniapp-body .template-summary-copy small,
.miniapp-body .template-item-copy small,
.miniapp-body .miniapp-user,
.miniapp-body .miniapp-title span,
.miniapp-body .editor-bottom-bar span,
.miniapp-body .mobile-list-card p,
.miniapp-body .miniapp-state-card p {
  color: var(--muted-ink) !important;
}
.miniapp-body .miniapp-topbar,
.miniapp-body .editor-bottom-bar {
  background: rgba(255,255,255,.98) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.miniapp-body .miniapp-home,
.miniapp-body .miniapp-back,
.miniapp-body .text-action {
  color: var(--accent) !important;
}
.miniapp-body .text-action-muted {
  color: var(--muted-ink) !important;
}
.miniapp-body .miniapp-state-card,
.miniapp-body .miniapp-form-card,
.miniapp-body .mobile-list-card,
.miniapp-body .template-strip-section,
.miniapp-body .editor-tools,
.miniapp-body .review-category,
.miniapp-body .template-accordion,
.miniapp-body .template-item-choice,
.miniapp-body .mini-item-card {
  background: #fff !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.miniapp-body .template-items-panel {
  background: #FAFBF8 !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.miniapp-body input,
.miniapp-body select,
.miniapp-body textarea,
.miniapp-body button {
  color-scheme: only light;
  -webkit-appearance: none;
  appearance: none;
}
.miniapp-body input:not([type="checkbox"]):not([type="radio"]),
.miniapp-body select,
.miniapp-body textarea {
  background: #fff !important;
  color: var(--ink) !important;
  border-color: #C9D3CB !important;
  caret-color: var(--accent);
  -webkit-text-fill-color: var(--ink);
  opacity: 1;
}
.miniapp-body input:disabled,
.miniapp-body select:disabled,
.miniapp-body textarea:disabled {
  background: #F0F3F0 !important;
  color: #59645E !important;
  -webkit-text-fill-color: #59645E;
  opacity: 1;
}
.miniapp-body input::placeholder,
.miniapp-body textarea::placeholder {
  color: #748078 !important;
  -webkit-text-fill-color: #748078;
  opacity: 1;
}
.miniapp-body select {
  background-image: none;
  padding-right: 12px;
}
.miniapp-body input[type="checkbox"],
.miniapp-body input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--accent);
  color-scheme: only light;
}
.miniapp-body .inline-title-field input {
  background: transparent !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink);
}
.miniapp-body .primary-button,
.miniapp-body .item-toggle-button,
.miniapp-body .template-master-choice input:checked + .template-checkmark,
.miniapp-body .template-item-choice input:checked + .template-item-check {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  -webkit-text-fill-color: #fff;
}
.miniapp-body .primary-button *,
.miniapp-body .item-toggle-button * {
  color: #fff !important;
}
.miniapp-body .secondary-button,
.miniapp-body .template-expand-button,
.miniapp-body .template-chip,
.miniapp-body .segmented-control button {
  background: #fff !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
  -webkit-text-fill-color: var(--ink);
}
.miniapp-body .template-expand-button,
.miniapp-body .segmented-control button.active {
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent);
}
.miniapp-body .segmented-control {
  background: #E9EFEA !important;
}
.miniapp-body .segmented-control button.active {
  background: #fff !important;
}
.miniapp-body .is-selected .item-toggle-button {
  background: #FCE8E8 !important;
  color: #8F3535 !important;
  border-color: #E5C9C9 !important;
  -webkit-text-fill-color: #8F3535;
}
.miniapp-body .is-selected .item-toggle-button * {
  color: #8F3535 !important;
}
.miniapp-body .template-accordion.has-selection,
.miniapp-body .mini-item-card.is-selected,
.miniapp-body .template-item-choice:has(input:checked) {
  border-color: #9FB8A7 !important;
  background: #F4F8F5 !important;
}
.miniapp-body .selected-number,
.miniapp-body .create-selection-total,
.miniapp-body .review-category h2 span,
.miniapp-body .template-chip span {
  background: #E7EEE9 !important;
  color: var(--accent) !important;
}
.miniapp-body .badge-success {
  background: #DCE8E1 !important;
  color: #1F4D3A !important;
}
.miniapp-body .badge-muted,
.miniapp-body .badge {
  background: #EEF2EE !important;
  color: #59645E !important;
}
.miniapp-body .empty-state,
.miniapp-body #filter-empty {
  color: var(--muted-ink) !important;
  border-color: #C9D3CB !important;
}
.miniapp-body .item-error,
.miniapp-body .save-state.error {
  color: #9B3030 !important;
}
.miniapp-body .photo-modal,
.miniapp-body .photo-modal * {
  color: #fff !important;
}

.miniapp-body input:-webkit-autofill,
.miniapp-body input:-webkit-autofill:hover,
.miniapp-body input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  transition: background-color 9999s ease-out 0s;
}
.miniapp-body button:disabled,
.miniapp-body input:disabled {
  opacity: 1;
}

/* Warehouse list workspace */
.workspace-page { padding-bottom: 118px; }
.workspace-form { display: grid; gap: 14px; }
.workspace-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.workspace-topline .miniapp-back { margin: 0; }
.workspace-name-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(31, 77, 58, .035);
}
.workspace-name-field { display: grid; gap: 7px; margin: 0; color: var(--ink); font-weight: 750; }
.workspace-name-field > span { font-size: 13px; }
.workspace-name-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #C9D3CB;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
}
.workspace-selection-total {
  display: grid;
  min-width: 70px;
  min-height: 70px;
  place-content: center;
  gap: 1px;
  border-radius: 14px;
  background: #E7EEE9;
  color: var(--accent);
  text-align: center;
}
.workspace-selection-total strong { color: var(--accent); font-size: 24px; line-height: 1; }
.workspace-selection-total span { color: var(--muted-ink); font-size: 10px; font-weight: 700; }
.workspace-tools { margin: 0; }
.workspace-category-list { display: grid; gap: 10px; }
.workspace-category {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 77, 58, .03);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.workspace-category.has-selection {
  border-color: #9FB8A7;
  box-shadow: 0 0 0 1px rgba(31, 77, 58, .04);
}
.workspace-category-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 66px;
}
.workspace-category-master {
  position: relative;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  margin: 0;
  padding: 12px 10px 12px 14px;
  cursor: pointer;
}
.workspace-category-master > input,
.workspace-item-check-wrap > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.workspace-master-check,
.workspace-item-check-wrap > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  border: 1.5px solid #AAB8AF;
  border-radius: 7px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.workspace-category-master input:checked + .workspace-master-check,
.workspace-item-check-wrap input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}
.workspace-category-master input:checked + .workspace-master-check::after,
.workspace-item-check-wrap input:checked + span::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}
.workspace-category-master input:indeterminate + .workspace-master-check {
  border-color: var(--accent);
  background: #DCE8E1;
}
.workspace-category-master input:indeterminate + .workspace-master-check::after {
  content: "–";
  color: var(--accent);
  font-size: 17px;
  font-weight: 900;
}
.workspace-category-master input:focus-visible + .workspace-master-check,
.workspace-item-check-wrap input:focus-visible + span {
  outline: 3px solid #C9D9CF;
  outline-offset: 2px;
}
.workspace-category-copy { display: grid; min-width: 0; gap: 3px; }
.workspace-category-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-category-copy small { color: var(--muted-ink); font-size: 12px; line-height: 1.3; }
.workspace-category-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 92px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid #EDF0ED;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.workspace-chevron { color: var(--accent); font-size: 18px; transition: transform .15s ease; }
.workspace-category-expand[aria-expanded="true"] .workspace-chevron { transform: rotate(180deg); }
.workspace-category-panel {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid #E7ECE8;
  background: #FAFBF8;
}
.workspace-category-panel[hidden] { display: none; }
.workspace-item-row {
  display: grid;
  grid-template-columns: 24px 52px minmax(0, 1fr) minmax(88px, 112px);
  align-items: center;
  gap: 9px;
  min-height: 66px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, opacity .15s ease;
}
.workspace-item-row.is-selected { border-color: #C7D7CC; background: #F1F6F2; }
.workspace-item-row.is-busy { opacity: .55; pointer-events: none; }
.workspace-item-check-wrap { display: grid; place-items: center; margin: 0; cursor: pointer; }
.workspace-item-check-wrap > span { width: 20px; height: 20px; border-radius: 6px; }
.workspace-item-check-wrap input:checked + span::after { font-size: 12px; }
.workspace-item-photo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #E9EFEA;
  color: #6B746F;
  font-size: 9px;
}
.workspace-item-photo img { width: 100%; height: 100%; object-fit: cover; }
.workspace-item-photo img[hidden] { display: none !important; }
.workspace-photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #6B746F;
  font-size: 9px;
  font-weight: 700;
}
.workspace-photo-placeholder[hidden] { display: none !important; }
.workspace-item-photo.is-photo-loading .workspace-photo-placeholder::after { content: "…"; }
.workspace-item-photo.is-photo-error .workspace-photo-placeholder { color: #8A4F4F; font-size: 8px; }
.workspace-item-photo:disabled { cursor: default; }
.workspace-item-copy { display: grid; min-width: 0; gap: 3px; }
.workspace-item-copy strong { color: var(--ink); font-size: 14px; line-height: 1.25; }
.workspace-item-copy small {
  overflow: hidden;
  color: var(--muted-ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-item-copy .item-error { margin: 0; color: #A33939; font-size: 11px; }
.workspace-quantity-wrap { margin: 0; }
.workspace-quantity-wrap .quantity-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 9px;
  text-align: center;
  font-size: 13px;
}
.workspace-item-row:not(.is-selected) .quantity-input { background: #EFF2EF; color: #8B938E; }
.workspace-bottom-bar button, .workspace-bottom-bar a { min-width: 154px; }
.workspace-toast {
  position: fixed;
  z-index: 150;
  right: 14px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 28px));
  padding: 11px 14px;
  border: 1px solid #B7C9BD;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(20, 40, 29, .16);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .18s ease;
}
.workspace-toast[data-kind="error"] { border-color: #D7AAAA; color: #8E3535; }
.workspace-toast.is-visible { opacity: 1; transform: translateY(0); }

.simplified-review-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.simplified-review-heading h1 { margin-bottom: 4px; }
.review-summary { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.review-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 10px;
  background: #E7EFE9;
  color: var(--muted-ink);
  font-size: 11px;
}
.review-summary strong { color: var(--accent); font-size: 15px; }
.review-quantity { min-width: 44px; text-align: right; color: var(--ink); }
.review-quantity-missing { max-width: 82px; color: var(--muted-ink); font-size: 10px; line-height: 1.2; text-align: right; }
.review-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 16px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #F6F7F3;
}
.review-actions form { margin: 0; }
.review-actions .primary-button, .review-actions .secondary-button { width: 100%; min-height: 50px; margin: 0; }

@media (max-width: 560px) {
  .workspace-name-card { grid-template-columns: minmax(0, 1fr) 64px; padding: 13px; }
  .workspace-selection-total { min-width: 64px; min-height: 64px; }
  .workspace-category-expand { min-width: 42px; width: 42px; padding: 0; }
  .workspace-category-expand > span:first-child { display: none; }
  .workspace-item-row { grid-template-columns: 22px 44px minmax(0, 1fr); }
  .workspace-item-photo { width: 42px; height: 42px; }
  .workspace-quantity-wrap { grid-column: 3; }
  .workspace-quantity-wrap .quantity-input { text-align: left; }
  .workspace-bottom-bar button, .workspace-bottom-bar a { min-width: 136px; }
  .simplified-review-heading { align-items: flex-start; flex-direction: column; }
  .review-summary { justify-content: flex-start; }
  .review-item { grid-template-columns: 48px minmax(0, 1fr) auto; }
}

/* Warehouse availability and event metadata */
.event-details-card {
  align-items: flex-end;
  gap: 16px;
}
.event-details-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(210px, 1.25fr);
  gap: 12px;
  flex: 1;
}
.event-name-field { min-width: 0; }
.list-owner-line,
.stock-legend,
.share-card,
.shared-event-header {
  background: #f6f7f3;
  border: 1px solid #dde3dd;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.list-owner-line,
.stock-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}
.stock-legend span {
  color: #6b746f;
  font-size: 13px;
}
.stock-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 5px;
  color: #6b746f;
  font-size: 12px;
}
.stock-inline .stock-available { color: #1f4d3a; }
.workspace-item-row.is-out-of-stock:not(.is-selected) { opacity: .58; }
.workspace-item-row.has-error { outline: 2px solid #a33; outline-offset: -2px; }
.event-meta-grid {
  display: grid;
  gap: 6px 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
  color: #6b746f;
  font-size: 14px;
}
.compact-event-meta { margin: 10px 0 0; }
.stock-review-line {
  display: block;
  margin-top: 4px;
  color: #6b746f;
}
.share-card {
  display: grid;
  gap: 12px;
}
.share-actions,
.share-confirmed-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.share-confirmed-box {
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  margin-top: 16px;
}
.share-actions input,
.share-confirmed-box input {
  min-width: 0;
  width: 100%;
}
.shared-event-header h1 { margin: 8px 0; }
.public-review-groups { margin-top: 14px; }
.public-review-item { cursor: default; }
.confirmation-meta { width: 100%; text-align: left; }

@media (max-width: 760px) {
  .event-details-card { align-items: stretch; }
  .event-details-grid,
  .event-meta-grid { grid-template-columns: 1fr; }
  .share-actions,
  .share-confirmed-box { grid-template-columns: 1fr; }
  .stock-legend { align-items: flex-start; }
  .stock-inline { display: grid; gap: 2px; }
}

/* Public warehouse collector */
.collector-page { padding-bottom: 96px; }
.collector-event-header { margin-bottom: 12px; }
.collector-progress-card {
  background: #fff;
  border: 1px solid #dde3dd;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(23, 58, 44, .06);
}
.collector-progress-copy {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}
.collector-progress-copy div { display: grid; gap: 3px; }
.collector-progress-copy span { color: #6b746f; font-size: 13px; }
.collector-progress-copy strong { font-size: 22px; }
.collector-progress-copy > b { color: #1f4d3a; font-size: 20px; }
.collector-progress-track {
  height: 10px;
  overflow: hidden;
  background: #dde3dd;
  border-radius: 999px;
  margin-top: 12px;
}
.collector-progress-track span {
  display: block;
  height: 100%;
  background: #1f4d3a;
  border-radius: inherit;
  transition: width .2s ease;
}
.collector-hint { margin: 10px 0 0; }
.collector-primary-action { width: 100%; margin-top: 12px; }
.collector-groups { display: grid; gap: 14px; }
.collector-category { margin: 0; }
.collector-items { display: grid; gap: 9px; }
.collector-item {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}
.collector-item.is-collected {
  background: #f6f7f3;
  opacity: .72;
}
.collector-item.is-collected .collector-item-copy strong { text-decoration: line-through; }
.collector-photo { width: 64px; height: 64px; }
.collector-photo img { width: 100%; height: 100%; object-fit: cover; }
.collector-item-copy { display: grid; gap: 3px; min-width: 0; }
.collector-item-copy > span { color: #6b746f; font-size: 13px; }
.collector-item-copy .review-quantity { font-size: 18px; font-weight: 800; line-height: 1.15; }
.collector-toggle {
  min-width: 116px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #1f4d3a;
  border-radius: 13px;
  background: #fff;
  color: #1f4d3a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.collector-toggle:disabled { cursor: default; opacity: .55; }
.collector-item.is-collected .collector-toggle {
  background: #1f4d3a;
  color: #fff;
}
.collector-check {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 6px;
  line-height: 1;
}
.collector-bottom-bar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 920px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #dde3dd;
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(23, 58, 44, .18);
  backdrop-filter: blur(10px);
}
.collector-bottom-bar > div { display: grid; }
.collector-bottom-bar span { color: #6b746f; font-size: 12px; }
.collector-bottom-bar strong { font-size: 18px; }
.collector-bottom-bar .primary-button { min-width: 190px; }

@media (max-width: 620px) {
  .collector-item {
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
  }
  .collector-photo { width: 56px; height: 56px; }
  .collector-toggle {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 48px;
  }
  .collector-bottom-bar .primary-button { min-width: 0; }
  .collector-item-copy .review-quantity { font-size: 20px; }
  .collector-removal-item { grid-template-columns: 50px minmax(0, 1fr); }
  .collector-removal-action, .collector-removal-done { grid-column: 1 / -1; width: 100%; text-align: center; }
}

.review-item.is-collected { background: #f6f7f3; opacity: .78; }
.review-item.is-collected strong { text-decoration: line-through; }
.review-item-state { display: grid; justify-items: end; gap: 5px; }
.review-item-removal-form { margin: 2px 0 0; }
.review-item-remove-button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #D9A7A7;
  border-radius: 9px;
  background: #FFF7F7;
  color: #9A3333;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.review-item-remove-button:hover { background: #FCECEC; }
.badge-danger { background: #FBEAEA; color: #9A3333; }
.removed-review-block {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #E8CACA;
  border-radius: 16px;
  background: #FFF9F9;
}
.removed-review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.removed-review-heading h2 { margin: 6px 0 0; }
.removed-review-heading > span {
  min-width: 28px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #FBEAEA;
  color: #9A3333;
  font-weight: 800;
}
.removed-review-items { display: grid; gap: 8px; margin-top: 12px; }
.removed-review-item {
  padding: 10px;
  border: 1px solid #EAD8D8;
  border-radius: 13px;
  background: #fff;
}
.removed-review-item.is-pending { border-color: #D99D9D; background: #FFF4F4; }

.collector-removal-section {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #DDAAAA;
  border-radius: 18px;
  background: #FFF4F4;
}
.collector-removal-heading { margin-bottom: 10px; }
.collector-removal-heading h2 { margin: 4px 0; color: #8E3535; }
.collector-removal-list { display: grid; gap: 9px; }
.collector-removal-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #E6C3C3;
  border-radius: 14px;
  background: #fff;
}
.collector-removal-copy { display: grid; gap: 3px; min-width: 0; }
.collector-removal-copy > span { color: #6B746F; font-size: 12px; }
.collector-removal-copy .review-quantity { text-align: left; color: #8E3535; font-size: 17px; font-weight: 800; }
.collector-removal-action {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #A84A4A;
  border-radius: 12px;
  background: #A33B3B;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.collector-removal-done { color: #8E3535; font-size: 12px; font-weight: 800; text-align: right; }


/* Warehouse UX hotfix: stock setup, direct quantity focus and photo preview. */
.stock-legend.stock-control-disabled {
  border-color: #DDE3DD;
  background: #F6F7F3;
}
.stock-legend.stock-control-disabled strong { color: #1F4D3A; }
.stock-inline-disabled { color: #6B746F; font-style: italic; }
.workspace-item-row { cursor: pointer; }
.workspace-quantity-wrap, .workspace-item-check-wrap { cursor: default; }
.review-photo-button {
  padding: 0;
  border: 0;
  cursor: zoom-in;
}
.review-photo-button:focus-visible {
  outline: 3px solid rgba(31, 77, 58, .35);
  outline-offset: 2px;
}

/* Commercial proposals: Batch 0 */
.workspace-dashboard-head { margin-bottom: 18px; }
.workspace-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.workspace-section-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 26px;
  border: 1px solid #DDE3DD;
  border-radius: 24px;
  background: #FFFFFF;
  color: #202522;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(23, 58, 44, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.workspace-section-card:hover {
  transform: translateY(-2px);
  border-color: #1F4D3A;
  box-shadow: 0 16px 38px rgba(23, 58, 44, .11);
}
.workspace-section-card strong { display: block; margin-bottom: 8px; font-size: 26px; }
.workspace-section-card p { margin: 0; max-width: 460px; color: #6B746F; line-height: 1.55; }
.workspace-section-label {
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: #F6F7F3;
  color: #1F4D3A;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.workspace-section-count {
  position: absolute;
  top: 24px;
  right: 24px;
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #1F4D3A;
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 800;
}
.proposal-section-card { background: linear-gradient(145deg, #FFFFFF, #F6F7F3); }
.compact-dashboard-grid { margin-top: 0; }

/* Batch 2: user administration */
.user-actions { margin-top: 0; flex-wrap: nowrap; }
.user-actions .secondary-button { margin: 0; padding: 8px 11px; white-space: nowrap; }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.checkbox-row input { width: 18px; height: 18px; }
@media (max-width: 760px) {
  .user-actions { flex-direction: column; align-items: stretch; }
  .user-actions .secondary-button { width: 100%; }
}

/* Batch 3: account linking and one-time login */
.narrow-panel { width: min(720px, 100%); margin-inline: auto; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 8px 0 12px; }
.copy-row input { min-width: 0; }
.field-label { display: block; margin-top: 18px; font-weight: 750; }
.auth-state-panel { margin-top: 40px; }
.user-actions form { margin: 0; }
@media (max-width: 680px) {
  .copy-row { grid-template-columns: 1fr; }
  .copy-row .primary-button { width: 100%; }
}

.live-edit-rules,
.supplement-heading-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.live-edit-rules form,
.supplement-bottom-bar form { margin: 0; }
.workspace-item-row.is-locked { opacity: .72; }
.workspace-item-row.is-locked .quantity-input { background: #eef1ed; cursor: not-allowed; }
.supplement-review-block {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dce8e1;
  border-radius: 18px;
  background: #f6f7f3;
}
.supplement-review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.supplement-review-heading h2 { margin: 6px 0 0; }
.supplement-bottom-bar { gap: 10px; }
.collector-section-block { margin-bottom: 20px; }
.collector-section-block.is-supplement {
  padding: 14px;
  border: 2px solid #dce8e1;
  border-radius: 18px;
  background: #f6f7f3;
}
.collector-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.collector-section-heading h2 { margin: 0; }
.collector-category h3 { margin: 0 0 10px; }

/* Unified date and time picker */
.ac-date-picker { display: grid; gap: 6px; }
/* iOS/WKWebView: keep touch activation on interactive Mini App controls direct
   and avoid delayed/gesture-interpreted taps. */
.ac-date-display,
.ac-date-trigger,
.ac-picker button,
.workspace-category-expand,
.workspace-category-master,
.workspace-item-check-wrap,
.workspace-item-photo,
.segmented-control button,
.workspace-bottom-bar button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.ac-date-control { display: grid; grid-template-columns: minmax(0, 1fr) 46px; align-items: stretch; }
.ac-date-display { width: 100%; min-height: 46px; border: 1px solid var(--line, #DDE3DD); border-right: 0; border-radius: 12px 0 0 12px; background: #fff; color: var(--ink, #202522); cursor: pointer; }
.ac-date-trigger { display: grid; place-items: center; min-width: 46px; border: 1px solid var(--line, #DDE3DD); border-radius: 0 12px 12px 0; background: #F6F7F3; color: var(--accent, #1F4D3A); cursor: pointer; }
.ac-date-trigger svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ac-date-trigger:hover, .ac-date-trigger:focus-visible { background: #EAF1EC; }
.ac-date-picker.is-invalid .ac-date-display, .ac-date-picker.is-invalid .ac-date-trigger { border-color: #B42318; }
.ac-date-error { color: #B42318; font-size: 12px; font-weight: 700; }
.ac-date-error[hidden] { display: none; }
.ac-picker-open { overflow: hidden; }
.ac-picker-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(23, 58, 44, .38); backdrop-filter: blur(4px); }
.ac-picker-overlay[hidden] { display: none; }
.ac-picker { width: min(420px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(23, 58, 44, .24); }
.ac-picker-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; margin-bottom: 12px; }
.ac-picker-head strong { text-align: center; font-size: 18px; }
.ac-picker-nav { min-height: 42px; border: 1px solid #DDE3DD; border-radius: 12px; background: #F6F7F3; color: #173A2C; cursor: pointer; font-size: 28px; line-height: 1; }
.ac-picker-weekdays, .ac-picker-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.ac-picker-weekdays { margin-bottom: 5px; color: #6B746F; font-size: 12px; font-weight: 800; text-align: center; }
.ac-picker-weekdays span { padding: 5px 0; }
.ac-picker-day { aspect-ratio: 1; min-width: 0; border: 0; border-radius: 11px; background: transparent; color: #202522; cursor: pointer; font-weight: 700; }
.ac-picker-day:hover, .ac-picker-day:focus-visible { background: #EAF1EC; }
.ac-picker-day.is-outside { color: #A1AAA5; }
.ac-picker-day.is-today { box-shadow: inset 0 0 0 1px #1F4D3A; }
.ac-picker-day.is-selected { background: #1F4D3A; color: #fff; box-shadow: none; }
.ac-picker-time { display: flex; align-items: end; justify-content: center; gap: 10px; margin-top: 16px; padding: 14px; border-radius: 14px; background: #F6F7F3; }
.ac-picker-time label { display: grid; gap: 5px; color: #6B746F; font-size: 12px; font-weight: 800; }
.ac-picker-time select { min-width: 92px; padding: 10px 12px; border: 1px solid #DDE3DD; border-radius: 10px; background: #fff; font-size: 17px; }
.ac-picker-time-separator { padding-bottom: 10px; font-size: 22px; font-weight: 900; }
.ac-picker-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ac-picker-actions button { margin: 0; }
@media (max-width: 480px) {
  .ac-picker-overlay { align-items: end; padding: 0; }
  .ac-picker { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .ac-picker-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .ac-picker-actions [data-picker-clear] { grid-column: 1 / -1; }
}

/* Batch 10 · Google Sheets inventory sync */
.sync-alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.sync-alert > div { display: grid; gap: 4px; }
.sync-alert strong { display: block; }
.sync-alert span, .sync-alert li { color: var(--muted-ink); }
.sync-alert ul { margin: 8px 0 0; padding-left: 20px; }
.sync-alert-success { border-color: #B8D7C6; background: #F0F8F3; }
.sync-alert-error { border-color: #F2B8B5; background: #FFF4F3; color: #8F1D18; }
.sync-explanation, .sync-history, .sync-change-list, .sync-apply-panel { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.sync-explanation h2, .sync-history h2, .sync-change-list h2 { margin: 0 0 14px; }
.sync-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sync-source-grid article { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--app-bg); }
.sync-source-grid span { color: var(--muted-ink); line-height: 1.45; }
.sync-run-list { display: grid; gap: 10px; }
.sync-run-row { display: grid; grid-template-columns: minmax(160px, 1fr) auto minmax(260px, auto); gap: 14px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; }
.sync-run-row:hover { border-color: var(--accent); }
.sync-run-row > div:first-child { display: grid; gap: 2px; }
.sync-run-row > div:first-child span, .sync-run-counts { color: var(--muted-ink); font-size: 12px; }
.sync-run-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.sync-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.sync-summary-grid article { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sync-summary-grid span { color: var(--muted-ink); font-size: 12px; }
.sync-summary-grid strong { font-size: 26px; }
.sync-summary-danger { border-color: #F2B8B5 !important; background: #FFF4F3 !important; }
.sync-apply-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.sync-apply-panel > div { display: grid; gap: 4px; }
.sync-apply-panel span { color: var(--muted-ink); }
.sync-change-list { display: grid; gap: 10px; }
.sync-change-row { padding: 14px 16px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 14px; }
.sync-change-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.sync-change-head > div { display: grid; gap: 3px; }
.sync-change-head span:first-child { color: var(--muted-ink); font-size: 11px; }
.sync-action-label { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--app-bg); font-size: 11px; font-weight: 800; }
.sync-action-create { border-left-color: #2F855A; }
.sync-action-update, .sync-action-link { border-left-color: #3178C6; }
.sync-action-deactivate { border-left-color: #D97706; }
.sync-action-noop { border-left-color: #A0A8A3; opacity: .76; }
.sync-action-conflict { border-color: #F2B8B5; border-left-color: #B42318; background: #FFF8F7; }
.sync-issues { margin: 10px 0 0; padding-left: 20px; color: #9B1C1C; }
.sync-field-changes { display: grid; gap: 4px; margin-top: 10px; color: var(--muted-ink); font-size: 13px; }
.sync-change-row small { display: block; margin-top: 9px; color: var(--muted-ink); }
.procurement-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.procurement-table { width: 100%; border-collapse: collapse; }
.procurement-table th, .procurement-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.procurement-table th { background: var(--app-bg); color: var(--muted-ink); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.procurement-table tr:last-child td { border-bottom: 0; }
@media (max-width: 860px) {
  .sync-source-grid, .sync-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sync-run-row { grid-template-columns: 1fr auto; }
  .sync-run-counts { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .sync-alert, .sync-apply-panel { flex-direction: column; align-items: stretch; }
  .sync-source-grid, .sync-summary-grid { grid-template-columns: 1fr; }
  .sync-change-head { align-items: flex-start; }
}

/* Warehouse catalogue: compact, readable cards with photos separated from text. */
.catalog-view-cards.item-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.catalog-view-cards .item-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(31,77,58,.035);
}
.catalog-view-cards .item-photo {
  aspect-ratio: 4 / 3;
  height: auto;
  min-height: 0;
  padding: 12px;
  border-bottom: 1px solid #E8ECE7;
  background: #F4F6F2;
}
.catalog-view-cards .item-photo a,
.catalog-view-cards .item-photo img {
  width: 100%;
  height: 100%;
}
.catalog-view-cards .item-photo a {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
}
.catalog-view-cards .item-photo img {
  display: block;
  object-fit: contain;
  border-radius: 9px;
}
.item-photo-empty {
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 750;
}
.catalog-view-cards .item-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 14px 15px 15px;
}
.item-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.item-title-row h2,
.catalog-view-cards .item-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}
.catalog-view-cards .item-size {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.35;
}
.catalog-view-cards .item-description {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.4;
}
.item-stock-block {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid #EDF0EC;
}
.item-stock-block span {
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 700;
}
.item-stock-block strong {
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
}
.item-stock-block .item-stock-untracked {
  color: var(--muted-ink);
  font-size: 13px;
}
.catalog-card-actions {
  padding-top: 2px;
}

/* List view keeps the same clean content hierarchy. */
.catalog-view-list .item-card {
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 116px;
}
.catalog-view-list .item-photo {
  aspect-ratio: 1 / 1;
  height: 116px;
  min-height: 116px;
  padding: 8px;
  border-right: 1px solid #E8ECE7;
  background: #F4F6F2;
}
.catalog-view-list .item-photo a,
.catalog-view-list .item-photo img {
  width: 100%;
  height: 100%;
  display: block;
}
.catalog-view-list .item-photo img { object-fit: contain; }
.catalog-view-list .item-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto) auto;
  grid-template-areas: "copy stock actions";
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
}
.catalog-view-list .item-card-copy { grid-area: copy; }
.catalog-view-list .item-stock-block {
  grid-area: stock;
  display: grid;
  justify-items: end;
  gap: 3px;
  margin: 0;
  padding: 0;
  border: 0;
}
.catalog-view-list .catalog-card-actions { grid-area: actions; }

@media (max-width: 1080px) {
  .catalog-view-cards.item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .catalog-view-cards.item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-view-list .item-card-body {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "copy stock" "actions actions";
  }
}
@media (max-width: 560px) {
  .catalog-view-cards.item-grid { grid-template-columns: 1fr; }
  .catalog-view-cards .item-photo { aspect-ratio: 16 / 10; }
  .catalog-view-list .item-card { grid-template-columns: 92px minmax(0, 1fr); }
  .catalog-view-list .item-photo { width: 92px; height: 100%; min-height: 108px; }
  .catalog-view-list .item-card-body { display: block; }
  .catalog-view-list .item-stock-block {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #EDF0EC;
  }
}

/* Warehouse batch 03 v8 · sync progress */
.sync-progress-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #C9D8CE;
  border-radius: 16px;
  background: #F7FAF7;
}
.sync-progress-panel[hidden] { display: none; }
.sync-progress-panel-error { border-color: #E5B4B0; background: #FFF8F7; }
.sync-progress-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.sync-progress-heading > div { display: grid; gap: 4px; }
.sync-progress-heading span { color: var(--muted-ink); font-size: 13px; }
.sync-progress-percent { color: var(--accent); font-size: 22px; line-height: 1; }
.sync-progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #E2EAE4;
}
.sync-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .35s ease;
}
.sync-progress-warning {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #EDF3EE;
}
.sync-progress-warning strong { color: var(--ink); font-size: 13px; }
.sync-progress-warning span { color: var(--muted-ink); font-size: 12px; line-height: 1.4; }

/* Warehouse batch 03 v8 · catalogue cards.
   Dedicated class names intentionally avoid all legacy .item-card/.item-photo rules. */
.catalog-product-grid {
  display: grid;
  gap: 14px;
}
.catalog-product-grid-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.catalog-product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(31, 77, 58, .035);
}
.catalog-product-card-inactive { opacity: .62; }
.catalog-product-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid #E7ECE8;
  background: #F2F5F1;
}
.catalog-product-photo-link {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  text-decoration: none;
}
.catalog-product-photo-link img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
}
.catalog-product-photo-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 750;
}
.catalog-product-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 128px;
  flex-direction: column;
  gap: 12px;
  padding: 14px 15px 15px;
  background: #fff;
}
.catalog-product-copy { min-width: 0; }
.catalog-product-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.catalog-product-title-row h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.28;
}
.catalog-product-size,
.catalog-product-description {
  margin: 6px 0 0;
  color: var(--muted-ink);
  font-size: 12.5px;
  line-height: 1.4;
}
.catalog-product-stock {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #EDF0ED;
}
.catalog-product-stock span {
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 700;
}
.catalog-product-stock strong {
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}
.catalog-product-stock .catalog-product-stock-untracked {
  color: var(--muted-ink);
  font-size: 13px;
}
.catalog-product-actions { padding-top: 2px; }

.catalog-product-grid-list { grid-template-columns: 1fr; gap: 10px; }
.catalog-product-grid-list .catalog-product-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  min-height: 120px;
}
.catalog-product-grid-list .catalog-product-media {
  height: 100%;
  min-height: 120px;
  aspect-ratio: auto;
  border-right: 1px solid #E7ECE8;
  border-bottom: 0;
}
.catalog-product-grid-list .catalog-product-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) auto;
  align-items: center;
  gap: 16px;
  min-height: 120px;
  padding: 14px 16px;
}
.catalog-product-grid-list .catalog-product-stock {
  display: grid;
  justify-items: end;
  gap: 3px;
  margin: 0;
  padding: 0;
  border: 0;
}

@media (max-width: 1080px) {
  .catalog-product-grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .catalog-product-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-product-grid-list .catalog-product-content {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .catalog-product-grid-list .catalog-product-actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .sync-progress-heading { align-items: center; }
  .catalog-product-grid-cards { grid-template-columns: 1fr; }
  .catalog-product-media { aspect-ratio: 16 / 10; }
  .catalog-product-grid-list .catalog-product-card { grid-template-columns: 92px minmax(0, 1fr); }
  .catalog-product-grid-list .catalog-product-media { min-height: 108px; }
  .catalog-product-grid-list .catalog-product-content { display: block; min-height: 108px; padding: 12px; }
  .catalog-product-grid-list .catalog-product-stock {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #EDF0ED;
  }
}

/* Warehouse batch 03 v9 · in-page catalogue photo viewer. */
body.catalog-photo-modal-open {
  overflow: hidden;
}
.catalog-photo-modal[hidden] {
  display: none !important;
}
.catalog-photo-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 56px 24px 28px;
  background: rgba(12, 20, 16, .78);
  backdrop-filter: blur(2px);
  cursor: zoom-out;
}
.catalog-photo-modal-stage {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 92px);
  cursor: default;
}
.catalog-photo-modal-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(960px, calc(100vw - 72px));
  max-height: min(720px, 78vh);
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}
.catalog-photo-modal-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(18, 28, 23, .82);
  color: #fff;
  font: inherit;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .22);
}
.catalog-photo-modal-close:hover,
.catalog-photo-modal-close:focus-visible {
  background: rgba(31, 77, 58, .96);
  outline: 2px solid rgba(255, 255, 255, .72);
  outline-offset: 2px;
}
.catalog-product-photo-link {
  cursor: zoom-in;
}
@media (max-width: 560px) {
  .catalog-photo-modal {
    padding: 58px 12px 16px;
  }
  .catalog-photo-modal-stage {
    width: auto;
    height: auto;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 76px);
  }
  .catalog-photo-modal-stage img {
    max-width: calc(100vw - 32px);
    max-height: 76vh;
  }
  .catalog-photo-modal-close {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }
}

/* Warehouse collection controls: pause/resume + reset progress. */
.collector-top-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}
.collector-top-actions .collector-primary-action {
  width: 100%;
  margin-top: 0;
}
.collector-reset-action {
  min-width: 110px;
  margin: 0;
}
@media (max-width: 420px) {
  .collector-top-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .collector-reset-action { min-width: 92px; padding-inline: 12px; }
}

/* Personal account */
.account-name-link,
.miniapp-user-link {
  color: inherit;
  text-decoration: none;
}
.account-name-link:hover,
.miniapp-user-link:hover { text-decoration: underline; }
.account-profile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 24px;
}
.account-profile-summary > div {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--app-bg);
}
.account-profile-summary span { color: var(--muted-ink); font-size: 12px; }
.account-password-section { padding-top: 18px; border-top: 1px solid var(--line); }
.account-password-section h2 { margin-top: 0; }
@media (max-width: 620px) {
  .account-profile-summary { grid-template-columns: 1fr; }
}

/* Physical return is confirmed only by the storekeeper after the event. */
.collector-top-actions form { margin: 0; }
.collector-release-action { width: 100%; margin: 0; }

/* Mini App keyboard UX: iOS Telegram/WKWebView does not reliably blur numeric
   inputs when the user taps page background. The inline controller toggles
   this compact Done bar and temporarily clears the workspace bottom action so
   the keyboard never fights with two fixed controls. */
.miniapp-keyboard-toolbar {
  position: fixed;
  z-index: 1250;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 7px 6px 12px;
  border: 1px solid rgba(23, 58, 44, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 10px 28px rgba(23, 58, 44, .18);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.miniapp-keyboard-toolbar.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.miniapp-keyboard-toolbar-label {
  color: #6B746F;
  font-size: 12px;
  font-weight: 700;
}
.miniapp-keyboard-done {
  min-width: 76px;
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 10px;
  background: #1F4D3A;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.workspace-bottom-bar {
  transition: opacity .14s ease, transform .14s ease;
}
.miniapp-keyboard-open .workspace-bottom-bar {
  opacity: 0;
  transform: translateY(120%);
  pointer-events: none;
}
@media (min-width: 720px) {
  .miniapp-keyboard-toolbar { right: 20px; }
}
