:root {
  --ink: #000;
  --muted: #5f6668;
  --brand: #678086;
  --brand-hover: #879ca1;
  --paper: #dbdcde;
  --light: #f0f0f0;
  --card: #fff;
  --line: #c8cdcf;
  --ok: #1f7a52;
  --warn: #9a5b0b;
  --bad: #b33c2f;
  --shadow: 0 22px 60px rgba(0, 0, 0, .1);
  --font-sans: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body, button, input, select { font-family: var(--font-sans); }
body { margin: 0; min-height: 100vh; background: linear-gradient(145deg, var(--light), var(--paper) 52%); }
button, input, select { font: inherit; }
button, a { transition: color .2s ease, background-color .2s ease, border-color .2s ease, opacity .2s ease, transform .15s ease; }
button:active { transform: translateY(1px); }
a { color: inherit; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 24px clamp(20px, 4vw, 56px); gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand img { width: 38px; height: 34px; }
.brand strong { display: block; font-size: .94rem; letter-spacing: -.02em; }
.brand span { display: block; margin-top: 2px; color: var(--muted); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.lang-select { border: 1px solid var(--ink); background: transparent; padding: 9px 30px 9px 13px; border-radius: 100px; color: var(--ink); font-size: .72rem; font-weight: 600; }

.center { flex: 1; display: grid; place-items: center; padding: 28px 20px 70px; }
.card { width: min(100%, 490px); background: var(--card); border: 1px solid rgba(0, 0, 0, .14); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.card-body { padding: clamp(24px, 5vw, 38px); }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-size: .69rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.card h1 { margin: 0 0 12px; font-family: var(--font-sans); font-size: clamp(2rem, 8vw, 3.15rem); font-weight: 700; letter-spacing: -.055em; line-height: .98; }
.lede { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.55; }
.amount { margin: 28px 0 6px; font-size: clamp(2.2rem, 10vw, 3.9rem); font-weight: 700; letter-spacing: -.065em; }
.subject { margin: 0 0 28px; font-size: 1rem; font-weight: 650; }
.secure-note { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--muted); font-size: .76rem; }
.secure-note svg { flex: none; }

.field { display: grid; gap: 7px; margin: 17px 0; }
.field label { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select { width: 100%; min-height: 50px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: #fff; padding: 12px 13px; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-bottom-color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.button { width: 100%; min-height: 52px; border: 1px solid var(--ink); border-radius: 100px; padding: 13px 24px; background: var(--ink); color: #fff; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.button:hover { border-color: var(--brand-hover); background: var(--brand-hover); color: var(--ink); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary { border-color: var(--light); background: var(--light); color: var(--ink); }
.button.ghost { width: auto; min-height: 38px; padding: 8px 14px; background: transparent; border: 1px solid var(--ink); color: var(--ink); font-size: .66rem; }
.button.ghost:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.button.danger { color: var(--bad); }
.error { min-height: 20px; margin: 12px 0 0; color: var(--bad); font-size: .82rem; }
.notice { margin: 18px 0; padding: 13px 14px; border-radius: 8px; background: var(--light); color: var(--brand); font-size: .82rem; line-height: 1.45; }
.notice.bad { background: #fbefed; color: var(--bad); }
.notice.ok { background: #ecf7f1; color: var(--ok); }
#payment-element { margin-top: 22px; }
.hidden { display: none !important; }

.marquee { overflow: hidden; border-top: 1px solid rgba(0, 0, 0, .18); border-bottom: 1px solid rgba(0, 0, 0, .18); background: rgba(255, 255, 255, .48); }
.marquee-track { display: flex; width: max-content; will-change: transform; animation: marquee 26s linear infinite; }
.marquee-set { display: flex; flex: none; align-items: center; }
.marquee span { display: inline-flex; align-items: center; gap: 18px; padding: 15px 20px; color: var(--brand); font-size: .71rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.marquee span::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

.legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 20px; padding: 20px; color: var(--muted); font-size: .72rem; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal a:hover { color: var(--ink); }

.admin-main { width: min(1180px, calc(100% - 32px)); margin: 16px auto 80px; }
.admin-grid { display: grid; grid-template-columns: minmax(280px, 390px) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: rgba(255, 255, 255, .9); border: 1px solid rgba(0, 0, 0, .16); border-radius: 10px; box-shadow: 0 14px 45px rgba(0, 0, 0, .07); }
.panel-pad { padding: 24px; }
.panel h2 { margin: 0 0 5px; font-size: 1.12rem; font-weight: 700; }
.panel-sub { margin: 0 0 20px; color: var(--muted); font-size: .79rem; line-height: 1.45; }
.amount-row { display: grid; grid-template-columns: 1fr 92px; gap: 8px; }
.locale-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.config-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.config-pill { padding: 7px 11px; border-radius: 100px; background: var(--light); color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.config-pill.ready { background: #e7f6ee; color: var(--ok); }
.links-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.links-toolbar input { min-height: 42px; width: min(280px, 55%); border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 9px 11px; background: transparent; outline: none; }
.links-toolbar input:focus { border-bottom-color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.link-list { display: grid; gap: 10px; }
.link-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.link-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-top strong { font-size: .91rem; }
.link-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: .72rem; }
.link-ids { margin-top: 7px; color: var(--muted); font-family: var(--font-sans); font-size: .65rem; font-weight: 600; overflow-wrap: anywhere; }
.link-actions { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 100px; background: #eef0ef; color: var(--muted); font-size: .61rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.status.paid { background: #e7f6ee; color: var(--ok); }
.status.processing { background: #fff4dd; color: var(--warn); }
.status.failed, .status.cancelled, .status.expired { background: #faece9; color: var(--bad); }
.subjects { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.subject-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: .78rem; }
.subject-row.inactive { opacity: .48; }
.text-button { border: 0; background: transparent; color: var(--brand); font-family: var(--font-sans); font-size: .67rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.empty { padding: 38px 12px; text-align: center; color: var(--muted); font-size: .82rem; }

@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-main { width: min(100% - 24px, 620px); }
  .topbar { padding: 18px; }
  .link-item { grid-template-columns: 1fr; }
  .link-actions { justify-content: flex-start; }
  .card h1 { font-size: 2.55rem; }
}
