:root {
  --ink-950: #050506;
  --ink-925: #09090b;
  --ink-900: #7f0a16;
  --ink-700: #ae0018;
  --line: rgba(232, 232, 232, 0.16);
  --line-strong: rgba(255, 255, 255, 0.26);
  --text: #ffffff;
  --text-soft: #e8e8e8;
  --text-muted: #d2d1d1;
  --surface-1: rgba(8, 8, 10, 0.96);
  --surface-2: rgba(18, 11, 13, 0.92);
  --surface-3: rgba(174, 0, 24, 0.16);
  --surface-4: rgba(255, 255, 255, 0.05);
  --shadow: rgba(0, 0, 0, 0.44);
  --shadow-strong: rgba(0, 0, 0, 0.68);
  --glow: rgba(174, 0, 24, 0.34);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-sans: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --font-serif: "Cormorant Garamond", "Iowan Old Style", "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", "Consolas", monospace;
}

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

html {
  color-scheme: dark;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 16% 18%, rgba(174, 0, 24, 0.22), transparent 24%),
    radial-gradient(circle at 84% 16%, rgba(127, 10, 22, 0.24), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(174, 0, 24, 0.2), transparent 36%),
    linear-gradient(180deg, var(--ink-950), var(--ink-925) 34%, #12070b 100%);
  background-attachment: fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(rgba(174, 0, 24, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(174, 0, 24, 0.1) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.2;
}

body::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.016), transparent 32%, rgba(174, 0, 24, 0.05) 66%, transparent),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  opacity: 0.16;
}

img {
  display: block;
  max-width: 100%;
}

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

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

button {
  border: 0;
}

.hidden {
  display: none !important;
}

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

.shell-stage {
  width: min(1560px, calc(100vw - 32px));
  margin: 20px auto;
}

.window-shell,
.command-shell {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(232, 232, 232, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    radial-gradient(circle at top left, rgba(174, 0, 24, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(7, 7, 9, 0.98), rgba(14, 9, 11, 0.95));
  box-shadow:
    0 26px 80px var(--shadow-strong),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.window-shell::before,
.command-shell::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 29px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.shell-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(232, 232, 232, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.006)),
    rgba(0, 0, 0, 0.18);
}

.shell-bar,
.shell-tab,
.status-pill,
.eyebrow,
.section-label,
.field label,
.table-shell th,
.toggle-copy span:first-child,
.stat-label,
.objective-list li span:first-child,
.mini-kicker {
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.window-dots {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 84px;
}

.window-dots span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.window-dots span:first-child {
  background: #ae0018;
}

.shell-tabs,
.shell-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.shell-tab {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.shell-tab.active {
  color: var(--text);
}

.shell-tab.alert {
  color: #ffffff;
}

.shell-tab + .shell-tab {
  position: relative;
  padding-left: 16px;
}

.shell-tab + .shell-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 16px;
  background: rgba(232, 232, 232, 0.14);
  transform: translateY(-50%);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(232, 232, 232, 0.14);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 0.76rem;
}

.status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
}

.status-pill.alert::before {
  background: #ae0018;
  box-shadow: 0 0 16px rgba(174, 0, 24, 0.7);
}

.status-pill.subtle::before {
  background: #d2d1d1;
  box-shadow: none;
}

.panel,
.message-card,
.attachment-view,
.question-card,
.smartphone,
.modal-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(232, 232, 232, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012)),
    linear-gradient(180deg, rgba(10, 10, 12, 0.9), rgba(22, 10, 13, 0.84));
  box-shadow:
    0 18px 44px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel::before,
.message-card::before,
.attachment-view::before,
.question-card::before,
.smartphone::before,
.modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 30%, rgba(174, 0, 24, 0.08));
  pointer-events: none;
}

.panel {
  padding: 24px;
}

.eyebrow,
.section-label,
.mini-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.eyebrow::before,
.section-label::before,
.mini-kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.display-title,
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  line-height: 0.92;
}

.display-title {
  font-size: clamp(3.4rem, 6vw, 5.8rem);
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 3.3rem);
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
}

.lede {
  margin: 18px 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.38rem);
  color: var(--text-soft);
}

p {
  margin: 0;
  color: rgba(232, 232, 232, 0.78);
  line-height: 1.7;
}

.helper {
  color: rgba(232, 232, 232, 0.68);
  font-size: 0.92rem;
}

.muted {
  color: rgba(232, 232, 232, 0.56);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field,
.form-row {
  display: grid;
  gap: 10px;
}

.field label,
.form-row label {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.82);
}

.input,
.select,
select,
input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(232, 232, 232, 0.14);
  background: rgba(255, 255, 255, 0.035);
  color: #ffffff;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.select,
select {
  appearance: none;
  padding-right: 48px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.76) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.76) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 2px),
    calc(100% - 16px) calc(50% - 2px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.select,
select,
input[type="text"],
input[type="password"] {
  backdrop-filter: blur(8px);
}

.input::placeholder,
.select,
select,
input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: rgba(232, 232, 232, 0.52);
}

input[type="file"] {
  padding: 10px 12px;
}

input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: 14px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(232, 232, 232, 0.16);
  background: linear-gradient(135deg, rgba(174, 0, 24, 0.94), rgba(127, 10, 22, 0.92));
  color: #ffffff;
  cursor: pointer;
}

.input:focus-visible,
.select:focus-visible,
select:focus-visible,
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid rgba(232, 232, 232, 0.16);
  background: rgba(255, 255, 255, 0.026);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 14px 28px rgba(127, 10, 22, 0.28);
}

.btn.primary {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(174, 0, 24, 0.98), rgba(127, 10, 22, 0.94));
  box-shadow:
    0 18px 34px rgba(174, 0, 24, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.015);
}

.btn.danger {
  background: linear-gradient(135deg, rgba(174, 0, 24, 0.92), rgba(127, 10, 22, 0.88));
}

.btn.success {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(174, 0, 24, 0.4));
}

.btn.small {
  min-height: 42px;
  padding: 0 16px;
  font-size: 0.88rem;
}

.badge,
.pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(232, 232, 232, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.82rem;
}

.badge::before,
.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ae0018;
}

.stat-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(232, 232, 232, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.012)),
    rgba(255, 255, 255, 0.012);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: rgba(232, 232, 232, 0.72);
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  color: #ffffff;
}

.table-shell {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(232, 232, 232, 0.12);
  background: rgba(255, 255, 255, 0.018);
}

.table-shell table {
  width: 100%;
  border-collapse: collapse;
}

.table-shell th,
.table-shell td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(232, 232, 232, 0.08);
  font-size: 0.92rem;
}

.table-shell td {
  color: var(--text-muted);
}

.table-shell tr:last-child td {
  border-bottom: 0;
}

.table-shell th {
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  font-size: 0.72rem;
}

.error-text,
.input-error {
  min-height: 20px;
  color: #ffffff;
  font-size: 0.9rem;
}

.input-error {
  display: none;
}

.input-error.active {
  display: block;
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle input {
  width: 22px;
  height: 22px;
  accent-color: #ae0018;
}

.meter {
  display: flex;
  gap: 6px;
}

.meter span {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter span::before {
  content: "";
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(174, 0, 24, 0.95));
}

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

.surface-item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(232, 232, 232, 0.12);
  background: rgba(255, 255, 255, 0.018);
}

.surface-item strong {
  display: block;
  margin-bottom: 4px;
  color: #ffffff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 6, 0.74);
  backdrop-filter: blur(12px);
  z-index: 999;
}

.modal-overlay.active {
  display: flex;
}

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

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.pulse {
  animation: pulse-ring 1.4s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.16);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .shell-stage {
    width: min(100vw - 20px, 1560px);
    margin: 10px auto;
  }

  .window-shell,
  .command-shell {
    border-radius: 24px;
  }

  .shell-bar {
    padding: 14px 18px;
  }
}

@media (max-width: 720px) {
  .shell-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell-tabs,
  .shell-tools {
    width: 100%;
  }

  .shell-tabs {
    gap: 10px;
  }

  .shell-tab + .shell-tab::before {
    display: none;
  }

  .shell-tab + .shell-tab {
    padding-left: 0;
  }
}
