:root {
  --bg: #121212;
  --bg-raised: #1a1a1a;
  --bg-card: #222222;
  --bg-card-hover: #2a2a2a;
  --line: #3a3a3a;
  --line-strong: #4a4a4a;
  --amber: #ff6600;
  --amber-dim: #cc5200;
  --amber-soft: rgba(255, 102, 0, 0.16);
  --text: #c8c8c8;
  --muted: #8a8a8a;
  --danger: #d45a4a;
  --danger-soft: rgba(212, 90, 74, 0.12);
  --ok: #2f9e7a;
  --ok-soft: rgba(47, 158, 122, 0.12);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --font: "Segoe UI", "Helvetica Neue", ui-sans-serif, system-ui, sans-serif;
  --display: "Arial Narrow", "Franklin Gothic Medium", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  background-image:
    radial-gradient(1200px 500px at 10% -10%, rgba(255, 102, 0, 0.14), transparent 50%),
    linear-gradient(180deg, #121212 0%, var(--bg) 280px);
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-size: 0.92em;
  color: var(--amber);
}

.hazard {
  height: 3px;
  max-height: 3px;
  flex: 0 0 3px;
  pointer-events: none;
  position: relative;
  z-index: 0;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  box-shadow: 0 0 16px rgba(255, 102, 0, 0.6);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 18, 18, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.mark,
.brand-logo {
  flex: none;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #121212;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-logo {
  height: 52px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.auth-logo {
  display: block;
  width: min(260px, 100%);
  height: auto;
  max-height: 240px;
  object-fit: contain;
  margin: 0 auto 20px;
}

.brand-wordmark,
.auth-wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-wordmark {
  font-size: 16px;
}

.auth-wordmark {
  font-size: 22px;
  margin: 0 0 16px;
  text-shadow: 0 0 18px rgba(255, 102, 0, 0.4);
}

.brand-copy {
  min-width: 0;
}

.brand-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--amber-dim);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
}

.email-chip {
  color: var(--muted);
  font-size: 12px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.btn:hover {
  background: var(--bg-card-hover);
}

.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1a1200;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff8f6;
}

.btn-danger:hover {
  filter: brightness(1.05);
}

.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-card {
  width: min(560px, 100%);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
}

.stat {
  background: #121212;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat strong {
  font-size: 18px;
}

.warn-box {
  border: 1px solid rgba(212, 90, 74, 0.4);
  background: var(--danger-soft);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.warn-box p {
  margin: 0 0 8px;
  color: #f0b4ad;
  font-size: 14px;
  line-height: 1.4;
}

.warn-box p:last-child {
  margin-bottom: 0;
}

.wrap {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.auth-shell {
  min-height: calc(100vh - 3px);
  display: grid;
  place-items: start center;
  padding: 24px 16px 40px;
}

@media (min-height: 720px) {
  .auth-shell {
    place-items: center;
  }
}

.auth-card {
  width: min(440px, 100%);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.auth-card > .hazard {
  border-radius: var(--radius) var(--radius) 0 0;
}

.auth-body {
  position: relative;
  z-index: 1;
  padding: 28px 24px 24px;
}

.auth-kicker {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(22px, 6vw, 32px);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
  overflow: visible;
}

.auth-sub {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

input[type="email"],
input[type="text"]:not(.otp-digit),
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #121212;
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
}

input:focus {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

.stack {
  display: grid;
  gap: 14px;
}

.otp-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.otp-digit {
  display: block;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: 48px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 48px;
  border: 1px solid var(--line-strong);
  background: #121212;
  color: var(--text);
  border-radius: 10px;
  caret-color: var(--amber);
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.msg {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.msg.show {
  display: block;
}

.msg-error {
  background: var(--danger-soft);
  color: #f0b4ad;
  border: 1px solid rgba(212, 90, 74, 0.35);
}

.msg-ok {
  background: var(--ok-soft);
  color: #b6e4d3;
  border: 1px solid rgba(47, 158, 122, 0.35);
}

.dev-panel {
  display: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--amber-dim);
  background: #2a1f08;
  border-radius: 12px;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.dev-panel.show,
.dev-panel[data-open="1"] {
  display: block;
}

.dev-code {
  display: block;
  margin: 6px 0 0;
  color: var(--amber);
  letter-spacing: 0.28em;
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  user-select: all;
}

.page-lead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 28px;
}

.page-lead h1 {
  margin: 0;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(26px, 4vw, 38px);
}

.page-lead p {
  margin: 6px 0 0;
  color: var(--muted);
}

.category {
  margin-bottom: 28px;
}

.category-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.category-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.category-head::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--amber);
  transform: rotate(45deg);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  color: inherit;
  min-height: 132px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.card:hover {
  text-decoration: none;
  border-color: var(--amber-dim);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 4px 8px;
  border-radius: 999px;
}

.footer-note {
  margin-top: 36px;
  color: var(--muted);
  font-size: 13px;
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .brand-title {
    font-size: 20px;
  }
}

@media (min-width: 1040px) {
  .grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.home-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
}

.home-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.home-tab:hover {
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
}

.home-tab.is-active {
  color: #1a1200;
  background: var(--amber);
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
}

.project-card-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-card h3 {
  margin: 0 0 6px;
}

.project-card p {
  margin: 0;
}

.project-card .btn {
  flex: none;
  pointer-events: none;
}

@media (min-width: 720px) {
  .project-list {
    grid-template-columns: 1fr;
  }
}
