.site-wrap:has(> .sc-page) { background: #f9f9f9; }
body[data-theme="dark"] .site-wrap:has(> .sc-page) { background: #111; }

.sc-page {
    --sc-ink: #062653;
    --sc-text: #384659;
    --sc-surface: #fff;
    --sc-line: #d2dfef;
    --sc-tint: #eef5fc;
    --sc-button: #062653;
    --sc-gap: 24px;
    width: min(100%, 1240px);
    margin-inline: auto;
    padding: 28px clamp(16px, 4vw, 42px) 76px;
    color: var(--sc-text);
}
.sc-page:has(> .sc-hero) {
    /* Match the home feed container. */
    width: 100%;
    max-width: 1280px;
    padding-inline: 20px;
}
body[data-theme="dark"] .sc-page {
    --sc-ink: #e3eeff;
    --sc-text: #d6e0ef;
    --sc-surface: #151d28;
    --sc-line: #43536a;
    --sc-tint: #202c3d;
    --sc-button: #18467e;
}
.sc-page :where(h1,h2,h3,legend,a) { color: var(--sc-ink); }
.sc-page h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; margin: 6px 0 12px; overflow-wrap: anywhere; }
.sc-page h2 { font-size: clamp(21px, 2.5vw, 28px); line-height: 1.22; margin-bottom: 12px; }
.sc-page p { margin: 8px 0 12px; }
.sc-page a:focus-visible, .sc-page button:focus-visible, .sc-page summary:focus-visible {
    outline: 3px solid #1681c7;
    outline-offset: 3px;
}
.sc-crumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 27px; font-size: 14px; }
.sc-crumb a:hover, .sc-actions > a:not(.sc-button) { text-decoration: underline; text-underline-offset: .18em; }
.sc-back { gap: 8px; margin-bottom: var(--sc-gap); }
.sc-panel, .sc-card, .sc-hero {
    border: 1px solid var(--sc-line);
    border-radius: 14px;
    background: var(--sc-surface);
    min-width: 0;
}
.sc-hero { padding: clamp(16px, 4vw, 32px); }
.sc-hero p, .sc-intro p { max-width: 64ch; font-size: 17px; line-height: 1.55; }
.sc-panel { padding: clamp(16px, 3vw, 25px); }
.sc-intro, .sc-tabs, .sc-error { margin-bottom: var(--sc-gap); }
.sc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sc-gap); }
.sc-tabs a { border: 1px solid var(--sc-line); background: var(--sc-surface); border-radius: 8px; padding: 8px 14px; }
.sc-tabs a[aria-current] { background: var(--sc-button); border-color: var(--sc-button); color: #fff; }
.sc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.sc-hero-dashboard { margin-inline-start: auto; }
.sc-page .sc-button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 15px;
    border: 1px solid var(--sc-button); border-radius: 8px; background: var(--sc-button); color: #fff;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.sc-page .sc-button:hover { background: #00529e; color: #fff; }
.sc-page .sc-secondary { color: var(--sc-ink); background: var(--sc-surface); border-color: var(--sc-line); }
.sc-results { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: var(--sc-gap); align-items: start; scroll-margin-top: 90px; }
.sc-filters form, .sc-stack, .sc-dashboard { display: grid; gap: 14px; min-width: 0; }
.sc-field { display: grid; gap: 5px; font-size: 14px; font-weight: 700; min-width: 0; }
.sc-page .sc-field :is(input, select, textarea) {
    width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px;
    background: var(--sc-surface); color: var(--sc-text); border: 1px solid var(--sc-line);
    border-radius: 7px; font: inherit; font-weight: 400;
}
.sc-page .sc-field :focus-visible { outline: 2px solid #1681c7; outline-offset: 1px; }
.sc-form { max-width: 900px; }
.sc-form fieldset { border: 0; border-bottom: 1px solid var(--sc-line); padding: 0 0 20px; margin: 0 0 20px; }
.sc-form legend { font-size: 20px; font-weight: 700; padding: 0 0 10px; }
.sc-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.sc-consent { display: flex; gap: 8px; align-items: flex-start; }
.sc-consent input { margin-top: 4px; }
.sc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sc-card > a { display: block; height: 100%; overflow: hidden; border-radius: inherit; }
.sc-card:hover { border-color: #1681c7; }
.sc-card img { width: 100%; height: auto; aspect-ratio: 8/5; object-fit: cover; display: block; }
.sc-card-body { padding: 15px; overflow-wrap: anywhere; }
.sc-card-body h3 { font-size: 18px; margin-bottom: 5px; }
.sc-card-body p { margin: 0 0 5px; font-size: 14px; }
.sc-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--sc-tint); color: var(--sc-ink); font-size: 13px; font-weight: 700; }
.sc-price { display: block; color: var(--sc-ink); font-size: 24px; line-height: 1.2; margin: 10px 0; }
.sc-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(245px, 1fr); gap: var(--sc-gap); align-items: start; }
.sc-gallery-main { display: block; border-radius: 14px; background: var(--sc-tint); overflow: hidden; }
.sc-gallery-main img { display: block; width: 100%; height: auto; aspect-ratio: 16/10; object-fit: contain; }
.sc-thumbs, .sc-photo-editor { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.sc-thumbs a { display: block; border: 2px solid transparent; border-radius: 7px; overflow: hidden; }
.sc-thumbs a[aria-current] { border-color: #1681c7; }
.sc-thumbs img, .sc-photo-editor img { display: block; object-fit: cover; }
.sc-photo-editor label { display: block; }
.sc-photo-drop {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: clamp(16px, 3vw, 24px);
    border: 2px dashed var(--sc-line);
    border-radius: 14px;
    background: var(--sc-surface);
    text-align: center;
}
.sc-photo-drop label { color: var(--sc-ink); font-weight: 700; }
.sc-photo-drop > span, .sc-photo-drop .sc-file-feedback { font-size: 14px; }
.sc-photo-drop.is-dragging { border-color: #1681c7; background: var(--sc-tint); }
.sc-photo-drop input { width: auto; max-width: 100%; min-height: 44px; font: inherit; color: var(--sc-text); }
.sc-photo-drop input:focus-visible { outline: 2px solid #1681c7; outline-offset: 3px; }
.sc-photo-drop input::file-selector-button {
    min-height: 44px;
    margin-inline-end: 10px;
    padding: 8px 15px;
    border: 0;
    border-radius: 8px;
    background: var(--sc-button);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.sc-photo-drop input::file-selector-button:hover { background: #00529e; }
.sc-photo-drop .sc-file-feedback { margin: 0; }
.sc-photo-drop .sc-photo-submit-hint { max-width: 48ch; margin: 0; font-size: 14px; }
.sc-photo-previews { margin-top: 16px; }
.sc-photo-previews h3 { margin-bottom: 8px; font-size: 16px; }
.sc-photo-previews ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sc-photo-previews button {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--sc-line);
    border-radius: 8px;
    background: var(--sc-tint);
    overflow: hidden;
    cursor: zoom-in;
}
.sc-photo-previews img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: contain; }
.sc-photo-lightbox {
    position: fixed;
    inset: 0;
    width: min(92vw, 900px);
    margin: auto;
    padding: clamp(12px, 3vw, 20px);
    border: 1px solid var(--sc-line);
    border-radius: 14px;
    background: var(--sc-surface);
    color: var(--sc-text);
}
.sc-photo-lightbox::backdrop { background: rgb(0 0 0 / 75%); }
.sc-photo-lightbox-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sc-photo-lightbox h3 { margin: 0; font-size: 18px; }
.sc-photo-lightbox img { display: block; max-height: 72vh; margin: auto; object-fit: contain; }
.sc-gallery-main, .sc-thumbs a { cursor: zoom-in; }
.sc-gallery-lightbox:not([open]) { display: none; }
.sc-gallery-lightbox h2 { margin: 0; font-size: 18px; }
.sc-gallery-lightbox img { max-width: 100%; max-height: 62vh; }
.sc-gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.sc-gallery-controls button { min-width: 44px; }
.sc-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0; }
.sc-specs dt { font-size: 13px; }
.sc-specs dd { margin: 0; font-weight: 700; }
.sc-pagination ul { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 20px 0 0; }
.sc-pagination li > * { display: block; border: 1px solid var(--sc-line); border-radius: 7px; padding: 5px 12px; }
.sc-pagination [aria-current] { background: var(--sc-button); color: #fff; }
.sc-error { border: 1px solid #b42424; padding: 10px 15px; border-radius: 8px; }
.sc-file-feedback:empty { display: none; }
.sc-page [hidden] { display: none !important; }
@media (max-width: 1000px) {
    .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .sc-results, .sc-detail { grid-template-columns: 1fr; }
    .sc-page { --sc-gap: 16px; }
}
@media (max-width: 440px) {
    .sc-grid, .sc-form-grid { grid-template-columns: 1fr; }
}

