/* Aqarman public valuation page. Palette built from the logo blue (#29a9e1) and a deep navy ink. */
:root {
    --ink: #0f2540;
    --ink-2: #3b4f68;
    --muted: #6a7b90;
    --brand: #1f9fd9;
    --brand-deep: #0b6fa4;
    --paper: #f3f7fb;
    --surface: #ffffff;
    --line: #dbe4ee;
    --line-soft: #e9eff5;
    --danger: #b42318;
    --up: #0b7a55;
    --down: #b25e09;

    /* Five-step navy scale for the map, light to dark; grey for too few listings. */
    --s1: #b9d4ee;
    --s2: #7eaedb;
    --s3: #4a82bf;
    --s4: #24579a;
    --s5: #0e2e63;
    --thin: #aab4bf;

    --radius-lg: 18px;
    --radius: 10px;
    --gutter: clamp(16px, 4vw, 32px);
    color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Cairo", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

h1, h2, h3 { margin: 0; line-height: 1.3; }

a { color: var(--brand-deep); }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

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

.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Masthead */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }

.masthead__row { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-block: 10px; }

.brand img { display: block; height: 30px; width: auto; }

.masthead__title { display: flex; flex-direction: column; line-height: 1.25; padding-inline-start: 16px; border-inline-start: 1px solid var(--line); }

.masthead__title strong { font-size: 17px; font-weight: 800; }

.masthead__title span { font-size: 14px; color: var(--muted); }

.masthead__nav { margin-inline-start: auto; display: flex; gap: 4px; }

.masthead__nav a {
    padding: 4px 12px;
    border-radius: 999px;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.masthead__nav a:hover { background: var(--paper); }

.masthead__nav a[aria-current="page"] { background: #e4f4fc; color: var(--brand-deep); }

.beta {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-deep);
    background: #e4f4fc;
    border: 1px solid #bfe3f5;
    border-radius: 999px;
    padding: 4px 12px;
}

/* Valuation: form on the right (start), estimate on the left (end) in RTL */
.valuation {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 24px;
    margin-block: 28px 8px;
    align-items: start;
}

.unit, .estimate {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.unit { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }

.unit h1 { grid-column: 1 / -1; font-size: 20px; font-weight: 800; }

.unit__lead { grid-column: 1 / -1; margin: -8px 0 4px; font-size: 14px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

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

.field > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }

.field small { font-weight: 400; color: var(--muted); font-size: 12px; }

.field input, .field select, .field textarea {
    width: 100%;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 12px;
    min-height: 44px;
}

.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: 3px solid #bfe3f5; outline-offset: 0; }

.field select:disabled { background: var(--paper); color: var(--ink-2); }

.field [aria-invalid="true"] { border-color: var(--danger); }

.field__error { font-style: normal; font-size: 13px; color: var(--danger); }

.field__note { font-style: normal; font-size: 13px; color: var(--brand); }

.unit__submit {
    grid-column: 1 / -1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    margin-top: 6px;
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    background: var(--ink);
    border: 0;
    border-radius: var(--radius);
    padding: 10px 20px;
    cursor: pointer;
}

.unit__submit:hover { background: var(--brand-deep); }

/* Estimate card */
.estimate h2 { font-size: 15px; font-weight: 700; color: var(--muted); }

.estimate h3 { font-size: 15px; font-weight: 800; margin-top: 22px; }

.estimate__mid { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: var(--ink-2); }

.estimate__mid span {
    font-size: clamp(38px, 6vw, 56px);
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.estimate__caption { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.estimate__intro { max-width: 52ch; color: var(--ink-2); }

/* The market strip: every comparable as a tick across the 20-80 band */
.strip__track {
    position: relative;
    height: 44px;
    border-radius: var(--radius);
    background: repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px 10%), var(--paper);
    border: 1px solid var(--line);
}

.strip__band {
    position: absolute;
    inset-block: 6px;
    background: linear-gradient(0deg, #cfeaf8, #e2f3fb);
    border: 1px solid #8fd0ef;
    border-radius: 6px;
}

.strip__tick {
    position: absolute;
    inset-block: 12px;
    width: 2px;
    margin-inline-start: -1px;
    background: var(--ink-2);
    opacity: .55;
    border-radius: 2px;
}

.strip__mid {
    position: absolute;
    inset-block: -6px;
    width: 4px;
    margin-inline-start: -2px;
    background: var(--brand);
    border-radius: 4px;
    box-shadow: 0 0 0 3px var(--surface);
}

.strip__note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

.range { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }

.range div { border-inline-start: 3px solid var(--line); padding-inline-start: 10px; }

.range .range__mid { border-color: var(--brand); }

.range dt { font-size: 13px; color: var(--muted); }

.range dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }

.confidence { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; font-size: 14px; font-weight: 700; }

.confidence__meter { display: inline-flex; gap: 4px; }

.confidence__meter i { width: 18px; height: 10px; border-radius: 3px; background: var(--line); }

.confidence__meter i.on { background: var(--ink); }

.confidence__count { color: var(--muted); font-weight: 600; }

.note { margin: 8px 0 0; font-size: 13px; color: var(--down); }

.factors { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.factors li { font-size: 14px; font-weight: 600; border-radius: 999px; padding: 3px 12px; background: var(--paper); border: 1px solid var(--line); }

.factors li.up { color: var(--up); border-color: #b5dfcd; background: #eef8f3; }

.factors li.up::before { content: "▲ "; font-size: 10px; }

.factors li.down { color: var(--down); border-color: #f0d2ae; background: #fdf5eb; }

.factors li.down::before { content: "▼ "; font-size: 10px; }

.explain { margin-top: 20px; padding: 14px 16px; background: var(--paper); border-radius: var(--radius); border-inline-start: 3px solid var(--brand); }

.explain h3 { margin-top: 0; }

.explain p { margin: 6px 0 0; max-width: 70ch; }

.provenance { margin: 20px 0 0; font-size: 13px; color: var(--muted); }

.disclaimer { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }

.refusal { margin: 10px 0 6px; font-size: 18px; font-weight: 700; color: var(--danger); }

.overview { display: flex; gap: 28px; flex-wrap: wrap; margin: 18px 0 14px; }

.overview dt { font-size: 13px; color: var(--muted); }

.overview dd { margin: 0; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Sections below the fold */
.block { margin-block: 36px; }

.block h2 { font-size: 22px; font-weight: 800; }

.block__lead { margin: 4px 0 14px; color: var(--muted); max-width: 75ch; }

.scroller { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }

.table th { text-align: start; font-weight: 700; color: var(--muted); font-size: 13px; background: var(--paper); padding: 10px 14px; white-space: nowrap; }

.table td { padding: 10px 14px; border-top: 1px solid var(--line-soft); vertical-align: top; white-space: nowrap; }

.table tr.thin td { color: var(--muted); }
.table td small { display: block; font-size: 12px; }

.source { white-space: nowrap; }

.source a { font-weight: 700; text-decoration: none; }

.source a:hover { text-decoration: underline; }

.source time { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Map */
.mapgrid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }

.map { height: 440px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: #e8eef4; z-index: 0; }

/* Quiet the base map so the navy zone circles carry the colour. */
.map .leaflet-tile-pane { filter: grayscale(1) contrast(.85) brightness(1.06); }

.zones { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; }

.legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.legend i { width: 24px; height: 10px; border-radius: 2px; background: var(--c); }

.legend span:first-child { margin-inline-end: 4px; }

.legend span:last-child { margin-inline-start: 4px; }

.zones__list { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; }

.zones__list li { display: grid; grid-template-columns: 1fr auto; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }

.zones__name { font-weight: 700; }

.zones__value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }

.zones__count { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

.zones__list li.thin .zones__value { color: var(--muted); font-weight: 600; font-size: 13px; }

.tip { font-family: "Cairo", sans-serif; direction: rtl; text-align: right; }

.tip strong { display: block; }

.breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 48px; }

.footer__row { display: flex; justify-content: space-between; gap: 24px; padding-block: 22px; font-size: 13px; color: var(--muted); }

.footer__row p { margin: 0; max-width: 70ch; }

.footer__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.footer__nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }

.footer__nav a { color: var(--ink-2); font-weight: 600; text-decoration: none; }

.footer__nav a:hover, .footer__nav a[aria-current="page"] { text-decoration: underline; }

.footer__by { font-weight: 700; color: var(--ink-2); white-space: nowrap; }

.halt { padding-block: 80px; max-width: 560px; }

.halt h1 { font-size: 26px; font-weight: 800; }

/* Tablet and phone */
@media (max-width: 900px) {
    .valuation { grid-template-columns: 1fr; }
    .mapgrid { grid-template-columns: 1fr; }
    .map { height: 360px; }
    .zones__list { max-height: none; }
    .breakdown { grid-template-columns: 1fr; }
}

/* API docs */
.docs { padding-block: 32px 0; }

.docs__intro h1 { font-size: 30px; font-weight: 800; }

.docs__card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-block: 20px;
}

.docs__card h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }

.docs__card > p { margin: 8px 0 0; }

.docs__card .scroller { border-radius: var(--radius); margin-block: 8px 12px; }

.docs__card code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; background: var(--paper); border-radius: 6px; padding: 1px 6px; }

.docs__card ul, .docs__steps { margin: 8px 0 0; padding-inline-start: 22px; display: grid; gap: 6px; max-width: 80ch; }

.docs__card > p { max-width: 80ch; }

.docs__updated { color: var(--muted); font-size: 14px; }

.contact { display: grid; gap: 10px; margin: 8px 0 0; }

.contact div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }

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

.contact dd { margin: 0; font-weight: 700; }

.docs__head--spaced { margin-top: 16px; }

.alert { color: var(--danger); font-weight: 700; }

/* Subscribe form: the valuation form card, on its own */
.subscribe { max-width: 560px; margin-block: 20px; }

.field textarea { resize: vertical; }

.check { display: flex; align-items: flex-start; gap: 10px; grid-column: 1 / -1; font-size: 14px; }

.check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--ink); }

.subscribe__trap { position: absolute; inset-inline-start: -9999px; }

.table--wrap td { white-space: normal; }

.docs__endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 !important; }

.docs__endpoint code { font-size: 15px; word-break: break-all; }

.verb { background: var(--ink); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .06em; border-radius: 6px; padding: 2px 8px; }

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

.copy {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-deep);
    background: #e4f4fc;
    border: 1px solid #bfe3f5;
    border-radius: 999px;
    padding: 3px 16px;
    cursor: pointer;
}

.copy:hover { background: #d3edfa; }

.code {
    margin: 10px 0 0;
    padding: 16px 18px;
    background: var(--ink);
    color: #e6eef8;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
}

.docs__card .code code { background: none; padding: 0; font-size: inherit; color: inherit; }

.docs__legend { display: grid; gap: 8px; margin: 16px 0 0; }

.docs__legend div { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 12px; }

.docs__legend dt, .docs__legend dd { margin: 0; }

@media (max-width: 560px) {
    .docs__card { padding: 16px; }
    .docs__legend div { grid-template-columns: 1fr; gap: 0; }
    .masthead__nav { margin-inline-start: 0; }

    .masthead__row { gap: 10px; }
    .masthead__title { padding-inline-start: 10px; }
    .beta { margin-inline-start: 0; width: 100%; text-align: center; }
    .unit, .estimate { padding: 18px; }
    .range { grid-template-columns: 1fr; }
    .range div { display: flex; justify-content: space-between; align-items: baseline; }
    .footer__row { flex-direction: column; gap: 12px; }
    .footer__side { align-items: flex-start; }
    .contact div { grid-template-columns: 1fr; gap: 0; }
}

/* Factors around a pinned unit */
.unit__pin { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); }

.map { cursor: crosshair; }

.around { margin-top: 16px; }

.around h3 { font-size: 17px; font-weight: 800; }

.around__lead { margin: 4px 0 12px; font-size: 14px; color: var(--ink-2); }

.around__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

.around__item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); border-inline-start: 4px solid var(--brand); }

.around__item--stated { border-inline-start-color: var(--muted); }

.around__item strong { font-size: 15px; }

.around__basis { font-size: 13px; color: var(--ink-2); }

.around__effect { font-size: 13px; color: var(--muted); }

.around__note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

.typeswitch { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }

.typeswitch a { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }

.typeswitch a.is-current { background: var(--brand-deep); border-color: var(--brand-deep); color: #ffffff; }

.report-button { margin-top: 14px; padding: 10px 18px; border: 1px solid var(--brand-deep); border-radius: var(--radius); background: var(--surface); color: var(--brand-deep); font: inherit; font-weight: 700; cursor: pointer; }

.report-button:hover { background: var(--brand-deep); color: #ffffff; }

/* Market tiles above the form, and the chart cards */
.icon { flex: none; width: 20px; height: 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-block: 24px 0; }

.kpi { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: inherit; text-decoration: none; }

.kpi .icon { grid-row: 1 / span 3; width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand-deep); }

.kpi__label { font-size: 13px; color: var(--muted); }

.kpi__value { font-size: 26px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }

.kpi__value small { font-size: 14px; font-weight: 600; color: var(--muted); }

.kpi__value--date { font-size: 20px; text-align: end; }

.kpi__value--none { font-size: 16px; color: var(--muted); }

.kpi__hint { font-size: 12px; color: var(--muted); }

.kpi--link:hover { border-color: var(--brand); }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

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

.chart { margin: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }

.chart figcaption { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; margin-bottom: 12px; }

.chart figcaption .icon { color: var(--brand-deep); }

.chart figcaption strong { font-size: 16px; font-weight: 800; }

.chart figcaption span { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

.chart__plot { position: relative; }

.chart__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }

.chart__legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }

.chart__legend i:not(:first-child) { margin-inline-start: 12px; }

/* Inside the estimate panel the card needs no second frame. */
.estimate .chart { margin-top: 18px; padding: 0; border: 0; }

@media (max-width: 900px) {
    .charts { grid-template-columns: 1fr; }
}

/* Phone: tiles two to a row so the form stays near the top. */
@media (max-width: 560px) {
    .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi { padding: 12px; column-gap: 8px; }
    .kpi .icon { width: 32px; height: 32px; padding: 7px; border-radius: 10px; align-self: start; }
    .kpi__value { font-size: 20px; }
    .kpi__value--date { font-size: 16px; }
}

/* Under each comparable: where it is and why it was chosen. */
.table tr.why td { padding-top: 0; border-top: 0; font-size: 13px; color: var(--ink-2); text-align: start; white-space: normal; }
