:root {
  color-scheme: light dark;
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Per-business theme accent. --brand-bg can be a solid color or a gradient
     (used only for backgrounds); --brand-solid is always a flat color (used
     for text/icons/borders, where a gradient isn't valid CSS). The "Diraduka"
     wordmark (h1) deliberately does NOT use these — it stays brand gold. */
  --brand-bg: #F2CB36;
  --brand-solid: #F2CB36;
  /* Shared "card" look used for every rounded white container app-wide
     (admin rows, profile info cards, item rows, product cards, etc.) --
     a gentle shadow tinted with the business's own brand color instead
     of flat black, so it reads as a soft glow rather than a hard edge. */
  --card-radius: 14px;
  --card-shadow: 0 6px 18px -2px color-mix(in srgb, var(--brand-solid) 22%, transparent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  background: #f4f4f2;
  color: #222;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.page-with-bottom-nav {
  padding-bottom: 118px;
}

.page-narrow {
  max-width: 360px;
  padding-top: 60px;
}

h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 4px;
  color: #F2CB36;
}

.auth-logo {
  display: block;
  height: 56px;
  width: auto;
  margin: 0 0 4px;
}

.subtitle {
  color: #555;
  margin-bottom: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -20px -16px 16px;
  padding: 20px 16px 12px;
  background: #f4f4f2;
}

.app-topbar {
  flex-direction: column;
  align-items: stretch;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.header-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 8px;
  margin: -4px -8px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}

.header-menu {
  position: relative;
  flex-shrink: 0;
}

.header-menu-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  transition: box-shadow 0.15s ease;
}

.header-menu-toggle::-webkit-details-marker {
  display: none;
}

.header-menu-toggle:hover,
.header-menu[open] .header-menu-toggle {
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-menu-label {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  color: #444;
}

.header-menu-icon {
  position: relative;
  width: 16px;
  height: 2px;
  background: #444;
  border-radius: 2px;
}

.header-menu-icon::before,
.header-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: #444;
  border-radius: 2px;
}

.header-menu-icon::before {
  top: -5px;
}

.header-menu-icon::after {
  top: 5px;
}

.header-menu-dropdown {
  position: absolute;
  top: 36px;
  right: 0;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 6px;
  min-width: 170px;
  z-index: 30;
}

.header-menu-dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #222;
  text-decoration: none;
}

.header-menu-dropdown a:hover,
.header-menu-dropdown a:active {
  background: #f4f4f2;
}

.header-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.header-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-bg);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
}

.header-business-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.greeting {
  font-size: 0.85rem;
  color: #444;
  text-align: right;
}

.home-greeting {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.3;
  color: #000;
  margin: 0 0 12px;
}

.section-divider {
  border: none;
  border-top: 2px solid rgba(0, 0, 0, 0.1);
  margin: 6px 0 16px;
}

.settings-list {
  background: #fff;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-top: 18px;
  margin-bottom: 16px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s ease;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row:hover {
  background: #fafafa;
}

.settings-row-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--brand-solid) 14%, white);
  color: var(--brand-solid);
}

.settings-row-icon svg {
  width: 20px;
  height: 20px;
}

.settings-row-body {
  flex: 1;
  min-width: 0;
}

.settings-row-title {
  display: block;
  font-weight: 600;
  font-size: 0.98rem;
  color: #222;
}

.settings-row-subtitle {
  display: block;
  font-size: 0.82rem;
  color: #888;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-row-chevron {
  flex: none;
  width: 18px;
  height: 18px;
  color: #ccc;
}

/* ---------- profile header (vendor/customer detail pages) ---------- */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 20px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-bg);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.item-row-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-bg);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
}

.profile-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
  color: #222;
}

.profile-header .qty-btn {
  flex: none;
  margin-top: 12px;
}

.profile-info-card {
  background: #fff;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}

.profile-info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.profile-info-row:last-child {
  border-bottom: none;
}

.profile-info-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--brand-solid) 14%, white);
  color: var(--brand-solid);
}

.profile-info-icon svg {
  width: 17px;
  height: 17px;
}

.profile-info-body {
  flex: 1;
  min-width: 0;
}

.profile-info-label {
  display: block;
  font-size: 0.76rem;
  color: #888;
}

.profile-info-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: #222;
  overflow-wrap: anywhere;
}

.header-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.whoami {
  font-size: 0.95rem;
  color: #444;
  text-align: right;
}

.switch-link {
  color: var(--brand-solid);
  text-decoration: none;
  margin-left: 4px;
}

.switch-link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 16px auto 0;
  display: block;
  color: var(--brand-solid);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.store-login-link {
  font-size: 0.85rem;
  white-space: nowrap;
  margin-left: 0;
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 22px;
}

.auth-links .switch-link {
  margin-left: 0;
}

.auth-links-minor {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.auth-links-minor .switch-link {
  margin-left: 0;
  font-size: 0.85rem;
  color: #888;
}

.landing-logo {
  display: block;
  height: 150px;
  width: auto;
  margin: 0 auto 8px;
}

.landing-subtitle {
  text-align: center;
  color: #555;
  margin-bottom: 32px;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-actions button,
.landing-actions .qty-btn {
  margin-top: 0;
  width: 100%;
  padding: 14px 16px;
}

.stepper {
  display: flex;
  align-items: flex-start;
  margin-bottom: 28px;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
  width: 64px;
}

.stepper-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  background: #f0f0f0;
  color: #999;
}

.stepper-label {
  font-size: 0.72rem;
  color: #999;
  text-align: center;
  line-height: 1.2;
}

.stepper-step-active .stepper-circle {
  background: var(--brand-bg);
  color: #fff;
}

.stepper-step-active .stepper-label {
  color: #222;
  font-weight: 600;
}

.stepper-step-done .stepper-circle {
  background: color-mix(in srgb, var(--brand-solid) 18%, white);
  color: var(--brand-solid);
}

.stepper-step-done .stepper-label {
  color: #666;
}

.stepper-line {
  flex: 1;
  height: 2px;
  background: #f0f0f0;
  margin-top: 13px;
}

.stepper-line-done {
  background: color-mix(in srgb, var(--brand-solid) 35%, white);
}

.card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #444;
  margin-top: 14px;
}

.optional {
  font-weight: 400;
  color: #888;
}

.hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: -2px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 10px;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.detail-photo {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #f4f4f4;
  border-radius: 10px;
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.detail-label {
  color: #888;
}

input,
textarea,
.card select {
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid #e3e1db;
  border-radius: 10px;
  width: 100%;
  background: #fff;
  color: #222;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
.card select:focus {
  outline: none;
  border-color: var(--brand-solid);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-solid) 28%, transparent);
}

textarea {
  resize: vertical;
}

.search-input {
  margin-bottom: 12px;
}

input[type="date"] {
  max-width: 100%;
}

button {
  align-self: center;
  margin-top: 10px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background: var(--brand-bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

button:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

button:active {
  filter: brightness(0.85);
}

.btn-danger {
  background: #a83232;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: #999;
  font-size: 0.85rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 0;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: #3c4043;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.15s ease;
}

.google-btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.google-btn:active {
  background: #f8f8f8;
}

.btn-add-stock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin: 4px 0 16px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand-bg);
  border-radius: 8px;
  transition: box-shadow 0.15s ease;
}

.btn-add-stock:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-add-stock-centered {
  display: flex;
  width: fit-content;
  margin: 4px auto 16px;
}

.btn-danger:active {
  background: #862828;
}

.message {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.message-success {
  background: color-mix(in srgb, var(--brand-solid) 14%, white);
  color: var(--brand-solid);
}

.message-error {
  background: #fbe6e6;
  color: #a83232;
}

.offline-banner {
  padding: 10px 16px;
  font-size: 0.85rem;
  text-align: center;
  background: #4a4a4a;
  color: #fff;
}

.owed-badge {
  color: var(--brand-solid);
  font-weight: 600;
}

.owner-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-solid);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: middle;
}

h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 12px;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-gap-after {
  margin-bottom: 16px;
}

.item-row {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 12px 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.item-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 140px;
  min-width: 0;
}

.item-name {
  font-weight: 600;
}

.item-code {
  font-size: 0.8rem;
  color: #888;
}

.admin-hint-italic {
  font-style: italic;
}

.btn-copy-link {
  padding: 10px 14px;
  min-width: 0;
}

.btn-copy-link:hover {
  background: var(--brand-bg);
  color: #fff;
}

.toggle-switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #ddd;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.toggle-switch input:checked ~ .toggle-track {
  background: var(--brand-bg);
}

.toggle-switch input:checked ~ .toggle-knob {
  transform: translateX(20px);
}

.item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.9rem;
  color: #444;
}

.item-line-total {
  font-weight: 600;
  color: var(--brand-solid);
}

.grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: color-mix(in srgb, var(--brand-solid) 10%, white);
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
  font-weight: 700;
  color: var(--brand-solid);
}

.business-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: #777;
  margin-top: -2px;
}

.sold-out {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #999;
  font-style: italic;
}

.history-link {
  font-size: 0.75rem;
  color: #888;
  text-decoration: none;
}

.history-link:hover {
  text-decoration: underline;
}

.chart-card {
  padding: 10px;
}

.history-chart {
  width: 100%;
  height: auto;
  display: block;
}

.history-positive {
  font-weight: 600;
  color: var(--brand-solid);
}

.history-negative {
  font-weight: 600;
  color: #a83232;
}

.empty-state {
  color: #888;
  font-style: italic;
}

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

.list-header h2 {
  margin: 0;
}

.sort-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-label {
  font-size: 0.8rem;
  font-weight: 400;
  color: #777;
  margin: 0;
}

.sort-form select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: #fff;
  color: #222;
}

.item-photo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.actions-row {
  flex: 1 0 100%;
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.qty-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 14px 10px;
  min-width: 64px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
  color: var(--brand-solid);
  background: color-mix(in srgb, var(--brand-solid) 10%, white);
  cursor: pointer;
  text-align: center;
  transition: box-shadow 0.15s ease;
}

.qty-btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.qty-btn-primary {
  background: var(--brand-bg);
  color: #fff;
}

.qty-btn-cancel {
  color: #a83232;
  background: color-mix(in srgb, #a83232 10%, white);
}

.qty-btn-disabled {
  opacity: 0.4;
  pointer-events: none;
  color: #999;
  background: #f0f0f0;
}

.qty-btn-compact {
  flex: none;
  padding: 10px 14px;
}

.qty-btn-fill-hover:hover {
  background: var(--brand-bg);
  color: #fff;
}

.inline-form {
  flex: 1;
  margin: 0;
  display: flex;
}

.inline-form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.inline-form-row input {
  flex: 1 1 0;
  min-width: 0;
}

.inline-form-row button {
  margin-top: 0;
  flex: none;
  padding: 12px 16px;
}

.inline-form .qty-btn {
  width: 100%;
}

.users-table-wrap {
  overflow-x: auto;
  margin-bottom: 12px;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.8rem;
}

.users-table th,
.users-table td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.users-table th {
  font-family: var(--font-heading);
  font-weight: 500;
  color: #666;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

.users-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid #f2f2f2;
}

.users-table-login-date,
.users-table-login-time {
  display: block;
  white-space: nowrap;
}

.users-table-login-time {
  color: #888;
  font-size: 0.75rem;
}

.users-table .col-manage {
  text-align: right;
  white-space: nowrap;
}

.users-table .col-manage .qty-btn {
  min-width: 0;
  padding: 7px 10px;
  font-size: 0.72rem;
}

.remove-user-link {
  display: block;
  color: #a83232;
  margin: 4px 0 14px;
}

.item-footer {
  flex: 1 0 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.size-breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.size-breakdown-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
}

.size-breakdown-row input[type="number"] {
  width: 80px;
  flex: 0 0 auto;
}

.size-breakdown-row-header {
  padding-bottom: 0;
  justify-content: space-between;
}

.size-breakdown-row-header .item-code:first-child {
  flex: 1 1 auto;
}

.size-breakdown-row-header .item-code:last-child {
  width: 80px;
  flex: 0 0 auto;
}

.size-row-remove {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin-top: 0;
  padding: 0;
  border-radius: 8px;
  border: none;
  background: color-mix(in srgb, #a83232 10%, white);
  color: #a83232;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.delete-link {
  font-size: 0.75rem;
  color: #a83232;
  text-decoration: underline;
}

#custom-range-fields:not([hidden]) {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

#custom-range-fields input[type="date"] {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding: 5px 6px;
  font-size: 0.8rem;
}

#custom-range-fields button {
  margin-top: 0;
  padding: 6px 10px;
  font-size: 0.8rem;
}

#value-custom-range-fields:not([hidden]) {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

#value-custom-range-fields input[type="date"] {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding: 5px 6px;
  font-size: 0.8rem;
}

#value-custom-range-fields button {
  margin-top: 0;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.value-range-form {
  margin-bottom: 12px;
}

.grand-total-top {
  margin-top: 0;
  margin-bottom: 16px;
}

.dashboard-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.dashboard-stat {
  flex: 1;
  background: #fff;
  border-radius: var(--card-radius);
  padding: 12px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-stat-value {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--brand-solid);
}

.dashboard-stat-label {
  font-size: 0.75rem;
  color: #666;
}

.dashboard-stat-sub {
  font-size: 0.68rem;
  color: #999;
}

.snapshot-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: color-mix(in srgb, var(--brand-solid) 12%, white);
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: #7a5b00;
}

.accordion-controls {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
}

.chip-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  margin: 0 -16px 12px;
  padding-left: 16px;
  padding-right: 16px;
  position: sticky;
  top: 0;
  z-index: 15;
  background: #f4f4f2;
}

.chip {
  flex: none;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-solid) 10%, white);
  border: none;
  color: var(--brand-solid);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}

.link-btn {
  margin-top: 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--brand-solid);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:active {
  background: none;
}

details.accordion {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 10px;
  overflow: hidden;
}

details.accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.05rem;
}

details.accordion > summary::-webkit-details-marker {
  display: none;
}

details.accordion > summary::before {
  content: "▸";
  font-family: var(--font-body);
  margin-right: 8px;
  color: var(--brand-solid);
  transition: transform 0.15s ease;
}

details.accordion[open] > summary::before {
  transform: rotate(90deg);
}

details.accordion > summary span:first-child {
  flex: 1;
  display: flex;
  align-items: center;
}

details.accordion > summary .qty-btn {
  flex: 0 0 auto;
  min-width: 56px;
}

.accordion-body {
  padding: 0 16px 16px;
}

.accordion-body .card {
  margin-bottom: 16px;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.search-form input[type="search"] {
  flex: 1;
}

.search-form button {
  margin-top: 0;
  padding: 12px 16px;
  flex-shrink: 0;
}

.item-note {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
  margin-top: 2px;
}

.item-row-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.item-row-link:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.back-to-top {
  position: fixed;
  bottom: 78px;
  right: 18px;
  background: var(--brand-bg);
  color: #fff;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 50;
}

.exclamation {
  color: #a83232;
  font-weight: 700;
  margin-left: 2px;
}

.snapshot-banner {
  position: relative;
}

.snapshot-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--brand-solid);
}

.snapshot-view-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-solid);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-top: 0;
}

.snapshot-dismiss {
  background: none;
  border: none;
  color: var(--brand-solid);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.notices-collapsed-form {
  margin-bottom: 16px;
}

.notices-collapsed-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--brand-solid);
  background: color-mix(in srgb, var(--brand-solid) 12%, white);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.notices-collapsed-pill:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.menu-dropdown {
  display: inline-block;
}

.menu-dropdown summary {
  list-style: none;
  cursor: pointer;
  color: var(--brand-solid);
  font-size: 0.95rem;
  text-decoration: none;
}

.menu-dropdown summary::-webkit-details-marker {
  display: none;
}

.menu-dropdown[open] summary {
  text-decoration: underline;
}

.menu-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: none;
  border-radius: var(--card-radius);
  padding: 10px 14px;
  margin-top: 6px;
  box-shadow: var(--card-shadow);
}

.menu-panel a {
  color: var(--brand-solid);
  text-decoration: none;
  font-size: 0.9rem;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
}

.snapshot-dismiss-form {
  position: absolute;
  top: 8px;
  right: 10px;
  flex: none;
  display: block;
}

.footer-feedback {
  text-align: center;
  margin: 24px 0 8px;
}

.photo-buttons {
  display: flex;
  gap: 8px;
}

.photo-buttons .qty-btn {
  flex: 1;
}

.photo-crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.photo-crop-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-crop-image-wrap {
  max-height: 60vh;
  overflow: hidden;
  border-radius: 8px;
}

.photo-crop-image {
  display: block;
  max-width: 100%;
}

.photo-crop-actions {
  display: flex;
  gap: 8px;
}

.photo-crop-actions .qty-btn {
  flex: 1;
}

.lang-switcher {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
}

.page-narrow .lang-switcher {
  justify-content: center;
}

.lang-btn {
  margin-top: 0;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #F2CB36;
  background: #fff;
  border: 1px solid #F2CB36;
  border-radius: 20px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.lang-btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lang-btn-active {
  color: #fff;
  background: #F2CB36;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid #e2e2e2;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-icons {
  display: flex;
}

.bottom-nav-brand {
  display: flex;
  justify-content: center;
  padding: 6px 0 10px;
  border-top: 1px solid #f2f2f2;
}

.bottom-nav-logo {
  height: 26px;
  width: auto;
  opacity: 0.75;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  text-decoration: none;
  color: #888;
  font-size: 0.7rem;
  font-weight: 500;
  transition: box-shadow 0.15s ease;
}

.bottom-nav-item:hover {
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.bottom-nav-item .nav-icon {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active {
  color: var(--brand-solid);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.view-toggle {
  display: flex;
  width: fit-content;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  flex-shrink: 0;
}

.view-toggle-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  color: #555;
  background: #fff;
}

.view-toggle-btn.active {
  background: var(--brand-bg);
  color: #fff;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grid-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.grid-card-photo-link {
  position: relative;
  display: block;
}

.grid-card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f4f4f4;
  display: block;
}

.grid-card-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0ee;
  color: #aaa;
  font-size: 0.8rem;
}

.grid-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #a83232;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-card-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  color: #222;
  padding: 10px 10px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-card-price {
  font-weight: 600;
  color: var(--brand-solid);
  font-size: 0.85rem;
  padding: 2px 10px 8px;
}

.grid-card-actions {
  display: flex;
  gap: 6px;
  padding: 0 10px 10px;
}

.grid-card-actions .qty-btn {
  padding: 7px 4px;
  font-size: 0.75rem;
  min-width: 0;
}

.theme-swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 6px;
}

.theme-swatch-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  color: #666;
  text-align: center;
}

.theme-swatch-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.theme-swatch-option input[type="radio"]:checked + .theme-swatch {
  border-color: #222;
}

.theme-color-wheel-wrap {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red);
}

.theme-color-wheel-wrap input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.admin-logo-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.photo-watermark {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.detail-photo-wrap {
  position: relative;
  margin-bottom: 16px;
}

.detail-photo-wrap .detail-photo {
  margin-bottom: 0;
}

/* Buyer storefront (public pages) */

.store-page {
  padding-top: 24px;
}

.store-topbar {
  position: static;
  margin: 0 0 16px;
  padding: 0;
  background: none;
}

.store-app-mark {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
  color: #F2CB36;
}

.store-app-mark[src] {
  height: 32px;
  width: auto;
}

.store-category-heading {
  margin: 20px 0 10px;
}

.store-category-heading:first-of-type {
  margin-top: 4px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.store-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.store-card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f4f4f4;
  display: block;
}

.store-card-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0ee;
  color: #aaa;
  font-size: 0.8rem;
}

.store-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
}

.store-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.store-card-price {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--brand-solid);
  font-size: 0.95rem;
  margin-top: 2px;
}

.store-detail-photo {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #f4f4f4;
  border-radius: 10px;
  margin: 12px 0;
}

.store-detail-name {
  margin-bottom: 2px;
}

.store-detail-price {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--brand-solid);
  font-size: 1.2rem;
  margin: 4px 0;
}

.store-cta-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.store-cta-btn {
  flex: 1;
  padding: 14px;
  font-size: 0.95rem;
}

.share-recap-btn {
  display: flex;
  width: fit-content;
  margin: 0 auto 16px;
}

.share-recap-btn:hover {
  background: var(--brand-bg);
  color: #fff;
}

.store-link-text {
  word-break: break-all;
}

.form-more-details {
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin-top: 4px;
}

.form-more-details > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--brand-solid);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-more-details > summary::-webkit-details-marker {
  display: none;
}

.form-more-details > summary::before {
  content: "▸";
  font-family: var(--font-body);
  transition: transform 0.15s ease;
}

.form-more-details[open] > summary::before {
  transform: rotate(90deg);
}

.form-more-details .accordion-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  padding-left: 0;
  padding-right: 0;
}

