:root {
    color-scheme: light;
    --ink: #142c36;
    --subtle: #46616b;
    --teal: #087484;
    --teal-dark: #07515e;
    --orange: #eb781d;
    --edge: #c8dcde;
    --surface: #fbfefe;
    font-family: "Avenir Next", Avenir, system-ui, sans-serif;
    color: var(--ink);
    background: #eaf4f5;
    font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    min-width: 280px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 4% 27%, #b4e0e76e, transparent 51%),
        radial-gradient(ellipse at 91% 12%, #fbdab865, transparent 44%),
        linear-gradient(150deg, #f6fbfc, #e9f4f5 63%, #f5faf9);
}

body::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 455px;
    pointer-events: none;
    opacity: .65;
    background: repeating-radial-gradient(ellipse at 93% 25%, transparent 0 27px, #ffffff87 28px 29px, transparent 30px 59px);
    mask-image: linear-gradient(#000, transparent);
}

a { color: var(--teal-dark); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #168998; outline-offset: 3px; }

.shell {
    width: min(100% - 48px, 790px);
    margin-inline: auto;
    position: relative;
}

.shell--login { width: min(100% - 48px, 560px); }

.masthead {
    min-height: 94px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border-bottom: 1px solid #527e881f;
}

.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { display: block; width: 186px; height: auto; }
.nav {
    display: flex;
    gap: 3px;
    padding: 4px;
    background: #ffffff75;
    border: 1px solid #ffffffb0;
    border-radius: 999px;
    white-space: nowrap;
}

.nav a {
    display: grid;
    min-height: 36px;
    align-content: center;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--subtle);
    font-size: .83rem;
    font-weight: 700;
    text-decoration: none;
}

.nav a[aria-current="page"] {
    color: var(--teal-dark);
    background: #d9eef0;
}

.intro { margin: 44px 0 27px; }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 9px;
    font-size: .73rem;
    font-weight: 750;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--teal-dark);
}
.eyebrow span { width: 8px; height: 8px; background: var(--orange); border-radius: 50%; }
h1 {
    margin: 0;
    font-size: clamp(2.8rem, 7vw, 4.45rem);
    font-weight: 700;
    line-height: .99;
    letter-spacing: -.072em;
}
.title-dot { color: var(--orange); }
.intro-copy { margin: 13px 0 0; color: var(--subtle); line-height: 1.5; }

.panel {
    padding: clamp(20px, 4.8vw, 37px);
    background: #ffffffbd;
    border: 1px solid #fff;
    border-radius: 25px;
    box-shadow: 0 20px 54px #254e5810, 0 2px 8px #35565a0b;
    backdrop-filter: blur(17px);
}

.form-section { padding: 0; margin: 0; border: 0; min-inline-size: 0; }
.form-section + .form-section {
    position: relative;
    margin-top: 24px;
    padding-top: 22px;
}
.form-section + .form-section::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    border-top: 1px solid #d9e6e8;
}
fieldset.form-section + .form-section { margin-top: 29px; padding-top: 0; }
fieldset.form-section + .form-section::before { content: none; }
.lead-form > .form-section:first-of-type { position: relative; }
.lead-form > .form-section:first-of-type::after {
    content: "";
    position: absolute;
    inset: auto 0 -14px;
    border-top: 1px solid #d9e6e8;
}
fieldset.form-section + .form-section + .form-section { margin-top: 23px; padding-top: 21px; }

.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin: 0 0 13px;
    font-size: 1.1rem;
    font-weight: 750;
}
.section-heading h2, .attachments h2 { margin: 0; font-size: inherit; }
.tile {
    position: relative;
    display: inline-grid;
    min-width: 35px;
    height: 35px;
    place-items: center;
    border-radius: 11px;
    color: var(--teal-dark);
    background: #dff0f1;
}
.tile--warm { color: #9c480e; background: #fff0df; }
.icon { display: block; position: relative; }
.icon--person { width: 17px; height: 19px; }
.icon--person::before, .icon--person::after { content: ""; position: absolute; border: 1.5px solid currentColor; }
.icon--person::before { width: 8px; height: 8px; border-radius: 50%; left: 4.5px; top: 0; }
.icon--person::after { width: 16px; height: 8px; border-radius: 8px 8px 3px 3px; left: .5px; bottom: 1px; }
.icon--spark { font-size: 1.55rem; line-height: 1; }
.icon--paperclip {
    width: 10px;
    height: 19px;
    border: 1.6px solid currentColor;
    border-radius: 8px;
    transform: rotate(38deg);
}
.icon--paperclip::before {
    content: "";
    position: absolute;
    inset: 3px 1.2px 2px;
    border: 1.3px solid currentColor;
    border-top: 0;
    border-radius: 0 0 5px 5px;
}

.contact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; }
.field { display: grid; min-width: 0; gap: 6px; }
.field > span, .attachments h2 { font-size: .89rem; font-weight: 740; }
.field--wide { grid-column: 1 / -1; }
.required { color: #a84b0c; }
.optional { font-size: .76rem; color: var(--subtle); font-weight: 500; margin-left: 5px; }

.field input, textarea, input[type="search"] {
    width: 100%;
    min-height: 47px;
    border: 1px solid var(--edge);
    border-radius: 11px;
    background: var(--surface);
    color: var(--ink);
    padding: 10px 12px;
    font-size: 1rem;
}
textarea { resize: vertical; min-height: 78px; }
input::placeholder, textarea::placeholder { color: #647980; opacity: 1; }
.hint { margin: -6px 0 10px; color: var(--subtle); font-size: .86rem; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice, .file-control { position: relative; display: inline-flex; cursor: pointer; }
.choice input, .file-control input, .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.choice > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--edge);
    border-radius: 11px;
    background: var(--surface);
    font-size: .87rem;
    font-weight: 650;
}
.choice i {
    display: grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border: 1px solid #91afb4;
    border-radius: 4px;
}
.choice input:checked + span { background: #dff2f2; color: var(--teal-dark); border-color: #52a5ad; }
.choice input:checked + span i { color: #fff; background: var(--teal); border-color: var(--teal); }
.choice input:checked + span i::after { content: "✓"; font: 700 11px system-ui; }
.choice input:focus-visible + span, .file-control input:focus-visible + span { outline: 3px solid #168998; outline-offset: 3px; }

.extras { display: grid; gap: 17px; }
.attachments { display: grid; gap: 7px; }
.upload-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    gap: 10px;
    border: 1px dashed #9dbdc1;
    border-radius: 13px;
    background: #ebf6f789;
}
.upload-intro { display: flex; align-items: center; gap: 10px; }
.upload-intro strong { display: block; font-size: .85rem; }
.upload-intro p, .file-selection { margin: 3px 0 0; color: var(--subtle); font-size: .76rem; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.file-selection { flex-basis: 100%; overflow-wrap: anywhere; }
.attachment-list { margin: 2px 0 5px; padding-left: 20px; font-size: .9rem; overflow-wrap: anywhere; }

.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 23px; }
.button {
    display: inline-flex;
    min-height: 45px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 730;
    font-size: .87rem;
    text-decoration: none;
    line-height: 1.2;
}
.button--primary {
    background: var(--teal-dark);
    color: white;
    box-shadow: 0 5px 12px #095b6422;
}
.button--primary:hover { background: #086978; }
.button--secondary { background: var(--surface); color: var(--teal-dark); border-color: var(--edge); }
.button--secondary:hover { background: #e8f4f4; }
.button--danger-outline { background: var(--surface); color: #922c23; border-color: #e7bcb6; }
.button--danger-outline:hover { background: #fff0ed; }
.button--danger { background: #922c23; color: #fff; }
.button--danger:hover { background: #76231b; }
.file-control .button { padding-inline: 10px; font-size: .78rem; }
.sign-in { display: grid; align-items: start; gap: 15px; }
.sign-in .button { justify-self: start; }
.notice {
    display: flex;
    gap: 7px;
    padding: 10px 13px;
    border: 1px solid #a6d5cd;
    border-radius: 11px;
    margin: 0 0 13px;
    background: #e4f5ef;
    color: #144c40;
    font-size: .9rem;
    font-weight: 650;
}
.notice--error { color: #832c22; background: #fff0ed; border-color: #f4c2b8; }

.list-toolbar, .search { display: flex; flex-wrap: wrap; gap: 8px; }
.list-toolbar { justify-content: space-between; }
.search { flex: 1; flex-wrap: nowrap; min-width: min(100%, 310px); }
.search input { min-width: 0; }
.result-count { color: var(--subtle); margin: 22px 0 10px; font-size: .86rem; }
.lead-list { list-style: none; margin: 0; padding: 0; }
.lead-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    border-top: 1px solid #d9e6e8;
    padding: 13px 0;
    overflow-wrap: anywhere;
}
.lead-card h2 { margin: 0; font-size: 1.06rem; }
.lead-card h2 a { text-decoration: none; }
.lead-card h2 a:hover { text-decoration: underline; }
.lead-card p { margin: 4px 0; color: var(--subtle); font-size: .86rem; }
.lead-card > .button { flex-shrink: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags span { padding: 3px 7px; color: var(--teal-dark); background: #e7f3f3; border-radius: 6px; font-size: .75rem; }
.empty { display: grid; justify-items: start; gap: 8px; }
.empty h2 { margin: 0; font-size: 1.1rem; }

.detail-heading, .detail-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.detail-heading h2, .delete-panel h2 { margin: 0; font-size: clamp(1.35rem, 5vw, 2rem); overflow-wrap: anywhere; }
.detail-heading p, .delete-panel p { margin: 5px 0 0; color: var(--subtle); overflow-wrap: anywhere; }
.detail-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    margin: 21px 0;
    padding: 18px 0;
    border-block: 1px solid #d9e6e8;
}
.detail-fields dt { margin-bottom: 4px; color: var(--subtle); font-size: .82rem; font-weight: 700; }
.detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.detail-notes { white-space: pre-wrap; }
.delete-panel .detail-actions { justify-content: flex-start; margin-top: 20px; }

.footer { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 10px; color: var(--subtle); font-size: .78rem; }
.footer button { min-height: 44px; padding: 0 5px; border: 0; background: transparent; color: var(--teal-dark); text-decoration: underline; }

@media (max-width: 570px) {
    .shell, .shell--login { width: min(100% - 26px, 790px); }
    .masthead { min-height: 70px; gap: 8px; }
    .brand img { width: clamp(107px, 34vw, 150px); }
    .nav { gap: 0; padding: 2px; }
    .nav a { padding-inline: 8px; min-height: 44px; font-size: .76rem; }
    .intro { margin: 26px 3px 17px; }
    .intro-copy { margin-top: 9px; font-size: .9rem; }
    .panel { border-radius: 20px; padding: 16px; }
    .contact-fields { grid-template-columns: 1fr; gap: 10px; }
    .form-actions > * { flex: 1 0 auto; }
    .detail-fields { grid-template-columns: 1fr; }
    .upload-actions { flex: 1 0 100%; }
    .upload-actions > *, .upload-actions .button { flex: 1; }
}
