@font-face {
    font-family: Inter;
    src: url("InterVariable.2bf3d951bf9d.woff2") format('woff2');
    font-weight: 100 900;
    font-display: swap
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px
}

.brand img {
    width: 28px;
    height: 28px
}
.profile-menu { display: inline-flex; align-items: center; gap: 8px; }
.profile-menu > span:last-child { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-placeholder { display: grid; place-items: center; background: #c3dfff; color: #132c48; font-weight: 700; }

:root {
    color-scheme: light;
    --bg: #f3f4f5;
    --panel: #fff;
    --field: #f7f8fa;
    --fg: #202329;
    --muted: #616b78;
    --line: #dce0e6;
    --hover: #e9edf2
}

.product-views { margin: 16px 0; flex-wrap: wrap; }
.product-views [aria-current=page] { background: #c3dfff; color: #132c48; border-color: #7ebcff; font-weight: 700; }
.product-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.product-card { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.product-card:hover, .product-card:focus-visible { border-color: #78aee8; outline: 2px solid #78aee8; text-decoration: none; }
.product-card-image { display: grid; place-items: center; height: 190px; border-radius: 12px; overflow: hidden; background: var(--field); }
.product-card-image img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.product-no-image { display: grid; text-align: center; color: var(--muted); font-size: 42px; }
.product-no-image small { font-size: 12px; }
.product-card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding-top: 14px; }
.product-card-body h2 { font-size: 17px; margin: 6px 0; overflow-wrap: anywhere; }
.product-card-body p, .product-card-body small { color: var(--muted); overflow-wrap: anywhere; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; }
.product-cards.compact { grid-template-columns: 1fr; gap: 10px; }
.compact .product-card { flex-direction: row; align-items: center; gap: 18px; padding: 12px; }
.compact .product-card-image { width: 96px; height: 96px; flex-shrink: 0; }
.compact .product-card-body { padding: 0; }
.compact .product-card-body p { margin: 2px 0; }
.compact .product-card-footer { padding-top: 8px; }

html[data-theme=dark] {
    color-scheme: dark;
    --bg: #15181c;
    --panel: #20252d;
    --field: #191e25;
    --fg: #e7e9ed;
    --muted: #a4acb8;
    --line: #3b424c;
    --hover: #303b49
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 14px/1.5 Inter, system-ui, sans-serif
}

a {
    color: inherit;
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

button,
input,
select,
textarea {
    font: inherit
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--fg);
    border-radius: 6px;
    cursor: pointer;
    min-height: 40px
}

button:hover,
.button:hover {
    background: var(--hover);
    text-decoration: none
}

:focus-visible {
    outline: 2px solid #90aacb;
    outline-offset: 3px
}

.primary {
    background: var(--fg);
    color: var(--panel)
}

.top {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    background: #171717;
    color: #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 5
}

.top nav {
    display: flex;
    gap: 20px;
    flex: 1;
    flex-wrap: wrap
}

.top form {
    margin: 0
}

.brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .04em
}

.brand small {
    font-size: 11px;
    font-weight: 400
}

.top button {
    background: transparent;
    color: #eee
}

main {
    max-width: 1700px;
    margin: auto;
    padding: 28px 32px
}

h1 {
    font-size: 28px;
    line-height: 1.3;
    margin: 0 0 14px
}

h2 {
    font-size: 18px;
    margin: 0 0 14px
}

p {
    margin: 8px 0 16px
}

.heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px
}

.eyebrow,
.muted,
small {
    color: var(--muted)
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px
}

.panel {
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 20px;
    min-width: 0
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.metrics,
.smt-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 16px;
    margin: 20px 0 28px;
}

.smt-settings > div { min-width: 0 }
.smt-settings > div:last-child { grid-column: 1 / -1 }
[data-smt-edit] .actions, [data-smt-actions] { justify-content: flex-end }
[data-bom-import-edit] .actions, [data-bom-import-confirm] { justify-content: flex-end }
[data-bom-import-edit] td input { min-width: 130px }

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px
}

.metrics.cols-1 {
    grid-template-columns: 1fr
}

.metrics.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.metrics.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr))
}

.metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.metric strong {
    font-size: 40px
}

.metric:hover {
    background: var(--hover);
    text-decoration: none
}

table {
    width: 100%;
    border-collapse: collapse
}

th {
    text-align: left;
    color: var(--muted);
    font-weight: 500
}

td,
th {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel)
}

tr:hover td {
    background: var(--hover)
}

.table-scroll {
    overflow-x: auto
}

td small {
    display: block
}

.empty {
    padding: 44px !important;
    text-align: center;
    color: var(--muted)
}

.search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px
}

input:not([type=checkbox]):not([type=hidden]),
select,
textarea {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--fg);
    border-radius: 5px;
    padding: 10px
}

input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: #718ba7
}

label {
    display: block;
    margin-bottom: 8px
}

.edit-form {
    max-width: 900px
}

.edit-form p {
    margin-bottom: 20px
}

.edit-form label {
    color: var(--muted)
}

.status {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 5px;
    background: var(--hover);
    white-space: nowrap
}

.status.released {
    background: #213c31;
    color: #a1d7b8
}

.status.confirmed {
    background: #453b23;
    color: #e6cd8e
}

.status.withdrawn {
    background: #472d32;
    color: #e5adb5
}

.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 20px
}

.identity {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 24px
}

.hero {
    height: 230px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--field);
    border: 1px solid var(--line)
}

.hero img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain
}

.hero[data-preview] {
    cursor: zoom-in
}

dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px
}

dt {
    color: var(--muted)
}

dd {
    margin: 0
}

.journal article {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere
}

.pagination {
    display: flex;
    gap: 24px;
    justify-content: flex-end
}

.editor-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0
}

.editor-row label {
    flex: 1
}

.notice {
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 6px
}

.login {
    max-width: 440px;
    margin: 8vh auto
}

.supplier-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: #005b96;
    color: white;
    border-radius: 8px;
    font-weight: 800;
    margin-bottom: 18px
}

.supplier-icon.digikey {
    background: #b51e28
}
.supplier-setting { display: inline-flex; align-items: center; gap: 12px; }
.supplier-setting .supplier-icon { width: 36px; height: 36px; margin: 0; font-size: 12px; flex-shrink: 0; }

.supplier-icon.tme {
    background: #174983
}

dialog#image-preview {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    border: 0;
    background: #15181c;
    padding: 60px 20px 20px
}

dialog#image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.close {
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 25px
}

dialog::backdrop {
    background: #000b
}

[hidden] {
    display: none !important
}

@media(max-width:800px) {
    main {
        padding: 20px 14px
    }

    .top {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 10px
    }

    .top nav {
        order: 3;
        width: 100%;
        flex-basis: 100%;
        font-size: 12px;
        gap: 14px
    }

    .metrics,
    .metrics.cols-2,
    .metrics.cols-4,
    .product-grid {
        grid-template-columns: 1fr
    }

    .product-layout,
    .identity {
        grid-template-columns: 1fr
    }

    .panel {
        padding: 18px
    }

    .heading {
        align-items: flex-start;
        flex-wrap: wrap
    }

    .hero {
        height: 250px
    }

    h1 {
        font-size: 23px
    }

    td,
    th {
        white-space: nowrap
    }

    dl {
        grid-template-columns: 110px 1fr
    }
}

.orbit-stage {
    display: grid;
    place-items: center;
    height: calc(100vh - 250px);
    min-height: 220px;
    background: #15181c;
    color: #e7e9ed
}

.orbit-frame {
    cursor: grab;
    touch-action: none;
    user-select: none;
    filter: contrast(var(--orbit-contrast, 1.35));
    height: 100%;
    aspect-ratio: 1;
    max-width: 100%;
    background-size: 400% 400%;
    background-repeat: no-repeat
}
.orbit-frame.dragging { cursor: grabbing; }

.orbit-stage:fullscreen {
    height: 100vh
}

.orbit-controls {
    justify-content: center
}

.panel:has(>table) {
    overflow-x: auto
}

h1,
h2,
dd {
    overflow-wrap: anywhere
}

.orbit-viewer:fullscreen {
    background: #15181c;
    padding: 16px;
    display: flex;
    flex-direction: column
}

.orbit-viewer:fullscreen .orbit-stage {
    height: auto;
    flex: 1;
    min-height: 0
}

.orbit-viewer:fullscreen .orbit-controls {
    margin: 12px 0 0;
    flex-shrink: 0
}

.errorlist {
    color: #df737e
}

@media(max-width:600px) {
    .accounts-table,
    .accounts-table tbody {
        display: block;
        min-width: 0;
        width: 100%
    }
    .accounts-table thead { display: none }
    .accounts-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 12px 0;
        border-bottom: 1px solid var(--line)
    }
    .accounts-table td {
        padding: 4px 0;
        border: 0;
        white-space: normal;
        overflow-wrap: anywhere
    }
    .accounts-table td:first-child,
    .accounts-table td:last-child { grid-column: 1 / -1 }
}

@media(min-width:801px) {
    .journal {
        align-self: start;
        max-height: calc(100vh - 130px);
        overflow: auto;
        position: sticky;
        top: 100px
    }
}
