:root {
  --bg: #071015;
  --panel: #0d171e;
  --panel-2: #121f28;
  --line: rgba(234, 242, 246, 0.13);
  --text: #f4f8fb;
  --muted: #a8b4bd;
  --muted-2: #7f8d97;
  --green: #20c878;
  --green-2: #0e8f55;
  --cyan: #26c6da;
  --orange: #ff8a1f;
  --danger: #ff6b6b;
  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);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

.orange {
  color: var(--orange);
}

.green {
  color: var(--green);
}

.auth-layout {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(10, 25, 34, 0.96), rgba(7, 16, 21, 1) 64%),
    repeating-linear-gradient(90deg, rgba(244, 248, 251, 0.045) 0 1px, transparent 1px 96px);
}

.auth-panel {
  display: grid;
  gap: 34px;
  width: min(440px, 100%);
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 23, 30, 0.94);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

.brand-block,
.app-brand {
  display: grid;
  gap: 3px;
  text-decoration: none;
}

.brand-mark,
.app-brand > span {
  color: var(--text);
  font-size: 1.85rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.brand-subtitle,
.app-brand small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-form,
.project-form {
  display: grid;
  gap: 16px;
}

.login-form h1,
.dashboard h1,
.list-heading h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.login-form h1 {
  font-size: 1.45rem;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(234, 242, 246, 0.16);
  border-radius: 6px;
  background: rgba(4, 10, 14, 0.72);
  color: var(--text);
  padding: 0 13px;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid rgba(234, 242, 246, 0.16);
  border-radius: 6px;
  background: rgba(4, 10, 14, 0.72);
  color: var(--text);
  padding: 13px;
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
}

input:focus {
  border-color: rgba(32, 200, 120, 0.88);
  box-shadow: 0 0 0 3px rgba(32, 200, 120, 0.13);
}

textarea:focus {
  border-color: rgba(32, 200, 120, 0.88);
  box-shadow: 0 0 0 3px rgba(32, 200, 120, 0.13);
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  font-size: 0.86rem;
  font-weight: 900;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.primary-button {
  border: 1px solid rgba(32, 200, 120, 0.82);
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #03110a;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(244, 248, 251, 0.04);
  color: var(--text);
}

.primary-button:hover,
.ghost-button:hover {
  filter: brightness(1.08);
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.form-message.error {
  color: var(--danger);
}

.app-shell {
  min-height: 100svh;
  background: #081117;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 20px;
  padding: 16px clamp(18px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 23, 0.94);
}

.app-brand > span {
  font-size: 1.45rem;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

#user-email {
  overflow: hidden;
  max-width: 280px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100svh - 76px);
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: #0a141a;
}

.nav-item {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 850;
}

.nav-item.active {
  border-color: rgba(32, 200, 120, 0.28);
  background: rgba(32, 200, 120, 0.12);
  color: var(--text);
}

.nav-item:disabled {
  opacity: 0.55;
}

.dashboard {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: clamp(18px, 3vw, 34px);
}

.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dashboard h1 {
  font-size: clamp(1.75rem, 3vw, 2.55rem);
}

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

.status-grid article {
  display: grid;
  gap: 7px;
  min-height: 98px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(32, 200, 120, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(32, 200, 120, 0.11), rgba(38, 198, 218, 0.05)),
    var(--panel);
}

.planner-launch h2,
.planner-launch p {
  margin: 0;
}

.planner-launch h2 {
  color: var(--text);
  font-size: 1.1rem;
}

.planner-launch p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.primary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(32, 200, 120, 0.82);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #03110a;
  padding: 0 16px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 950;
  white-space: nowrap;
}

.primary-link-button:hover {
  filter: brightness(1.08);
}

.project-band {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.scenario-band {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(280px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.project-form,
.project-list-wrap,
.scenario-editor {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.scenario-editor {
  display: grid;
  gap: 16px;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.list-heading h2 {
  font-size: 1.05rem;
}

.list-heading > span {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  min-height: 26px;
  border-radius: 999px;
  background: rgba(32, 200, 120, 0.12);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 950;
}

.project-list {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.8fr) 86px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 12px;
  border: 1px solid rgba(234, 242, 246, 0.1);
  border-radius: 7px;
  background: var(--panel-2);
  color: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  width: 100%;
}

.project-row:hover,
.project-row:focus-visible {
  border-color: rgba(32, 200, 120, 0.44);
  background: #172733;
  outline: none;
  transform: translateY(-1px);
}

.project-row strong,
.project-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-row strong {
  color: var(--text);
}

.project-row span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.status-pill {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(38, 198, 218, 0.12);
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.status-pill.current {
  background: rgba(32, 200, 120, 0.14);
  color: var(--green);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scenario-list {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.scenario-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(234, 242, 246, 0.1);
  border-radius: 7px;
  background: var(--panel-2);
}

.scenario-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scenario-row strong,
.scenario-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.scenario-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.empty-state {
  margin: 16px 0 0;
  color: var(--muted-2);
  font-size: 0.9rem;
  font-weight: 800;
}

.empty-state[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .workspace,
  .project-band,
  .scenario-band {
    grid-template-columns: 1fr;
  }

  .planner-launch {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    grid-auto-flow: column;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-header,
  .dashboard-head,
  .user-bar {
    align-items: start;
    flex-direction: column;
  }

  #user-email {
    max-width: calc(100vw - 40px);
  }

  .project-row {
    grid-template-columns: 1fr;
  }

  .scenario-row,
  .scenario-controls {
    align-items: start;
    flex-direction: column;
  }

  textarea {
    min-height: 260px;
  }
}
