:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #232925;
  background: #f3f7f3;
  --green: #37b532;
  --green-dark: #168f41;
  --green-pale: #eaf8e9;
  --ink: #232925;
  --muted: #68716c;
  --line: #dce6de;
  --surface: rgba(255, 255, 255, 0.94);
  --danger: #bd4141;
  --shadow: 0 18px 50px rgba(27, 61, 37, 0.075);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { display: flex; min-height: 100vh; margin: 0; flex-direction: column; background: radial-gradient(circle at 94% 1%, rgba(55, 181, 50, .12), transparent 29%), linear-gradient(145deg, #f8faf8, #eef4ef); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }

.site-header { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 330px 1fr auto; align-items: center; min-height: 82px; padding: 0 max(28px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid rgba(215, 226, 217, .9); background: rgba(248, 251, 248, .92); backdrop-filter: blur(18px); }
.brand-frame, .login-logo-frame { display: flex; align-items: center; gap: 13px; }
.brand-frame { width: max-content; min-width: 280px; }
.brand-symbol { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 50%; color: white; background: linear-gradient(145deg, var(--green-dark), var(--green)); box-shadow: 0 9px 24px rgba(22, 143, 65, .2); font-size: 26px; font-weight: 900; letter-spacing: -.08em; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { color: #454b48; font-size: 25px; font-weight: 850; letter-spacing: .045em; }
.brand-copy small { margin-top: 6px; color: var(--muted); font-size: 11px; letter-spacing: .025em; }
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a { padding: 10px 14px; border-radius: 11px; color: #55605a; font-size: 14px; font-weight: 700; }
.main-nav a:hover { color: var(--green-dark); background: var(--green-pale); }
.user-menu { display: flex; align-items: center; gap: 13px; }
.user-copy { display: flex; min-width: 130px; flex-direction: column; text-align: right; }
.user-copy strong { font-size: 13px; }
.user-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; color: #56615a; background: white; font-size: 18px; }
.icon-button:hover { color: var(--danger); border-color: #edcccc; background: #fff5f5; }

.page-shell { width: min(1184px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 70px; flex: 1 0 auto; }
.panel { border: 1px solid rgba(216, 228, 218, .95); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.eyebrow { color: var(--green-dark); font-size: 11px; font-weight: 850; letter-spacing: .15em; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 26px; }
.page-heading h1 { margin: 7px 0 7px; font-size: clamp(34px, 4vw, 50px); line-height: 1; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.page-actions { display: flex; max-width: 650px; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.compact-heading h1 { font-size: 42px; }

.button { display: inline-flex; min-height: 42px; padding: 0 18px; align-items: center; justify-content: center; border: 0; border-radius: 12px; cursor: pointer; font-weight: 750; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button-primary { color: white; background: linear-gradient(135deg, var(--green-dark), var(--green)); box-shadow: 0 9px 22px rgba(22, 143, 65, .18); }
.button-secondary { color: #256d39; border: 1px solid #ccdfcf; background: #f9fcf9; }
.button-danger { color: white; background: linear-gradient(135deg, #9f3434, #c65353); box-shadow: 0 9px 22px rgba(159, 52, 52, .16); }
.button-large { min-height: 50px; }
.button-wide { width: 100%; }
.link-button { border: 0; cursor: pointer; color: var(--green-dark); background: transparent; font-weight: 700; }
.link-button.danger { color: var(--danger); }

.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 13px 16px; border: 1px solid #cbe4ce; border-radius: 12px; color: #1d7135; background: #effaf0; }
.message.error { color: #9f3333; border-color: #efcccc; background: #fff1f1; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metric-card { display: flex; min-height: 150px; padding: 22px; flex-direction: column; }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { margin: auto 0 2px; font-size: 35px; letter-spacing: -.04em; }
.metric-card small { color: #8a928e; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.section-card { padding: 24px; }
.card-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 17px; }
.card-heading h2 { margin: 5px 0 0; font-size: 23px; }
.card-heading > a { color: var(--green-dark); font-size: 13px; font-weight: 750; }
.compact-list, .timeline { display: grid; gap: 7px; }
.compact-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #edf1ee; }
.compact-row:first-child { border-top: 0; }
.compact-row > div:nth-child(2), .timeline-row div { display: flex; min-width: 0; flex-direction: column; }
.compact-row strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.compact-row span:not(.status), .timeline-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.file-symbol { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: var(--green-dark); background: var(--green-pale); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.file-symbol.large { width: 54px; height: 54px; font-size: 12px; }
.status { display: inline-flex; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 780; }
.status-active { color: #19723a; background: #e9f8eb; }
.status-archived { color: #786953; background: #f5f0e8; }
.status-deleted { color: #9d3939; background: #fbeaea; }
.timeline-row { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 8px 0; }
.timeline-dot { width: 9px; height: 9px; margin-top: 4px !important; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-pale); }
.empty-inline { padding: 25px 0; color: var(--muted); text-align: center; }

.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 18px; color: #7b847f; background: #f7faf7; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { padding: 16px 18px; border-top: 1px solid #e8eee9; color: #4b554f; font-size: 14px; }
td strong { color: var(--ink); }
.clickable-row { cursor: pointer; transition: background .15s ease; }
.clickable-row:hover, .clickable-row:focus { outline: none; background: #f7fbf7; }
.row-primary-link { display: block; }
.cell-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
code { padding: 4px 7px; border-radius: 6px; color: #4d5951; background: #eef3ef; }
.empty-cell { padding: 50px; color: var(--muted); text-align: center; }

.search-bar { display: flex; gap: 10px; margin-bottom: 16px; padding: 12px; border-radius: 16px; box-shadow: none; }
.search-bar input { min-width: 0; flex: 1; height: 42px; padding: 0 13px; border: 0; outline: none; background: transparent; }

.form-panel { max-width: 850px; padding: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px; }
.field { display: flex; min-width: 0; flex-direction: column; }
.field-wide { grid-column: 1 / -1; }
.field label, .stack-form label { margin-bottom: 8px; font-size: 13px; font-weight: 760; }
.field input, .field select, .stack-form input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #cad6cd; border-radius: 11px; outline: none; background: white; }
.field input[type=file] { padding: 10px; }
.field input:focus, .field select:focus, .stack-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(55, 181, 50, .12); }
.field small { margin-top: 6px; color: var(--muted); }
.field-error { margin-top: 6px; color: var(--danger); font-size: 12px; }
.form-alert { padding: 11px 13px; border: 1px solid #efcccc; border-radius: 10px; color: #9f3333; background: #fff1f1; font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 5px; }
.upload-note { display: flex; gap: 10px; padding: 14px 16px; border: 1px solid #d6e7d8; border-radius: 12px; color: #41604a; background: #f4faf4; font-size: 13px; }
.upload-progress { padding: 17px 18px; border: 1px solid #cee2d1; border-radius: 14px; background: #f8fcf8; }
.upload-progress > div { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 10px; color: #31533a; font-size: 13px; }
.upload-progress progress { width: 100%; height: 13px; overflow: hidden; border: 0; border-radius: 999px; accent-color: var(--green-dark); }
.upload-progress small { display: block; margin-top: 9px; color: var(--muted); }
.checkbox-field { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.checkbox-field input { width: 20px; min-height: 20px; }
.checkbox-field label { margin: 0; }

.heading-actions { display: flex; gap: 10px; }
.detail-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 18px; margin-bottom: 18px; }
.detail-card { padding: 25px; }
.detail-list { display: grid; gap: 0; margin: 18px 0 0; }
.detail-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid #edf1ee; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; font-weight: 700; }
.account-list { display: grid; margin-top: 12px; }
.account-row { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-top: 1px solid #edf1ee; }
.account-row:first-child { border-top: 0; }
.account-row > div { display: flex; flex-direction: column; gap: 5px; }
.account-row > div:last-child { align-items: flex-end; }
.account-row span:not(.status) { color: var(--muted); font-size: 12px; }
.partner-studies-preview { margin-bottom: 18px; }
.danger-zone { display: flex; padding: 22px 4px; align-items: center; justify-content: space-between; gap: 24px; }
.danger-zone h2 { margin: 0 0 5px; color: #873535; font-size: 18px; }
.danger-zone p { margin: 0; color: var(--muted); font-size: 13px; }
.delete-confirmation { margin-top: 25px; }
.confirmation-actions { display: flex; justify-content: flex-end; gap: 10px; }

.partner-hero { position: relative; display: flex; min-height: 210px; margin-bottom: 20px; padding: 34px 38px; align-items: center; justify-content: space-between; overflow: hidden; }
.partner-hero::after { position: absolute; right: -80px; top: -130px; width: 360px; height: 360px; border: 1px solid rgba(55, 181, 50, .18); border-radius: 50%; content: ""; }
.partner-hero h1 { margin: 8px 0 10px; font-size: 44px; letter-spacing: -.04em; }
.partner-hero p { margin: 0; color: var(--muted); }
.launcher-guide { margin-bottom: 18px; padding: 26px 30px; }
.launcher-guide-heading { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.launcher-guide-heading h2 { margin: 6px 0 7px; font-size: 25px; }
.launcher-guide-heading p { margin: 0; color: var(--muted); }
.launcher-guide-heading > div:last-child { display: flex; align-items: center; flex-direction: column; gap: 8px; }
.launcher-guide-actions .button { width: 100%; white-space: nowrap; }
.launcher-version { color: var(--muted); font-size: 11px; }
.workflow-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px; margin-top: 25px; padding-top: 22px; border-top: 1px solid #e5ede6; }
.workflow-grid h3 { margin: 0 0 11px; font-size: 16px; }
.workflow-grid ol { margin: 0; padding-left: 20px; color: #53605a; font-size: 13px; line-height: 1.65; }
.hero-shield { position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; }
.hero-shield > span { display: grid; width: 74px; height: 74px; place-items: center; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--green-dark), var(--green)); box-shadow: 0 15px 35px rgba(22, 143, 65, .22); font-size: 30px; font-weight: 850; }
.hero-shield small { width: 80px; color: #377048; font-weight: 750; }
.study-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.partner-study-card { display: flex; min-height: 300px; padding: 20px; flex-direction: column; }
.study-card-top { display: flex; justify-content: space-between; }
.partner-study-card h2 { margin: 19px 0 5px; font-size: 21px; letter-spacing: -.02em; }
.partner-study-card p { margin: 0; color: var(--muted); font-size: 13px; }
.partner-study-card dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: auto 0 18px; padding-top: 24px; }
.partner-study-card dl div { display: flex; flex-direction: column; }
.partner-study-card dt { color: var(--muted); font-size: 11px; }
.partner-study-card dd { margin: 4px 0 0; font-size: 14px; font-weight: 760; }
.empty-state { grid-column: 1 / -1; padding: 65px 30px; text-align: center; }
.empty-state h1, .empty-state h2 { margin: 13px 0 8px; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-mark { display: grid; width: 55px; height: 55px; margin: auto; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--green-pale); font-size: 24px; }

.password-shell { max-width: 560px; margin: 40px auto; padding: 35px; }
.password-shell h1 { margin: 8px 0; font-size: 35px; letter-spacing: -.03em; }
.password-shell > p { margin: 0 0 25px; color: var(--muted); }
.stack-form { display: flex; flex-direction: column; }
.stack-form label:not(:first-child) { margin-top: 16px; }
.stack-form .button { margin-top: 24px; }
.muted { color: var(--muted); }
.site-credit { width: 100%; padding: 0 20px 22px; text-align: center; color: #7e8781; font-size: 11px; letter-spacing: .025em; }
.site-credit a { color: inherit; text-decoration: none; transition: color .15s ease; }
.site-credit a:hover, .site-credit a:focus-visible { color: var(--green-dark); }

.login-body { display: grid; min-height: 100vh; place-items: center; background: radial-gradient(circle at 78% 15%, rgba(55, 181, 50, .18), transparent 30%), linear-gradient(145deg, #f8faf8, #eaf2eb); }
.login-body .site-credit { position: fixed; left: 0; bottom: 0; z-index: 2; }
.login-shell { display: grid; width: min(1060px, calc(100% - 40px)); grid-template-columns: 1.25fr .75fr; align-items: center; gap: 70px; padding: 45px 0; }
.login-brand h1 { max-width: 650px; margin: 14px 0 16px; font-size: clamp(42px, 5vw, 67px); line-height: .98; letter-spacing: -.052em; }
.login-brand > p { max-width: 580px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.login-logo-frame { width: max-content; margin-bottom: 55px; }
.login-logo-frame .brand-symbol { width: 64px; height: 64px; flex-basis: 64px; font-size: 34px; }
.login-logo-frame .brand-copy strong { font-size: 34px; }
.login-logo-frame .brand-copy small { font-size: 13px; }
.security-note { display: flex; width: max-content; max-width: 100%; margin-top: 32px; padding: 12px 15px; align-items: center; gap: 9px; border: 1px solid #cbe2ce; border-radius: 12px; color: #337145; background: rgba(255, 255, 255, .65); font-size: 13px; }
.security-note span { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: white; background: var(--green-dark); }
.login-launcher-download { display: flex; margin-top: 16px; align-items: center; gap: 12px; flex-wrap: wrap; }
.login-card { padding: 32px; }
.login-card h2 { margin: 7px 0 8px; font-size: 31px; letter-spacing: -.03em; }
.login-card > div > p { margin: 0 0 22px; color: var(--muted); }
.login-card .form-alert { margin-bottom: 18px; }
.login-card > small { display: block; margin-top: 20px; line-height: 1.5; }

.app-toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 420px; padding: 14px 17px; border-radius: 13px; color: white; background: #2f3a33; box-shadow: 0 18px 50px rgba(0, 0, 0, .18); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.app-toast.visible { opacity: 1; transform: translateY(0); }
.app-toast.success { background: #19753a; }
.app-toast.error { background: #a53c3c; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 240px 1fr auto; }
  .brand-frame { min-width: 230px; }
  .main-nav a { padding: 9px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .study-grid { grid-template-columns: repeat(2, 1fr); }
  .login-shell { gap: 35px; }
}

@media (max-width: 720px) {
  .site-header { position: static; display: flex; min-height: auto; padding: 12px 18px; flex-wrap: wrap; }
  .brand-frame { min-width: 0; }
  .brand-frame .brand-symbol { width: 42px; height: 42px; flex-basis: 42px; font-size: 22px; }
  .brand-frame .brand-copy strong { font-size: 20px; }
  .brand-frame .brand-copy small { display: none; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .user-menu { margin-left: auto; }
  .user-copy { display: none; }
  .page-shell { width: min(100% - 28px, 1184px); padding-top: 28px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading h1, .compact-heading h1, .partner-hero h1 { font-size: 36px; }
  .metric-grid, .study-grid, .form-grid { grid-template-columns: 1fr; }
  .workflow-grid { grid-template-columns: 1fr; gap: 20px; }
  .launcher-guide-heading, .danger-zone, .account-row { align-items: stretch; flex-direction: column; }
  .launcher-guide-heading > div:last-child, .account-row > div:last-child { align-items: stretch; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .page-actions { width: 100%; max-width: none; justify-content: stretch; }
  .page-actions .button { flex: 1 1 220px; }
  .field-wide { grid-column: auto; }
  .partner-hero { padding: 28px 24px; }
  .hero-shield { display: none; }
  .login-shell { grid-template-columns: 1fr; padding: 24px 0; }
  .login-brand h1 { font-size: 43px; }
  .login-logo-frame { margin-bottom: 30px; }
  .login-card { padding: 25px; }
  .security-note { width: auto; }
}
