:root {
  --bg: #f4f7f5;
  --panel: #ffffff;
  --ink: #14231d;
  --muted: #68766f;
  --line: #dfe8e3;
  --green: #0f8a50;
  --dark: #10231b;
  --red: #b93636;
  --amber: #c98212;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.user-page {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 14px;
}

.user-card,
.tracker-card {
  width: min(760px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(17, 35, 27, .08);
  padding: clamp(22px, 4vw, 38px);
}

.tracker-card {
  width: min(1120px, 100%);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  font-size: 24px;
}

.brand-row strong,
.brand-row span {
  display: block;
}

.brand-row span,
.hero-copy p,
.flow-card p,
.tracker-head p,
.list-head p,
.favorites-panel p,
.small-note {
  color: var(--muted);
}

.hero-copy h1 {
  font-size: clamp(32px, 6vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
  margin: 0 0 14px;
  font-weight: 900;
}

.hero-copy p {
  max-width: 560px;
  margin: 0 auto 22px;
  font-size: 17px;
}

.flow-card,
.result-box,
.favorites-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
  padding: 18px;
  margin-top: 12px;
}

.flow-card h2 {
  font-weight: 900;
  font-size: 20px;
}

.code-input {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 8px;
}

.result-box.success {
  border-color: #bfe3ce;
  background: #effaf4;
  color: #087044;
  font-weight: 800;
}

.result-box.error {
  border-color: #efc8c8;
  background: #fff1f1;
  color: var(--red);
  font-weight: 800;
}

.small-note {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.legal-links button,
.cookie-banner button[data-bs-toggle] {
  border: 0;
  background: transparent;
  color: #087044;
  font-weight: 800;
  text-decoration: underline;
  padding: 0;
}

.legal-copy h6 {
  font-weight: 900;
  margin-top: 16px;
}

.legal-contact-box {
  border: 1px solid #cdebd9;
  border-radius: 12px;
  background: #f4fff8;
  padding: 14px;
  margin-bottom: 16px;
}

.legal-contact-box h6 {
  margin-top: 0;
}

.legal-contact-box p {
  margin: 0 0 6px;
}

.legal-copy li {
  margin-bottom: 6px;
}

.useful-footer {
  width: min(1080px, 100%);
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(16, 35, 25, .06);
}

.useful-footer strong {
  display: block;
  font-weight: 900;
  font-size: 18px;
}

.useful-footer p {
  margin: 3px 0 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d7e5dd;
  border-radius: 999px;
  background: #fbfdfb;
  color: #123026;
  padding: 8px 11px;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
}

.footer-links a:hover {
  border-color: #9bd1b4;
  color: #087044;
  background: #f4fff8;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1080;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  border: 1px solid #cdebd9;
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 50px rgba(17, 35, 27, .18);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cookie-banner strong,
.cookie-banner p {
  display: block;
  margin: 0;
}

.cookie-banner p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.tracker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tracker-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.system-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
  padding: 10px 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.system-status.ok {
  border-color: #cdebd9;
  background: #f7fffa;
  color: #087044;
}

.system-status.warn {
  border-color: #f0d7a2;
  background: #fff8e9;
  color: #775018;
}

.national-stats {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border: 1px solid #cdebd9;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fffa, #eefaf4);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.source-logo {
  width: 68px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
  padding: 5px;
  border: 1px solid #dcefe4;
  border-radius: 8px;
  background: #fff;
}

.national-stats span,
.national-stats small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.national-stats strong {
  display: block;
  color: #087044;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.national-stats small {
  margin-left: auto;
  text-align: right;
}

.tracker-head h1 {
  font-weight: 900;
  font-size: clamp(26px, 4vw, 38px);
  margin: 8px 0 4px;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #087044;
  background: #effaf4;
  border: 1px solid #bfe3ce;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 900;
}

.countdown-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid #cdebd9;
  border-radius: 10px;
  background: #f7fffa;
}

.countdown-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.countdown-box strong {
  color: #087044;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.countdown-box.expired {
  border-color: #f0d7a2;
  background: #fff8e9;
}

.countdown-box.expired strong {
  color: #94610f;
}

.region-tools,
.list-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.region-search {
  min-width: 240px;
  flex: 1 1 320px;
}

.radius-control {
  width: 210px;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px 6px;
  background: #fff;
}

.radius-top,
.radius-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.radius-top span,
.radius-scale {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.radius-top strong {
  color: #087044;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.radius-control .form-range {
  margin: 4px 0 0;
  accent-color: var(--green);
}

.geo-help {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid #f0d7a2;
  border-radius: 10px;
  background: #fff9ee;
  color: #775018;
  font-size: 14px;
}

.map-box {
  height: 360px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
  background: #eef3ef;
}

.list-head h2,
.favorites-panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.list-head p,
.favorites-panel p {
  margin: 2px 0 0;
}

.list-head input {
  max-width: 320px;
}

.machine-list,
.favorite-list {
  display: grid;
  gap: 10px;
}

.machine-item,
.favorite-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.favorite-item {
  border-color: #bfe3ce;
  background: #f6fff9;
}

.favorite-item::before {
  content: "★";
  color: var(--amber);
  font-weight: 900;
  font-size: 20px;
}

.favorite-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.machine-title,
.favorite-title {
  font-weight: 900;
}

.favorite-title small {
  display: block;
  color: var(--muted);
  font-weight: 650;
  margin-top: 2px;
}

.machine-address,
.favorite-meta {
  color: var(--muted);
  font-size: 13px;
}

.pill-row,
.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-pill,
.bin-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status-active,
.bin-ok {
  color: #087044;
  background: #effaf4;
  border: 1px solid #cdebd9;
}

.status-warning {
  color: #94610f;
  background: #fff7e8;
  border: 1px solid #f0d7a2;
}

.status-inactive,
.bin-full {
  color: #9b2e2e;
  background: #fff0f0;
  border: 1px solid #f1cece;
}

.empty-state {
  border: 1px dashed #bfd0c7;
  border-radius: 10px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .user-page {
    padding: 10px;
  }

  .user-card,
  .tracker-card {
    border-radius: 10px;
    padding: 18px 14px;
  }

  .brand-row {
    justify-content: flex-start;
    margin-bottom: 18px;
  }

  .hero-copy h1 {
    font-size: 34px;
    line-height: 1.08;
  }

  .hero-copy p {
    font-size: 15px;
    margin-bottom: 18px;
  }

  .flow-card {
    padding: 14px;
  }

  .code-input {
    font-size: 24px;
    letter-spacing: 5px;
  }

  .btn-lg {
    font-size: 17px;
    padding: 10px 14px;
  }

  .tracker-head,
  .tracker-actions,
  .system-status,
  .region-tools,
  .list-head,
  .machine-item {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .tracker-actions .btn,
  .system-status .btn {
    width: 100%;
  }

  .national-stats {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .national-stats small {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }

  .source-logo {
    width: 58px;
    height: 36px;
  }

  .useful-footer {
    padding: 14px;
  }

  .footer-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .footer-links a {
    justify-content: center;
    border-radius: 10px;
  }

  .favorite-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .favorite-item .item-actions {
    grid-column: 1 / -1;
  }

  .region-tools .form-control,
  .radius-control,
  .region-search,
  .list-head input {
    max-width: none;
    width: 100%;
  }

  .region-search {
    flex: 0 0 auto;
    min-width: 0;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
  }

  .cookie-actions .btn {
    width: 100%;
  }
}
