:root {
    --ink: #17211d;
    --muted: #66716c;
    --paper: #f5f3ed;
    --surface: #ffffff;
    --line: #d9ddd8;
    --forest: #0f5b47;
    --forest-dark: #093f32;
    --mint: #e2f0ea;
    --amber: #f0b429;
    --amber-soft: #fff5d6;
    --danger-soft: #fce9e4;
    --danger: #8d3325;
    --shadow: 0 12px 30px rgba(23, 33, 29, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 72px;
    padding: 10px max(20px, calc((100vw - 1180px) / 2));
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    align-items: center;
    display: inline-flex;
    gap: 12px;
    text-decoration: none;
}

.brand img {
    border: 2px solid var(--amber);
    border-radius: 8px;
    height: 48px;
    object-fit: cover;
    width: 48px;
}

.brand span { display: flex; flex-direction: column; }
.brand strong { font-size: 1rem; }
.brand small { color: var(--muted); }

.pilot-badge, .coverage, .result-count {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 6px 10px;
}

.container {
    margin: 0 auto;
    max-width: 1180px;
    padding: 32px 20px 64px;
}

.workspace-intro {
    align-items: end;
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
    margin-bottom: 28px;
}

.eyebrow {
    color: var(--forest);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0;
    margin: 0 0 6px;
}

.workspace-intro h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.04;
    margin: 0;
    max-width: 850px;
}

.workspace-intro > div > p:last-child {
    color: var(--muted);
    font-size: 1.05rem;
    margin: 14px 0 0;
    max-width: 760px;
}

.trust-note {
    border-left: 4px solid var(--amber);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 8px 16px;
}

.trust-note span { color: var(--muted); }

.search-panel, .results {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    padding: 24px;
}

.panel-heading, .section-heading {
    align-items: start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.panel-heading > div { align-items: start; display: flex; gap: 12px; }
.panel-heading h2, .section-heading h2 { font-size: 1.35rem; margin: 0; }
.panel-heading p, .section-heading p { color: var(--muted); margin: 3px 0 0; }

.step {
    align-items: center;
    background: var(--ink);
    border-radius: 6px;
    color: white;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-wide { grid-column: 1 / -1; }
.field-wide small { color: var(--muted); font-size: 0.76rem; font-weight: 500; }
.optional { color: var(--muted); font-weight: 500; }

label {
    color: #33423b;
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    font-weight: 750;
    gap: 7px;
}

input, select, textarea {
    background: #fbfcfa;
    border: 1px solid #bdc6c0;
    border-radius: 6px;
    color: var(--ink);
    min-height: 44px;
    padding: 9px 11px;
    width: 100%;
}

textarea { min-height: 120px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(15, 91, 71, 0.13);
    outline: none;
}

.search-footer {
    align-items: end;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-top: 22px;
    padding-top: 18px;
}
.form-error { background: #fff0ed; border: 1px solid #e4aaa1; border-left: 4px solid #a63d2f; border-radius: 8px; color: #78281f; margin-bottom: 18px; padding: 13px 15px; }

.radius-panel { display: flex; flex-direction: column; gap: 8px; }
.radius-panel > span { color: var(--muted); font-size: 0.78rem; font-weight: 750; }
.radius-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.radius-chip {
    background: white;
    border: 1px solid #b8c3bd;
    border-radius: 6px;
    color: #46534d;
    min-height: 36px;
    padding: 6px 10px;
}

.radius-chip:hover { border-color: var(--forest); color: var(--forest); }
.radius-chip.active { background: var(--forest); border-color: var(--forest); color: white; }

.primary-action, .unlock-action {
    align-items: center;
    background: var(--forest);
    border: 0;
    border-radius: 6px;
    color: white;
    display: inline-flex;
    font-weight: 800;
    gap: 9px;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
}

.primary-action:hover, .unlock-action:hover { background: var(--forest-dark); }
.primary-action:disabled { cursor: wait; opacity: 0.7; }

.button-loader {
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    border-top-color: white;
    display: none;
    height: 14px;
    width: 14px;
}

.primary-action.is-loading .button-loader { animation: spin 800ms linear infinite; display: inline-block; }
.form-status { color: var(--forest); font-size: 0.85rem; font-weight: 700; margin: 10px 0 0; min-height: 20px; }

.search-feedback {
    background: linear-gradient(135deg, #edf6f2, #fffaf0);
    border: 1px solid #c8ddd4;
    border-radius: 10px;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(220px, 0.75fr) minmax(300px, 1.25fr);
    margin-top: 24px;
    padding: 22px;
}
.search-feedback h2 { font-size: 1.35rem; margin: 0 0 8px; }
.search-feedback > div > p:last-child { color: var(--muted); margin: 0; }
.search-feedback form { display: grid; gap: 15px; }
.star-rating { border: 0; margin: 0; padding: 0; }
.star-rating legend { color: #33423b; font-size: 0.82rem; font-weight: 750; margin-bottom: 7px; }
.star-rating > div { display: flex; gap: 7px; }
.star-rating label { cursor: pointer; display: block; }
.star-rating input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.star-rating span[aria-hidden="true"] { color: #a5ada9; display: block; font-size: 2rem; line-height: 1; transition: color 120ms ease, transform 120ms ease; }
.star-rating label:hover span[aria-hidden="true"],
.star-rating label:has(~ label:hover) span[aria-hidden="true"],
.star-rating label:has(input:checked) span[aria-hidden="true"],
.star-rating label:has(~ label input:checked) span[aria-hidden="true"] { color: var(--amber); transform: translateY(-1px); }
.star-rating label:has(input:focus-visible) span[aria-hidden="true"] { outline: 3px solid rgba(15, 91, 71, 0.25); outline-offset: 3px; }
.consent-check { align-items: flex-start; flex-direction: row; font-weight: 600; }
.consent-check input { flex: 0 0 auto; margin-top: 2px; min-height: 18px; width: 18px; }
.feedback-submit { background: var(--ink); border: 0; border-radius: 6px; color: white; font-weight: 800; min-height: 44px; padding: 10px 18px; }
.feedback-submit:disabled { cursor: not-allowed; opacity: 0.65; }
.issue-type-fieldset { border: 0; margin: 0; padding: 0; }
.issue-type-fieldset legend { color: #33423b; font-size: 0.82rem; font-weight: 750; margin-bottom: 8px; }
.issue-type-options { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.issue-type-options label { align-items: center; background: rgba(255,255,255,.72); border: 1px solid #c8ddd4; border-radius: 7px; cursor: pointer; display: flex; gap: 8px; padding: 9px 10px; }
.issue-type-options label:has(input:checked) { background: #e4f2ec; border-color: var(--forest); color: var(--forest); font-weight: 750; }
.issue-type-options input { accent-color: var(--forest); }
.other-issue-detail.is-hidden { display: none; }
.other-issue-detail textarea { min-height: 80px; }
.sr-only { clip: rect(0, 0, 0, 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.embed-mode { background: transparent; }
.embed-mode .container { max-width: 1120px; padding: 8px 8px 24px; }
.embed-mode .search-panel, .embed-mode .results { box-shadow: none; }

.app-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 36px;
    padding: 22px 20px 28px;
    text-align: center;
}

.app-footer p { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 0; }
.app-footer strong { color: var(--ink); }
.app-footer a { color: var(--forest); font-weight: 750; text-decoration: none; }
.app-footer a:hover, .app-footer a:focus { text-decoration: underline; }

.notice {
    background: var(--amber-soft);
    border-left: 4px solid var(--amber);
    color: #60480e;
    margin: 0 0 18px;
    padding: 11px 14px;
}

.ring-summary {
    align-items: stretch;
    background: var(--mint);
    border-radius: 8px;
    display: grid;
    gap: 18px;
    grid-template-columns: 150px 1fr;
    margin-bottom: 20px;
    padding: 14px;
}

.ring-summary > div { border-right: 1px solid #b8d2c7; display: flex; flex-direction: column; justify-content: center; }
.ring-summary > div span { color: var(--muted); font-size: 0.75rem; }
.ring-summary > div strong { font-size: 1.5rem; }
.ring-summary ol { display: flex; gap: 8px; list-style: none; margin: 0; overflow-x: auto; padding: 0; }
.ring-summary li { background: white; border: 1px solid #c8ddd4; border-radius: 6px; display: flex; flex: 0 0 auto; flex-direction: column; min-width: 76px; padding: 8px 10px; }
.ring-summary li span { color: var(--muted); font-size: 0.72rem; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.listing-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    padding: 18px;
}

.listing-head { align-items: start; display: grid; gap: 10px; grid-template-columns: 30px 1fr auto; }
.rank { align-items: center; background: var(--ink); border-radius: 5px; color: white; display: inline-flex; font-size: 0.72rem; font-weight: 800; height: 28px; justify-content: center; }
.card-kicker { color: var(--forest); font-size: 0.7rem; font-weight: 800; margin: 0 0 2px; }
.listing-title h3 { font-size: 1rem; line-height: 1.3; margin: 0; }
.score { align-items: baseline; color: var(--forest); display: flex; }
.score strong { font-size: 1.4rem; }
.score span { color: var(--muted); font-size: 0.7rem; }

.falcon-reason {
    background: var(--amber-soft);
    border-radius: 6px;
    color: #5c4816;
    font-size: 0.86rem;
    margin: 14px 0;
    padding: 10px 12px;
}

.cost-line { border-bottom: 1px solid var(--line); display: grid; gap: 10px; grid-template-columns: 1.35fr 1fr; padding-bottom: 13px; }
.cost-line div { display: flex; flex-direction: column; }
.cost-line span { color: var(--muted); font-size: 0.72rem; }
.cost-line strong { font-size: 1.05rem; }
.cost-line div:first-child strong { color: var(--forest); font-size: 1.25rem; }
.cost-line .converted-rent { color: #50615a; font-size: 0.78rem; font-weight: 700; margin-top: 3px; }
.exchange-note { color: #596861; font-size: 0.75rem; margin: -5px 0 13px; }

.facts { display: grid; gap: 0 14px; grid-template-columns: 1fr 1fr; margin: 10px 0; }
.facts div { border-bottom: 1px solid #eef0ed; padding: 8px 0; }
.facts dt { color: var(--muted); font-size: 0.68rem; }
.facts dd { font-size: 0.82rem; font-weight: 700; margin: 2px 0 0; }
.facts dd strong { display: none; }

.listing-access { align-items: center; display: flex; font-size: 0.78rem; justify-content: space-between; padding-top: 4px; }
.listing-access > span { color: var(--muted); }
.locked { color: var(--danger); font-size: 0.7rem; font-weight: 850; }
.detail-link { color: var(--forest); font-weight: 850; }

.price-guidance {
    background: var(--amber-soft);
    border-radius: 6px;
    color: #5c4816;
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 12px 0 4px;
    padding: 10px 12px;
}
.contact-note { color: var(--muted); font-size: 0.75rem; margin: 10px 0 0; }
.verified-contact { color: var(--forest); }
.verified-contact a { color: inherit; font-weight: 800; }
.listing-feedback { border-top: 1px solid #eef0ed; margin-top: 12px; padding-top: 12px; }
.listing-feedback > span { display: block; font-size: 0.8rem; font-weight: 750; margin-bottom: 7px; }
.listing-feedback > div { display: flex; gap: 7px; }
.listing-feedback button,
.search-assistant button { background: white; border: 1px solid #bfd2ca; border-radius: 999px; color: var(--forest); cursor: pointer; font: inherit; font-size: 0.75rem; font-weight: 750; padding: 7px 11px; }
.listing-feedback button.selected { background: var(--forest); color: white; }
.listing-feedback small { color: var(--muted); display: block; margin-top: 7px; }
.search-assistant { background: #edf6f2; border: 1px solid #cee2d9; border-radius: 8px; margin-top: 16px; padding: 16px; }
.search-assistant p { color: var(--muted); font-size: 0.85rem; margin: 4px 0 10px; }
.search-assistant > div { display: flex; flex-wrap: wrap; gap: 8px; }
.source-expansion { background: linear-gradient(135deg, #fffaf0, #f5f9f6); border: 1px solid #e5d8b7; border-radius: 10px; margin-top: 18px; padding: 18px; }
.source-expansion h3 { color: var(--ink); font-size: 1.05rem; margin: 3px 0 6px; }
.source-expansion p:not(.eyebrow) { color: var(--muted); font-size: 0.88rem; margin: 0 0 12px; }
.source-expansion form { margin: 0; }

.premium-cta {
    align-items: center;
    background: var(--ink);
    border-radius: 8px;
    color: white;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    margin-top: 20px;
    padding: 20px;
}

.premium-cta .eyebrow { color: #ffd66c; }
.premium-cta h3 { margin: 0 0 4px; }
.premium-cta p { color: #dce3df; margin: 0; }
.premium-cta small { color: #aebbb5; display: block; margin-top: 7px; }
.premium-cta form { flex: 0 0 auto; }
.unlock-action { background: var(--amber); color: #302405; }
.unlock-action:hover { background: #ffd05b; }

.admin-banner {
    align-items: center;
    background: #fff3cd;
    border: 1px solid #e8c45a;
    border-radius: 14px;
    color: #4a3900;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 12px 16px;
}

.admin-banner span { font-size: 0.92rem; }

.admin-source {
    background: #eef6f1;
    border-left: 4px solid var(--forest);
    border-radius: 8px;
    display: grid;
    gap: 3px;
    margin-top: 12px;
    padding: 10px 12px;
}

.admin-source span, .admin-source small { color: var(--muted); }

.empty-state { align-items: center; background: var(--danger-soft); border-left: 4px solid var(--danger); display: flex; gap: 20px; padding: 22px; }
.empty-state img { border-radius: 8px; height: 74px; object-fit: cover; width: 74px; }
.empty-state h3 { margin: 0 0 5px; }
.empty-state p { margin: 4px 0; }
.falcon-voice { color: var(--danger); font-weight: 700; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 840px) {
    .workspace-intro { align-items: start; grid-template-columns: 1fr; }
    .trust-note { max-width: 560px; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards { grid-template-columns: 1fr; }
    .search-feedback { grid-template-columns: 1fr; }
    .issue-type-options { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .admin-banner { align-items: flex-start; flex-direction: column; gap: 5px; }
    .app-header { min-height: 64px; }
    .brand img { height: 42px; width: 42px; }
    .brand small { font-size: 0.7rem; }
    .pilot-badge { display: none; }
    .container { padding: 24px 14px 48px; }
    .workspace-intro h1 { font-size: 2rem; }
    .search-panel, .results { padding: 17px; }
    .panel-heading, .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .grid { grid-template-columns: 1fr; }
    .search-footer { align-items: stretch; flex-direction: column; }
    .primary-action { width: 100%; }
    .ring-summary { grid-template-columns: 1fr; }
    .ring-summary > div { border-bottom: 1px solid #b8d2c7; border-right: 0; padding-bottom: 10px; }
    .listing-head { grid-template-columns: 30px 1fr; }
    .score { grid-column: 2; }
    .facts { grid-template-columns: 1fr; }
    .premium-cta { align-items: stretch; flex-direction: column; }
    .unlock-action { width: 100%; }
    .empty-state { align-items: flex-start; flex-direction: column; }
}
