:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #fff;
  --text: #17202c;
  --muted: #5c6675;
  --line: #e4e8ef;
  --blue: #185adb;
  --blue-bg: #ecf2ff;
  --green: #146c43;
  --green-bg: #eaf6ef;
  --orange: #915108;
  --orange-bg: #fff4df;
  --red: #b32631;
  --red-bg: #fff0f1;
  --shadow: 0 2px 8px #00000008, 0 12px 40px #0000000a;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
input,
select {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  min-height: 46px;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--blue);
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 16px;
  line-height: 1.4;
}
small,
.small {
  font-size: 12px;
}
svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.muted {
  color: var(--muted);
}
.mono,
.money {
  font-variant-numeric: tabular-nums;
}
.money {
  font-weight: 650;
  white-space: nowrap;
}
.wrap {
  overflow-wrap: anywhere;
}
.shell {
  max-width: 1050px;
  margin-inline: auto;
  padding: 24px 20px 110px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 24px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--text);
  color: var(--surface);
}
.brand-icon svg {
  width: 24px;
  height: 24px;
}
.subtitle {
  margin-block-start: 4px;
  color: var(--muted);
  font-size: 13px;
}
.user {
  font-size: 13px;
  color: var(--muted);
}
.health {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border-radius: 16px;
  margin-block-end: 24px;
}
.health-main {
  display: flex;
  gap: 10px;
  align-items: center;
}
.health-dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}
.health-dot.warn {
  background: var(--orange);
}
.health-title {
  font-size: 13px;
  font-weight: 600;
}
.health-age {
  font-size: 12px;
  color: var(--muted);
}
.page-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-block-end: 20px;
}
.page-head p {
  margin-block-start: 5px;
  font-size: 13px;
  color: var(--muted);
}
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  margin-inline-start: 7px;
}
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, 0.55fr);
  gap: 12px;
  margin-block-end: 16px;
}
.search {
  position: relative;
}
.search svg {
  position: absolute;
  inset-inline-start: 13px;
  inset-block-start: 13px;
  color: var(--muted);
}
.search input {
  padding-inline-start: 41px;
}
.segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 20px;
}
.segment {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  padding: 9px 12px;
  min-height: 42px;
}
.segment.active {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: var(--blue);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  border: 1px solid transparent;
}
.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}
.card-title {
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-block-start: 4px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--blue-bg);
  color: var(--blue);
}
.badge.green {
  background: var(--green-bg);
  color: var(--green);
}
.badge.orange {
  background: var(--orange-bg);
  color: var(--orange);
}
.badge.red {
  background: var(--red-bg);
  color: var(--red);
}
.badge.gray {
  background: var(--bg);
  color: var(--muted);
}
.raw {
  font-size: 14px;
  overflow-wrap: anywhere;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
}
.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.price-label {
  font-size: 11px;
  color: var(--muted);
  margin-block-end: 3px;
}
.price-value {
  font-size: 20px;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.price-mini {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: auto;
}
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition:
    opacity 150ms,
    background-color 150ms,
    transform 100ms cubic-bezier(0.2, 0, 0, 1);
}
.btn:not(.static):active {
  transform: scale(0.96);
}
.btn:hover {
  background: var(--bg);
}
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn.primary:hover {
  opacity: 0.9;
}
.btn.danger {
  background: var(--red-bg);
  border-color: var(--red-bg);
  color: var(--red);
}
.btn.quiet {
  border-color: transparent;
  background: var(--bg);
  color: var(--muted);
}
.btn.full {
  width: 100%;
}
.btn.compact {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 12px;
}
.actions > .btn {
  flex: 1;
}
.link-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}
.link-row a {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 54px 20px;
  background: var(--surface);
  border-radius: 18px;
  color: var(--muted);
}
.empty svg {
  width: 34px;
  height: 34px;
  color: var(--blue);
}
.empty h3 {
  color: var(--text);
}
.empty p {
  max-width: 400px;
  font-size: 13px;
}
.loading {
  padding: 80px 24px;
  text-align: center;
  color: var(--muted);
}
.banner {
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--orange-bg);
  color: var(--orange);
  font-size: 13px;
  margin-block-end: 16px;
}
.nav {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 650px;
  margin-inline: auto;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-block-start: 1px solid var(--line);
  z-index: 10;
  box-shadow: 0 -6px 30px #00000006;
}
.nav-button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 6px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.nav-button[aria-current="page"] {
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 650;
}
.nav-button svg {
  width: 21px;
  height: 21px;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.list-item {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.list-item p {
  font-size: 13px;
}
.list-item .small {
  margin-block-start: 4px;
}
.section-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.section-price {
  font-size: 15px;
  font-weight: 650;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toggle-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--bg);
  border-radius: 12px;
}
.toggle-row span {
  flex: 1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.notice {
  font-size: 13px;
  padding: 12px;
  border-radius: 10px;
  background: var(--blue-bg);
  color: var(--blue);
}
.form-error {
  font-size: 13px;
  color: var(--red);
  background: var(--red-bg);
  padding: 12px;
  border-radius: 10px;
  white-space: pre-wrap;
}
.form-error[hidden] {
  display: none;
}
.preview {
  padding: 16px;
  border-radius: 14px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preview-total {
  padding-block-start: 10px;
  border-block-start: 1px solid var(--line);
  font-size: 18px;
  font-weight: 700;
}
.offers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.offer {
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.offer:first-child {
  border-color: var(--blue);
  background: var(--blue-bg);
}
.offer p {
  font-size: 13px;
}
.history-meta {
  font-size: 12px;
  color: var(--muted);
}
.history-entry {
  padding: 16px;
  background: var(--surface);
  border-radius: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.history-icon {
  display: grid;
  place-items: center;
  background: var(--blue-bg);
  color: var(--blue);
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
}
.history-entry p {
  font-size: 13px;
  margin-block: 3px;
}
.history-entry code {
  font-size: 11px;
  overflow-wrap: anywhere;
  color: var(--muted);
}
dialog {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100dvh - 48px);
  padding: 22px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: auto;
}
dialog::backdrop {
  background: #0007;
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 20px;
}
.dialog-head h2 {
  font-size: 20px;
}
.close {
  border: 0;
  background: var(--bg);
  border-radius: 10px;
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.toast {
  position: fixed;
  inset-inline: 16px;
  inset-block-end: calc(90px + env(safe-area-inset-bottom));
  max-width: 600px;
  margin-inline: auto;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  z-index: 30;
  overflow-wrap: anywhere;
}
.toast[hidden] {
  display: none;
}
.load-more {
  margin-block-start: 20px;
}
.demo-label {
  background: var(--orange-bg);
  color: var(--orange);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
}
.selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}
.selection {
  display: block;
  text-align: start;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.selection.active {
  border-color: var(--blue);
  background: var(--blue-bg);
}
@media (min-width: 900px) {
  .shell {
    padding-inline-start: 200px;
    padding-block-end: 40px;
  }
  .nav {
    inset-inline-start: max(20px, calc((100vw - 1050px) / 2));
    inset-inline-end: auto;
    inset-block-start: 190px;
    inset-block-end: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 160px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .nav-button {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px;
    font-size: 13px;
  }
  .card {
    padding: 20px;
  }
}
@media (max-width: 380px) {
  .shell {
    padding: 18px 12px 110px;
  }
  .brand {
    gap: 9px;
  }
  .brand-icon {
    width: 37px;
    height: 37px;
    border-radius: 12px;
  }
  h1 {
    font-size: 20px;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 15px;
  }
  .card-head {
    flex-wrap: wrap;
  }
  .topbar {
    gap: 8px;
  }
  .user {
    display: none;
  }
  dialog {
    padding: 18px;
  }
  .actions {
    gap: 8px;
  }
  .btn {
    padding-inline: 10px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12151b;
    --surface: #1c2029;
    --text: #edf0f5;
    --muted: #a5afbf;
    --line: #343b48;
    --blue: #8fb3ff;
    --blue-bg: #223351;
    --green: #82d8a5;
    --green-bg: #18382b;
    --orange: #f3c77e;
    --orange-bg: #3d301d;
    --red: #ff9eaa;
    --red-bg: #42232c;
  }
  .btn.primary {
    background: #2f6cec;
    border-color: #2f6cec;
    color: #fff;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .btn:active {
    transform: none !important;
  }
}
