:root {
  color-scheme: dark;
  --bg: #0b1411;
  --panel: #13231c;
  --panel-2: #182d24;
  --line: #29483a;
  --text: #edf7f1;
  --muted: #9db2a7;
  --green: #3bb273;
  --gold: #d6a94a;
  --red: #d95858;
  --blue: #5c8fd6;
  --shadow: 0 18px 48px rgba(0, 0, 0, .38);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  min-height: 44px;
}

button:disabled {
  opacity: .45;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #09130f;
  color: var(--text);
  padding: 0 12px;
}

label span,
.eyebrow,
.status-strip span,
.meta-grid span,
.meter-label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

h1,
h2,
p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-panel {
  width: min(100%, 390px);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--gold));
  color: #09130f;
  font-weight: 900;
  font-size: 26px;
}

.login-panel h1 {
  font-size: 28px;
}

.login-panel label,
.password-panel label {
  display: grid;
  gap: 6px;
}

.primary {
  background: var(--green);
  color: #07100c;
  font-weight: 800;
}

.wide {
  width: 100%;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0 14px;
}

.message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.app-view {
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(86px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.topbar h1 {
  font-size: 23px;
  line-height: 1.15;
}

.icon-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.screen {
  display: grid;
  gap: 12px;
}

.status-strip,
.selector-section,
.account-panel {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
}

.status-strip > div,
.selector-section,
.slot-card,
.account-panel,
.password-panel,
.list-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-strip > div {
  min-height: 58px;
  padding: 10px 12px;
}

.status-strip strong {
  display: block;
  font-size: 14px;
  margin-top: 4px;
}

.selector-section {
  grid-template-columns: 1fr 112px;
  padding: 12px;
}

.select-label {
  display: grid;
  gap: 6px;
}

.slot-card {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.slot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.slot-head h2 {
  font-size: 21px;
  line-height: 1.2;
}

.state-pill {
  max-width: 46%;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #0b1712;
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 12px;
  text-align: center;
  word-break: break-word;
}

.meters {
  display: grid;
  gap: 10px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.meter-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #07100c;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width .18s ease;
}

.meter-fill.hp {
  background: var(--red);
}

.meter-fill.mp {
  background: var(--blue);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.meta-grid div {
  min-width: 0;
  padding: 9px;
  border-radius: 8px;
  background: #0b1712;
}

.meta-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.command-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.command-btn span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  font-size: 12px;
}

.command-btn.green {
  background: var(--green);
  color: #07100c;
}

.command-btn.gold {
  background: var(--gold);
  color: #07100c;
}

.command-btn.red {
  background: var(--red);
}

.whisper-form {
  display: grid;
  grid-template-columns: minmax(82px, .8fr) minmax(0, 1.3fr) auto;
  gap: 8px;
}

.whisper-form button {
  padding: 0 14px;
  background: var(--blue);
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.list-row strong {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.account-panel {
  grid-template-columns: 1fr auto;
  padding: 14px;
}

.password-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(7, 14, 11, .94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  min-height: 46px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.bottom-nav button.active {
  background: var(--panel-2);
  color: var(--text);
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 20;
  padding: 12px 14px;
  border-radius: 8px;
  background: #101c17;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow);
}

.toast.good {
  border-color: var(--green);
}

.toast.bad {
  border-color: var(--red);
}

@media (min-width: 720px) {
  .app-view {
    width: min(720px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 380px) {
  .status-strip {
    grid-template-columns: 1fr 1fr;
  }

  .status-strip .ghost {
    grid-column: 1 / -1;
  }

  .whisper-form {
    grid-template-columns: 1fr;
  }
}
