:root {
  --bg: #020403;
  --surface: #070a08;
  --surface-2: #0d120f;
  --field: #050806;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(37, 255, 122, 0.45);
  --green: #25ff7a;
  --green-soft: rgba(37, 255, 122, 0.1);
  --green-dark: #071b10;
  --text: #f7fff9;
  --muted: #96a39a;
  --danger: #ff5d5d;
  --success: #25ff7a;
  --info: #7ec8ff;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

.phone-frame {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 4, 3, 0.96);
  padding: 10px 12px;
}

.brand-lockup,
.person-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-lockup img,
.brand-mark,
.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #020403;
  object-fit: cover;
}

.brand-copy,
.person-main div {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span,
.person-main strong,
.person-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.brand-copy span,
.muted {
  color: var(--muted);
}

.brand-copy span {
  font-size: 0.72rem;
}

.beta-mark {
  display: block;
  margin-top: 2px;
  color: var(--green);
  font-size: 0.56rem;
  font-weight: 1000;
  letter-spacing: 0;
  opacity: 0.72;
}

.beta-chip {
  width: max-content;
  border: 1px solid rgba(37, 255, 122, 0.35);
  border-radius: 5px;
  background: rgba(37, 255, 122, 0.08);
  color: var(--green);
  padding: 3px 6px;
  font-size: 0.62rem;
  font-weight: 1000;
}

.smaug-egg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-self: end;
  color: rgba(150, 163, 154, 0.35);
  font-size: 0.58rem;
  font-weight: 900;
}

.dragon-lay {
  position: relative;
  width: 18px;
  height: 9px;
  color: rgba(37, 255, 122, 0.42);
  flex: 0 0 auto;
}

.dragon-lay::before {
  position: absolute;
  right: 3px;
  bottom: 1px;
  width: 10px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 999px 999px 6px 6px;
  background: rgba(37, 255, 122, 0.06);
  content: "";
}

.dragon-lay::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: -14px 3px 0 -1px currentColor;
  content: "";
}

.dragon-lay span {
  position: absolute;
  right: 7px;
  top: 0;
  width: 6px;
  height: 5px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  border-radius: 5px 0 0 0;
  transform: rotate(14deg) skewX(-18deg);
}

.content {
  padding: 14px;
}

.stack,
.choice-grid,
form,
.form-grid {
  display: grid;
  gap: 10px;
}

.hero {
  display: grid;
  align-content: start;
  gap: 0;
}

.hero-visual {
  display: grid;
  min-height: 145px;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: #030604;
}

.hero-visual img {
  width: 116px;
  height: 116px;
  filter: drop-shadow(0 0 18px rgba(37, 255, 122, 0.18));
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--text);
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: 0;
}

h1[data-action],
.brand-copy strong[data-action] {
  cursor: pointer;
}

h2 {
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.2;
}

.lead {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.eyebrow,
.badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow {
  min-height: 26px;
  padding: 5px 8px;
}

.badge {
  min-height: 24px;
  padding: 3px 7px;
  white-space: nowrap;
}

.badge.ok {
  color: var(--success);
}

.badge.info {
  border-color: rgba(126, 200, 255, 0.45);
  background: rgba(126, 200, 255, 0.1);
  color: var(--info);
}

.badge.danger {
  border-color: rgba(255, 93, 93, 0.45);
  background: rgba(255, 93, 93, 0.1);
  color: var(--danger);
}

.choice-card,
.panel,
.request-card,
.person-card,
.stat,
.notice,
.meta,
.policy-box,
.sheet-table,
.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.choice-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  min-height: 66px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--text);
  text-align: left;
}

.choice-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--green-dark);
  color: var(--green);
  font-size: 1rem;
}

.arrow {
  color: var(--green);
  font-size: 1.1rem;
}

.icon-btn,
.ghost-btn,
.primary-btn,
.danger-btn,
.tab,
.nav-btn {
  border-radius: 7px;
  font-weight: 900;
}

.icon-btn,
.ghost-btn,
.primary-btn,
.danger-btn {
  min-height: 40px;
  border: 1px solid var(--line);
}

.icon-btn {
  width: 40px;
  flex: 0 0 40px;
  background: var(--surface-2);
  color: var(--green);
}

.admin-fab {
  position: fixed;
  right: 12px;
  bottom: 10px;
  z-index: 40;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: rgba(247, 255, 249, 0.46);
  font-size: 0.68rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ghost-btn,
.primary-btn,
.danger-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  text-decoration: none;
}

.ghost-btn {
  background: transparent;
  color: var(--text);
}

.primary-btn {
  border-color: var(--green);
  background: var(--green);
  color: #021006;
}

.danger-btn {
  border-color: rgba(255, 93, 93, 0.45);
  background: rgba(255, 93, 93, 0.12);
  color: #ffb8b8;
}

.compact-btn {
  width: auto;
  min-width: 82px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.74rem;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #030604;
  padding: 4px;
}

.tab {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--green);
  color: #021006;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: var(--field);
  color: var(--text);
  padding: 10px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(37, 255, 122, 0.16);
}

.field-row,
.meta-grid,
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.check-pill {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  padding: 8px;
  color: var(--text);
  font-size: 0.8rem;
}

.check-pill input {
  width: 15px;
  min-height: 15px;
  accent-color: var(--green);
}

.optional-panel {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #030604;
  padding: 9px;
}

.optional-panel summary {
  cursor: pointer;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 1000;
}

.optional-panel[open] summary {
  margin-bottom: 8px;
}

.panel,
.request-card,
.person-card,
.notice {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.panel-head,
.request-card header,
.person-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.status-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 12;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: rgba(2, 4, 3, 0.96);
  padding: 6px;
  scrollbar-width: thin;
}

.nav-btn {
  display: grid;
  flex: 0 0 72px;
  min-width: 72px;
  min-height: 42px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.64rem;
}

.nav-btn span {
  display: block;
  color: inherit;
  font-size: 0.95rem;
}

.nav-btn.active {
  background: var(--green);
  color: #021006;
}

.stat {
  min-height: 68px;
  padding: 10px;
}

.stat strong {
  display: block;
  color: var(--green);
  font-size: 1.35rem;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.meta {
  min-height: 48px;
  padding: 8px;
}

.meta span {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
}

.meta strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.8rem;
}

.policy-box {
  display: grid;
  max-height: 190px;
  gap: 8px;
  overflow: auto;
  padding: 10px;
}

.policy-box p {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.38;
}

.policy-check {
  align-items: flex-start;
  line-height: 1.3;
}

.sheet-table {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.76rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #030604;
  color: var(--green);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 50;
  display: none;
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #06120b;
  color: var(--text);
  padding: 10px 12px;
  font-weight: 900;
}

.toast.show {
  display: block;
}

.empty {
  display: grid;
  min-height: 92px;
  place-items: center;
  border-style: dashed;
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

.link-btn {
  text-align: center;
}

.compact-list {
  gap: 6px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  padding: 8px;
}

.list-row span {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 8px;
  color: #041107;
  font-size: 0.68rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.level-badge.bronze {
  background: #b97845;
}

.level-badge.silver {
  background: #d4dde3;
}

.level-badge.gold {
  background: #ffd45a;
}

.level-badge.elite {
  background: var(--green);
}

.chat-box {
  display: grid;
  max-height: 360px;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.chat-message {
  display: grid;
  gap: 7px;
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #030604;
  padding: 9px;
}

.chat-message.mine {
  justify-self: end;
  border-color: rgba(92, 255, 0, 0.38);
  background: #06120b;
}

.chat-message header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.66rem;
}

.chat-message p {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.35;
}

.list-button {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #030604;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.list-button span {
  color: var(--muted);
  font-size: 0.72rem;
}

.list-button.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(92, 255, 0, 0.24);
}

@media (min-width: 920px) {
  .phone-frame {
    min-height: calc(100vh - 24px);
    margin: 12px auto;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .desktop-grid,
  .admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .admin-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .hero {
    grid-template-columns: 220px 1fr;
    align-items: stretch;
  }

  .hero-visual {
    min-height: 100%;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 1.55rem;
  }

  .field-row,
  .check-grid,
  .meta-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 12px;
  }
}
