:root {
    --ink: #101722;
    --paper: #f7f9fb;
    --paper-strong: #ffffff;
    --line: #d7dee8;
    --muted: #667181;
    --blue: #1769e0;
    --green: #23a26d;
    --violet: #6c5ce7;
    --dark: #07111f;
    --dark-soft: #101d2e;
    --warn: #b2452d;
    --radius: 8px;
    --shadow: 0 18px 42px rgba(19, 30, 44, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(90deg, rgba(35, 162, 109, .08), transparent 28%),
        linear-gradient(180deg, #fbfcfe, #eef3f8 72%, #e8edf4);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper-strong);
    color: var(--ink);
    padding: .85rem .9rem;
}

textarea {
    resize: vertical;
}

label {
    display: grid;
    gap: .4rem;
    color: #263244;
    font-weight: 700;
}

.public-header {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    font-weight: 800;
}

.brand img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    border-radius: var(--radius);
}

.header-link,
.button,
.link-button {
    min-height: 2.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper-strong);
    color: var(--ink);
    padding: .75rem 1rem;
    font-weight: 800;
    cursor: pointer;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button.primary {
    border-color: #114caa;
    background: var(--blue);
    color: #fff;
}

.eyebrow,
.step,
.metric-row span,
.record span,
.table-row small,
.detail-list dt {
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

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

h1 {
    max-width: 12em;
    font-size: 3.1rem;
    line-height: 1;
}

h2 {
    font-size: 2rem;
    line-height: 1.05;
}

h3 {
    font-size: 1.25rem;
}

.lead {
    max-width: 42rem;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.muted {
    color: var(--muted);
}

.intake-hero,
.intake-form,
.thanks-shell,
.login-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.intake-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 1.25rem;
    align-items: end;
    padding: 3rem 0 2rem;
}

.signal-panel,
.panel,
.form-section,
.project-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow);
}

.signal-panel {
    padding: 1.4rem;
    border-left: 4px solid var(--green);
}

.signal-panel span {
    color: var(--green);
    font-weight: 900;
}

.signal-panel strong {
    display: block;
    margin: .7rem 0;
    font-size: 1.5rem;
    line-height: 1.1;
}

.form-section {
    display: grid;
    grid-template-columns: minmax(220px, .42fr) minmax(0, 1fr);
    gap: 1.4rem;
    padding: 1.35rem;
    margin-bottom: 1rem;
}

.step-nav {
    position: sticky;
    top: .75rem;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .45rem;
    margin-bottom: 1rem;
    padding: .55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow);
}

.step-nav button {
    border: 1px solid transparent;
    border-radius: var(--radius);
    min-height: 2.45rem;
    background: transparent;
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
}

.step-nav button.is-active {
    background: var(--dark);
    color: #fff;
}

.step-panel {
    display: none;
}

.step-panel.is-active {
    display: grid;
}

.step-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 0;
    background: linear-gradient(180deg, transparent, #eef3f8 34%);
}

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

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

.service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.choice-block {
    display: grid;
    gap: .8rem;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

.choice {
    min-height: 3.4rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: .85rem;
}

.choice input {
    width: auto;
}

.choice span {
    font-weight: 900;
}

.service-option {
    min-height: 7.4rem;
    align-content: start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 1rem;
}

.service-option.compact {
    min-height: 6.2rem;
}

.service-option input {
    width: auto;
}

.service-option span {
    font-size: 1.05rem;
}

.service-option small {
    color: var(--muted);
    line-height: 1.45;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.checkline {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    line-height: 1.5;
}

.checkline input {
    width: auto;
    margin-top: .2rem;
}

.is-muted {
    opacity: .52;
}

.notice {
    border-radius: var(--radius);
    background: #eaf5ef;
    border: 1px solid #b9dac9;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #164a34;
    font-weight: 800;
}

.error,
.error-box {
    color: var(--warn);
}

.thanks-shell,
.login-shell {
    min-height: 70vh;
    display: grid;
    align-content: center;
    gap: 1.25rem;
}

.login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: center;
}

.login-shell .panel {
    padding: 1.25rem;
}

.admin-page {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    background: #eef3f8;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    background: var(--dark);
    color: #edf4ff;
    padding: 1rem;
    display: grid;
    align-content: start;
    gap: 1.2rem;
}

.brand-admin img {
    background: #fff;
}

.admin-sidebar nav {
    display: grid;
    gap: .45rem;
}

.admin-sidebar nav a,
.link-button {
    border-radius: var(--radius);
    padding: .8rem .9rem;
    color: #d9e7f8;
    background: transparent;
    border: 1px solid transparent;
    text-align: left;
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover,
.link-button:hover {
    border-color: rgba(255,255,255,.16);
    background: var(--dark-soft);
}

.admin-main {
    padding: 1.5rem;
}

.page-heading {
    margin-bottom: 1.2rem;
}

.split-heading,
.panel-head,
.project-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.metric-row,
.admin-grid-two,
.project-grid {
    display: grid;
    gap: 1rem;
}

.metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.metric-row article,
.panel,
.project-panel {
    padding: 1.15rem;
}

.metric-row article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.metric-row strong {
    display: block;
    font-size: 2.2rem;
}

.admin-grid-two,
.project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.record-list,
.table-list,
.comment-list {
    display: grid;
    gap: .7rem;
}

.record,
.table-row,
.task-row,
.comment-list article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: .9rem;
}

.record strong,
.record small,
.table-row strong,
.table-row small {
    display: block;
}

.table-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) .6fr .6fr .6fr;
    gap: .75rem;
    align-items: center;
}

.toolbar,
.inline-form,
.mini-form {
    display: grid;
    gap: .65rem;
}

.toolbar {
    grid-template-columns: minmax(0, 1fr) 220px auto;
    margin-bottom: 1rem;
}

.inline-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    max-width: 620px;
}

.project-panel {
    margin-top: 1rem;
}

.soft {
    background: rgba(255,255,255,.72);
    box-shadow: none;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.chip-row span {
    border-radius: var(--radius);
    background: #e9f3ee;
    border: 1px solid #c9e1d4;
    padding: .45rem .65rem;
    color: #164a34;
    font-weight: 800;
}

.task-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: .75rem;
    align-items: center;
}

.detail-list {
    display: grid;
    gap: .8rem;
}

.detail-list div {
    border-bottom: 1px solid var(--line);
    padding-bottom: .7rem;
}

.detail-list dd {
    margin: .2rem 0 0;
}

@media (max-width: 900px) {
    h1 {
        font-size: 2.25rem;
    }

    .intake-hero,
    .form-section,
    .login-shell,
    .admin-page,
    .admin-grid-two,
    .project-grid,
    .metric-row {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        min-height: auto;
    }

    .field-grid,
    .service-grid,
    .choice-grid,
    .toolbar,
    .inline-form,
    .table-row,
    .step-nav,
    .task-row {
        grid-template-columns: 1fr;
    }
}
