@font-face {
  font-family: Geist;
  src: url("/fonts/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  font-family: Geist, system-ui, sans-serif;
  color: #2a1110;
  background: #fff6ed;
  font-synthesis: none;
  --ink: #2a1110;
  --paper: #fff6ed;
  --primary: #d92322;
  --highlight: #ffdfae;
  --accent: #ffc9be;
  --line: #ddc9c4;
  --muted: #604a48;
  --surface: #fff;
  --error: #913226;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  line-height: 1.5;
}
a {
  color: var(--primary);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
input:focus-visible,
select:focus-visible {
  outline-offset: 1px;
}
.shell {
  width: min(100%, 1320px);
  margin: auto;
  padding: 0 clamp(16px, 4vw, 64px);
}
header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  width: clamp(132px, 18vw, 210px);
  height: 52px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0;
  color: transparent;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
}
.brand-dot {
  display: none;
}
main {
  min-height: calc(100vh - 178px);
}
.overline,
.step {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary);
}
h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}
h1 {
  font-size: clamp(42px, 6vw, 82px);
  line-height: 1.04;
  letter-spacing: -0.055em;
  font-weight: 700;
  margin: 14px 0 22px;
}
h2 {
  letter-spacing: -0.035em;
  line-height: 1.16;
}
p {
  line-height: 1.65;
}
.intro {
  max-width: 760px;
  padding: clamp(40px, 7vw, 92px) 0 26px;
}
.intro p {
  font-size: clamp(17px, 2vw, 22px);
  color: var(--muted);
  max-width: 620px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: clamp(22px, 4vw, 48px);
  box-shadow: 8px 8px 0 rgba(36, 19, 48, 0.07);
  min-width: 0;
}
.panel h2 {
  font-size: clamp(25px, 3vw, 35px);
  margin: 4px 0 24px;
}
.login {
  max-width: 650px;
  margin-bottom: 90px;
}
form label,
#card-app label,
.field-label,
.admin-panel > label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 18px 0 8px;
}
input:not([type="hidden"]),
select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #a38d88;
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}
input::placeholder {
  color: #665450;
}
button:not(.quiet):not(.dialog-close):not(.sort-button) {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  border-radius: 2px;
  padding: 12px 20px;
  min-height: 46px;
  margin-top: 18px;
  font-weight: 700;
  transition:
    background 0.18s,
    color 0.18s,
    transform 0.18s;
}
button:not(.quiet):not(.dialog-close):not(.sort-button):hover:not(:disabled) {
  background: #a21b19;
  transform: translateY(-2px);
}
.muted {
  font-size: 13px;
  color: var(--muted);
}
.centered {
  max-width: 650px;
  margin: clamp(50px, 9vw, 110px) auto;
  text-align: center;
}
.centered h1,
.edit-panel h1 {
  font-size: clamp(38px, 5vw, 62px);
}
.centered .code-form {
  text-align: left;
  max-width: 360px;
  margin: 32px auto;
}
.text-link,
.back {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.dashboard-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: clamp(40px, 6vw, 76px) 0 30px;
  gap: 20px;
}
.dashboard-top h1 {
  font-size: clamp(40px, 5vw, 70px);
}
.dashboard-top p {
  color: var(--muted);
  margin-bottom: 0;
}
.quiet {
  background: transparent;
  color: var(--primary);
  border: 1px solid transparent;
  padding: 10px 12px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}
.quiet:hover {
  background: #ffe6d7;
}
.account,
.detail {
  margin-bottom: 24px;
}
.account-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}
.account-head > div,
.subscription > div {
  min-width: 0;
}
.account-head h2 {
  margin: 8px 0;
}
.account-head p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.subscriptions {
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding-top: 22px;
}
.subscriptions h3 {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.subscriptions h3 span {
  font-size: 11px;
  color: var(--ink);
  background: var(--highlight);
  border-radius: 20px;
  padding: 3px 8px;
  margin-left: 5px;
}
.subscription {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 18px 0;
  gap: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.18s;
}
.subscription:hover,
.subscription:focus-visible {
  background: #fff0e3;
}
.subscription strong,
.subscription small {
  display: block;
  overflow-wrap: anywhere;
}
.subscription small {
  color: var(--muted);
  margin-top: 5px;
}
.subscription-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}
.badge,
.status-good,
.status-bad,
.status-unknown {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.badge,
.status-good {
  background: var(--highlight);
  color: var(--ink);
}
.status-bad {
  background: #ffe2d9;
  color: #792d22;
}
.status-unknown {
  background: #f2e7e1;
  color: var(--ink);
}
.subscription-next {
  font-size: 12px;
  color: var(--muted);
  max-width: 250px;
  line-height: 1.5;
}
.back {
  display: inline-block;
  margin: 40px 0 20px;
}
.edit-panel {
  max-width: 740px;
  margin-bottom: 80px;
}
.edit-panel p {
  color: var(--muted);
}
.edit-panel form {
  max-width: 480px;
}
.notice,
.success {
  background: #ffebdd;
  padding: 16px;
  border-left: 4px solid var(--primary);
  color: var(--ink) !important;
}
.success {
  background: #e9f5c4;
  border-color: #58731a;
}
#card-element {
  border: 1px solid #a38d88;
  border-radius: 2px;
  padding: 17px;
  margin-top: 10px;
}
#card-element:focus-within {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
#card-error {
  min-height: 24px;
  color: var(--error) !important;
  font-size: 13px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 25px 0 34px;
  font-size: 12px;
  color: var(--muted);
}
.detail h1 {
  font-size: clamp(35px, 5vw, 65px);
  overflow-wrap: anywhere;
}
.detail h2 {
  margin-top: 38px;
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  background: #fff0e3;
  padding: clamp(18px, 3vw, 28px);
  margin: 30px 0;
}
.detail-stats strong {
  display: block;
  font-size: 17px;
  line-height: 1.4;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.line-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}
.line-item > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.line-item strong,
.line-item small {
  display: block;
}
.line-item small {
  color: var(--muted);
  margin-top: 6px;
}
.history {
  margin-bottom: 85px;
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}
th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}
td:last-child,
th:last-child {
  text-align: right;
}
.history table {
  min-width: 580px;
}
.history td,
.history th {
  white-space: nowrap;
}
.card-dialog {
  border: 1px solid var(--ink);
  border-radius: 2px;
  box-shadow: 12px 12px 0 #2a111055;
  padding: clamp(20px, 4vw, 38px);
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  color: var(--ink);
  background: var(--paper);
}
.card-dialog::backdrop {
  background: #2a1110b8;
}
.card-dialog h2 {
  font-size: clamp(29px, 5vw, 40px);
  margin: 20px 0 14px;
}
.card-dialog p {
  color: var(--muted);
  font-size: 14px;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dialog-close {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  margin: 0;
  padding: 6px 10px;
  min-width: 44px;
  min-height: 44px;
}
.dialog-close:hover {
  background: var(--accent);
}
.card-dialog #card-app {
  margin-top: 26px;
}
.card-dialog #card-submit {
  width: 100%;
}
.card-dialog #card-element {
  min-height: 59px;
}
.admin-panel {
  margin-bottom: 85px;
}
.admin-panel .table-scroll {
  margin-top: 22px;
}
.admin-panel table,
.admin-table {
  width: 100%;
  table-layout: auto;
}
.admin-panel th,
.admin-panel td,
.admin-table th,
.admin-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  vertical-align: middle;
}
.admin-panel td:nth-child(2) {
  color: var(--muted);
}
.admin-panel td form {
  margin: 0;
}
.admin-panel .table-action {
  margin: 0 !important;
  padding: 9px 12px !important;
  font-size: 12px;
  white-space: normal;
}
.admin-panel tr[hidden] {
  display: none !important;
}
.admin-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 20px;
}
.admin-controls > *,
.admin-controls label {
  min-width: 0;
}
.admin-controls label {
  margin: 0;
}
.admin-controls input,
.admin-controls select {
  max-width: 100%;
}
.admin-controls > div {
  flex: 1 1 185px;
}
.admin-controls button {
  margin-top: 0 !important;
}
.sort-button {
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  font-weight: inherit;
  color: inherit;
  border: 0;
  background: transparent;
  padding: 8px 4px;
  margin: -8px -4px;
  text-align: inherit;
  min-height: 44px;
}
.sort-button:hover,
.admin-table th[aria-sort] .sort-button:hover {
  color: var(--primary);
  text-decoration: underline;
}
.admin-table th[aria-sort="ascending"] .sort-button,
.admin-table th[aria-sort="descending"] .sort-button {
  color: var(--primary);
  font-weight: 800;
}
.sort-button span {
  margin-left: 4px;
}
.admin-panel [data-status] {
  min-height: 32px;
}
.status-loading {
  display: inline-block;
  width: 68px;
  height: 24px;
  border-radius: 2px;
  color: transparent;
  background: linear-gradient(100deg, #efe3dc 25%, #fff6ed 45%, #efe3dc 65%)
    100% 0/220% 100%;
  animation: status-pulse 1.5s ease-in-out infinite;
}
@keyframes status-pulse {
  to {
    background-position: -100% 0;
  }
}
.admin-explanation {
  margin-top: 24px;
}
.admin-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--highlight);
  color: var(--ink);
  padding: 14px 20px;
  margin-bottom: 25px;
  font-size: 13px;
}
.admin-banner form {
  margin-left: auto;
}
.edit-divider {
  border-top: 1px solid var(--line);
  margin: 38px 0 28px;
}
.recovery-summary {
  background: #fff1e8;
  border-left: 4px solid #a44331;
  padding: 16px 19px;
  margin: 18px 0;
}
.recovery-summary strong {
  font-size: 16px;
  line-height: 1.4;
}
.recovery-summary p {
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.55;
}
@media (max-width: 750px) {
  .detail-stats {
    grid-template-columns: 1fr;
  }
  .dashboard-top,
  .account-head {
    align-items: start;
    flex-direction: column;
  }
  .subscription {
    align-items: start;
    flex-direction: column;
  }
  .subscription-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .subscription-next {
    max-width: none;
  }
  .admin-panel .table-scroll {
    overflow: visible;
  }
  .admin-panel table,
  .admin-table,
  .admin-panel tbody,
  .admin-panel tr,
  .admin-panel td,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }
  .admin-panel thead,
  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .admin-panel tbody,
  .admin-table tbody {
    display: grid;
    gap: 12px;
  }
  .admin-panel tr,
  .admin-table tr {
    padding: 10px 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    min-width: 0;
  }
  .admin-panel td,
  .admin-table td {
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    text-align: left !important;
    overflow-wrap: anywhere;
  }
  .admin-panel td:last-child,
  .admin-table td:last-child {
    border: 0;
  }
  .admin-panel td::before,
  .admin-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    overflow-wrap: anywhere;
  }
  .admin-panel td form,
  .admin-table td form {
    min-width: 0;
  }
  .admin-panel td [data-status],
  .admin-table td [data-status] {
    min-width: 0;
  }
}
@media (max-width: 480px) {
  header {
    min-height: 72px;
  }
  .brand {
    width: 148px;
  }
  .shell {
    padding: 0 16px;
  }
  .intro {
    padding: 38px 0 15px;
  }
  .panel {
    padding: 22px 18px;
    box-shadow: 4px 4px 0 rgba(36, 19, 48, 0.07);
  }
  .dashboard-top {
    padding: 42px 0 25px;
  }
  .dashboard-top h1 {
    font-size: clamp(38px, 12vw, 52px);
  }
  .centered {
    margin: 50px auto;
  }
  .subscription-actions {
    gap: 9px;
  }
  .line-item {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }
  .admin-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-controls > * {
    width: 100%;
  }
  .admin-panel td,
  .admin-table td {
    grid-template-columns: minmax(75px, 32%) minmax(0, 1fr);
  }
  .admin-banner form {
    margin-left: 0;
    width: 100%;
  }
  .card-dialog {
    box-shadow: 4px 4px 0 #2a111055;
  }
}
@media (max-width: 650px) {
  .history .table-scroll {
    overflow: visible;
  }
  .history table,
  .history tbody,
  .history tr,
  .history td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .history thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .history tbody {
    display: grid;
    gap: 12px;
  }
  .history tr {
    padding: 10px 14px;
    border: 1px solid var(--line);
    background: var(--paper);
  }
  .history td {
    display: grid;
    grid-template-columns: minmax(75px, 32%) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    white-space: normal;
    overflow-wrap: anywhere;
    padding: 10px 0;
    text-align: left !important;
  }
  .history td:last-child {
    border-bottom: 0;
  }
  .history td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
