:root {
  --blue: #3157d5;
  --blue-dark: #2448b8;
  --navy: #13224a;
  --sky: #f4f7fc;
  --yellow: #ffd84d;
  --white: #fff;
  --text: #18213a;
  --muted: #68728a;
  --danger: #b42318;
  --success: #137a47;
  --border: #dce3f0;
  --focus: #afc2ff;
  --shadow: 0 12px 32px rgba(19, 34, 74, .10);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--sky); font-family: Inter, Arial, sans-serif; line-height: 1.5; }
a { color: var(--blue-dark); }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); font-weight: 900; text-decoration: none; }
.brand-logo { width: 44px; height: 44px; border-radius: 15px; object-fit: cover; display: block; flex-shrink: 0; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; background: var(--blue); color: white; font-size: 24px; }
.nav-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 700; }
main { min-height: calc(100vh - 160px); }
.hero { padding: 72px 0 54px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.eyebrow { display: inline-block; padding: 7px 12px; border-radius: 999px; background: #dbe5ff; color: var(--blue-dark); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
h1 { margin: 18px 0; color: var(--navy); font-size: clamp(38px, 7vw, 72px); line-height: 1.02; letter-spacing: -.04em; }
h2 { color: var(--navy); font-size: clamp(26px, 4vw, 42px); line-height: 1.15; }
h3 { color: var(--navy); }
.lead { max-width: 700px; color: var(--muted); font-size: 19px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.button, button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--blue); color: white; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { background: var(--blue-dark); }
.button.secondary { color: var(--navy); background: var(--yellow); }
.button.ghost { color: var(--blue-dark); background: #e7edff; }
.hero-card, .card, .form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card { padding: 28px; transform: rotate(1.5deg); }
.robot-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(220px, 100%); margin: 0 auto 18px; }
.robot-art span { display: block; aspect-ratio: 1; border-radius: 18px; background: linear-gradient(145deg, #dbe5ff, #8ea8ff); border: 2px solid #c7d5ff; }
.robot-art span:nth-child(2) { transform: translateY(-8px); background: linear-gradient(145deg, #fff8d6, #ffd84d); border-color: #ffe58a; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 48px; }
.step-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.step-card strong { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #e7edff; color: var(--blue-dark); }
.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.breadcrumb a { color: var(--blue-dark); text-decoration: none; font-weight: 700; }
.field-error { color: var(--danger); font-size: 13px; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .checkbox.has-error { border-color: var(--danger); }
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice-card { display: grid; gap: 8px; padding: 16px; border: 2px solid var(--border); border-radius: 16px; background: #fbfcff; cursor: pointer; min-height: 44px; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card.is-selected, .choice-card:has(input:checked) { border-color: var(--blue); background: #eef3ff; box-shadow: inset 0 0 0 1px var(--blue); }
.choice-card__title { font-weight: 800; color: var(--navy); }
.choice-card__text { color: var(--muted); font-size: 14px; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a.button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.progress { height: 8px; border-radius: 999px; background: #e7edff; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--blue); }
.progress.health-insufficient span { background: #9aa3b5; }
.progress.health-launchable span { background: #e6b800; }
.progress.health-profitable span { background: #137a47; }
.progress.health-target span { background: #0d5c36; }
.group-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.group-finance-hint { margin: 8px 0 0; }
.group-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.group-card__head h3 { margin: 0; }
.group-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.group-edit-panel { margin-top: 16px; border-top: 1px solid var(--border, #e5e7eb); padding-top: 12px; }
.group-edit-panel summary { cursor: pointer; font-weight: 600; color: var(--primary, #2563eb); margin-bottom: 12px; }
.group-edit-form { margin-top: 12px; }
.finance-group-card ul { margin: 0; padding: 0; list-style: none; }
.finance-group-stats li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.finance-group-stats li:last-child { border-bottom: 0; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.record-list { display: none; gap: 12px; }
.record-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.record-card h3 { margin: 0 0 8px; font-size: 18px; }
.record-meta { display: grid; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.feature-grid, .choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; padding-bottom: 72px; }
.card { padding: 28px; }
.card p { color: var(--muted); }
.form-wrap { padding: 54px 0 80px; }
.form-head { max-width: 760px; margin-bottom: 26px; }
.form-head h1 { font-size: clamp(36px, 6vw, 60px); }
.form-card { padding: clamp(22px, 5vw, 48px); }
.form-section { padding: 8px 0 24px; border: 0; margin: 0 0 22px; border-bottom: 1px solid var(--border); }
.form-section legend { padding: 0; margin-bottom: 18px; color: var(--navy); font-weight: 900; font-size: 22px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 750; }
input, select, textarea { width: 100%; min-height: 48px; border: 1px solid #bac6db; border-radius: 12px; padding: 11px 13px; background: white; color: var(--text); font: inherit; }
textarea { min-height: 108px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #ccd8ff; border-color: var(--blue); }
input[type="checkbox"], input[type="radio"] {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  border-radius: 4px;
  flex-shrink: 0;
  accent-color: var(--blue);
}
.checkbox { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 14px 0; font-weight: 500; }
.checkbox input { width: 20px !important; min-height: 20px !important; height: 20px !important; max-width: 20px !important; margin-top: 2px; }
.col-check { width: 52px; white-space: nowrap; }
.col-age { white-space: nowrap; }
table .row-check {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
}
.hint { color: var(--muted); font-size: 13px; }
.required { color: var(--danger); }
.errors { padding: 14px 18px; margin-bottom: 20px; border-radius: 14px; background: #ffebe9; color: var(--danger); }
.errors ul { margin: 6px 0; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.conditional[hidden] { display: none; }
.success-box { max-width: 720px; margin: 80px auto; text-align: center; }
.success-icon { font-size: 72px; }
.legal { max-width: 850px; margin: 52px auto 80px; }
.legal-content { white-space: pre-wrap; }
.site-footer { padding: 28px 0; background: var(--navy); color: #dce5ff; text-align: center; }
.site-footer a { color: #dce5ff; }

/* Admin */
.admin-body { background: #f4f6fb; }
.admin-header { background: var(--navy); color: white; }
.admin-header .brand { color: white; }
.admin-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.admin-nav a { color: #dfe7ff; text-decoration: none; font-weight: 700; }
.link-button { min-height: 0; padding: 0; background: none; color: #dfe7ff; }
.admin-main { padding: 34px 0 70px; }
.admin-choices { margin-top: 22px; }
.admin-title { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 22px; }
.admin-title h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat { padding: 24px; background: white; border: 1px solid var(--border); border-radius: 18px; }
.stat strong { display: block; color: var(--navy); font-size: 40px; }
.toolbar { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 10px; padding: 16px; background: white; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 16px; }
.toolbar button { min-height: 44px; }
.bulk-bar { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 12px; align-items: center; padding: 14px 16px; background: #e7edff; border-radius: 16px; }
.bulk-bar .checkbox { margin: 0; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--border); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #e9eeff; color: var(--blue-dark); font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.new { background: #fff3c4; color: #704f00; }
.badge.accepted, .badge.enrolled, .badge.active { background: #dff7e9; color: var(--success); }
.badge.rejected, .badge.archived { background: #f4e6e6; color: #7c2727; }
.detail-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 22px; }
.detail-list { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.stack { display: grid; gap: 16px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.score { font-size: 42px; font-weight: 900; color: var(--blue-dark); }
.score-reasons { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.login-card { max-width: 440px; margin: 80px auto; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; min-width: 220px; }
.copy-row input { min-height: 40px; font-size: 13px; }

@media (max-width: 860px) {
  .hero-grid, .detail-grid { grid-template-columns: 1fr; }
  .hero-card { transform: none; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr; }
  .role-cards, .steps { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav { align-items: flex-start; padding: 12px 0; }
  .nav-links { justify-content: flex-end; font-size: 13px; }
  .hero { padding-top: 42px; }
  .feature-grid, .choice-grid, .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .form-card { padding: 20px; border-radius: 18px; }
  .toolbar { grid-template-columns: 1fr; }
  .bulk-bar { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; gap: 2px; }
  .detail-list dd { margin-bottom: 10px; }
  .admin-title { align-items: flex-start; flex-direction: column; }
  .desktop-table { display: none; }
  .record-list { display: grid; }
}

.source-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.source-actions form { margin: 0; }
.modal {
  border: none;
  padding: 0;
  border-radius: 18px;
  max-width: min(640px, calc(100vw - 24px));
  width: 100%;
  background: transparent;
  margin: auto;
}
.modal[open] {
  display: block;
}
.modal::backdrop { background: rgba(15, 28, 63, 0.45); }
.modal-card {
  margin: 0;
  padding: 22px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 28, 63, 0.18);
  max-height: min(90vh, 720px);
  overflow: auto;
}

/* Social content center */
.social-status { margin-bottom: 22px; }
.social-integrations { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; }
.toolbar-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 18px; }
.social-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.social-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #eef2fb; }
.social-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.social-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.social-card-actions form { margin: 0; }
.social-preview { max-width: 100%; max-height: 280px; object-fit: contain; border-radius: 12px; background: #eef2fb; }
.social-preview-box { white-space: pre-wrap; word-break: break-word; background: #f7f9fd; border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-height: 120px; font: inherit; }
.social-previews { margin-top: 18px; }
.social-editor { margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.flash.success { background: #e8f8ef; color: #136f3a; }
.flash.warn { background: #fff7e6; color: #8a5a00; }
.flash.error { background: #fdeeee; color: #9b1c1c; }
.flash.info { background: #eef4ff; color: #1e429f; }
.warn-inline { color: #8a5a00; font-size: 0.92rem; }
.inline-form { display: inline; margin: 0 0 0 8px; }
.actions-cell { white-space: nowrap; }

/* Finance */
.finance-mix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 12px; }
.finance-track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 14px; }
.finance-track-card { padding: 16px; background: #f8faff; border: 1px solid var(--border); border-radius: 14px; }
.finance-track-card h3 { margin: 0 0 4px; font-size: 16px; }
.finance-track-card__meta { margin: 0 0 14px; }
.finance-track-card__fields { grid-template-columns: 1fr; gap: 12px; }
.finance-mix-grid h3 { margin: 0 0 10px; font-size: 16px; }
.finance-summary.finance-profit--pos { border-color: #b7e4c7; background: linear-gradient(180deg, #f4fff8 0%, #fff 120px); }
.finance-summary.finance-profit--neg { border-color: #f0c4c4; background: linear-gradient(180deg, #fff8f8 0%, #fff 120px); }
.finance-net { margin: 8px 0 0; font-size: clamp(32px, 6vw, 48px); font-weight: 800; color: var(--navy); }
.finance-profit--neg .finance-net { color: var(--danger); }
.finance-profit--pos .finance-net { color: var(--success); }
.finance-table th { width: 55%; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); }
.finance-table td { text-align: right; font-weight: 700; }
.finance-table-total th, .finance-table-total td { font-size: 18px; padding-top: 16px; }
.finance-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.finance-breakdown article { padding: 14px; background: #f8faff; border-radius: 14px; border: 1px solid var(--border); }
.finance-breakdown h3 { margin: 0 0 8px; font-size: 15px; }
.finance-breakdown ul { margin: 10px 0 0; padding-left: 18px; }
.finance-formulas summary { cursor: pointer; font-weight: 700; }
.finance-formulas ul { margin: 12px 0 0; padding-left: 18px; }
.badge.health-insufficient { background: #eceff4; color: #5c6578; }
.badge.health-launchable { background: #fff3c4; color: #704f00; }
.badge.health-profitable { background: #dff7e9; color: var(--success); }
.badge.health-target { background: #c8f0d8; color: #0d5c36; }

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 20px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.admin-subnav a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: var(--blue-dark);
  background: #eef3ff;
}
.admin-subnav a.is-active { background: var(--navy); color: white; }
.group-health-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -10px 0 18px; }

@media (max-width: 1100px) {
  .admin-nav { gap: 10px; font-size: 14px; }
}
@media (max-width: 900px) {
  .admin-header .brand span { display: none; }
  .admin-header .nav { flex-wrap: wrap; }
  .admin-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .finance-mix-grid { grid-template-columns: 1fr; }
  .finance-track-grid { grid-template-columns: 1fr; }
  .finance-table th, .finance-table td { display: block; width: 100%; text-align: left; }
  .finance-table td { padding-top: 0; padding-bottom: 12px; }
  .group-health-legend { flex-direction: column; align-items: flex-start; }
}
