:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #18181b;
  --surface-2: #111827;
  --surface-3: #0f172a;
  --border: #27272a;
  --border-strong: rgba(16, 185, 129, 0.35);
  --text: #fafafa;
  --text-dim: #a1a1aa;
  --accent: #10b981;
  --accent-2: #22c55e;
  --accent-3: #38bdf8;
  --warn: #f59e0b;
  --danger: #fb7185;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.14), transparent 26%),
    linear-gradient(180deg, #050508, #09090b 35%, #111827 100%);
  color: var(--text);
}

body.drawer-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 16%, rgba(16, 185, 129, 0.12), transparent 22%),
    radial-gradient(circle at 82% 12%, rgba(139, 92, 246, 0.12), transparent 18%);
}

.mobile-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.device-shell {
  width: min(100%, 430px);
  min-height: min(920px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(24, 24, 27, 0.96), rgba(9, 9, 11, 0.98)),
    linear-gradient(180deg, rgba(16, 185, 129, 0.08), transparent 18%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.masthead,
.summary-card,
.tab-panel,
.bottom-nav {
  padding-left: 18px;
  padding-right: 18px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.masthead__brand,
.masthead__meta,
.signal-pill,
.summary-card__top,
.summary-card__actions,
.stats-row,
.section-head,
.list-card__top,
.list-card__actions,
.form-actions,
.toggle-row,
.bottom-nav,
.checkbox-row,
.case-button,
.runtime-inline {
  display: flex;
  align-items: center;
}

.masthead__brand {
  gap: 12px;
}

.masthead__mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(56, 189, 248, 0.18));
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.masthead__eyebrow,
.summary-card__label,
.stat-card__label,
.hero-card__eyebrow,
.hint-text,
.quick-tile__label {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.masthead h1,
.hero-card h2,
.section-head h2,
.section-head h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.masthead h1 {
  font-size: 1.08rem;
}

.masthead__meta {
  gap: 8px;
}

.masthead__chip,
.icon-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.signal-pill,
.status-chip,
.capture-state,
.priority {
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  font-weight: 700;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.signal-pill[data-state="checking"] {
  color: var(--text-dim);
}

.signal-pill[data-state="ok"],
.status-chip[data-state="ready"],
.capture-state[data-state="local"],
.priority--low {
  color: var(--accent);
  border-color: var(--border-strong);
  background: rgba(16, 185, 129, 0.1);
}

.signal-pill[data-state="warn"],
.priority--medium {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.08);
}

.signal-pill[data-state="error"],
.capture-state[data-state="failed"],
.priority--critical,
.priority--high {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.24);
  background: rgba(251, 113, 133, 0.08);
}

.summary-card,
.hero-card,
.panel-card,
.stat-card,
.list-card,
.quick-tile,
.launch-tile {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.summary-card {
  margin: 0 18px 18px;
  padding: 16px;
  border-radius: 22px;
}

.summary-card__top,
.section-head,
.list-card__top,
.list-card__actions,
.case-button,
.summary-card__actions {
  justify-content: space-between;
}

.summary-card__top {
  gap: 12px;
}

.summary-card strong,
.hero-card h2 {
  display: block;
  margin-top: 4px;
}

.summary-card__actions {
  gap: 10px;
  margin-top: 16px;
}

.device-screen {
  flex: 1;
  overflow: auto;
  padding-bottom: 8px;
}

.tab-panel {
  padding-bottom: 18px;
}

.hero-card,
.panel-card {
  border-radius: 22px;
}

.hero-card {
  padding: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-card__copy {
  margin: 10px 0 0;
  color: var(--text-dim);
  line-height: 1.6;
}

.stats-row {
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  flex: 1;
  padding: 14px;
  border-radius: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.3rem;
}

.panel-card {
  padding: 16px;
  margin-bottom: 14px;
}

.panel-card--muted {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.15);
}

.panel-card--muted p,
.empty-state,
.list-card__copy,
.drawer-copy {
  color: var(--text-dim);
  line-height: 1.6;
}

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

.launch-grid,
.fast-lane-grid,
.quick-grid,
.provider-list {
  display: grid;
  gap: 10px;
}

.fast-lane-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.launch-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fast-lane-card,
.launch-tile {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
}

.fast-lane-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.fast-lane-card--dashboard {
  background:
    linear-gradient(180deg, rgba(16, 185, 129, 0.14), rgba(255, 255, 255, 0.04));
  border-color: rgba(16, 185, 129, 0.24);
}

.fast-lane-card--intake {
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.14), rgba(255, 255, 255, 0.04));
  border-color: rgba(56, 189, 248, 0.24);
}

.list-card {
  padding: 14px;
  border-radius: 18px;
}

.list-card__title {
  margin: 0;
  display: block;
  font-weight: 700;
  line-height: 1.45;
}

.list-card__title.is-done {
  color: var(--text-dim);
  text-decoration: line-through;
}

.list-card__copy {
  margin: 8px 0 0;
  font-size: 0.94rem;
}

.checkbox-row {
  gap: 12px;
  align-items: flex-start;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.checkbox-copy {
  display: grid;
  gap: 8px;
  flex: 1;
}

.case-pill,
.text-button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-3);
  cursor: pointer;
  font-weight: 700;
}

.case-button {
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.case-accent {
  width: 4px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--case-accent, var(--accent));
}

.case-copy {
  display: grid;
  gap: 6px;
  flex: 1;
}

.pin-mark {
  color: var(--warn);
  font-weight: 800;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.9rem;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 9, 11, 0.7);
  color: var(--text);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(16, 185, 129, 0.32);
  outline-offset: 1px;
}

.toggle-row {
  gap: 10px;
  justify-content: flex-start;
}

.btn {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
}

.btn-small {
  min-height: 38px;
  padding: 0 12px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #052e1c;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn,
.bottom-nav__item,
.text-button,
.icon-button,
.quick-tile,
.provider-btn {
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.btn:hover,
.bottom-nav__item:hover,
.text-button:hover,
.icon-button:hover,
.quick-tile:hover,
.provider-btn:hover {
  transform: translateY(-1px);
}

.bottom-nav {
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bottom-nav__item {
  flex: 1;
  gap: 6px;
  flex-direction: column;
  min-height: 58px;
  padding: 8px 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.bottom-nav__item.is-active {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.08);
}

.bottom-nav__icon {
  font-size: 1rem;
  font-weight: 800;
}

.drawer[hidden] {
  display: none;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.drawer__panel {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(100% - 24px, 420px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.98), rgba(9, 9, 11, 0.98));
  padding: 18px;
  box-shadow: var(--shadow);
}

.quick-tile,
.provider-btn {
  padding: 14px;
  border-radius: 18px;
}

.quick-tile strong,
.provider-btn {
  display: block;
}

.quick-tile--button {
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.provider-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  font-weight: 700;
}

.divider {
  margin: 18px 0 12px;
  color: var(--text-dim);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  .mobile-root {
    padding: 0;
  }

  .device-shell {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .summary-card__actions,
  .form-actions {
    flex-direction: column;
  }

  .launch-grid,
  .fast-lane-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }
}
