:root {
    --bg: #050912;
    --accent: #ff9c27;
    --accent-soft: rgba(255, 156, 39, 0.15);
    --card: rgba(12, 19, 35, 0.9);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #f7f6f1;
    --muted: rgba(247, 246, 241, 0.75);
}
html {
    background: var(--bg);
}
* { box-sizing: border-box; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
body {
    margin: 0;
    font-family: 'Space Grotesk', 'Helvetica Neue', sans-serif;
    background: radial-gradient(circle at top, #1a2242 0%, #050912 55%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.bg-aurora {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 20%, rgba(255, 156, 39, 0.35), transparent 45%),
                radial-gradient(circle at 80% 0%, rgba(74, 167, 255, 0.25), transparent 40%);
    filter: blur(40px);
    opacity: 0.8;
}
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 5vw;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 320px;
    max-width: 520px;
}

.header-menu-button {
    display: none;
    border: none;
    background: radial-gradient(circle, rgba(5, 9, 18, 0.9) 0%, rgba(5, 9, 18, 0.0) 80%);
    color: var(--text);
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.header-menu-button:hover {
    color: var(--text);
}

.header-menu-button:focus-visible {
    outline: 2px solid rgba(255, 156, 39, 0.35);
    outline-offset: 2px;
    color: var(--text);
}

.header-search-input {
    flex: 1 1 auto;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
}

.header-search-input::placeholder {
    color: rgba(247, 246, 241, 0.6);
}

.header-search-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.header-search-button {
    border: none;
    background: radial-gradient(circle, rgba(5, 9, 18, 0.9) 0%, rgba(5, 9, 18, 0.0) 80%);
    color: var(--text);
    border-radius: 0;
    padding: 0;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.header-search-button img {
    width: 22px;
    height: 22px;
    display: block;
}

.header-search-button:hover {
    color: var(--text);
}

.header-search-button:focus-visible {
    outline: 2px solid rgba(255, 156, 39, 0.35);
    outline-offset: 2px;
    color: var(--text);
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 1rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    transition: border-color 200ms ease;
}
.nav-user-link {
    display: inline-block;
    position: relative;
    padding-right: 0.1rem;
}
.nav-badge {
    position: absolute;
    top: -0.45rem;
    right: -0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #ff4d4d;
    color: #1b1101;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(255, 77, 77, 0.35);
}
.site-nav a:hover,
.site-nav a:focus,
.site-nav a[aria-current="page"] {
    border-color: var(--accent);
    color: var(--text);
}
main a:not(.cta) {
    color: rgba(247, 246, 241, 0.92);
    font-weight: 600;
    text-decoration-color: rgba(247, 246, 241, 0.6);
    text-underline-offset: 0.12em;
    text-decoration-thickness: 0.08em;
}
main a:not(.cta):hover,
main a:not(.cta):focus-visible {
    color: #ffffff;
    text-decoration-color: #ffffff;
}
main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2rem 5vw 4rem;
}
.content-shell {
    width: min(1100px, 100%);
    display: grid;
    gap: 1.5rem;
    align-items: flex-start;
}
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: visible;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.grid-3 .label {
    display: block;
    min-height: 2.2rem;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}
.stack > label {
    width: 100%;
}
form.stack { width: 100%; }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.85rem;
}

.tag-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    color: var(--text);
}

.model-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.model-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    color: var(--text);
}

.model-tag-remove {
    border: none;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.model-tag-remove img {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(0.9);
}

.model-tag-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.model-tag-input-row .pill-input {
    flex: 1 1 auto;
}

.model-tag-add {
    padding: 0.5rem 0.75rem;
}

.license-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.license-icon {
    display: inline-flex;
    width: 84px;
    height: 30px;
    color: rgba(247, 246, 241, 0.9);
}

.license-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.license-icon img {
    width: 100%;
    height: 100%;
    display: block;
}

.license-link {
    color: rgba(247, 246, 241, 0.92);
    font-weight: 600;
    text-decoration-color: rgba(247, 246, 241, 0.6);
    text-underline-offset: 0.12em;
    text-decoration-thickness: 0.08em;
}

.cta-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.cta {
    border: none;
    border-radius: 999px;
    padding: 0.9rem 1.7rem;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
}
.cta:visited { text-decoration: none; }
.cta:hover,
.cta:focus-visible { text-decoration: none; }
.cta.primary {
    background: var(--accent);
    color: #1b1101;
    box-shadow: 0 10px 30px rgba(255, 156, 39, 0.35);
}
.cta.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--card-border);
}
.cta.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--card-border);
}
.cta.primary.is-loading {
    color: transparent;
    pointer-events: none;
    gap: 0;
}
.cta.primary.is-loading::after {
    content: "";
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid rgba(27, 17, 1, 0.35);
    border-top-color: #1b1101;
    animation: button-spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center;
}
@keyframes button-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
.cta:hover { transform: translateY(-2px); }

.pill-input {
    padding: 0.85rem 1rem;
    border-radius: 32px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    width: 100%;
}
select.pill-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23f7f6f1' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65rem;
}

.autocomplete-select {
    position: relative;
    width: 100%;
}

.autocomplete-input {
    position: relative;
    width: 100%;
}

.autocomplete-input-field {
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23f7f6f1' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65rem;
}

.autocomplete-popover {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 0.35rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 20;
    max-height: 240px;
    overflow: auto;
}

.autocomplete-select.is-above .autocomplete-popover {
    top: auto;
    bottom: calc(100% + 0.35rem);
}

.autocomplete-option {
    display: flex;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
}

.autocomplete-option:hover,
.autocomplete-option:focus-visible {
    background: var(--accent-soft);
    outline: none;
}

.autocomplete-option[aria-selected="true"] {
    background: var(--accent);
    color: #1b1101;
}

.autocomplete-empty {
    padding: 0.65rem 0.75rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.method-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.method-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
@media (max-width: 720px) { .method-row { grid-template-columns: 1fr; } }

.checkbox-pill { position: relative; display: inline-flex; }
.checkbox-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox-pill-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.checkbox-pill-label::before {
    content: "";
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 0.4rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    transition: border-color 160ms ease, background 160ms ease;
}
.checkbox-pill input:checked + .checkbox-pill-label {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(255, 156, 39, 0.25);
}
.checkbox-pill input:checked + .checkbox-pill-label::before {
    border-color: var(--accent);
    background: var(--accent);
}
.checkbox-pill input:focus-visible + .checkbox-pill-label { outline: 2px solid var(--accent); outline-offset: 3px; }

.notice {
    width: 100%;
    border-radius: 16px;
    padding: 0.9rem 1.2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.notice.success { background: rgba(71, 202, 133, 0.15); color: #5bf0a4; }
.notice.error { background: rgba(255, 91, 91, 0.12); color: #ff9c9c; }

.choice-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: flex-start; width: 100%; }
.choice-card { display: flex; flex-direction: column; gap: 0.5rem; border: 1px solid var(--card-border); border-radius: 20px; padding: 1.2rem; background: rgba(255, 255, 255, 0.02); }
.profile-card { width: 100%; border-radius: 20px; border: 1px solid var(--card-border); padding: 1.5rem; background: rgba(255, 255, 255, 0.02); display: flex; flex-direction: column; gap: 0.5rem; }
.dialog-card { width: 100%; border-radius: 24px; border: 1px solid var(--card-border); padding: 1.5rem; background: rgba(10, 14, 26, 0.85); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35); }
.dialog-options { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; width: 100%; }
.dialog-option {
    flex: 1 1 220px;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 160ms ease, transform 160ms ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.dialog-option:hover,
.dialog-option:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.dialog-option-title { font-weight: 600; }
.dialog-option-hint { color: var(--muted); font-size: 0.9rem; }

.label { display: block; font-size: 0.95rem; color: var(--muted); margin-bottom: 0.35rem; }

.location-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}
.location-panel[hidden] {
    display: none;
}
.location-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.location-panel-values {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.2rem 0 0;
    font-size: 0.95rem;
}
.location-panel-values span {
    display: inline-flex;
}
.location-panel-values [data-location-display-status] {
    color: var(--muted);
}
.location-picker {
    display: block;
    width: 100%;
    align-self: stretch;
}
.location-picker .leaflet-map {
    height: 360px;
    width: 100%;
    margin: 0;
    border: none;
}

.empty-state { border: 1px dashed var(--card-border); border-radius: 16px; padding: 1rem; display: flex; align-items: center; gap: 0.75rem; }
.empty-icon { font-size: 1.5rem; }

.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); }
.modal-content {
    position: relative;
    width: min(720px, 92vw);
    max-height: 90vh;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
    z-index: 31;
    overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.75rem; }

.icon-button {
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    line-height: 0;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, color 160ms ease;
}
.icon-button img { width: 18px; height: 18px; display: block; }
.icon-button img[data-printer-icon] { width: 18px; height: 18px; display: block; }
.icon-button:hover,
.icon-button:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); outline: none; }
.icon-button.danger { border-color: rgba(255, 77, 77, 0.5); background: rgba(255, 77, 77, 0.12); color: #ff6b6b; box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.12); }
.icon-button.danger:hover,
.icon-button.danger:focus-visible { border-color: rgba(255, 77, 77, 0.7); background: rgba(255, 77, 77, 0.18); color: #ff7d7d; }
.icon-button.danger img { /* No filter needed - using red SVG variant */ }

.material-inline-colors { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.material-details { display: flex; flex-direction: column; gap: 0.75rem; }
.material-details[hidden], .material-details.is-collapsed { display: none !important; }
.color-row { display: flex; align-items: center; gap: 0.5rem; }
.color-dot { width: 26px; height: 26px; aspect-ratio: 1 / 1; display: inline-block; flex-shrink: 0; }
.color-dot.small { width: 18px; height: 18px; }
.color-dot img { width: 100%; height: 100%; display: block; }

.color-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; width: 100%; }
@media (max-width: 720px) { .color-options { grid-template-columns: 1fr; } }
.color-options .checkbox-pill { width: 100%; }
.custom-color-row { display: grid; grid-template-columns: 1.5fr 1fr auto; gap: 0.5rem; align-items: center; }
.selected-color-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.color-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.5rem; border: 1px solid var(--card-border); border-radius: 12px; background: rgba(255, 255, 255, 0.02); font-size: 0.95rem; }
.color-chip .remove-btn { border: none; background: none; color: var(--muted); cursor: pointer; padding: 0; line-height: 1; }

.input-locked {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
}

footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-divider {
    width: min(960px, 100%);
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 1.4rem auto 0.9rem;
}

.footer-country-section {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.35rem;
    text-align: center;
    width: min(960px, 100%);
    align-self: center;
}

.footer-country-title {
    font-size: 1.35rem;
    color: var(--muted);
}

.footer-country-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0;
}

.footer-country-link {
    font-weight: 600;
    color: var(--text);
    text-align: center;
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 0.5rem;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: min(960px, 100%);
    margin: 0 auto;
}

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

footer a,
footer a:visited {
    color: var(--muted);
    text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

@media (max-width: 720px) {
    html,
    body {
        overflow-x: hidden;
    }

    header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.6rem;
        padding: 1rem 1rem 0.8rem;
    }
    .logo {
        gap: 0.25rem !important;
    }
    .logo span {
        font-size: 1.45rem;
    }
    .header-search {
        width: 100%;
        min-width: 0;
        max-width: none;
        flex: 1 1 auto;
    }
    .header-search-input {
        min-width: 0;
    }
    .header-menu-button {
        display: inline-flex;
    }
    .header-menu-button img {
        width: 22px;
        height: 22px;
    }
    .site-nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 0.3rem;
        padding-top: 0.3rem;
        border-top: 1px solid var(--card-border);
    }
    header.mobile-menu-open .site-nav {
        display: grid;
        gap: 0.65rem;
    }
    .site-nav a {
        margin: 0;
        padding-bottom: 0;
        border-bottom: 0;
    }
    main {
        padding: 1rem 2px 1.5rem;
    }

    .card {
        padding: 0.9rem 10px;
    }

    .content-shell {
        gap: 1rem;
    }

    .footer-country-link { flex-basis: 100%; max-width: 100%; }
}

/* Ensure native dropdowns and their options are readable on light-themed system menus */
select,
select:focus,
.panel-block select,
.modal select {
    background-color: rgba(12, 19, 35, 0.98) !important;
    color: var(--text) !important;
    border: 1px solid var(--card-border) !important;
    -webkit-text-fill-color: var(--text) !important;
}

select option,
select optgroup {
    background-color: rgba(12, 19, 35, 0.98) !important;
    color: var(--text) !important;
}

/* Some browsers preserve native focus outlines; keep accessible focus state */
select:focus {
    outline: 3px solid rgba(255, 156, 39, 0.12);
    outline-offset: 2px;
}

