:root {
  --bg: #f5f7f8;
  --panel: #fff;
  --text: #172126;
  --muted: #66737d;
  --line: #dce3e8;
  --brand: #0b7f68;
  --brand-dark: #096350;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand,
.nav,
.button,
button {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
}

.nav {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav a,
.button,
button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: white;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.primary:hover {
  background: var(--brand-dark);
}

.profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f4f1;
  color: var(--brand-dark);
  font-weight: 800;
}

.profile-meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.profile-meta span {
  color: var(--muted);
  font-size: 12px;
}

.profile-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.profile-logout {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: white;
  text-decoration: none;
  color: var(--muted);
}

.content {
  width: min(1140px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.headline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1 {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

p {
  line-height: 1.5;
}

.headline p,
.muted,
.catalog-card span {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.catalog-card,
.location-card,
.package-card,
.row-link {
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.catalog-card strong,
.location-card strong,
.package-card strong {
  font-size: 18px;
}

.price,
.total {
  font-size: 28px;
  font-weight: 850;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 16px;
  align-items: start;
}

.list {
  display: grid;
  gap: 10px;
}

.row-link {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: white;
}

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 24px;
  align-items: start;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #e8ca93;
  border-radius: 8px;
  background: #fff8eb;
  color: #684407;
}

.danger {
  border-color: #f0b7b2;
  background: #fff1f0;
  color: var(--danger);
}

.badge {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.qr {
  max-width: 280px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.button-stack,
.manual-data,
.help-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.button-stack {
  justify-items: start;
}

.manual-data {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(120px, .45fr) minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
}

.detail-row strong {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.spaced {
  margin-top: 16px;
}

@media (max-width: 760px) {
  .headline,
  .auth {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 16px;
  }

  .brand {
    justify-content: center;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .nav a {
    justify-content: center;
    text-align: center;
  }

  .profile {
    min-width: 0;
    width: 100%;
  }

  .profile-logout {
    justify-content: center;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .row-link {
    grid-template-columns: 1fr;
  }

  .detail-row {
    grid-template-columns: 1fr;
  }
}
