:root {
  --bg: #10202c;
  --panel: #f8f0de;
  --panel-strong: #fff9ee;
  --ink: #162530;
  --ink-soft: #5e6a75;
  --line: rgba(22, 37, 48, 0.12);
  --accent: #d58b2a;
  --accent-strong: #b87013;
  --shadow: 0 24px 54px rgba(6, 15, 22, 0.24);
  --radius-lg: 28px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Aptos", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(213, 139, 42, 0.2), transparent 28%),
    linear-gradient(180deg, #172937 0%, #0d151d 100%);
}

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

button {
  cursor: pointer;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.86rem 0.95rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(213, 139, 42, 0.56);
  box-shadow: 0 0 0 4px rgba(213, 139, 42, 0.15);
}

textarea {
  resize: vertical;
}

.app-shell {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  color: #f3f8fb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #efb962, #c26f0d);
  color: #0d1720;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.2);
}

.brand h1 {
  margin: 0.18rem 0 0;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  letter-spacing: -0.05em;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: rgba(243, 248, 251, 0.62);
}

.panel .eyebrow,
.hero-card .eyebrow,
.field span,
.rfi-header .eyebrow {
  color: rgba(88, 102, 114, 0.9);
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: #fdfbf6;
  backdrop-filter: blur(18px);
}

.status-pill::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #f1c36d;
}

.status-pill.live::before {
  background: #93efc6;
}

.main-grid {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.panel {
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.15rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1rem;
}

.hero h2 {
  margin: 0.35rem 0 0.8rem;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.support-text,
.message,
.anchor-list,
.list-card span,
.list-card small {
  color: var(--ink-soft);
  line-height: 1.58;
}

.inline-note {
  margin: -0.2rem 0 0;
  font-size: 0.95rem;
}

.hero-card {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.anchor-list {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.auth-panel {
  max-width: 620px;
}

.auth-shell {
  display: flex;
  justify-content: center;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1rem 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.workspace-columns {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1rem;
}

.workspace-shell,
.workspace-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.workspace-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.page-button {
  min-height: 2.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: #f3f8fb;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

.page-button.active {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff8ea;
  box-shadow: 0 14px 28px rgba(184, 112, 19, 0.28);
  border-color: transparent;
}

.page-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-column,
.main-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-header h3,
.rfi-header h4 {
  margin: 0.2rem 0 0;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.stack-form.compact {
  gap: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field span {
  font-size: 0.88rem;
  font-weight: 700;
}

.gate-panel {
  max-width: 860px;
}

.settings-grid,
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.account-summary {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.summary-row span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  gap: 0.9rem;
}

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

.mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.mode-button {
  border: 1px solid rgba(16, 26, 37, 0.08);
  border-radius: 999px;
  padding: 0.76rem 0.95rem;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink-soft);
  font-weight: 800;
}

.mode-button.active {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff8ea;
  box-shadow: 0 12px 24px rgba(184, 112, 19, 0.24);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.6rem;
}

.button {
  min-height: 2.9rem;
  border: none;
  border-radius: 16px;
  padding: 0.8rem 1.05rem;
  font-weight: 800;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

.button.small {
  min-height: 2.45rem;
  padding: 0.6rem 0.9rem;
}

.button.primary {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff8eb;
  box-shadow: 0 14px 28px rgba(184, 112, 19, 0.28);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  border: 1px solid var(--line);
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.button-card {
  border: 1px solid var(--line);
}

.empty-state {
  padding: 1rem;
  border: 1px dashed rgba(22, 37, 48, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink-soft);
}

.message {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(213, 139, 42, 0.12);
  color: #7c4c12;
}

.message.error {
  background: rgba(156, 59, 52, 0.1);
  color: #8f332c;
}

.rfi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.2rem;
}

.rfi-item {
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.rfi-item-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  max-width: min(420px, calc(100% - 2rem));
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(16, 26, 37, 0.94);
  color: #edf4f8;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

body.auth-only .app-shell {
  width: min(560px, calc(100% - 1.5rem));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

body.auth-only .main-grid {
  width: 100%;
}

body.auth-only .auth-panel {
  width: 100%;
}

@media (max-width: 1080px) {
  .hero,
  .workspace-columns,
  .settings-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 0.8rem;
  }

  body.auth-only .app-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 0;
  }

  .topbar,
  .panel-header,
  .rfi-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .two-up {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .button.small {
    width: 100%;
  }
}
