@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --red: #c51d24;
  --ink: #18212b;
  --muted: #596474;
  --line: #dce1e5;
  --bg: #f5f6f7;
  --green: #17633b;
  font: 16px/1.5 "DM Sans", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
h1,
h2,
h3,
.amount {
  font-family: "Manrope", Arial, sans-serif;
}
h2 {
  font-size: 1rem;
  line-height: 1.4;
}
h3 {
  font-size: 0.9375rem;
  line-height: 1.4;
}
p {
  overflow-wrap: anywhere;
}
.small,
small {
  font-size: 0.8125rem;
  line-height: 1.5;
}
.muted {
  color: var(--muted);
}
.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #195aac;
  outline-offset: 3px;
}
:is(a, button):active {
  opacity: 0.8;
}
.hide,
.desktop-only,
.sidebar,
.breadcrumb {
  display: none !important;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: 164px;
  background: #fff;
  flex-shrink: 0;
}
.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4.3;
  object-fit: cover;
  object-position: center;
}
.topbar {
  min-height: 60px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.top-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.main {
  padding: 16px 12px calc(104px + env(safe-area-inset-bottom));
  min-width: 0;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.heading > div {
  min-width: 0;
}
.heading p {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 4px;
}
.heading p:empty {
  display: none;
}
.btn,
.icon-button,
.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 9px 12px;
  border: 1px solid var(--red);
  border-radius: 6px;
  color: #fff;
  background: var(--red);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}
.btn.secondary,
.icon-button {
  color: var(--ink);
  background: #fff;
  border-color: #78838c;
}
.btn.dark {
  background: var(--ink);
  border-color: var(--ink);
}
.btn.text-btn,
.text-btn {
  color: var(--red);
  background: transparent;
  border-color: transparent;
  padding: 8px 4px;
}
.btn:hover {
  filter: brightness(0.96);
}
.icon-button {
  padding: 9px;
}
.card {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.row,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.row > *,
.section-title > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.section-title {
  margin-bottom: 8px;
}
.two-col,
.three-col,
.content-grid,
.form-grid,
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.content-grid,
.spacer {
  margin-top: 16px;
}
.amount {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  margin: 8px 0;
}
.card-label {
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.wallet-summary {
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  padding: 16px;
}
.wallet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wallet-top .amount {
  font-size: clamp(1.4rem, 6vw, 2rem);
  margin: 4px 0 0;
}
.wallet-top .btn {
  border-color: #fff;
  background: #fff;
  color: var(--ink);
  flex-shrink: 0;
}
.summary-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-top: 1px solid #67717d;
  margin-top: 12px;
  padding-top: 8px;
  font-size: 0.8125rem;
  flex-wrap: wrap;
}
.summary-link strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.summary-link .icon {
  width: 18px;
}
.due-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.due-row > div {
  min-width: 0;
}
.due-row .btn {
  flex-shrink: 0;
}
.service-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 8px;
  margin: 12px 0;
}
.service-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  min-height: 68px;
  padding: 8px 2px;
  font-size: 0.8125rem;
  text-align: center;
}
.service-nav a:hover {
  background: #e9edf0;
  border-radius: 6px;
}
.transaction {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.transaction:last-child {
  border-bottom: 0;
}
.transaction .details {
  flex: 1;
  min-width: 0;
}
.transaction h3 {
  font-size: 0.8125rem;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}
.transaction .small {
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.transaction .money {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 32px;
  color: var(--muted);
}
.icon-box.green,
.positive {
  color: var(--green);
}
.pill {
  display: inline-block;
  border-radius: 4px;
  padding: 3px 6px;
  background: #eaf4ed;
  color: #205d3a;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}
.pill.warning {
  background: #fff0d5;
  color: #785009;
}
.pill.info {
  background: #edf0f3;
  color: #3e5062;
}
.pill.danger {
  background: #ffeded;
  color: #a31b23;
}
.field {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 12px 0;
}
.field :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #78838c;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.field :is(input, select, textarea):focus {
  border-color: var(--red);
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  margin: 12px 0;
  font-size: 0.875rem;
}
.check input {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--red);
}
.info-box,
.form-error {
  padding: 10px 12px;
  border-radius: 6px;
  background: #eef1f4;
  color: #465360;
  font-size: 0.8125rem;
}
.form-error {
  background: #fff0f0;
  color: #a31b23;
  margin: 12px 0;
}
.details-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  font-size: 0.875rem;
}
.details-list .row {
  align-items: flex-start;
}
.details-list .row > span {
  color: var(--muted);
  flex: 1;
}
.details-list strong {
  text-align: right;
  max-width: 62%;
}
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.page-tabs .btn {
  font-size: 0.8125rem;
}
.empty {
  padding: 20px 4px;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 4px;
}
.empty p {
  font-size: 0.875rem;
}
details {
  margin: 12px 0;
  border-top: 1px solid var(--line);
}
summary {
  min-height: 44px;
  padding: 12px 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
}
details > p {
  font-size: 0.875rem;
  color: var(--muted);
  padding-bottom: 8px;
}
.timeline {
  margin: 8px 0;
}
.step {
  padding: 0 0 16px 14px;
  border-left: 2px solid var(--line);
  font-size: 0.8125rem;
}
.step.current {
  border-color: var(--red);
}
.step p {
  color: var(--muted);
  margin-top: 4px;
}
.progress {
  height: 5px;
  background: #e8ecef;
  border-radius: 3px;
  margin: 12px 0;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--red);
}
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.schedule-cell {
  padding: 8px 4px;
  background: #f0f2f4;
  text-align: center;
  font-size: 0.75rem;
}
.schedule-cell.done {
  background: #eaf4ed;
  color: var(--green);
}
.schedule-cell.next {
  background: #fff0d5;
  color: #785009;
}
.catalog {
  display: grid;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}
.product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.product-card:last-child {
  border: 0;
}
.product-copy {
  min-width: 0;
  flex: 1;
}
.product-card .price {
  font-size: 0.9375rem;
}
.product-card h3 {
  margin: 2px 0 6px;
}
.service-list > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.service-list > a:last-child {
  border: 0;
}
.queue-list > a {
  display: grid;
  grid-template-columns: 1fr auto 68px 20px;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.queue-list > a:last-child {
  border: 0;
}
.queue-list strong {
  font-size: 1.125rem;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 0.8125rem;
}
th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
th {
  background: #f1f3f5;
  color: var(--muted);
}
td .small {
  display: block;
}
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eee;
  font-weight: 700;
}
.footnote {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 12px;
}
.footnote .btn {
  font-size: 0.75rem;
}
.server-status {
  color: var(--muted);
}
.refresh-warning {
  color: #8b4e00;
}
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  z-index: 20;
  width: calc(100% - 32px);
  max-width: 430px;
  margin-inline: auto;
  padding: 6px;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 24px #18212b1f, 0 1px 4px #18212b0d;
}
.bottom-nav :is(a, button) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  min-height: 52px;
  min-width: 0;
  padding: 4px 2px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
}
.bottom-nav a.active {
  color: var(--red);
  background: #fff0f0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  width: calc(100% - 24px);
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  color: var(--ink);
  box-shadow: 0 12px 50px #0003;
}
dialog::backdrop {
  background: #11182799;
}
dialog > h2 {
  padding-right: 48px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
dialog .close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.dialog-body {
  margin-top: 12px;
}
.receipt-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.receipt-head .brand,
.balance-card .brand {
  width: 240px;
  max-width: 100%;
}
.balance-card {
  background: var(--ink);
  color: #fff;
}
.success-mark {
  color: var(--green);
  margin-bottom: 12px;
}
.space-code {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
  background: #f0f2f4;
  padding: 12px;
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}
#toast {
  display: none;
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  margin: auto;
  max-width: 520px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  z-index: 50;
  font-size: 0.875rem;
}
#toast.visible {
  display: block;
}
.auth-layout {
  max-width: 440px;
  margin: auto;
  padding: 24px 20px;
}
.auth-story .brand {
  width: 240px;
  max-width: 100%;
}
.auth-story h1,
.auth-story p {
  display: none;
}
.auth-form {
  margin-top: 24px;
}
.auth-form > h2 {
  font-size: 1.375rem;
  margin: 4px 0;
}
.auth-form > p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.auth-form .page-tabs {
  margin-top: 20px;
}
.auth-form form > .btn {
  width: 100%;
}
.auth-note {
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 12px;
}
.boot {
  max-width: 360px;
  margin: 18vh auto;
  padding: 20px;
  text-align: center;
}
.boot .brand-logo {
  margin-bottom: 16px;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  z-index: 100;
}
.skip-link:focus {
  top: 8px;
}
.large-ui {
  font-size: 20px;
}
@media (min-width: 700px) {
  .sidebar {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    padding: 20px 14px;
    background: #fff;
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .sidebar .brand {
    width: 190px;
    max-width: 100%;
    margin-bottom: 24px;
  }
  .side-label {
    color: var(--muted);
    font-size: 0.75rem;
    margin: 0 10px 10px;
  }
  .navlink {
    min-height: 44px;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    margin-bottom: 2px;
    font-size: 0.875rem;
    border-radius: 5px;
  }
  .navlink.active {
    background: #fff0f0;
    color: var(--red);
    font-weight: 600;
  }
  .side-bottom {
    margin-top: auto;
    padding-top: 24px;
    font-size: 0.8125rem;
  }
  .side-bottom .btn {
    width: 100%;
    margin-top: 8px;
  }
  .topbar {
    margin-left: 220px;
    padding: 10px 24px;
    min-height: 64px;
  }
  .breadcrumb,
  .desktop-only {
    display: block !important;
  }
  .breadcrumb {
    font-size: 0.8125rem;
  }
  .scope-label {
    font-size: 0.75rem;
    color: var(--muted);
  }
  .mobile-only,
  .mobile-brand,
  .bottom-nav {
    display: none !important;
  }
  .main {
    margin-left: 220px;
    padding: 24px;
    max-width: 1320px;
  }
  h1 {
    font-size: 1.5rem;
  }
  .heading {
    margin-bottom: 20px;
  }
  .card {
    padding: 20px;
  }
  .service-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 16px 0;
  }
  .wallet-summary {
    padding: 20px;
  }
  .wallet-top .amount {
    font-size: 2rem;
  }
  .auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    max-width: 1080px;
    min-height: 100dvh;
    align-items: center;
    padding: 48px;
  }
  .auth-story h1 {
    display: block;
    font-size: 2.2rem;
    max-width: 360px;
    margin: 32px 0 12px;
  }
  .auth-story p {
    display: block;
    color: var(--muted);
  }
  .auth-form {
    margin: 0;
  }
  #toast {
    bottom: 24px;
  }
}
@media (min-width: 1100px) {
  .two-col,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .content-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 20px;
  }
  .schedule-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 359px) {
  .brand {
    width: 140px;
  }
  .main {
    padding-left: 10px;
    padding-right: 10px;
  }
  .transaction > .icon-box {
    display: none;
  }
  .heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media print {
  .sidebar,
  .topbar,
  .bottom-nav,
  .footnote,
  .skip-link,
  #toast {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .main {
    margin: 0;
    padding: 0;
  }
  body:has(dialog[open]) #app {
    display: none;
  }
  dialog[open] {
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  dialog .close,
  dialog .btn {
    display: none;
  }
}
