/* VGUI Tactical Olive-Gold theme (100% local, zero inline styles under strict CSP). */
:root {
  --bg: #171c15;
  --surface: #21281e;
  --surface-2: #283125;
  --well: #131711;
  --border-light: #3b4735;
  --border-dark: #0e120c;
  --line: #313b2c;
  --text: #e7ebe2;
  --muted: #a2ae9a;
  --dim: #707d69;
  --amber: #ffb000;
  --amber-hover: #ffc233;
  --amber-ink: #17140a;
  --amber-soft: rgba(255, 176, 0, 0.11);
  --green: #7ed957;
  --green-soft: rgba(126, 217, 87, 0.12);
  --danger: #ef5b5b;
  --danger-soft: rgba(239, 91, 91, 0.12);
  --grid: rgba(168, 194, 145, 0.035);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(860px 360px at 50% -80px, rgba(114, 138, 86, 0.16), transparent 70%),
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.narrow {
  max-width: 32rem;
  margin: 0 auto;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand:hover { text-decoration: none; color: var(--amber); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--amber-soft);
  border: 1px solid var(--amber);
  border-radius: 2px;
  color: var(--amber);
  flex-shrink: 0;
}

.brand-ver {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
  padding: 0.1rem 0.38rem;
  background: var(--surface-2);
  color: var(--amber);
  border-radius: 2px;
  font-weight: 600;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.main-nav a { color: var(--muted); }
.main-nav a:hover { color: var(--text); }

.nav-user {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.28rem 0.65rem;
  color: var(--amber);
  font-weight: 600;
  font-size: 0.85rem;
}

.main-content {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* VGUI beveled panels + corner reticle accents */
.panel {
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
  border-radius: 3px;
  padding: 1.4rem;
  position: relative;
  margin-bottom: 1.25rem;
}

.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  opacity: 0.8;
}

.reticle::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--amber);
  border-left: 2px solid var(--amber);
}

.reticle::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--amber);
  border-right: 2px solid var(--amber);
}

h1 {
  margin: 0 0 1rem 0;
  font-size: 1.45rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--amber);
  font-weight: 600;
}

.lead { color: var(--muted); margin: 0 0 1rem 0; }

/* Home hero & features */
.hero { padding: 1.85rem; }

.kicker {
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.hero-title {
  font-size: 1.65rem;
  margin: 0 0 0.9rem 0;
}

.hero-copy p {
  margin: 0 0 0.85rem 0;
  color: var(--muted);
  line-height: 1.75;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1.75rem 0 0.85rem 0;
}

.section-head h2 { margin: 0; }
.section-sub { font-size: 0.8rem; color: var(--dim); }

.feat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.feat-card { margin-bottom: 0; padding: 1.1rem 1.2rem; }
.feat-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.feat-dot { color: var(--amber); font-size: 0.75rem; }
.feat-desc { margin: 0; font-size: 0.84rem; color: var(--muted); line-height: 1.55; }

/* Forms & Inputs */
label {
  display: block;
  margin: 0 0 1rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input:not([type]),
select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  background: var(--well);
  color: var(--text);
  border-top: 1px solid var(--border-dark);
  border-left: 1px solid var(--border-dark);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  border-radius: 2px;
  padding: 0.58rem 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}

input.code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amber);
  color: var(--amber-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-right: 0.5rem;
  text-decoration: none;
}

button:hover, .btn:hover { background: var(--amber-hover); text-decoration: none; }

button.secondary, .btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-top: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
}

button.secondary:hover, .btn-secondary:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--surface-2);
}

button.danger, .btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
}

button.danger:hover, .btn-danger:hover {
  background: var(--danger);
  color: #160a0a;
}

button.link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
}

button.link:hover { color: var(--amber); background: none; text-decoration: underline; }

form.inline { display: inline; }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }

.form-links { margin: 0.9rem 0 0 0; font-size: 0.85rem; color: var(--muted); }

/* Notices & Badges */
.error, .warn, .ok-banner {
  padding: 0.75rem 0.95rem;
  border-radius: 2px;
  font-size: 0.88rem;
  margin: 0 0 1rem 0;
}

.error {
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
  color: #ffc8c8;
}

.warn {
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  color: var(--text);
}

.ok-banner {
  background: var(--green-soft);
  border-left: 3px solid var(--green);
  color: var(--text);
}

.note { font-size: 0.82rem; color: var(--dim); margin: 0.5rem 0 0 0; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 2px;
}

.badge-ok { background: var(--green-soft); color: var(--green); border: 1px solid rgba(126, 217, 87, 0.45); }
.badge-warn { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(255, 176, 0, 0.45); }

/* Account dashboard cards */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}
.page-head h1 { margin: 0; }

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.panel-head h2 { margin: 0; }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.kv-box {
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.8rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.kv-label { font-size: 0.75rem; color: var(--muted); }
.kv-val { font-weight: 600; margin-top: 0.2rem; word-break: break-word; }
.kv-sub { font-size: 0.75rem; color: var(--dim); margin-top: 0.25rem; }

.device-row {
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.device-name { font-weight: 600; font-size: 0.95rem; }
.device-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }

.device-choices { margin: 0.75rem 0 1rem 0; }
.choice-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.6rem 0.8rem;
  margin: 0 0 0.45rem 0;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}
.choice-row input[type="radio"] { width: auto; display: inline; margin: 0; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.action-row:last-child { border-bottom: none; padding-bottom: 0; }
.action-title { font-weight: 600; font-size: 0.9rem; }
.action-desc { font-size: 0.8rem; color: var(--muted); }

.danger-zone {
  border-color: rgba(239, 91, 91, 0.45);
}
.danger-zone h2 { color: var(--danger); }

.locale-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.locale-form select {
  width: auto;
  display: inline-block;
  margin-top: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.84rem;
}

.cf-turnstile { margin: 0.75rem 0 1rem 0; }

/* Simple definition list fallback */
dl { margin: 0 0 1rem 0; }
dt { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
dd { margin: 0.1rem 0 0.75rem 0; font-weight: 600; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem 0;
  font-size: 0.82rem;
  color: var(--dim);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.footer-inner a { color: var(--muted); }

@media (max-width: 640px) {
  .feat-grid, .kv-grid { grid-template-columns: 1fr; }
  .hero { padding: 1.25rem; }
}

/* Admin console helpers (no inline styles) */
.admin-wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.admin-table td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin-bottom: 1rem; }
.filter-bar label { margin: 0; }
textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  background: var(--well);
  color: var(--text);
  border-top: 1px solid var(--border-dark);
  border-left: 1px solid var(--border-dark);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  border-radius: 2px;
  padding: 0.55rem 0.75rem;
  font: inherit;
}
textarea:focus { border-color: var(--amber); outline: none; }

