/* Scrap Yard Finder — industrial, large controls, high contrast */

:root,
[data-theme="dark"] {
  --bg: #1a1d21;
  --bg-panel: #2a2f36;
  --bg-input: #12151a;
  --bg-header: #0f1216;
  --bg-glow: #2c333c;
  --bg-mid: #15181c;
  --steel: #8b939e;
  --text: #f2f4f6;
  --muted: #b0b7c0;
  --border: #3d4550;
  --accent: #cd712e;
  --accent-hover: #ffd24d;
  --accent-text: #1a1d21;
  --accent-border: #c99200;
  --accent-btn-hover: #ffc933;
  --accent-soft: rgba(245, 180, 0, 0.08);
  --danger: #ff6b4a;
  --danger-text: #ffcfc4;
  --danger-bg: rgba(255, 107, 74, 0.15);
  --danger-flash-bg: rgba(255, 107, 74, 0.12);
  --ok: #3dd68c;
  --ok-flash-bg: rgba(61, 214, 140, 0.12);
  --focus: #ffe08a;
  --shadow: rgba(0, 0, 0, 0.35);
  --panel-lift: rgba(0, 0, 0, 0.25);
  --chip-border: rgba(255, 255, 255, 0.12);
  --swatch-border: rgba(255, 255, 255, 0.08);
  --radius: 6px;
  --font: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  --space: 1rem;
  --btn-h: 2.75rem;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #d8dde4;
  --bg-panel: #f4f6f8;
  --bg-input: #ffffff;
  --bg-header: #eceff3;
  --bg-glow: #c5ced8;
  --bg-mid: #d8dde4;
  --steel: #6a7380;
  --text: #1a1d21;
  --muted: #5a6470;
  --border: #b7c0cb;
  --accent: #c99200;
  --accent-hover: #a87a00;
  --accent-text: #1a1d21;
  --accent-border: #a87a00;
  --accent-btn-hover: #e0a800;
  --accent-soft: rgba(201, 146, 0, 0.12);
  --danger: #d94a2c;
  --danger-text: #7a1f0f;
  --danger-bg: rgba(217, 74, 44, 0.12);
  --danger-flash-bg: rgba(217, 74, 44, 0.1);
  --ok: #1f9a5c;
  --ok-flash-bg: rgba(31, 154, 92, 0.12);
  --focus: #c99200;
  --shadow: rgba(26, 29, 33, 0.14);
  --panel-lift: rgba(26, 29, 33, 0.08);
  --chip-border: rgba(26, 29, 33, 0.12);
  --swatch-border: rgba(26, 29, 33, 0.1);
  color-scheme: light;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(ellipse at top, var(--bg-glow) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg) 40%);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--accent);
  font-weight: 600;
}

a:hover {
  color: var(--accent-hover);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.7rem 1.1rem;
  background: var(--bg-header);
  border-bottom: 3px solid var(--accent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  line-height: 1.2;
  min-width: 0;
}

.brand:hover {
  color: var(--accent);
}

.brand-logo {
  display: block;
  height: 2.35rem;
  width: auto;
  max-width: min(11.5rem, 42vw);
  object-fit: contain;
  object-position: left center;
  border-radius: 2px;
  flex-shrink: 0;
}

.brand-slogan {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--muted);
  max-width: 12rem;
}

.brand:hover .brand-slogan {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem 0.6rem;
  margin-left: auto;
}

.site-nav a:not(.btn) {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  font-weight: 700;
}

.site-nav a:not(.btn):hover {
  background: var(--bg-panel);
  color: var(--accent);
}

.site-nav a:not(.btn).is-active {
  color: var(--accent);
}

.nav-link-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  display: block;
}

.nav-icon.icon-magnet {
  width: 1.35rem;
  height: 1.35rem;
  /* Curve sits high; nudge down so it lines up with text/other icons */
  transform: translateY(0.08rem);
}

.nav-user {
  color: var(--text);
  font-weight: 700;
  padding: 0;
}

.account-menu {
  position: relative;
}

.account-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.account-menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.account-menu-toggle.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.account-menu-toggle.is-active .nav-user {
  color: var(--accent);
}

.account-menu-caret {
  color: var(--muted);
  font-size: 0.85rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle .nav-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun,
[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 50;
  min-width: 11rem;
  padding: 0.35rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: 0 10px 24px var(--shadow);
}

.account-menu-panel a {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.account-menu-panel a:hover {
  background: var(--bg-input);
  color: var(--accent);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.1rem;
}

.site-footer {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding: 0.85rem 1.1rem 1.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.footer-nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent);
}

.panel {
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: 0 6px 0 var(--panel-lift);
}

.danger-zone {
  margin-top: 1.25rem;
  border-color: var(--danger);
}

h1,
h2 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.2rem;
}

.lede {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1rem;
}

.muted {
  color: var(--muted);
}

.error {
  background: var(--danger-bg);
  border: 2px solid var(--danger);
  color: var(--danger-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
}

.flash {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 2px solid;
  font-weight: 700;
}

.flash-success {
  border-color: var(--ok);
  background: var(--ok-flash-bg);
}

.flash-error {
  border-color: var(--danger);
  background: var(--danger-flash-bg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-h);
  padding: 0.45rem 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent-border);
}

.btn-primary:hover {
  background: var(--accent-btn-hover);
  color: var(--accent-text);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-input);
  color: var(--text);
}

.btn-secondary {
  background: var(--bg-mid);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-panel);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: var(--accent-text);
  border-color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 2.25rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
}

.btn-whatsapp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--btn-h);
  padding: 0.45rem 1.1rem;
  border: none;
  border-radius: 999px;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-whatsapp-pill:hover {
  background: #1ebe5b;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-whatsapp-pill .whatsapp-logo {
  width: 2rem;
  height: 2rem;
  display: block;
}

.btn-whatsapp-pill.btn-sm {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}

.btn-whatsapp-pill.btn-sm .whatsapp-logo {
  width: 1.1rem;
  height: 1.1rem;
}

[data-theme="light"] .btn-whatsapp-pill,
[data-theme="light"] .btn-whatsapp-pill:hover {
  color: #1a1d21;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Waste tracking form — grouped sections as cards */
#waste-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

#waste-form fieldset {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
}

#waste-form legend {
  float: left;
  padding: 0.22rem 0.7rem;
  border: 2px solid var(--accent-border);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

#waste-form fieldset > :not(legend) {
  clear: both;
}

#waste-form fieldset > :not(legend) + :not(legend) {
  margin-top: 0.9rem;
}

#waste-form select[multiple] {
  min-height: 8rem;
  width: 100%;
}

.waste-item-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}

.repeat-rows {
  display: grid;
  gap: 0.5rem;
  margin: 0.4rem 0;
}

.repeat-row {
  display: grid;
  grid-template-columns: 1fr 8rem auto;
  gap: 0.5rem;
  align-items: end;
}

@media (max-width: 640px) {
  .repeat-row {
    grid-template-columns: 1fr;
  }
}

.fieldset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}

.fieldset-grid > * {
  min-width: 0;
}

.fieldset-grid .field-span-2 {
  grid-column: 1 / -1;
}

.input-btn-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.input-btn-row select,
.input-btn-row input {
  flex: 1;
  min-width: 0;
}

.input-btn-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .fieldset-grid {
    grid-template-columns: 1fr;
  }
}

.form-action-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.form-action-row .btn {
  min-width: 12rem;
}

.form-action-row .muted {
  margin: 0;
  flex: 1;
  min-width: 10rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  min-height: var(--btn-h);
  padding: 0.5rem 0.7rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Native date/time picker indicator — keep it visible against the dark field */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"] {
  color-scheme: light;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  align-items: center;
  -webkit-appearance: none;
  appearance: none;
}

/* Browser autofill — keep the theme look instead of Chrome's default white/yellow */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.role-pick {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.role-pick legend {
  font-weight: 800;
  padding: 0 0.35rem;
}

.choice {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  margin: 0.55rem 0;
  font-weight: 700;
  cursor: pointer;
}

.choice input {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--accent);
}

.auth-panel {
  max-width: 28rem;
  margin: 1.5rem auto;
}

.content-panel {
  max-width: 46rem;
  margin: 1.5rem auto;
}

.content-panel h2 {
  margin-top: 1.75rem;
  margin-bottom: 0.4rem;
}

.content-panel p,
.content-panel ul,
.content-panel ol {
  color: var(--text);
}

.content-panel ul,
.content-panel ol {
  padding-left: 1.4rem;
}

.content-panel li {
  margin: 0.35rem 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-oauth {
  margin: 0;
}

.auth-forgot {
  margin: -0.35rem 0 0;
  text-align: right;
  font-size: 0.9rem;
}

.auth-forgot a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-forgot a:hover {
  color: var(--accent);
}

/* Google Sign-In style (white surface + multicolour G) */
.btn-google {
  gap: 0.75rem;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}

.btn-google:hover {
  background: #f8f9fa;
  color: #3c4043;
  border-color: #d2d3d4;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
}

.btn-google:focus-visible {
  outline: 3px solid #4285f4;
  outline-offset: 2px;
}

.btn-google-icon {
  flex-shrink: 0;
  display: block;
}

/* Merchant tabs */
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  width: 100%;
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.5rem;
  padding: 0.35rem 0.4rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

@media (min-width: 700px) {
  .tabs {
    gap: 0.5rem;
    width: auto;
  }

  .tab {
    flex: 0 0 auto;
    min-width: unset;
    min-height: var(--btn-h);
    padding: 0.45rem 0.9rem;
    font-size: 0.95rem;
  }
}

.tab.is-active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent-border);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.market-board .price-cell {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.banner {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  margin-bottom: 1rem;
  background: var(--bg-input);
  font-weight: 600;
}

.banner-warn {
  border-color: var(--accent);
}

.onboarding-nudge {
  font-weight: 500;
}

.onboarding-nudge strong {
  font-weight: 700;
}

button.text-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

button.text-link:hover {
  color: var(--ink);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.3rem;
  border-bottom-color: transparent;
}

.toggle-row input[type="checkbox"] {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--accent);
}

.toggle-row .choice {
  margin: 0;
  gap: 0.5rem;
}

.metal-swatch {
  border: 1px solid var(--swatch-border);
}

.metal-swatch .metal-unit {
  opacity: 0.75;
  font-weight: 600;
}

.metal-swatch .choice {
  color: inherit;
}

.market-board .metal-swatch td {
  border-bottom-color: transparent;
}

.market-board .metal-swatch .price-cell {
  color: inherit;
  opacity: 0.95;
}

.market-board tbody tr.metal-swatch {
  border-radius: var(--radius);
}

.market-board tbody tr.metal-swatch td:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.market-board tbody tr.metal-swatch td:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

#prices-list .metal-swatch td {
  border-bottom-color: transparent;
}

#prices-list .metal-swatch .yard-price {
  width: 100%;
  max-width: 9rem;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  border-color: rgba(255, 255, 255, 0.28);
}

#prices-list .metal-swatch .price-cell {
  color: inherit;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}

/* Find yards — compact filter row */
.find-hero {
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
}

.find-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.find-hero-top h1 {
  margin: 0;
  font-size: 1.25rem;
}

.filter-bar {
  display: grid;
  gap: 0.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .filter-bar {
    grid-template-columns: minmax(12rem, 1.5fr) minmax(9rem, 0.85fr) minmax(8rem, 0.9fr);
  }
}

.filter-field label,
.filter-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.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;
}

.filter-distance {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.distance-inline {
  margin: 0;
  flex-shrink: 0;
}

.distance-inline .distance-value {
  float: none;
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
  font-size: 0.9rem;
}

.filter-distance input[type="range"] {
  flex: 1;
  min-width: 0;
  min-height: 1.5rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.filter-distance input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
}

.filter-distance input[type="range"]:focus {
  outline: none;
}

.filter-distance input[type="range"]::-moz-range-thumb {
  border: none;
}

.metal-dropdown {
  position: relative;
}

.metal-dropdown-toggle {
  width: 100%;
  min-height: var(--btn-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.metal-dropdown-caret {
  color: var(--muted);
}

.metal-dropdown-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 0.4rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: 0 10px 24px var(--shadow);
}

.metal-dropdown-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
}

.metal-dropdown-option:last-child {
  margin-bottom: 0;
}

.metal-dropdown-option input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.metal-chip-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.metal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border: 2px solid var(--chip-border);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.location-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

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

.location-row .btn {
  flex-shrink: 0;
  min-width: 4.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.fav-choice {
  margin: 0;
  margin-right: auto;
}

.view-toggle {
  display: flex;
  gap: 0.4rem;
  margin-left: 0;
}

.find-results {
  margin-top: 0.25rem;
}

#map {
  width: 100%;
  min-height: 420px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
}

.map-placeholder {
  padding: 2rem 1.25rem;
  color: var(--muted);
  font-weight: 600;
}

/* Google InfoWindow: force readable dark text (Maps uses a white bubble) */
.gm-style .gm-style-iw-c,
.gm-style .gm-style-iw-d {
  color: #1a1d21 !important;
}

.map-info {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  min-width: 180px;
  max-width: 260px;
  padding: 0.15rem 0.1rem 0.25rem;
  color: #1a1d21;
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.35;
}

.map-info-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #c99200;
  background: #eceff3;
  flex-shrink: 0;
}

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

.map-info-name {
  font-weight: 800;
  font-size: 1rem;
  color: #1a1d21;
  margin-bottom: 0.15rem;
}

.map-info-addr {
  color: #5a6470;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.map-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.4rem;
}

.map-info-meta {
  color: #3d4550;
  font-weight: 700;
  font-size: 0.82rem;
}

.map-info-link {
  display: inline-block;
  color: #8a6a00 !important;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-info-link:hover {
  color: #c99200 !important;
}

.dealer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dealer-card {
  display: block;
  padding: 1rem 1.1rem;
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.dealer-card:hover {
  border-color: var(--accent);
}

.dealer-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-weight: 600;
}

.fav-btn {
  min-width: 3.25rem;
}

.price-grid {
  display: grid;
  gap: 0.5rem;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.price-row.metal-swatch {
  border-bottom: none;
  border-radius: var(--radius);
}

.price-row.metal-swatch .metal-unit {
  opacity: 0.75;
  font-weight: 600;
}

.stars {
  display: flex;
  gap: 0.35rem;
  font-size: 1.25rem;
}

.review {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.status-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 0.35rem;
}

/* Avatars */
.avatar {
  display: block;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg-input);
  flex-shrink: 0;
}

/* Avatar picker preview always shows the accent-hover border to indicate the
   currently selected avatar, matching the option hover treatment. */
#avatar-preview {
  border-color: var(--accent-hover);
}

.avatar-sm {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.avatar-md {
  width: 72px;
  height: 72px;
}

.avatar-lg {
  width: 96px;
  height: 96px;
}

.avatar-xl {
  width: 112px;
  height: 112px;
  border-radius: 18px;
  border-width: 3px;
  border-color: var(--accent);
}

.dealer-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.dealer-header-text h1 {
  margin-bottom: 0.25rem;
}

.dealer-header-text .lede {
  margin-bottom: 0;
}

.dealer-card-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.avatar-editor {
  display: grid;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  margin-bottom: 0.15rem;
  align-items: center;
}

@media (min-width: 700px) {
  .avatar-editor {
    grid-template-columns: auto 1fr;
  }
}

.avatar-preview-wrap {
  display: flex;
  justify-content: center;
}

.avatar-controls-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.35rem;
}

.avatar-controls-head .avatar-hint {
  margin: 0;
  font-size: 0.85rem;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0;
}

.icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  padding: 0.35rem 0.2rem 0.4rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-panel);
  font-family: inherit;
  min-height: 0;
  color: var(--muted);
}

.icon-option:hover {
  border-color: var(--accent-hover);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.icon-option-label {
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
}

.icon-option img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.icon-option.is-selected:not(.icon-option-first) {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.icon-option-first {
  border-color: var(--accent);
  border-width: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.icon-option-first:hover {
  border-color: var(--accent-hover);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.icon-option-custom .custom-thumb-wrap {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px dashed var(--steel);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--bg-input);
}

.avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.avatar-hint {
  margin: 0;
  font-size: 0.85rem;
}

.avatar-mode {
  margin: 0;
}

/* Admin dashboard */
.admin-tabs {
  overflow-x: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.stat-card {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.3;
}

.waste-trend {
  display: flex;
  flex-direction: column;
  height: 8.5rem;
  padding-top: 0.75rem;
}

.waste-trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  min-height: 0;
}

.waste-trend-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.waste-trend-bar {
  width: 72%;
  max-width: 18px;
  min-height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transition: background 0.15s ease;
}

.waste-trend-bar.is-zero {
  background: var(--border);
}

.waste-trend-bar.is-tonnes {
  background: var(--ok);
}

.waste-trend-bar.is-tonnes:hover {
  background: var(--accent-hover);
}

.waste-trend-bar:hover {
  background: var(--accent-hover);
}

.waste-trend-stack {
  width: 72%;
  max-width: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}

.waste-trend-seg {
  width: 100%;
  flex: none;
  min-height: 2px;
}

.waste-trend-labels {
  display: flex;
  height: 1.1rem;
  margin-top: 0.3rem;
  overflow: hidden;
}

.waste-trend-label {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waste-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin: 0.35rem 0 0.5rem;
}

.waste-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.waste-legend-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.admin-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.admin-search {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.filter-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.filter-fieldset legend {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 0.25rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  border-color: var(--accent);
}

.filter-chip.is-active,
.filter-chip--check:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip--check {
  flex-direction: row !important;
  align-items: center;
  align-self: end;
  font-weight: 700;
  margin: 0;
}

.filter-chip--check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.stat-card.is-jump {
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  appearance: none;
}

.stat-card.is-jump:hover,
.stat-card.is-jump:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.admin-toolbar input[type="search"],
.admin-toolbar select,
.yard-editor input,
.yard-editor textarea,
.metal-add-form input,
#metals-body input[type="text"],
#metals-body input[type="number"],
.user-role {
  min-height: 2.4rem;
  padding: 0.4rem 0.55rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
}

.inline-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.inline-check input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
}

.table-scroll {
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.pill-ok {
  background: var(--ok-flash-bg);
  color: var(--ok);
  border-color: transparent;
}

.pill-danger {
  background: var(--danger-flash-bg);
  color: var(--danger-text);
  border-color: transparent;
}

.pill-warn {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.muted.small {
  font-size: 0.85rem;
  font-weight: 500;
}

.yard-editor {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.admin-reviews {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-review {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: var(--bg-input);
}

.admin-review.is-hidden-review {
  opacity: 0.72;
}

.admin-review-head {
  margin-bottom: 0.25rem;
}

.admin-review-comment {
  margin: 0.5rem 0 0.75rem;
}

.metal-swatch-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.35rem 0.4rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid var(--swatch-border);
}

.color-inputs {
  white-space: nowrap;
}

.color-inputs input[type="color"] {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.metal-add-form {
  margin-top: 1rem;
  max-width: 36rem;
}

.checklist {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.checklist li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.35rem 0;
}

.checklist li.is-done {
  opacity: 0.7;
  text-decoration: line-through;
}

.hours-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  margin: 0.75rem 0;
}

.hours-editor {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.hours-row {
  display: grid;
  grid-template-columns: 6.5rem auto auto auto auto;
  gap: 0.5rem;
  align-items: center;
}

.hours-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.hours-list li {
  display: flex;
  gap: 0.75rem;
}

.hours-list li span {
  width: 2.5rem;
  color: var(--muted);
}

.price-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.price-chip {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--swatch-border);
}

.merchant-reply {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.visibility-toggle {
  margin-bottom: 0.75rem;
}

.open-now {
  color: var(--ok);
  font-weight: 700;
}

.reply-label {
  display: block;
  margin-top: 0.5rem;
}

/* Merchant analytics: large numeric totals only */
.stats-grid--metrics .stat-value {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .hours-row {
    grid-template-columns: 1fr 1fr;
  }

  .hours-day {
    grid-column: 1 / -1;
  }
}

/* Waste receipts table */
.waste-receipts td.num-cell,
.waste-receipts th.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-accepted { color: #0b6b37; background: rgba(61, 214, 140, 0.18); }
.status-submitted { color: #0b6b7a; background: rgba(23, 162, 184, 0.16); }
.status-pending { color: #8a6a00; background: rgba(255, 193, 7, 0.2); }
.status-error { color: #4b5158; background: rgba(108, 117, 125, 0.18); }
.status-rejected { color: #a32718; background: rgba(220, 53, 69, 0.16); }
[data-theme="dark"] .status-accepted { color: #7be0ac; }
[data-theme="dark"] .status-submitted { color: #6fd8e8; }
[data-theme="dark"] .status-pending { color: #ffd24d; }
[data-theme="dark"] .status-error { color: #b7bec6; }
[data-theme="dark"] .status-rejected { color: #ff9d90; }

/* Waste stats panel polish */
#tab-waste-stats .stat-card {
  padding: 0.9rem 1rem;
}

#tab-waste-stats .form-row-2 {
  margin-bottom: 1rem;
}

#tab-waste-stats > .table-scroll {
  margin-bottom: 1rem;
}

.billing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

@media (min-width: 720px) {
  .billing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.billing-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--bg-card, transparent);
}

.billing-card h3 {
  margin-top: 0;
}

.billing-prices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.billing-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

