:root {
  --ink: #111827;
  --muted: #64748b;
  --line: #d8e0ea;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --qstp: #0f766e;
  --qstp-dark: #134e4a;
  --blue: #2563eb;
  --amber: #d97706;
  --red: #dc2626;
  --green: #059669;
  --violet: #7c3aed;
  --shadow: 0 16px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef3f8;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hidden {
  display: none !important;
}

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

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
}

textarea {
  resize: vertical;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), transparent 45%),
    #eef3f8;
}

.login-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-brand {
  margin-bottom: 24px;
}

.login-brand h1 {
  color: var(--ink);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form input,
#add-startup-form input,
#add-startup-form select,
#add-startup-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  outline: 0;
}

.login-form input:focus,
#add-startup-form input:focus,
#add-startup-form select:focus,
#add-startup-form textarea:focus {
  border-color: var(--qstp);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #10201f;
  color: #f8fafc;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark,
.logo-badge {
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--qstp-dark);
  overflow: hidden;
}

.logo-mark {
  padding: 6px;
}

.brand-mark img,
.topbar-title img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand h1,
.topbar h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 22px;
}

.eyebrow {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0d9488;
}

.sidebar .eyebrow {
  color: #5eead4;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.primary-button,
.text-button {
  border: 0;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cbd5e1;
  background: transparent;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  font-weight: 750;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.mission-box {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 18px;
  color: #dbeafe;
  line-height: 1.5;
}

.logout-button {
  width: 100%;
  margin-top: 14px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 850;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

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

.topbar-title {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.topbar-title img {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 6px;
}

.topbar h2 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.topbar-actions,
.filter-row,
.feed-heading,
.panel-header,
.live-pill {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 12px;
}

.live-pill {
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 14px;
  color: var(--qstp-dark);
  font-weight: 800;
  white-space: nowrap;
}

.live-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(5, 150, 105, 0.12);
}

.primary-button {
  min-height: 46px;
  border-radius: 8px;
  background: var(--qstp);
  color: #ffffff;
  padding: 0 18px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
}

.primary-button:hover {
  background: var(--qstp-dark);
}

.text-button {
  background: transparent;
  color: var(--qstp);
  font-weight: 850;
  padding: 8px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.monitor-panel {
  margin-bottom: 18px;
}

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

.monitor-grid div {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.monitor-grid strong {
  display: block;
  font-size: 24px;
}

.monitor-grid span {
  color: var(--muted);
  font-weight: 750;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 20px;
}

.metric-card p,
.metric-card span,
.feed-meta,
.timeline-meta {
  color: var(--muted);
}

.metric-card p {
  margin: 0 0 8px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  font-size: 40px;
  line-height: 1;
  margin-bottom: 8px;
}

.alert-metric strong {
  color: var(--red);
}

.layout-two,
.profile-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.85fr);
  gap: 18px;
}

.panel {
  padding: 22px;
}

.panel-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel h3 {
  font-size: 22px;
}

.feed-list,
.alert-list,
.startup-picker,
.rank-list,
.bar-list,
.trend-grid {
  display: grid;
  gap: 12px;
}

.feed-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.feed-card-button {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 16px;
}

.feed-card:hover {
  border-color: rgba(15, 118, 110, 0.4);
}

.logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #d9f99d;
  color: #1a2e05;
}

.feed-copy {
  min-width: 0;
}

.feed-heading {
  gap: 10px;
  flex-wrap: wrap;
}

.feed-heading h4 {
  margin: 0;
  font-size: 17px;
}

.summary {
  margin: 6px 0;
  line-height: 1.45;
}

.tag,
.score-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.tag {
  padding: 5px 9px;
  background: #dbeafe;
  color: #1d4ed8;
}

.tag.funding {
  background: #fee2e2;
  color: #b91c1c;
}

.tag.launch,
.tag.product {
  background: #ccfbf1;
  color: #0f766e;
}

.tag.hiring {
  background: #fef3c7;
  color: #92400e;
}

.score-pill {
  background: #111827;
  color: #ffffff;
  padding: 8px 10px;
}

.alert-card,
.rank-item,
.bar-item,
.trend-card,
.picker-button,
.timeline-item {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 14px;
}

.alert-card {
  display: grid;
  gap: 6px;
}

.alert-card strong {
  color: var(--red);
}

.filter-row {
  gap: 12px;
  margin-bottom: 18px;
}

.search-control {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.search-control input,
select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}

.search-control input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.startup-picker-panel {
  max-height: calc(100vh - 140px);
  overflow: auto;
}

.picker-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.picker-button.active {
  border-color: var(--qstp);
  background: #ecfdf5;
}

.profile-hero {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.profile-hero .logo-badge {
  width: 74px;
  height: 74px;
  font-size: 22px;
}

.profile-hero h3 {
  font-size: 28px;
}

.status-pill {
  padding: 7px 10px;
  background: #dcfce7;
  color: #166534;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.stat-box strong {
  display: block;
  font-size: 26px;
}

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

.timeline-item p,
.rank-item p,
.trend-card p,
.alert-card p,
.picker-button p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.rank-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.rank-number {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.bar-fill {
  height: 100%;
  background: var(--qstp);
  border-radius: inherit;
}

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

.trend-card strong {
  font-size: 24px;
}

.field-label {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin: 18px 0 8px;
}

#add-startup-form {
  display: grid;
}

.social-section {
  margin-top: 4px;
}

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

.social-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 6px;
}

.social-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--qstp-dark);
  padding: 7px 10px;
  text-decoration: none;
  font-weight: 850;
  font-size: 13px;
}

.generator-panel select,
.full-width {
  width: 100%;
}

.generated-post {
  min-height: 310px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 20px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: #ffffff;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  z-index: 10;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mission-box {
    display: none;
  }

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

  .layout-two,
  .profile-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .metrics-grid,
  .monitor-grid,
  .profile-stats,
  .social-grid,
  .trend-grid {
    grid-template-columns: 1fr;
  }

  .feed-card-button,
  .profile-hero,
  .rank-item {
    grid-template-columns: 1fr;
  }

  .score-pill {
    justify-self: start;
  }
}
