:root {
    color-scheme: light;
    --bg: #f6f5f0;
    --surface: #ffffff;
    --surface-muted: #f0f4f3;
    --text: #17201c;
    --muted: #66736d;
    --line: #dce2de;
    --primary: #236b5d;
    --primary-dark: #174b41;
    --accent: #c8623b;
    --shadow: 0 18px 45px rgba(23, 32, 28, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.site-header,
.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    gap: 24px;
    align-items: end;
    justify-content: space-between;
    padding: 32px 0 20px;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.site-nav a,
.text-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
    color: var(--primary-dark);
    text-decoration: underline;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1;
}

.page-shell {
    padding-bottom: 48px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dashboard-hero h2 {
    max-width: 720px;
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
}

.dashboard-hero p {
    max-width: 620px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

button {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

.button-link.is-disabled {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--muted);
    cursor: not-allowed;
    pointer-events: none;
}

button:hover,
button:focus-visible,
.button-link:hover,
.button-link:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
}

.secondary-button {
    background: #ffffff;
    color: var(--primary);
}

.secondary-button:hover,
.secondary-button:focus-visible {
    background: var(--surface-muted);
    color: var(--primary-dark);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.dashboard-overview-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.overview-card {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.overview-card strong {
    font-size: 2rem;
    line-height: 1;
}

.overview-card span {
    font-weight: 700;
}

.overview-card small {
    color: var(--muted);
}

.category-card {
    display: grid;
    gap: 20px;
    min-height: 210px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.category-card.is-active {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.category-card-top,
.category-card-footer {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.category-card h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.category-card-top strong {
    font-size: clamp(2rem, 6vw, 3.2rem);
    line-height: 1;
}

.category-card p:not(.eyebrow) {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.55;
}

.category-card-footer span {
    color: var(--muted);
    font-size: 0.9rem;
}

.category-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.category-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
    align-items: end;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.category-page-header h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
}

.category-page-header p:not(.eyebrow) {
    max-width: 620px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

.history-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
    align-items: end;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.history-header h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
}

.history-header p:not(.eyebrow) {
    max-width: 660px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

.history-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.history-card {
    display: grid;
    gap: 14px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.history-card-header {
    display: flex;
    gap: 16px;
    align-items: start;
    justify-content: space-between;
}

.history-card-header h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
    line-height: 1.25;
}

.history-card p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.55;
}

.history-pill {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: var(--muted);
    font-size: 0.88rem;
}

.history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.export-card {
    display: grid;
    gap: 14px;
    align-content: start;
}

.export-card h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.export-card p:not(.eyebrow) {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.55;
}

.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.opportunity-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    min-height: 0;
    margin-top: 18px;
}

.filter-search {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: end;
}

.filter-search label {
    gap: 7px;
}

.filter-search input {
    min-width: 0;
}

.filter-search .small-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    margin-top: 0;
}

.opportunity-filters h3 {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.filter-chip span {
    color: var(--primary-dark);
}

.filter-chip:hover,
.filter-chip:focus-visible,
.filter-chip.is-active {
    border-color: var(--primary);
    background: rgba(35, 107, 93, 0.1);
    color: var(--primary-dark);
}

.compact-history-list {
    gap: 12px;
}

.opportunity-review-card {
    gap: 12px;
    padding: 18px;
}

.review-card-ignored {
    opacity: 0.72;
}

.opportunity-card-eyebrows {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 7px;
}

.opportunity-card-eyebrows .eyebrow {
    margin-bottom: 0;
}

.review-chip {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.review-chip-needs_review {
    background: #fff6df;
    color: #705212;
}

.review-chip-promising {
    background: rgba(35, 107, 93, 0.12);
    color: var(--primary-dark);
}

.review-chip-ignored {
    background: var(--surface-muted);
    color: var(--muted);
}

.opportunity-major-points {
    display: grid;
    gap: 6px;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.opportunity-major-points strong {
    color: var(--ink);
    font-size: 0.92rem;
}

.opportunity-major-points .briefing-text {
    margin: 0;
}

.source-details {
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.source-details summary {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
}

.source-details .briefing-text {
    margin-top: 10px;
}

.source-package-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.source-package-grid span {
    display: grid;
    gap: 2px;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.source-package-grid strong {
    color: var(--ink);
    font-size: 1.1rem;
}

.source-package-grid small {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.source-review-checklist {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    background: #fff6df;
    border: 1px solid #ecd08c;
    border-radius: 8px;
}

.source-review-checklist > strong {
    color: #705212;
    font-size: 0.92rem;
}

.source-review-checklist ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.source-review-warning {
    padding: 0;
    background: transparent;
    border: 0;
}

.source-review-warning span {
    display: block;
    color: var(--text);
    font-weight: 700;
}

.source-review-warning p {
    margin: 2px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.evidence-list {
    display: grid;
    gap: 10px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.evidence-list li {
    padding: 0;
    background: transparent;
    border: 0;
}

.evidence-list small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.82rem;
}

.link-list {
    gap: 6px;
}

.source-evidence-note {
    color: var(--ink) !important;
}

.source-evidence-note strong {
    color: var(--ink);
}

.source-newsletter-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.source-newsletter-list li {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.source-newsletter-list strong {
    line-height: 1.3;
}

.source-newsletter-list p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.source-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--muted);
    font-size: 0.88rem;
}

.opportunity-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
}

.opportunity-review-actions form {
    margin: 0;
}

.opportunity-review-actions button,
.opportunity-review-actions .button-link {
    min-height: 38px;
    padding: 0 13px;
    font-size: 0.9rem;
}

.gmail-setup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.check-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    display: grid;
    gap: 4px;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.check-list span {
    color: var(--muted);
    font-size: 0.92rem;
}

.setup-note {
    margin: 16px 0 0;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    line-height: 1.5;
}

.setup-note.is-ready {
    background: rgba(35, 107, 93, 0.1);
    border-color: rgba(35, 107, 93, 0.24);
    color: var(--primary-dark);
}

.setup-note.is-missing {
    background: #fff1e9;
    border-color: #efc0a7;
    color: #8b3f1f;
}

.gmail-help-panel {
    margin-top: 18px;
}

.gmail-action-block {
    margin-top: 18px;
}

.gmail-action-block .button-link {
    width: 100%;
}

.gmail-import-controls {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.gmail-import-controls form,
.gmail-import-controls button {
    width: 100%;
}

.gmail-import-choice-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.gmail-import-choice {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.gmail-import-choice h4,
.gmail-import-choice p {
    margin: 0;
}

.gmail-import-choice p,
.gmail-advanced-details .briefing-text {
    color: var(--muted);
}

.gmail-import-choice button {
    width: 100%;
}

.gmail-advanced-details {
    margin-top: 16px;
}

.gmail-advanced-details summary {
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 700;
}

.settings-layout {
    margin-top: 18px;
}

.settings-form {
    display: grid;
    gap: 22px;
}

.settings-form textarea {
    min-height: 120px;
}

.settings-section {
    display: grid;
    gap: 14px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.settings-section:last-of-type {
    border-bottom: 0;
}

.settings-section h3 {
    margin-bottom: 0;
    font-size: 1rem;
}

.category-summary {
    display: grid;
    gap: 6px;
    justify-items: end;
    text-align: right;
}

.category-summary strong {
    font-size: clamp(2.4rem, 7vw, 4rem);
    line-height: 1;
}

.category-summary span {
    color: var(--text);
    font-weight: 700;
}

.category-summary small {
    color: var(--muted);
    line-height: 1.4;
}

.category-newsletter-panel {
    margin-top: 18px;
}

.category-opportunity-panel {
    margin-top: 18px;
}

.content-brief-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: end;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.content-brief-header h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.08;
}

.content-brief-header p:not(.eyebrow) {
    max-width: 680px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

.brief-header-side {
    display: grid;
    gap: 16px;
}

.compact-summary strong {
    font-size: clamp(1.6rem, 5vw, 2.6rem);
}

.brief-actions {
    display: grid;
    gap: 10px;
}

.brief-actions form,
.brief-actions button {
    width: 100%;
}

.brief-actions .button-link {
    width: 100%;
}

button:disabled,
button:disabled:hover,
button:disabled:focus-visible {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--muted);
    cursor: not-allowed;
}

.status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.status-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 78px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.status-item strong,
.status-item span {
    display: block;
}

.status-item strong {
    margin-bottom: 3px;
    font-size: 0.94rem;
}

.status-item span {
    color: var(--muted);
    font-size: 0.88rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--muted);
}

.status-dot.is-ready {
    background: var(--primary);
}

.status-dot.is-missing {
    background: var(--accent);
}

.status-dot.is-review {
    background: #c4942f;
}

.source-readiness-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 20px;
    align-items: center;
    min-height: 0;
    margin-top: 18px;
}

.source-readiness-summary h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.source-readiness-summary p:not(.eyebrow) {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.5;
}

.readiness-score-box {
    display: grid;
    gap: 4px;
    justify-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    text-align: right;
}

.readiness-score-box strong {
    font-size: 2rem;
    line-height: 1;
}

.readiness-score-box span {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.readiness-score-box.score-ready {
    border-color: rgba(35, 107, 93, 0.28);
    background: rgba(35, 107, 93, 0.08);
}

.readiness-score-box.score-review {
    border-color: rgba(196, 148, 47, 0.38);
    background: #fff6df;
}

.readiness-score-box.score-missing {
    border-color: #efc0a7;
    background: #fff1e9;
}

.brief-workbench {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.workbench-panel {
    display: grid;
    gap: 18px;
    align-content: start;
    min-height: 0;
}

.workbench-heading h3 {
    margin-bottom: 0;
    font-size: 1.02rem;
}

.workbench-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.workbench-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.workbench-list li.is-ready {
    border-color: rgba(35, 107, 93, 0.22);
    background: rgba(35, 107, 93, 0.08);
}

.workbench-list li.is-missing {
    border-color: #efc0a7;
    background: #fff1e9;
}

.workbench-list li.is-review {
    border-color: rgba(196, 148, 47, 0.38);
    background: #fff6df;
}

.workbench-list strong,
.workbench-list span,
.workbench-list small {
    display: block;
}

.workbench-list strong {
    margin-bottom: 2px;
    font-size: 0.92rem;
}

.workbench-list span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.workbench-list small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.workbench-action {
    width: 100%;
    margin-top: 2px;
}

.ready-panel {
    border-color: rgba(35, 107, 93, 0.26);
}

.decision-panel {
    border-color: rgba(200, 98, 59, 0.32);
}

.evidence-panel {
    border-color: rgba(60, 91, 132, 0.24);
}

.workbench-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: center;
    min-height: 0;
    margin-top: 18px;
}

.workbench-summary h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.workbench-summary .briefing-text {
    margin-bottom: 0;
}

.summary-actions {
    display: grid;
    gap: 10px;
}

.summary-actions form,
.summary-actions button {
    width: 100%;
}

.summary-actions .button-link {
    width: 100%;
}

.refine-panel {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: end;
    min-height: 0;
    margin-top: 18px;
}

.refine-panel h3 {
    margin-bottom: 0;
    font-size: 1.1rem;
}

.refine-form {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.refine-form label {
    gap: 7px;
}

.brief-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.opportunity-detail-layout {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.panel {
    min-height: 220px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.wide-panel {
    grid-column: 1 / -1;
}

.brief-section {
    display: grid;
    gap: 16px;
    align-content: start;
}

.priority-section {
    border-color: rgba(35, 107, 93, 0.28);
}

.source-section {
    background: #fbfcfb;
}

.brief-section-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.brief-section-heading h3 {
    margin-bottom: 0;
    font-size: 1rem;
}

.section-status {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.section-status.is-ready {
    background: rgba(35, 107, 93, 0.1);
    color: var(--primary-dark);
}

.section-status.is-missing {
    background: #fff1e9;
    color: #8b3f1f;
}

.copy-source {
    position: fixed;
    left: -9999px;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.copy-source.is-visible {
    left: 16px;
    width: min(640px, calc(100% - 32px));
    height: 220px;
    opacity: 1;
    z-index: 10;
}

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

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.action-hint {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: right;
}

.panel-header h3 {
    margin-bottom: 0;
    font-size: 1rem;
}

.small-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.86rem;
}

.panel-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.panel-header span {
    display: inline-flex;
    min-width: 34px;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.empty-state {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.item-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.opportunity-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.opportunity-list li {
    display: grid;
    gap: 10px;
    padding: 16px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.opportunity-list strong,
.opportunity-list span {
    display: block;
}

.opportunity-list span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
}

.opportunity-list p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.opportunity-list .source-notes {
    white-space: pre-line;
}

.inline-form {
    margin-top: 4px;
}

.item-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.item-list strong,
.item-list span {
    display: block;
}

.item-list span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9rem;
}

.item-list p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.5;
    white-space: pre-line;
}

.briefing-text {
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-line;
}

h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.flash-list {
    margin-bottom: 18px;
    padding: 12px 16px;
    background: #fff6df;
    border: 1px solid #efd18b;
    border-radius: 8px;
    color: #5e4612;
}

.flash-list p {
    margin: 0;
}

.form-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.form-intro {
    padding: 22px 0;
}

.form-intro h2 {
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.08;
}

.form-intro p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.6;
}

.newsletter-form {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.edit-form {
    display: grid;
    gap: 18px;
}

.edit-form textarea {
    min-height: 0;
    margin-top: 0;
}

.edit-form .tall-textarea {
    min-height: 220px;
}

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

label,
.full-field {
    display: grid;
    gap: 8px;
}

label span,
.full-field span {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}

.field-label {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}

.target-count-control {
    display: grid;
    gap: 8px;
}

.date-preset-control {
    display: grid;
    gap: 8px;
    align-content: start;
}

.date-preset-control .field-label {
    color: var(--text);
}

.manual-selection-note {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(35, 107, 93, 0.28);
    border-radius: 8px;
    background: rgba(35, 107, 93, 0.08);
}

.manual-selection-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.handpicked-run-panel {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.handpicked-run-panel strong {
    font-size: 0.95rem;
}

.source-set-shortcuts {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.source-set-shortcuts strong {
    font-size: 0.95rem;
}

.source-choice-panel {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(35, 107, 93, 0.28);
    border-radius: 8px;
    background: rgba(35, 107, 93, 0.08);
}

.source-choice-panel strong {
    font-size: 0.95rem;
}

.source-choice-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input,
select {
    min-height: 42px;
    padding: 0 12px;
}

textarea {
    min-height: 280px;
    margin-top: 18px;
    padding: 12px;
    line-height: 1.5;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(35, 107, 93, 0.16);
}

.form-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 18px;
}

.weekly-run-hero {
    margin-bottom: 18px;
}

.weekly-run-limit-panel,
.weekly-readiness-panel {
    min-height: auto;
}

.weekly-workflow-panel {
    min-height: auto;
    margin-bottom: 18px;
}

.weekly-workflow-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.weekly-workflow-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.weekly-step-number {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    font-weight: 700;
}

.weekly-step-copy strong,
.weekly-step-copy p {
    display: block;
    margin: 0;
}

.weekly-step-copy p {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.45;
}

.weekly-step-state {
    justify-self: end;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.weekly-workflow-step-ready .weekly-step-state,
.weekly-workflow-step-done .weekly-step-state {
    background: rgba(52, 211, 153, 0.14);
    color: #047857;
}

.weekly-workflow-step-attention .weekly-step-state,
.weekly-workflow-step-setup .weekly-step-state {
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
}

.weekly-workflow-step-blocked .weekly-step-state {
    background: rgba(148, 163, 184, 0.18);
}

.weekly-step-actions {
    grid-column: 2 / -1;
    margin-top: 0;
}

.weekly-readiness-list {
    margin-bottom: 16px;
}

.weekly-readiness-panel .history-actions {
    margin-top: 0;
}

.weekly-run-readiness small {
    color: var(--muted);
    font-size: 0.84rem;
}

.weekly-batch-note {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.weekly-batch-note strong,
.weekly-batch-note span {
    display: block;
}

.weekly-batch-note span {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.weekly-article-pair-panel {
    margin-top: 20px;
}

.weekly-article-pair-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.weekly-article-pair-card {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.weekly-article-pair-card h4,
.weekly-article-pair-card p {
    margin: 0;
}

.weekly-article-pair-card p:not(.eyebrow) {
    color: var(--muted);
}

.weekly-article-pair-card .history-actions {
    margin-top: 0;
}

.weekly-job-panel {
    margin-top: 20px;
}

.weekly-secondary-options,
.weekly-category-detail-panel {
    min-height: auto;
    margin-top: 20px;
}

.weekly-details-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.weekly-details-summary::-webkit-details-marker {
    display: none;
}

.weekly-details-summary > span:first-child {
    display: grid;
    gap: 4px;
}

.weekly-details-summary strong {
    font-size: 1rem;
}

.weekly-details-summary small {
    color: var(--muted);
    line-height: 1.4;
}

.summary-toggle {
    display: inline-flex;
    min-width: 116px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.weekly-secondary-options[open] .summary-toggle,
.weekly-category-detail-panel[open] .summary-toggle {
    background: var(--surface-muted);
}

.weekly-secondary-options .weekly-job-grid,
.weekly-category-detail-panel .weekly-run-grid {
    margin-top: 18px;
}

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

.weekly-job-card {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.weekly-job-card h4,
.weekly-job-card p {
    margin: 0;
}

.weekly-job-card p:not(.eyebrow) {
    color: var(--muted);
}

.weekly-job-card .history-actions {
    margin-top: 0;
}

.weekly-run-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.weekly-run-card {
    display: grid;
    gap: 22px;
    align-content: start;
}

.weekly-run-card .panel-header {
    margin-bottom: 0;
}

.weekly-run-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.weekly-run-metrics div {
    min-height: 96px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.weekly-run-metrics strong,
.weekly-run-metrics span {
    display: block;
}

.weekly-run-metrics strong {
    margin-bottom: 6px;
    font-size: 1.6rem;
    line-height: 1;
}

.weekly-run-metrics span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.weekly-run-steps {
    display: grid;
    gap: 14px;
}

.weekly-run-step {
    display: grid;
    gap: 8px;
    padding-left: 14px;
    border-left: 3px solid var(--line);
}

.weekly-run-step strong {
    line-height: 1.3;
}

.weekly-run-step p,
.weekly-run-step small {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.weekly-run-step small {
    font-size: 0.84rem;
}

.weekly-run-step form {
    margin: 2px 0 0;
}

.weekly-run-latest {
    display: grid;
    gap: 12px;
}

.weekly-run-latest h4 {
    margin-bottom: 0;
}

.library-filter-panel {
    min-height: auto;
}

.library-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.advanced-filter-panel {
    grid-column: 1 / -1;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.advanced-filter-panel summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 700;
}

.advanced-filter-panel summary small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.4;
}

.advanced-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.library-filter-actions {
    grid-column: 1 / -1;
}


.newsletter-picker-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    flex-wrap: wrap;
}

.newsletter-picker-toolbar > div:first-child {
    display: grid;
    gap: 4px;
}

.newsletter-picker-toolbar strong {
    font-size: 0.95rem;
}

.newsletter-picker-toolbar small {
    color: var(--muted);
    line-height: 1.4;
}

.newsletter-picker-toolbar .history-actions {
    margin: 0;
}

.newsletter-empty-actions .history-actions,
.opportunity-empty-actions .history-actions,
.category-empty-actions .history-actions {
    margin-top: 12px;
}

.cleanup-divider {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.cleanup-divider strong {
    display: block;
}

.date-range-cleanup-form {
    margin-top: 10px;
}

.bulk-row-actions {
    flex-wrap: wrap;
}
.opportunity-bulk-panel {
    margin-bottom: 18px;
}

.opportunity-bulk-panel .panel-header > span {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
}

.opportunity-card-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 2px 0 10px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.opportunity-card-select input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
}

.inline-action-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
}

.inline-action-field span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.inline-action-field select {
    min-width: 160px;
}

.library-summary-grid,
.create-workflow-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.create-quick-start-panel {
    min-height: auto;
    margin-top: 18px;
}

.create-quick-start-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.create-quick-start-card {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.create-quick-start-card h4,
.create-quick-start-card p {
    margin: 0;
}

.create-quick-start-card p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.5;
}
.simple-create-card.is-active {
    border-color: var(--primary);
    background: rgba(35, 107, 93, 0.08);
}

.simple-create-card-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.selection-pill {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.simple-article-count-control {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.article-count-choice {
    display: grid;
    min-height: 56px;
    place-items: center;
    gap: 1px;
    padding: 7px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    text-align: center;
    text-decoration: none;
}

.article-count-choice strong {
    color: var(--ink);
    font-size: 1.08rem;
}

.article-count-choice span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.article-count-choice:hover,
.article-count-choice:focus-visible,
.article-count-choice.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.article-count-choice:hover strong,
.article-count-choice:focus-visible strong,
.article-count-choice.is-active strong,
.article-count-choice:hover span,
.article-count-choice:focus-visible span,
.article-count-choice.is-active span {
    color: #fff;
}

.simple-target-count-control .filter-row {
    gap: 8px;
}

.create-advanced-options {
    margin-top: 4px;
}

.danger-panel {
    border-color: rgba(200, 98, 59, 0.36);
    background: #fffaf7;
}

.newsletter-list,
.batch-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.newsletter-list li,
.batch-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.newsletter-select-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.newsletter-select-row input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    margin-top: 2px;
}

.newsletter-select-row strong,
.newsletter-list strong,
.batch-list strong,
.newsletter-select-row small,
.newsletter-list small,
.batch-list span,
.batch-list small {
    display: block;
}

.newsletter-list small,
.batch-list span,
.batch-list small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.newsletter-list p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.compact-newsletter-list li {
    display: grid;
    gap: 4px;
}

.batch-list li {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.analysis-preview-box {
    display: grid;
    gap: 12px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.analysis-preview-box.needs-confirmation {
    border-color: rgba(200, 98, 59, 0.38);
    background: #fffaf7;
}

.run-readiness-panel {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.run-readiness-panel h4 {
    margin: 0;
    font-size: 0.95rem;
}

.run-step-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.45;
}

.analysis-launch-panel {
    display: grid;
    gap: 6px;
    margin: 16px 0 0;
    padding: 14px;
    border: 1px solid rgba(35, 107, 93, 0.28);
    border-radius: 8px;
    background: rgba(35, 107, 93, 0.08);
}

.analysis-launch-panel h4,
.analysis-launch-panel p {
    margin: 0;
}

.analysis-launch-panel p {
    color: var(--muted);
    line-height: 1.45;
}

.analysis-working-panel {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 14px;
    border: 1px solid rgba(72, 132, 90, 0.3);
    border-radius: 8px;
    background: #f4faf6;
}

.analysis-working-panel[hidden] {
    display: none;
}

.analysis-working-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.large-run-warning {
    display: grid;
    gap: 4px;
    padding: 12px;
    color: #6f351f;
    background: #fff3ec;
    border: 1px solid rgba(200, 98, 59, 0.34);
    border-radius: 8px;
}

.large-run-warning p {
    margin: 0;
    color: #7d4a35;
    line-height: 1.45;
}

.freshness-notice {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.freshness-notice p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.freshness-fresh {
    border-color: rgba(72, 132, 90, 0.3);
    background: #f4faf6;
}

.freshness-aging {
    border-color: rgba(190, 143, 54, 0.35);
    background: #fffaf0;
}

.freshness-stale {
    border-color: rgba(200, 98, 59, 0.34);
    background: #fff3ec;
}

.freshness-stale strong {
    color: #6f351f;
}

.freshness-unknown {
    border-color: rgba(110, 118, 129, 0.28);
    background: #f7f8f8;
}

.confirm-large-run-field {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-top: 14px;
    padding: 12px;
    background: #fffaf7;
    border: 1px solid rgba(200, 98, 59, 0.34);
    border-radius: 8px;
}

.confirm-large-run-field input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    margin-top: 2px;
}

.confirm-large-run-field span {
    color: var(--ink);
    font-weight: 700;
    line-height: 1.4;
}

.compact-check-list {
    gap: 6px;
}

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

.create-mode-card {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    color: inherit;
    text-decoration: none;
}

.create-mode-card.is-active {
    border-color: rgba(35, 107, 93, 0.55);
    background: rgba(35, 107, 93, 0.08);
}

.create-mode-card:hover {
    border-color: rgba(35, 107, 93, 0.48);
}

.create-mode-card h4,
.create-mode-card p {
    margin: 0;
}

.create-mode-card small,
.create-mode-card p {
    color: var(--muted);
    line-height: 1.5;
}

.mode-state {
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.create-mode-card.is-active .mode-state {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 760px) {
    .site-header,
    .app-launcher-grid,
    .advanced-filter-grid,
    .dashboard-hero,
    .dashboard-overview-grid,
    .category-grid,
    .category-page-header,
    .history-header,
    .content-brief-header,
    .dashboard-grid,
    .export-grid,
    .source-readiness-summary,
    .brief-workbench,
    .workbench-summary,
    .refine-panel,
    .refine-form,
    .status-strip,
    .brief-grid,
    .gmail-setup-grid,
    .opportunity-filters,
    .weekly-article-pair-grid,
    .weekly-job-grid,
    .weekly-run-grid,
    .weekly-run-metrics,
    .library-filter-form,
    .library-summary-grid,
    .create-workflow-grid,
    .create-quick-start-grid,
    .create-mode-grid,
    .form-layout,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .simple-article-count-control {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-header {
        align-items: start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .dashboard-hero {
        padding: 22px;
    }

    .action-row {
        justify-content: stretch;
    }

    .app-launcher-card .button-link,
    .action-row form,
    .action-row button,
    .button-link,
    .category-card-footer {
        width: 100%;
    }

    .category-card-footer,
    .category-card-actions,
    .batch-list li {
        align-items: stretch;
        flex-direction: column;
    }

    .category-card-actions {
        width: 100%;
    }

    .panel-header,
    .panel-actions,
    .filter-search,
    .history-card-header,
    .weekly-details-summary,
    .history-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-search {
        display: flex;
    }

    .panel-actions form,
    .panel-actions button,
    .filter-search button,
    .refine-form button,
    .weekly-run-step button,
    .weekly-run-step .button-link,
    .summary-toggle,
    .batch-list .button-link,
    .history-actions form,
    .history-actions button,
    .export-actions,
    .export-actions .button-link,
    .opportunity-review-actions form,
    .opportunity-review-actions button,
    .opportunity-review-actions .button-link {
        width: 100%;
    }

    .weekly-workflow-step {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .weekly-step-state,
    .weekly-step-actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .weekly-step-state {
        width: fit-content;
    }

    .action-hint {
        text-align: left;
    }

    .category-summary {
        justify-items: start;
        text-align: left;
    }

    .brief-actions {
        grid-template-columns: 1fr;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}

.app-launcher-body {
    display: grid;
    align-items: center;
    min-height: 100vh;
    padding: 28px 0;
}

.app-launcher-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
}

.app-launcher-heading {
    max-width: 760px;
    margin-bottom: 22px;
}

.app-launcher-heading h1 {
    margin-bottom: 12px;
}

.app-launcher-heading p:not(.eyebrow) {
    max-width: 680px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

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

.app-launcher-card {
    display: grid;
    gap: 28px;
    align-content: space-between;
    min-height: 280px;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.app-launcher-card h2 {
    margin-bottom: 10px;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.06;
}

.app-launcher-card p:not(.eyebrow) {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.55;
}

.app-launcher-card .button-link {
    width: fit-content;
}

.app-launcher-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.app-launcher-card-signal {
    border-color: rgba(35, 107, 93, 0.28);
}

.app-launcher-card-commander {
    border-color: rgba(200, 98, 59, 0.32);
}

.unframed-header {
    margin-top: 18px;
}

.analysis-progress-list .progress-step-complete {
    border-color: rgba(35, 107, 93, 0.28);
    background: rgba(35, 107, 93, 0.08);
}

.analysis-progress-list .progress-step-active {
    border-color: rgba(200, 98, 59, 0.34);
    background: #fffaf7;
}

.gmail-import-lock-note {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
}

.gmail-import-lock-note .button-link {
    justify-self: start;
}

.optional-source-tools {
    flex-basis: 100%;
    margin-top: 0.5rem;
}

.optional-source-tools form {
    margin-top: 0.75rem;
}
/* Finkle Automation shared account shell. */
.site-brand {
    display: inline-flex;
    min-width: 0;
    gap: 12px;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary-dark);
    color: #fff;
    font-weight: 800;
}

.brand-name {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.1;
}

.site-account {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.account-pill {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.link-button {
    min-height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
    background: transparent;
    color: var(--primary-dark);
    text-decoration: underline;
}

.app-launcher-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.app-launcher-heading > p {
    grid-column: 1 / -1;
}

.app-launcher-card.is-coming-soon {
    border-style: dashed;
    background: #fbfcfb;
}

@media (max-width: 760px) {
    .site-header {
        align-items: stretch;
    }

    .site-brand,
    .site-account,
    .account-pill {
        width: 100%;
    }

    .site-account,
    .account-pill {
        justify-content: center;
        white-space: normal;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .app-launcher-heading {
        grid-template-columns: 1fr;
    }
}

.signaldraft-inbox-panel {
    display: grid;
    gap: 1rem;
}

.inbox-copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.inbox-address-field {
    min-width: 0;
    font-weight: 700;
    color: #0f3d45;
    background: #f7fbfc;
}

.signaldraft-inbox-form {
    border-top: 1px solid #d8e5e8;
    padding-top: 1rem;
}

.inbox-step-list {
    margin-top: 0.75rem;
}

@media (max-width: 720px) {
    .inbox-copy-row {
        grid-template-columns: 1fr;
    }
}


.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 32px;
}

.site-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--primary-dark);
    text-decoration: underline;
}

.public-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 28px;
    align-items: center;
    min-height: 560px;
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f4faf6 54%, #fff6df 100%);
    box-shadow: var(--shadow);
}

.public-hero h1 {
    max-width: 760px;
    margin-bottom: 16px;
}

.public-hero p:not(.eyebrow),
.public-section p {
    color: var(--muted);
    line-height: 1.6;
}

.public-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.workflow-visual {
    display: grid;
    gap: 12px;
}

.workflow-visual div {
    display: grid;
    gap: 4px;
    min-height: 90px;
    align-content: center;
    padding: 16px;
    border: 1px solid rgba(35, 107, 93, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.workflow-visual strong {
    font-size: 1.1rem;
}

.workflow-visual span {
    color: var(--muted);
}

.public-section {
    margin-top: 18px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.public-plan-grid,
.public-coming-soon {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.public-plan-grid article,
.public-coming-soon article,
.legal-page article {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.public-plan-card {
    border-color: rgba(200, 98, 59, 0.34) !important;
    background: #fffaf7 !important;
}

.legal-page {
    display: grid;
    gap: 14px;
}

.legal-page h1 {
    margin-bottom: 6px;
}

.legal-review-note {
    padding: 12px;
    border: 1px solid rgba(200, 98, 59, 0.34);
    border-radius: 8px;
    background: #fffaf7;
    color: #6f351f !important;
}

@media (max-width: 760px) {
    .public-hero,
    .public-plan-grid,
    .public-coming-soon {
        grid-template-columns: 1fr;
    }

    .public-hero,
    .public-section {
        padding: 22px;
    }

    .public-actions .button-link {
        width: 100%;
    }
}
.hosted-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.hosted-metric {
    border: 1px solid #d7e5e8;
    border-radius: 8px;
    padding: 14px;
    background: #f8fbfc;
}
.hosted-metric strong {
    display: block;
    color: #0f5567;
    font-size: 1.75rem;
    line-height: 1.1;
}
.hosted-metric span {
    display: block;
    margin-top: 4px;
    color: #45616a;
}
.hosted-opportunity-list .button-link {
    display: inline-flex;
    margin-top: 8px;
}
@media (max-width: 760px) {
    .hosted-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .hosted-metric-grid {
        grid-template-columns: 1fr;
    }
}

.hosted-newsletter-panel {
    display: grid;
    gap: 18px;
}

.hosted-newsletter-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hosted-newsletter-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.hosted-newsletter-list li:first-child {
    border-top: 1px solid var(--line);
}

.hosted-newsletter-list strong,
.hosted-newsletter-list p {
    display: block;
}

.hosted-newsletter-list p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.hosted-newsletter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.hosted-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    color: var(--muted);
    font-weight: 700;
}

.hosted-newsletter-detail-grid {
    margin-top: 18px;
}

.hosted-newsletter-body-panel {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.hosted-newsletter-body {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--text);
    font: inherit;
    line-height: 1.65;
}

.hosted-newsletter-empty {
    display: grid;
    gap: 12px;
    justify-items: start;
}

@media (max-width: 760px) {
    .hosted-newsletter-list li,
    .hosted-pagination {
        align-items: stretch;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .hosted-pagination .button-link,
    .hosted-newsletter-list .button-link {
        width: 100%;
    }
}

.hosted-analysis-form {
    display: grid;
    gap: 16px;
}

.hosted-analysis-header {
    align-items: flex-start;
}

.hosted-analysis-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.hosted-analysis-actions label {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.hosted-analysis-actions select {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 700;
}

.selectable-newsletter-list li {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.newsletter-select-control {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

.hosted-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.hosted-progress-bar {
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(35, 107, 93, 0.22);
    border-radius: 999px;
    background: #eef6f4;
}

.hosted-progress-bar span {
    display: block;
    height: 100%;
    min-width: 4px;
    background: var(--accent);
}

.hosted-source-links-panel,
.hosted-forwarded-panel,
.hosted-analysis-status-panel,
.hosted-opportunity-brief-panel,
.hosted-source-evidence-panel {
    margin-top: 18px;
}

.hosted-link-list,
.hosted-source-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding-left: 22px;
}

.hosted-link-list li,
.hosted-source-list li {
    overflow-wrap: anywhere;
}

.hosted-link-list span,
.hosted-source-heading span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.compact-link-list {
    margin-top: 10px;
}

.compact-pre {
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-muted);
}

.hosted-opportunity-brief-panel h4 {
    margin: 16px 0 6px;
}

.hosted-source-heading {
    display: grid;
    gap: 2px;
    margin-bottom: 8px;
}

@media (max-width: 760px) {
    .hosted-analysis-actions,
    .hosted-analysis-actions button,
    .hosted-analysis-actions .button-link,
    .hosted-analysis-actions select {
        width: 100%;
    }

    .selectable-newsletter-list li {
        grid-template-columns: 1fr;
    }

    .newsletter-select-control {
        justify-content: flex-start;
    }
}
.hosted-dashboard-hero .compact-summary {
    min-width: 0;
    max-width: min(100%, 360px);
    justify-self: end;
    overflow-wrap: anywhere;
    word-break: normal;
}

.hosted-dashboard-hero .compact-summary strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 1.35rem;
    line-height: 1.12;
}

.hosted-dashboard-hero .compact-summary span,
.hosted-dashboard-hero .compact-summary small,
.hosted-link-list a {
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .hosted-dashboard-hero .compact-summary {
        justify-self: stretch;
        max-width: 100%;
    }
}
