:root {
  color-scheme: dark;
  --bg: #09110f;
  --panel: #111d19;
  --panel-soft: #16251f;
  --text: #f5f7f3;
  --muted: #9bac9f;
  --line: #294138;
  --accent: #b9f34a;
  --accent-text: #132000;
  --shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% 10%, #19352a 0, transparent 34rem), var(--bg); color: var(--text); font: 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
a { color: inherit; }
.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { text-decoration: none; font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.account { display: flex; align-items: center; gap: 12px; }
.account img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.account div { display: grid; }
.account small { color: var(--muted); }
.hero { max-width: 780px; padding: 13vh 0 80px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 12px 0 18px; font-size: clamp(42px, 7vw, 78px); line-height: .98; letter-spacing: -.055em; }
.hero > p:not(.eyebrow) { max-width: 660px; margin: 0 0 32px; color: var(--muted); font-size: 19px; }
.primary-button, .quiet-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; padding: 12px 18px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.primary-button { background: var(--accent); color: var(--accent-text); }
.compact-button { padding: 8px 13px; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.quiet-button { padding: 8px 11px; background: transparent; color: var(--muted); border: 1px solid var(--line); }
.notice, .empty-state, .error-card { border: 1px solid var(--line); border-radius: 14px; background: rgba(17,29,25,.85); padding: 24px; }
.notice { display: grid; max-width: 620px; }
.notice span, .empty-state p, .error-card p, .workspace-heading p, .project-card p { color: var(--muted); }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 70px 0 34px; }
.workspace-heading h1 { font-size: clamp(40px, 6vw, 64px); }
.workspace-heading p { margin: 0; }
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state h2 { margin: 0 0 8px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.project-card { display: block; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); text-decoration: none; transition: border-color .16s ease, transform .16s ease; }
.project-card:hover, .project-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.project-card > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.project-card h2 { margin: 28px 0 8px; }
.error-card { max-width: 680px; margin: 13vh auto; }
.error-card h1 { font-size: clamp(38px, 6vw, 62px); }
.error-card .primary-button { margin-top: 18px; }
.page-heading { max-width: 820px; padding: 64px 0 30px; }
.page-heading h1, .project-heading h1 { font-size: clamp(38px, 6vw, 64px); }
.page-heading > p:last-child, .project-heading p { color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: 14px; background: rgba(17,29,25,.9); padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid label, .member-form label { display: grid; align-content: start; gap: 8px; }
.form-grid label > span, .member-form label > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.full-field { grid-column: 1 / -1; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); color: var(--text); padding: 11px 12px; font: inherit; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-error, .form-success { margin: 0 0 20px; padding: 13px 15px; border-radius: 9px; }
.form-error { border: 1px solid #ef6464; background: rgba(127,29,29,.35); }
.form-success { border: 1px solid var(--accent); background: rgba(74,108,22,.28); }
.project-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 58px 0 30px; }
.project-heading > div { max-width: 820px; }
.status-banner, .role-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.project-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 4px 0 0; }
.section-heading > span { color: var(--muted); font-size: 13px; }
.member-form { display: grid; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.member-list { display: grid; gap: 4px; margin-top: 14px; }
.member { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.member > div { display: grid; min-width: 0; }
.member small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.member form { grid-column: 1 / -1; }
.member.is-revoked { opacity: .48; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.danger { color: #ff9696; }
.brief-grid { display: grid; gap: 18px; margin: 0; }
.brief-grid div { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.brief-grid dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.brief-grid dd { margin: 7px 0 0; white-space: pre-wrap; }
.timeline-panel { margin-top: 18px; }
.timeline { display: grid; gap: 0; }
.timeline article { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.timeline-dot { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--accent); }
.timeline p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 18px 0 50px; border-color: #703d3d; }
.danger-zone h2 { margin: 0; }
.danger-zone p { margin: 5px 0 0; color: var(--muted); }
.danger-button { border: 1px solid #b94a4a; border-radius: 9px; background: #702828; color: #fff; padding: 11px 14px; font: inherit; font-weight: 750; cursor: pointer; }
.create-shell { width: min(980px, calc(100% - 40px)); padding-bottom: 72px; }
.create-heading { max-width: 720px; padding: 52px 0 28px; }
.create-heading h1 { margin: 10px 0 14px; font-size: clamp(46px, 7vw, 68px); }
.create-heading > p:last-child { max-width: 640px; margin: 0; font-size: 18px; }
.project-create-form { position: relative; gap: 24px; padding: 32px; overflow: hidden; border-color: #365247; background: linear-gradient(145deg, rgba(22,37,31,.98), rgba(13,25,21,.98)); box-shadow: var(--shadow); }
.project-create-form::before { content: ''; position: absolute; width: 260px; height: 260px; right: -130px; top: -145px; border-radius: 50%; background: rgba(185,243,74,.08); pointer-events: none; }
.form-card-heading { position: relative; display: flex; align-items: flex-start; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.form-card-heading h2 { margin: 0; font-size: 22px; }
.form-card-heading p { max-width: 650px; margin: 4px 0 0; color: var(--muted); }
.form-step { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.project-create-form label { position: relative; gap: 9px; }
.project-create-form label > span { display: flex; justify-content: space-between; align-items: center; color: var(--text); font-size: 14px; }
.project-create-form label > span b { border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.project-create-form label > small { color: var(--muted); font-size: 12px; }
.project-create-form input { min-height: 50px; font-size: 16px; }
.project-create-form textarea { min-height: 128px; line-height: 1.55; }
.project-create-form input::placeholder, .project-create-form textarea::placeholder { color: #71847a; opacity: 1; }
.field-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9,17,15,.42); }
.project-create-form .form-actions { align-items: center; padding-top: 22px; border-top: 1px solid var(--line); }
.project-create-form .form-actions .primary-button { min-width: 168px; }

/* Clients */
.wide-shell { width: min(1500px, calc(100% - 40px)); }
.clients-heading { padding-bottom: 28px; }
.client-filters { display: grid; grid-template-columns: minmax(280px, 1.5fr) minmax(170px, .55fr) minmax(180px, .65fr) auto auto; align-items: end; gap: 12px; margin-bottom: 18px; padding: 16px; }
.client-filters label, .client-editor label, .client-profile-form label, .compact-form label, .communication-form label, .inline-status-form label { display: grid; gap: 7px; }
.client-filters label > span, .client-editor label > span, .client-profile-form label > span, .compact-form label > span, .communication-form label > span, .inline-status-form label > span { color: var(--muted); font-size: 12px; font-weight: 750; }
.filter-button { min-height: 47px; }
.text-link { align-self: center; color: var(--muted); font-size: 13px; }
.client-table-panel { padding: 0; overflow: hidden; }
.client-table-panel > .section-heading { align-items: center; padding: 22px 24px 2px; }
.status-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; color: var(--muted); font-size: 12px; }
.status-legend span { --status-color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--status-color); }
.data-table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 13px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: rgba(9,17,15,.35); text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-table td { min-width: 112px; padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table td:first-child { min-width: 190px; }
.data-table td:nth-child(4), .data-table td:nth-child(7), .data-table td:nth-child(8) { min-width: 155px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(185,243,74,.025); }
.data-table small, .record-link + small { display: block; margin-top: 4px; color: var(--muted); }
.record-link { text-decoration: none; }
.record-link:hover { color: var(--accent); }
.client-status { --status-color: var(--muted); display: inline-flex; align-items: center; gap: 7px; border: 1px solid color-mix(in srgb, var(--status-color) 60%, var(--line)); border-radius: 999px; padding: 4px 9px; color: var(--status-color); background: color-mix(in srgb, var(--status-color) 8%, transparent); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.client-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--status-color); }
.status-prospect { --status-color: #9bac9f !important; }
.status-connected { --status-color: #63b3ed !important; }
.status-subscriber { --status-color: #b9f34a !important; }
.status-rejected { --status-color: #ef7777 !important; }
.client-status.large { padding: 6px 11px; font-size: 12px; }
.dnc-label { color: #ff9696 !important; font-weight: 700; }
.source-chip, .mini-chip { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.table-empty { padding: 65px 24px; text-align: center; }
.table-empty h3 { margin: 0; font-size: 24px; }
.table-empty p { margin: 8px 0 22px; color: var(--muted); }
.status-settings { margin: 18px 0 60px; padding: 0; }
.status-settings summary { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; cursor: pointer; }
.status-settings summary > span:first-child { display: grid; }
.status-settings summary small { color: var(--muted); }
.status-settings-body { display: grid; gap: 20px; padding: 0 24px 24px; border-top: 1px solid var(--line); }
.status-list { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 20px; }
.inline-status-form { display: grid; grid-template-columns: minmax(220px, 1fr) 90px auto auto; align-items: end; gap: 12px; }
.color-input { min-height: 47px; padding: 6px; }
.check-field { display: flex !important; align-items: center; grid-template-columns: auto 1fr; align-content: center !important; }
.check-field input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
.check-field span { color: var(--text) !important; }

.client-form-shell { width: min(1040px, calc(100% - 40px)); padding-bottom: 70px; }
.client-editor { display: grid; gap: 0; padding: 0; overflow: hidden; box-shadow: var(--shadow); }
.editor-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: 28px; border-bottom: 1px solid var(--line); }
.editor-section h2 { margin: 4px 0 0; font-size: 20px; }
.editor-actions { padding: 22px 28px; }

.client-detail-shell { padding-bottom: 60px; }
.client-profile-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; padding: 55px 0 28px; }
.client-profile-heading h1 { margin: 8px 0 10px; font-size: clamp(42px, 6vw, 66px); }
.client-profile-heading p { margin: 0; color: var(--muted); }
.title-with-status { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.heading-facts { display: grid; min-width: 270px; border: 1px solid var(--line); border-radius: 12px; background: rgba(17,29,25,.75); }
.heading-facts span { display: grid; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.heading-facts span:last-child { border-bottom: 0; }
.heading-facts small { color: var(--muted); }
.heading-facts strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dnc-banner { display: flex; gap: 14px; margin-bottom: 18px; border: 1px solid #9b4e4e; border-radius: 10px; padding: 13px 16px; background: rgba(112,40,40,.35); }
.dnc-banner span { color: #eebbbb; }
.section-nav { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: rgba(9,17,15,.94); backdrop-filter: blur(10px); }
.section-nav a { border-radius: 7px; padding: 7px 11px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }
.section-nav a:hover { background: var(--panel-soft); color: var(--text); }
.detail-section { margin-bottom: 18px; scroll-margin-top: 70px; }
.client-profile-form { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 26px; }
.website-field { display: grid; gap: 7px; }
.website-field > label { color: var(--muted); font-size: 12px; font-weight: 750; }
.website-input-wrap { position: relative; }
.website-input-wrap input { width: 100%; padding-right: 52px; }
.website-open-link { position: absolute; top: 50%; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(9,17,15,.88); transform: translateY(-50%); }
.website-open-link:hover { border-color: var(--accent); color: var(--accent); background: var(--panel-soft); }
.website-open-link:focus-visible { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.website-open-link svg { width: 16px; height: 16px; }
.workflow-editor { display: grid; align-content: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9,17,15,.36); }
.workflow-editor .wide { grid-column: 1 / -1; }
.client-profile-form > .form-actions { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); }
.client-readonly-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0; }
.client-readonly-grid div { padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.client-readonly-grid dt { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.client-readonly-grid dd { margin: 5px 0 0; }
.detail-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.compact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: rgba(9,17,15,.36); }
.compact-form .wide { grid-column: 1 / -1; }
.contact-cards, .consent-list { display: grid; gap: 8px; }
.contact-cards article { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-cards article > div { display: grid; }
.contact-cards article small { color: var(--muted); }
.contact-cards article p { margin: 0; color: var(--muted); text-align: right; }
.mini-chip { margin-left: 8px; color: var(--accent); }
.consent-list article { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.consent-list p { margin: 3px 0; color: var(--muted); }
.consent-list small { color: var(--muted); }
.consent-state { border-radius: 6px; padding: 4px 7px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.consent-state.granted { background: rgba(185,243,74,.15); color: var(--accent); }
.consent-state.withdrawn { background: rgba(239,100,100,.15); color: #ff9696; }
.muted-empty { padding: 20px 0; color: var(--muted); text-align: center; }
.communication-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 12px; margin-bottom: 25px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9,17,15,.36); }
.communication-form .wide { grid-column: span 3; }
.communication-timeline { display: grid; }
.communication-timeline article { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.communication-marker { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--panel-soft); color: var(--accent); font-weight: 900; }
.communication-entry header { display: flex; justify-content: space-between; gap: 20px; }
.communication-entry time, .communication-entry footer { color: var(--muted); font-size: 12px; }
.communication-entry p { margin: 8px 0; }
.next-action-note { margin-top: 10px; border-left: 2px solid var(--accent); padding: 7px 10px; background: rgba(185,243,74,.05); color: var(--muted); font-size: 12px; }
.activity-columns { margin-top: 0; }
.simple-timeline { display: grid; }
.simple-timeline article { display: grid; grid-template-columns: 13px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.simple-timeline p { margin: 2px 0; color: var(--muted); }
.simple-timeline small { color: var(--muted); }

/* Hermes research */
.research-state, .review-state { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.state-running, .state-ready_to_import, .state-validated, .review-needs_review { border-color: #63b3ed; color: #8ac7f0; background: rgba(99,179,237,.09); }
.state-completed, .state-imported, .state-fresh, .review-accepted { border-color: var(--accent); color: var(--accent); background: rgba(185,243,74,.08); }
.state-failed, .state-invalid, .state-blocked, .review-rejected { border-color: #ef7777; color: #ff9696; background: rgba(239,119,119,.08); }
.state-queued, .state-awaiting_import, .state-processing, .state-partial, .review-pending { border-color: #d6b56b; color: #e7ca86; background: rgba(214,181,107,.08); }
.state-superseded { border-color: var(--line); color: var(--muted); background: rgba(155,172,159,.06); }
.review-duplicate { border-color: #d49a62; color: #eab27a; background: rgba(212,154,98,.08); }
.research-detail-shell { padding-bottom: 60px; }
.research-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.research-request-actions { display: grid; justify-items: end; gap: 12px; }
.research-request-actions > div { display: flex; align-items: center; gap: 8px; }
.research-request-actions form { margin: 0; }
.research-lineage { margin: -4px 0 20px; color: var(--muted); font-size: 14px; }
.research-lineage a { color: var(--text); }
.research-candidates { display: grid; gap: 16px; }
.candidate-card { border: 1px solid var(--line); border-radius: 13px; background: rgba(9,17,15,.35); overflow: hidden; }
.candidate-card > header { display: flex; justify-content: space-between; gap: 24px; padding: 20px; border-bottom: 1px solid var(--line); }
.candidate-card > header p { margin: 5px 0 0; color: var(--muted); }
.candidate-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.candidate-title h3 { margin: 0; font-size: 22px; }
.candidate-confidence { display: grid; align-content: start; min-width: 70px; color: var(--accent); font-size: 20px; font-weight: 850; text-align: right; }
.candidate-confidence small { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.candidate-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 28px; padding: 20px; }
.candidate-body h4, .evidence-list h4 { margin: 0 0 7px; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.candidate-body p { margin: 0 0 18px; color: var(--muted); }
.candidate-facts { display: grid; gap: 0; margin: 0; }
.candidate-facts div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.candidate-facts dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.candidate-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.candidate-facts small { display: block; color: var(--muted); }
.evidence-list { padding: 0 20px 20px; }
.evidence-list > article { padding: 12px 0; border-top: 1px solid var(--line); }
.evidence-list p { margin: 5px 0; color: var(--muted); }
.evidence-list small { color: var(--muted); }
.candidate-warning { margin: 0 20px 18px; border: 1px solid #d49a62; border-radius: 9px; padding: 11px 13px; color: #eab27a; background: rgba(212,154,98,.08); }
.candidate-review-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); background: rgba(17,29,25,.55); }
.candidate-review-form label { display: grid; gap: 6px; }
.candidate-review-form label span { color: var(--muted); font-size: 11px; font-weight: 750; }
.candidate-review-form > div { display: flex; flex-wrap: wrap; gap: 7px; }
.candidate-decision { padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.work-task-panel, .work-import-panel { margin-bottom: 18px; }
.section-intro { margin: -4px 0 18px; color: var(--muted); }
.work-task-text { width: 100%; min-height: 420px; resize: vertical; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.work-task-actions { align-items: center; justify-content: flex-start; margin-top: 14px; }
.copy-work-status { min-height: 30px; display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; color: var(--muted); font-size: 12px; }
.copy-work-status:empty { display: none; }
.copy-work-status.is-success { border: 1px solid var(--accent); color: var(--text); background: rgba(167,255,47,.11); }
.copy-work-status.is-error { border: 1px solid #ef7777; color: #ffb0b0; background: rgba(239,119,119,.08); }
#copy-work-task.is-copied { box-shadow: 0 0 0 3px rgba(167,255,47,.18); }
#copy-work-task.copy-failed { border-color: #ef7777; }
.work-upload-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9,17,15,.35); }
.work-upload-form label { display: grid; gap: 7px; }
.work-upload-form label span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.work-import-list { display: grid; gap: 14px; margin-top: 18px; }
.work-import-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: rgba(9,17,15,.35); }
.work-import-card > header { display: flex; justify-content: space-between; gap: 20px; }
.work-import-card > header small { display: block; margin-top: 5px; color: var(--muted); }
.import-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 16px 0; background: var(--line); }
.import-facts div { padding: 11px; background: var(--panel); }
.import-facts dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.import-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.import-errors { margin: 14px 0; border: 1px solid #ef7777; border-radius: 9px; padding: 12px 14px; color: #ffb0b0; background: rgba(239,119,119,.07); }
.import-errors ul { margin: 8px 0 0; padding-left: 20px; }
.work-import-card > footer { justify-content: flex-start; }
.work-import-card > footer form { margin: 0; }
.research-profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.research-profile-grid .research-wide { grid-column: span 3; }
.research-profile-grid small { color: var(--muted); }
.research-evidence-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.research-evidence-list article { border: 1px solid var(--line); border-radius: 10px; padding: 13px; background: rgba(9,17,15,.3); }
.research-evidence-list p { margin: 6px 0; color: var(--muted); }
.research-evidence-list a, .research-evidence-list small { display: block; overflow-wrap: anywhere; }
.research-evidence-list small { margin-top: 5px; color: var(--muted); }
.deep-research-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.deep-research-sections > a { display: grid; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; text-decoration: none; overflow: hidden; }
.deep-research-sections > a:hover { border-color: var(--accent); background: rgba(185,243,74,.04); }
.deep-research-sections span { color: var(--text); font-weight: 750; }
.deep-research-sections small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 1120px); }
  .topbar, .workspace-heading { align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .account { width: 100%; flex-wrap: wrap; }
  .account form { margin-left: auto; }
  .hero { padding-top: 10vh; }
  .form-grid, .project-layout { grid-template-columns: 1fr; }
  .project-heading, .danger-zone { align-items: flex-start; flex-direction: column; }
  .research-request-actions { width: 100%; justify-items: stretch; }
  .research-request-actions > div { flex-wrap: wrap; }
  .form-actions { justify-content: stretch; }
  .form-actions > * { flex: 1; }
  .create-shell { width: min(100% - 24px, 980px); }
  .create-heading { padding-top: 38px; }
  .project-create-form { padding: 20px; gap: 18px; }
  .field-card { padding: 14px; }
  .wide-shell, .client-form-shell { width: min(100% - 24px, 1500px); }
  .client-filters, .inline-status-form, .editor-section, .client-profile-form, .detail-columns, .communication-form, .research-summary-grid, .candidate-body, .candidate-review-form, .work-upload-form { grid-template-columns: 1fr; }
  .editor-section { padding: 20px; }
  .communication-form .wide, .workflow-editor .wide { grid-column: auto; }
  .client-profile-heading { align-items: stretch; flex-direction: column; }
  .heading-facts { min-width: 0; }
  .client-readonly-grid { grid-template-columns: 1fr; }
  .status-legend { justify-content: flex-start; }
  .client-table-panel > .section-heading { align-items: flex-start; flex-direction: column; }
  .contact-cards article { flex-direction: column; }
  .contact-cards article p { text-align: left; }
  .communication-entry header { flex-direction: column; gap: 2px; }
  .candidate-card > header { flex-direction: column; }
  .candidate-confidence { text-align: left; }
  .work-import-card > header { flex-direction: column; }
  .import-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-profile-grid, .research-evidence-list { grid-template-columns: 1fr; }
  .research-profile-grid .research-wide { grid-column: auto; }
  .deep-research-sections { grid-template-columns: 1fr; }
}
