:root {
  --ink: #f7f0df;
  --muted: #a8b8b2;
  --panel: #0c2630;
  --line: #31545a;
  --green: #65d6ad;
  --red: #ef837d;
  --amber: #d8b56a;
  --bg: #06161e;
  --lapis: #0b3150;
  --emerald: #0d4e45;
  --brass: #d8b56a;
  --ivory: #f7f0df;
  --shadow: #020b10b8;
}

* { scrollbar-color: #4a6b69 #071820; }
[hidden] { display: none!important; }

html { scroll-behavior: smooth; }

body {
  background:
    linear-gradient(30deg, #d8b56a08 12%, transparent 12.5%, transparent 87%, #d8b56a08 87.5%, #d8b56a08),
    linear-gradient(150deg, #d8b56a08 12%, transparent 12.5%, transparent 87%, #d8b56a08 87.5%, #d8b56a08),
    linear-gradient(30deg, #d8b56a08 12%, transparent 12.5%, transparent 87%, #d8b56a08 87.5%, #d8b56a08),
    linear-gradient(150deg, #d8b56a08 12%, transparent 12.5%, transparent 87%, #d8b56a08 87.5%, #d8b56a08),
    radial-gradient(circle at 75% -10%, #174c6488, transparent 34%),
    linear-gradient(180deg, #071b25 0%, #05131a 58%, #061820 100%);
  background-position: 0 0, 0 0, 32px 56px, 32px 56px, 0 0, 0 0;
  background-size: 64px 112px, 64px 112px, 64px 112px, 64px 112px, auto, auto;
  color: var(--ivory);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

body::before {
  background: linear-gradient(90deg, transparent, #d8b56a44, transparent);
  content: '';
  height: 1px;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

main { padding: 0 0 72px; width: min(1240px, calc(100% - 40px)); }

.site-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, #061820f2, #061820c9);
  border-bottom: 1px solid #d8b56a2e;
  margin: 0 calc((100vw - min(1240px, calc(100vw - 40px))) / -2);
  padding: 22px max(20px, calc((100vw - 1240px) / 2));
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-lockup { align-items: center; display: flex; gap: 17px; }
.brand-mark {
  align-items: center;
  background: linear-gradient(145deg, #154f57, #092d3e);
  border: 1px solid #d8b56a99;
  clip-path: polygon(50% 0, 65% 15%, 86% 14%, 86% 35%, 100% 50%, 86% 65%, 86% 86%, 65% 86%, 50% 100%, 35% 86%, 14% 86%, 14% 65%, 0 50%, 14% 35%, 14% 14%, 35% 15%);
  color: var(--brass);
  display: flex;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  height: 58px;
  justify-content: center;
  width: 58px;
}

h1, h2, h3, .balance-main > strong, .price-options strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 500;
}

h1 { color: var(--ivory); font-size: clamp(29px, 4vw, 46px); letter-spacing: -.035em; line-height: .95; }
h2 { letter-spacing: -.015em; }
.brand-principles { color: #90a8a4; font-family: Georgia, serif; font-size: 11px; font-style: italic; letter-spacing: .08em; margin-top: 7px; }
.eyebrow { color: var(--brass)!important; font-size: 9px!important; font-weight: 750; letter-spacing: .22em!important; }

.connection {
  background: #0a2530;
  border: 1px solid #31545a;
  border-radius: 999px;
  color: #bed0cb;
  padding: 9px 13px;
}

#pulse { box-shadow: 0 0 0 4px #d8b56a14, 0 0 18px currentColor; }

.panel {
  background:
    linear-gradient(135deg, #ffffff08, transparent 28%),
    linear-gradient(160deg, #0d2a35f5, #081e28f5);
  border: 1px solid #3a5d6099;
  border-radius: 36px 36px 14px 14px;
  box-shadow: 0 28px 80px var(--shadow), inset 0 1px #ffffff0d;
  padding: 28px;
  position: relative;
}

.panel::after {
  background: linear-gradient(90deg, transparent, #d8b56a88, transparent);
  content: '';
  height: 1px;
  left: 14%;
  position: absolute;
  right: 14%;
  top: -1px;
}

.login {
  background: linear-gradient(175deg, #0e3040f8, #071c26fa);
  border-color: #d8b56a6e;
  margin: 72px auto;
  max-width: 580px;
  padding: 42px 44px 38px;
  text-align: center;
}

.login h2 { font-size: 34px; }
.login > p:not(.eyebrow) { margin: 8px auto 22px; max-width: 390px; }
.arch-seal {
  align-items: center;
  background: linear-gradient(180deg, #124354, #0a2937);
  border: 1px solid #d8b56a8c;
  border-radius: 50% 50% 12px 12px;
  box-shadow: 0 0 0 7px #d8b56a0b;
  color: var(--brass);
  display: flex;
  font-family: Georgia, serif;
  font-size: 24px;
  height: 66px;
  justify-content: center;
  margin: -8px auto 24px;
  width: 54px;
}

.auth-tabs { background: #061820; border: 1px solid #294c53; border-radius: 12px; padding: 4px; }
.auth-tabs button { border: 0; border-radius: 8px; }
.auth-tabs button.active { background: linear-gradient(135deg, #165546, #0c3c3b); box-shadow: inset 0 0 0 1px #65d6ad44; color: #dff8ec; }

input, select {
  background: #061820!important;
  border-color: #34565c!important;
  color: var(--ivory)!important;
  min-height: 44px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

input:focus, select:focus { border-color: var(--brass)!important; box-shadow: 0 0 0 3px #d8b56a17; }

button {
  background: linear-gradient(135deg, #d9b96f, #b88a3d);
  border-color: #e9ce8d;
  border-radius: 10px;
  color: #10211e;
  letter-spacing: .01em;
  transition: filter .2s, transform .15s, box-shadow .2s;
}

button:hover { box-shadow: 0 8px 24px #020b1066; filter: brightness(1.08); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; }
button.secondary { background: #102f3b; border-color: #416269; color: #d7e5e0; }
button.danger { background: #4b2729; border-color: #86494a; color: #ffc0b7; }
button.paper { background: #113a4a; border-color: #34667a; color: #acdbea; }
button.paper.active { background: #164c3c; border-color: #4e9879; color: #a9f0d1; }

.view-controls { margin: 22px 0 -10px; }
.view-controls button { border-color: #31545a; }
.collapse-toggle { border-radius: 999px!important; }
.collapsible.collapsed { background: linear-gradient(90deg, #0b2935, #091f29)!important; border-radius: 14px!important; }
.collapsible.collapsed > .collapse-toggle { color: var(--brass)!important; padding-left: 20px!important; }

.account-hero { border-color: #d8b56a5c; gap: 24px; margin-top: 42px; overflow: hidden; }
.account-hero::before {
  background: repeating-conic-gradient(from 22.5deg, #d8b56a0c 0 12.5%, transparent 0 25%);
  border-radius: 50%;
  content: '';
  height: 380px;
  position: absolute;
  right: -130px;
  top: -180px;
  width: 380px;
}
.balance-main > p { color: #9fb4af; }
.balance-main > strong { color: var(--ivory); font-size: clamp(48px, 7vw, 82px); text-shadow: 0 4px 22px #0008; }
.account-metrics { border: 1px solid #31545a; border-radius: 22px 22px 8px 8px; overflow: hidden; }
.account-metrics > div { background: #06182066; border-color: #31545a; }
.account-metrics span, .metrics span, .status-grid article span { color: #91aaa5; letter-spacing: .17em; }
.account-metrics strong { color: #f4ead1; font-family: Georgia, serif; }

.status-grid { gap: 10px; margin: 14px 0; }
.status-grid article {
  background: linear-gradient(145deg, #0c2c37, #071d27);
  border: 1px solid #31545a;
  border-radius: 18px 18px 7px 7px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}
.status-grid article::before { background: var(--brass); content: ''; height: 2px; left: 18px; opacity: .6; position: absolute; top: 0; width: 28px; }
.status-grid strong { color: var(--ivory); font-family: Georgia, serif; font-size: 19px; }

.workspace { gap: 14px; }
.position { min-height: 330px; }
.controls { width: 340px; }
.controls h2 { font-size: 25px; }
.control-field span { color: #a6bab6; }
.badge { background: #0a222c; border-color: #d8b56a5c; color: var(--brass); }

.position-card {
  background: linear-gradient(145deg, #0c303a, #071c26);
  border-color: #365b61;
  border-radius: 20px 20px 8px 8px;
  box-shadow: inset 3px 0 #d8b56a66;
  padding: 18px;
}
.position-card .metrics { background: #06182088; border-radius: 10px; padding: 13px; }
.position-actions button { min-height: 40px; }

.credential-panel, .readiness-panel, .password-panel { gap: 42px; }
.vault-state, .chart-level, .payment-destinations div { background: #06182099; border-color: #31545a; }
.credential-form, .payment-form, .payment-settings, #change-password-form { background: #06182055; border: 1px solid #2f5056; border-radius: 18px 18px 8px 8px; padding: 18px; }

.scanner-panel, .audit-panel, .admin-panel, .password-panel, .readiness-panel { margin-top: 14px; }
#candidates > div { background: #071c26aa; border-color: #31545a; border-radius: 10px; margin-top: 6px; padding: 14px; }
.progress { background: #061820; border: 1px solid #31545a; height: 10px; }
.progress span { background: linear-gradient(90deg, #b88a3d, #65d6ad); }
details { border-color: #31545a; }
summary { color: var(--brass); }

.audit-body { background: #071c26; border-color: #31545a; border-radius: 16px 16px 7px 7px; }
.audit-marker { border-color: #071c26; }
.audit-filters { background: #06182088; border: 1px solid #31545a; border-radius: 12px; padding: 4px; }
.audit-filters button { border: 0; }
.audit-filters button.active { background: #174c3f; color: #aaf0d2; }

.subscription-panel { border-color: #d8b56a66; margin-top: 70px; }
.price-options article { background: linear-gradient(145deg, #103442, #071c26); border-color: #d8b56a52; border-radius: 26px 26px 9px 9px; }
.price-options strong { color: var(--brass); }
.payment-row, .admin-user, .reset-row { border-color: #31545a; }
.admin-summary { background: #06182099; border: 1px solid #31545a; border-radius: 10px; padding: 13px; }

.chart-dialog { background: #071c26; border-color: #d8b56a66; border-radius: 36px 36px 14px 14px; box-shadow: 0 40px 120px #000d; }
.chart-wrap { border-color: #31545a; }
.chart-toolbar { background: #06182099; border-radius: 12px; padding: 6px; }
.chart-toolbar button { border: 0; }
.chart-toolbar button.active { background: #174c3f; }

.positive { color: #78e6bd!important; }
.negative { color: #ff938a!important; }
.hint, .credential-note { color: #8fa7a3; }
.logout-button { background: transparent; border-color: #36575d; color: #9fb4af; }

@media (max-width: 900px) {
  main { width: min(100% - 24px, 760px); }
  .site-header { margin-left: -12px; margin-right: -12px; padding-left: 18px; padding-right: 18px; }
  .account-hero { grid-template-columns: 1fr; }
  .credential-panel, .readiness-panel, .password-panel { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .brand-mark { height: 46px; width: 46px; }
  .brand-principles { display: none; }
  .site-header { padding-bottom: 15px; padding-top: 15px; }
  .panel { border-radius: 26px 26px 11px 11px; padding: 22px 18px; }
  .login { margin: 38px auto; padding: 30px 20px; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .workspace { display: block; }
  .controls { margin-top: 14px; width: auto; }
  .account-metrics { grid-template-columns: 1fr 1fr; }
  .credential-form { grid-template-columns: 1fr; }
  .credential-form .wide { grid-column: auto; }
}

@media (max-width: 460px) {
  main { width: calc(100% - 16px); }
  .site-header { margin-left: -8px; margin-right: -8px; }
  .brand-lockup { gap: 10px; }
  h1 { font-size: 27px; }
  .connection { padding: 8px; }
  .connection span:last-child { display: none; }
  .status-grid { grid-template-columns: 1fr; }
  .account-metrics { grid-template-columns: 1fr; }
  .account-metrics > div { border-left: 0; }
  .price-options { grid-template-columns: 1fr; }
  .auth-tabs button { font-size: 13px; padding-left: 7px; padding-right: 7px; }
  #show-login, #show-register { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto!important; transition: none!important; } }
