:root {
  color-scheme: dark;
  --bg: #0c1320;
  --panel: #131f30;
  --line: #29384c;
  --text: #edf3fb;
  --muted: #a5b3c7;
  --accent: #47dfbc;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 85% 0, #16433e55, transparent 45%), var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.site-header { border-bottom: 1px solid var(--line); background: #0c1320e6; }
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1160px;
  margin: auto;
  padding: 14px 24px;
}
.brand {
  display: flex;
  flex: 0 1 168px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  max-width: 168px;
  color: var(--text);
  line-height: 1.3;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 168px; max-width: 100%; height: auto; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.site-nav { display: flex; flex: 1; align-items: center; gap: 4px; min-width: 0; }
.site-nav > a, .nav-group > summary, .nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.site-nav a:hover, .nav-group > summary:hover { background: #ffffff08; color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"], .nav-group[data-current="true"] > summary {
  background: #47dfbc12;
  color: var(--accent);
}
.site-nav-guest { flex: 0 0 auto; margin-left: auto; }
.nav-group { position: relative; flex: 0 0 auto; }
.nav-group > summary { cursor: pointer; list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.nav-group[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 206px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 14px 32px #00000040;
}
.nav-dropdown > a { white-space: normal; }
.site-nav .nav-logout { flex: 0 0 auto; margin-left: auto; }
.site-nav .nav-logout button { min-height: 40px; padding: 8px 12px; }
.menu-toggle { display: inline-flex; align-items: center; gap: 9px; margin-left: auto; }
.menu-icon { width: 17px; height: 12px; border-block: 2px solid currentColor; position: relative; }
.menu-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid currentColor; }
.site-nav[hidden], .menu-toggle[hidden] { display: none; }
main { width: 100%; max-width: 1160px; min-width: 0; min-height: 68vh; margin: 36px auto; padding: 0 24px; }
h1 { margin: 10px 0 18px; font-size: clamp(28px, 4vw, 43px); letter-spacing: -.04em; line-height: 1.2; }
h2 { margin: 0 0 12px; font-size: 21px; line-height: 1.3; }
h1, h2, p, label, .notice { overflow-wrap: anywhere; }
.intro, .welcome > p { max-width: 680px; color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.welcome { max-width: 650px; margin-bottom: 32px; }
.card { min-width: 0; max-width: 100%; margin: 22px 0; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 12px 36px #00000010; }
.auth { max-width: 500px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 30px 0; }
.stats > div { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #131f3080; }
.stats strong { display: block; font-size: 30px; overflow-wrap: anywhere; }
.stats span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
form, label { min-width: 0; }
form { margin: 0; max-width: 100%; }
label { display: block; margin: 14px 0; color: var(--muted); font-size: 13px; }
input, select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #3c4b60;
  border-radius: 8px;
  background: #0d1726;
  color: var(--text);
  font: inherit;
}
input[type="hidden"] { display: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="file"] { font-size: 12px; }
textarea { resize: vertical; }
button {
  max-width: 100%;
  min-height: 42px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #062c24;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
button:hover { filter: brightness(1.08); }
button.quiet { border-color: var(--line); background: transparent; color: var(--text); }
.danger-button { color: #ffc3c3; background: #5c2428; }
.notice { margin: 20px 0; padding: 16px 20px; border: 1px solid #47dfbc55; border-radius: 10px; background: #47dfbc0d; }
.danger { border-color: #d85b66; color: #ffbfc4; background: #d85b6615; }
.muted { color: var(--muted); font-size: 13px; }
.secret { display: block; max-width: 100%; padding: 16px; border: 1px dashed var(--accent); background: #09121e; color: var(--accent); overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid > * { min-width: 0; }
.form-grid button { align-self: end; margin: 16px 0; }
.form-grid select { min-height: 46px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; }
.checkbox input { flex: 0 0 18px; width: 18px; min-width: 18px; margin-top: 4px; }
.card-title { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.card-title > * { min-width: 0; max-width: 100%; }
.card-title p { margin: 0 0 8px; }
.badge { display: inline-block; max-width: 100%; padding: 6px 14px; border-radius: 30px; background: #5c472b; color: #ffe5ac; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.badge.ok { color: var(--accent); background: #47dfbc18; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.facts > div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 3px 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.actions > * { min-width: 0; max-width: 100%; }
details { min-width: 0; max-width: 100%; }
summary { padding: 10px 0; cursor: pointer; color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
details form { width: 100%; max-width: 420px; padding: 10px 0; }
details.card > form { max-width: none; }
.table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
.suggestions-table caption { padding: 0 0 14px; color: var(--muted); text-align: left; }
.suggestions-table td { min-width: 145px; white-space: normal; vertical-align: top; }
.suggestions-table td:last-child { min-width: 270px; }
.suggestions-table p { overflow-wrap: anywhere; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 18px; }
.filter-form label { flex: 0 1 280px; min-width: 0; margin: 0; }
.filter-form button { margin-bottom: 1px; }
.checkout-link { display: inline-block; max-width: 100%; min-height: 42px; padding: 11px 18px; border-radius: 8px; background: var(--accent); color: #062c24; font-weight: 700; overflow-wrap: anywhere; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; max-width: 1160px; margin: auto; padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 1099px) {
  .header-inner { flex-wrap: wrap; gap: 0 16px; padding-top: 12px; padding-bottom: 12px; }
  .brand { flex-basis: 148px; max-width: 148px; }
  .brand-logo { width: 148px; }
  .site-nav { flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .site-nav > a, .nav-group > summary { min-height: 44px; white-space: normal; }
  .site-nav .nav-logout { margin: 4px 0 0; }
  .site-nav .nav-logout button { width: 100%; min-height: 44px; text-align: left; }
  .nav-group { width: 100%; }
  .nav-dropdown { position: static; width: 100%; margin: 4px 0; padding-left: 12px; border: 0; border-left: 2px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
  .nav-dropdown > a { min-height: 44px; }
  .site-nav-guest { flex: 0 0 auto; flex-direction: row; margin: 0 0 0 auto; padding: 0; border: 0; }
}
@media (max-width: 800px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 700px) {
  .header-inner { padding-right: 18px; padding-left: 18px; }
  main { margin: 26px auto; padding: 0 18px; }
  .card { margin: 18px 0; padding: 20px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  input, select, textarea { font-size: 16px; }
  .stats { gap: 10px; }
  .stats > div { padding: 16px; }
  .stats strong { font-size: 26px; }
  .actions > form, .actions > details, .actions > .checkout-link { flex-basis: 100%; width: 100%; }
  .actions > form > button { width: 100%; }
  .filter-form label, .filter-form button { flex-basis: 100%; width: 100%; }
  footer { padding: 20px 18px; }
}
@media (max-width: 480px) {
  .stats, .facts { grid-template-columns: minmax(0, 1fr); }
  .stats { margin: 22px 0; }
  .stats > div { display: flex; align-items: center; gap: 14px; }
  .stats strong { flex: 0 0 auto; font-size: 24px; }
  .card { padding: 18px; }
  .notice { padding: 14px; }
  .badge { padding: 6px 10px; }
}
