:root {
    --ink: #172026;
    --muted: #5e6a71;
    --line: #d8dee2;
    --surface: #f7f9fa;
    --accent: #0f766e;
    --accent-dark: #0b5f59;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #ffffff;
    font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--accent-dark);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
}

.brand {
    color: var(--ink);
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 18px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
}

.admin-header {
    align-items: flex-start;
}

.admin-header nav {
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-group {
    position: relative;
}

.nav-group summary {
    list-style: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

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

.nav-group summary::after {
    content: " +";
}

.nav-group[open] summary {
    color: var(--accent-dark);
}

.nav-group[open] summary::after {
    content: " -";
}

.nav-menu {
    position: absolute;
    z-index: 20;
    right: 0;
    top: calc(100% - 1px);
    display: grid;
    min-width: 190px;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(23, 32, 38, 0.12);
}

.nav-menu a,
.nav-menu .link-button {
    display: block;
    text-align: left;
}

.page {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0;
}

.page.landing-page {
    width: min(1120px, calc(100% - 40px));
    padding-top: 40px;
    padding-bottom: 72px;
}

.admin-page {
    width: min(1180px, calc(100% - 32px));
}

.hero,
.panel {
    max-width: 760px;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 34px;
    align-items: start;
}

.home-hero-copy {
    position: relative;
    padding: 18px 0 0;
}

.home-hero-copy::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 92px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #007b77 0%, #82c6ba 100%);
}

.home-hero-list {
    max-width: 38rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-hero-list li {
    position: relative;
    padding-left: 1.5rem;
}

.home-hero-list li::before {
    content: "";
    position: absolute;
    top: 0.8em;
    left: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #82c6ba;
    transform: translateY(-50%);
}

.home-provider-line {
    margin: 16px 0 0 1.5rem;
    color: var(--accent-dark);
    width: calc(100% - 1.5rem);
    max-width: none;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    white-space: nowrap;
}

.home-provider-line a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    text-decoration-thickness: 0.08em;
}

.home-provider-line a:hover,
.home-provider-line a:focus-visible {
    color: var(--accent);
}

.home-body-copy {
    max-width: 36rem;
    margin-top: 14px;
    margin-bottom: 0;
}

.home-body-copy {
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1.7;
}

.home-microcopy {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.95rem;
}

.home-microcopy span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.home-microcopy span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #9bcfc7;
}

.home-note-label {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-hero-note p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.home-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.home-hero-image-frame {
    width: min(100%, 460px);
    padding: 18px;
    border: 1px solid #dbe7e5;
    border-radius: 30px;
    background: linear-gradient(180deg, #ffffff 0%, #f4faf9 100%);
    box-shadow: 0 22px 54px rgba(9, 42, 53, 0.12);
}

.home-hero-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 22px;
}

.home-panel-card {
    position: relative;
    padding: 24px;
    border: 1px solid #dbe7e5;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f4faf9 100%);
    box-shadow: 0 18px 42px rgba(9, 42, 53, 0.08);
}

.home-panel-card-primary {
    overflow: hidden;
}

.home-panel-card-primary::after {
    content: "";
    position: absolute;
    inset: auto -42px -50px auto;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(130, 198, 186, 0.28) 0%, rgba(130, 198, 186, 0) 72%);
}

.home-panel-label {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e7f3f1;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-panel-card h2 {
    margin: 0 0 12px;
    font-size: 1.45rem;
}

.home-panel-list {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
}

.home-panel-list li + li {
    margin-top: 10px;
}

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

.home-stat {
    padding: 18px;
    border: 1px solid #dfe8e6;
    border-radius: 18px;
    background: #ffffff;
}

.home-stat strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.35rem;
    line-height: 1.1;
}

.home-stat span {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.home-section {
    margin-top: 34px;
}

.home-section-soft {
    padding: 30px;
    border: 1px solid #e3ecea;
    border-radius: 28px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
}

.home-section-heading {
    max-width: 42rem;
    margin-bottom: 20px;
}

.home-section-heading h2 {
    margin: 0 0 10px;
    font-size: 2rem;
}

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

.home-card {
    padding: 24px;
    border: 1px solid #e1ebe8;
    border-radius: 22px;
    background: #ffffff;
}

.home-card h3 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.home-card p {
    margin: 0;
    line-height: 1.7;
}

.home-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.home-step {
    padding: 24px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #e1ebe8;
}

.home-step-number {
    margin: 0 0 16px;
    color: var(--accent-dark);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-step h3 {
    margin: 0 0 10px;
    font-size: 1.22rem;
}

.home-step p {
    margin: 0;
    line-height: 1.7;
}

.home-invite-banner {
    margin-top: 24px;
    padding: 20px 22px;
    border: 1px solid #dbe7e5;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f3faf8 100%);
    box-shadow: 0 14px 34px rgba(9, 42, 53, 0.07);
}

.home-invite-copy {
    max-width: none;
}

.home-invite-copy p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.75;
}

.home-safety-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
    gap: 28px;
    align-items: start;
    padding: 32px;
    border: 1px solid #f0d7c5;
    border-radius: 28px;
    background: linear-gradient(180deg, #fff8f2 0%, #fffdfa 100%);
}

.home-safety-banner h2 {
    margin: 0 0 12px;
    font-size: 1.85rem;
}

.home-safety-banner p:last-child {
    margin-bottom: 0;
}

.eyebrow {
    color: var(--accent-dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

h1 {
    margin: 0 0 18px;
    font-size: 2.4rem;
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h2,
h3 {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    letter-spacing: -0.02em;
}

p {
    color: var(--muted);
    font-size: 1.05rem;
}

strong {
    color: var(--ink);
}

.button {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

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

.button:disabled,
.button[disabled] {
    background: #b7c5ce;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.85;
}

.button:disabled:hover,
.button[disabled]:hover {
    background: #b7c5ce;
}

.button.secondary {
    background: var(--surface);
    color: var(--accent-dark);
    border: 1px solid var(--line);
}

.button.secondary:hover {
    background: #edf3f2;
}

.form {
    display: grid;
    gap: 10px;
    max-width: 420px;
    margin-top: 24px;
}

.wide-form {
    max-width: 640px;
}

.full-panel {
    max-width: none;
}

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

.field-help {
    margin: -4px 0 6px;
    font-size: 0.92rem;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.field-error {
    margin: -4px 0 8px;
    color: #b42318;
    font-size: 0.92rem;
}

.form-card,
.filters {
    display: grid;
    gap: 12px;
    margin: 18px 0 26px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto;
    align-items: end;
}

.check-row {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: start;
}

.check-row input {
    width: auto;
    margin-top: 6px;
}

.small-text {
    max-width: 420px;
    overflow-wrap: anywhere;
    font-size: 0.86rem;
}

.consent-box {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: start;
    margin-top: 8px;
}

.consent-box input {
    width: auto;
    margin-top: 5px;
    transform: scale(1.35);
    transform-origin: top left;
}

.consent-box label {
    font-weight: 400;
}

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 700;
}

.checkbox-row input {
    width: auto;
}

.resource-fieldset {
    display: grid;
    gap: 10px;
    margin: 10px 0 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.resource-fieldset legend {
    color: var(--muted);
    font-weight: 700;
}

.notice {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    color: var(--ink);
    background: var(--surface);
}

.notice.error {
    border-color: #b42318;
    background: #fff4f2;
}

.section-header,
.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.actions {
    justify-content: flex-start;
    margin: 16px 0 24px;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.content-modules-table {
    min-width: 1120px;
    table-layout: fixed;
}

.content-modules-table th:nth-child(1) {
    width: 58px;
}

.content-modules-table th:nth-child(2) {
    width: 130px;
}

.content-modules-table th:nth-child(3) {
    width: 112px;
}

.content-modules-table th:nth-child(4) {
    width: 130px;
}

.content-modules-table th:nth-child(5) {
    width: 110px;
}

.content-modules-table th:nth-child(6) {
    width: 80px;
}

.content-modules-table th:nth-child(7) {
    width: 110px;
}

.content-modules-table th:nth-child(9) {
    width: 110px;
}

.content-modules-table th:nth-child(10) {
    width: 190px;
}

.content-modules-table .content-preview {
    overflow-wrap: anywhere;
}

.content-modules-table .actions-cell {
    min-width: 190px;
}

.checkin-flows-table {
    min-width: 1060px;
    table-layout: fixed;
}

.checkin-flows-table th:nth-child(1) {
    width: 80px;
}

.checkin-flows-table th:nth-child(2) {
    width: 170px;
}

.checkin-flows-table th:nth-child(3),
.checkin-flows-table th:nth-child(5) {
    width: 110px;
}

.checkin-flows-table th:nth-child(4),
.checkin-flows-table th:nth-child(6),
.checkin-flows-table th:nth-child(7) {
    width: 90px;
}

.checkin-flows-table th:nth-child(9) {
    width: 190px;
}

.checkin-flows-table .actions-cell {
    min-width: 190px;
}

.product-catalog-table,
.product-rules-table {
    min-width: 1040px;
    table-layout: fixed;
}

.product-catalog-table th:nth-child(1),
.product-rules-table th:nth-child(1) {
    width: 120px;
}

.product-catalog-table th:nth-child(2),
.product-rules-table th:nth-child(2) {
    width: 180px;
}

.product-catalog-table th:nth-child(3),
.product-catalog-table th:nth-child(4),
.product-rules-table th:nth-child(3),
.product-rules-table th:nth-child(4) {
    width: 110px;
}

.product-catalog-table th:last-child,
.product-rules-table th:last-child {
    width: 190px;
}

.product-catalog-table .actions-cell,
.product-rules-table .actions-cell {
    min-width: 190px;
}

.ai-logs-table {
    min-width: 1180px;
    table-layout: fixed;
}

.ai-logs-table th:nth-child(1) {
    width: 150px;
}

.ai-logs-table th:nth-child(2),
.ai-logs-table th:nth-child(5) {
    width: 150px;
}

.ai-logs-table th:nth-child(3),
.ai-logs-table th:nth-child(4),
.ai-logs-table th:nth-child(7),
.ai-logs-table th:nth-child(8),
.ai-logs-table th:nth-child(9) {
    width: 100px;
}

.ai-logs-table th:nth-child(6) {
    width: 160px;
}

.ai-logs-table th:nth-child(11) {
    width: 92px;
}

.import-results-table {
    min-width: 760px;
    table-layout: fixed;
}

.import-results-table th:nth-child(1) {
    width: 80px;
}

.import-results-table th:nth-child(2) {
    width: 120px;
}

.import-results-table th:nth-child(3) {
    width: 120px;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.88rem;
}

.severity-critical,
.severity-high {
    border-color: #b42318;
    background: #fff4f2;
    color: #912018;
}

.severity-medium {
    border-color: #b54708;
    background: #fff8ed;
    color: #93370d;
}

.severity-low {
    border-color: #b7c5ce;
    background: #f7f9fa;
    color: var(--ink);
}

.status-failed {
    border-color: #b42318;
    background: #fff4f2;
    color: #912018;
}

.status-blocking {
    border-color: #b42318;
    background: #fff4f2;
    color: #912018;
}

.status-warning {
    border-color: #b54708;
    background: #fff8ed;
    color: #93370d;
}

.status-completed {
    border-color: #0f766e;
    background: #ecfdf5;
    color: #0b5f59;
}

.status-pass {
    border-color: #0f766e;
    background: #ecfdf5;
    color: #0b5f59;
}

.status-skipped,
.status-created,
.status-secondary {
    border-color: #b7c5ce;
    background: #f7f9fa;
    color: var(--ink);
}

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

h2 {
    margin: 28px 0 10px;
    font-size: 1.35rem;
}

dl {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr;
    gap: 8px 14px;
}

dt {
    color: var(--muted);
    font-weight: 700;
}

dd {
    margin: 0;
}

.json-block {
    overflow-x: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.inline-form {
    margin: 0;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin: 20px 0;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-actions .button {
    margin-top: 0;
}

.pagination {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.pagination p {
    margin: 0;
}

.pagination-controls,
.pagination-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination .button {
    margin-top: 0;
}

.pagination-current {
    display: inline-block;
    min-width: 38px;
    padding: 9px 12px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: #ecfdf5;
    color: var(--accent-dark);
    font-weight: 700;
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 26px;
}

.summary-box {
    min-height: 92px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.summary-label {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.summary-box strong {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere;
    font-size: 1.25rem;
}

.import-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.8fr);
    gap: 28px;
    align-items: start;
    margin-top: 24px;
}

.import-review {
    margin-top: 32px;
}

.compact-list {
    margin: 0;
    padding-left: 18px;
}

.table-action-form {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

.table-action-form input {
    min-width: 0;
}

.table-action-form .button {
    margin-top: 0;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.link-button:hover {
    color: var(--accent-dark);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.site-footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer p {
    margin: 0;
    font-size: 0.95rem;
}

.site-footer nav {
    gap: 14px;
}

.legal-page {
    max-width: 820px;
}

.contact-page {
    max-width: 760px;
}

.contact-form {
    gap: 18px;
}

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

.contact-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.legal-meta {
    display: grid;
    gap: 2px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.legal-meta p,
.legal-page p,
.legal-page li {
    color: var(--ink);
    font-size: 1rem;
}

.legal-page p {
    margin: 0 0 14px;
}

.legal-page h2 {
    margin-top: 30px;
    margin-bottom: 10px;
}

.legal-list {
    margin: 0 0 16px;
    padding-left: 22px;
}

.legal-list li {
    margin-bottom: 8px;
}

@media (max-width: 1000px) {
    .home-hero,
    .home-card-grid,
    .home-steps,
    .home-safety-banner {
        grid-template-columns: 1fr;
    }

    .home-hero-visual {
        justify-content: flex-start;
    }

    .home-hero-image-frame {
        width: min(100%, 520px);
    }

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

}

@media (max-width: 640px) {
    .site-header {
        padding: 20px 20px 18px;
    }

    h1 {
        font-size: 2rem;
    }

    .brand {
        font-size: 2.1rem;
    }

    .page.landing-page {
        width: min(100%, calc(100% - 24px));
        padding-top: 44px;
        padding-bottom: 56px;
    }

    .detail-grid,
    .import-layout,
    dl,
    .filter-form,
    .filters,
    .summary-grid,
    .home-panel-grid {
        grid-template-columns: 1fr;
    }

    .admin-header nav {
        justify-content: flex-start;
    }

    .nav-menu {
        left: 0;
        right: auto;
    }

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

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .home-section-soft,
    .home-safety-banner,
    .home-card,
    .home-step,
    .home-panel-card,
    .home-hero-image-frame,
    .home-invite-banner {
        padding: 22px;
    }

    .home-provider-line {
        margin-left: 1.5rem;
        width: calc(100% - 1.5rem);
        font-size: 1.12rem;
        white-space: normal;
    }

    .home-hero-image {
        height: auto;
        max-height: none;
    }

}
