:root {
    --bg: #050b14;
    --bg-soft: #091321;
    --panel: #0b1726;
    --panel-2: #0e1d2f;
    --card: rgba(11, 23, 38, .94);
    --text: #e8f2ff;
    --muted: #89a1ba;
    --line: #1d344c;
    --line-bright: #245a78;
    --cyan: #22d3ee;
    --cyan-2: #67e8f9;
    --blue: #2563eb;
    --green: #36d399;
    --red: #fb7185;
    --amber: #fbbf24;
    --shadow: 0 20px 60px rgba(0, 0, 0, .34);
    --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    line-height: 1.55;
    background:
        linear-gradient(rgba(34, 211, 238, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, .025) 1px, transparent 1px),
        radial-gradient(circle at 12% 0%, rgba(37, 99, 235, .18), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(34, 211, 238, .10), transparent 28%),
        var(--bg);
    background-size: 32px 32px, 32px 32px, auto, auto, auto;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(255,255,255,.012) 50%, rgba(0,0,0,.014) 50%);
    background-size: 100% 4px;
    z-index: 100;
    opacity: .35;
}

a { color: var(--cyan-2); text-decoration: none; }
a:hover { color: #fff; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.container { width: min(1180px, calc(100% - 28px)); margin: 0 auto; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    color: #fff;
    border-bottom: 1px solid rgba(34, 211, 238, .22);
    background: rgba(5, 11, 20, .88);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
}
.topbar-inner {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-family: var(--mono);
    font-weight: 900;
    letter-spacing: .06em;
    font-size: 15px;
    text-transform: uppercase;
}
.brand span:last-child { color: var(--cyan); }
.brand-mark { color: var(--green) !important; text-shadow: 0 0 14px rgba(54, 211, 153, .65); }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav a {
    color: #a9bed1;
    font-family: var(--mono);
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
}
.nav a:hover { color: #fff; border-color: var(--line); background: rgba(34, 211, 238, .06); }

.hero { padding: 68px 0 24px; text-align: center; }
.tech-hero { max-width: 900px; margin: 0 auto; }
.hero-kicker, .eyebrow, .section-code, .stat-code, .record-code, .detail-label, .terminal-line, .search-prompt {
    font-family: var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.hero-kicker, .eyebrow { color: var(--cyan); font-size: 12px; font-weight: 800; }
.hero h1 {
    margin: 14px 0 16px;
    font-size: clamp(34px, 7vw, 70px);
    line-height: 1.02;
    letter-spacing: -.045em;
}
.hero h1 span {
    color: transparent;
    background: linear-gradient(90deg, var(--cyan), #60a5fa 65%, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
}
.hero p { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: clamp(15px, 2.5vw, 18px); }

.card, .console-panel {
    background: linear-gradient(145deg, rgba(14, 29, 47, .96), rgba(7, 17, 29, .96));
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.card { padding: 22px; }
.terminal-card { position: relative; overflow: hidden; }
.terminal-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(var(--cyan), var(--blue), transparent);
}
.lookup-card { max-width: 760px; margin: 26px auto; }
.terminal-line { color: var(--green); font-size: 12px; margin-bottom: 18px; }
.terminal-line span { color: var(--cyan-2); }
.lookup-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label { display: block; font-weight: 750; margin-bottom: 7px; font-size: 13px; color: #c7d8e8; }
.required::after { content: " *"; color: var(--red); }
input, textarea, select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #284159;
    border-radius: 10px;
    background: rgba(3, 10, 18, .82);
    padding: 11px 13px;
    color: #fff;
    outline: none;
    caret-color: var(--cyan);
}
input::placeholder, textarea::placeholder { color: #587089; }
textarea { min-height: 112px; resize: vertical; }
input:focus, textarea:focus, select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .11), 0 0 24px rgba(34, 211, 238, .07);
}
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--red); }
.help { color: var(--muted); font-size: 12px; margin-top: 6px; }
.field-gap { height: 16px; }

.btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    color: #021015;
    background: linear-gradient(135deg, var(--cyan), #38bdf8);
    box-shadow: 0 8px 24px rgba(34, 211, 238, .18);
}
.btn-primary:hover { color: #001018; box-shadow: 0 10px 32px rgba(34, 211, 238, .32); }
.btn-secondary { color: var(--cyan-2); background: rgba(34, 211, 238, .07); border-color: #24556b; }
.btn-secondary:hover { background: rgba(34, 211, 238, .13); }
.btn-danger { color: #fecdd3; background: rgba(251, 113, 133, .09); border-color: rgba(251, 113, 133, .34); }
.btn-ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 7px 10px; font-size: 11px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline; }
.sticky-actions { position: sticky; bottom: 12px; padding: 14px; margin: 0 -4px -4px; background: rgba(5, 11, 20, .88); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 12px; z-index: 20; }

.alert { border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-weight: 650; border: 1px solid; }
.alert-success { background: rgba(54, 211, 153, .09); color: #9ff6d4; border-color: rgba(54, 211, 153, .35); }
.alert-danger { background: rgba(251, 113, 133, .09); color: #fecdd3; border-color: rgba(251, 113, 133, .35); }
.alert-info { background: rgba(34, 211, 238, .08); color: #b9f4ff; border-color: rgba(34, 211, 238, .3); }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 34px 0 20px; }
.page-head h1 { margin: 4px 0 4px; font-size: clamp(28px, 5vw, 42px); letter-spacing: -.03em; }
.dashboard-head { padding-top: 10px; }
.small { font-size: 12px; color: var(--muted); }
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(54, 211, 153, .9);
    margin-right: 6px;
}

.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
    min-height: 132px;
    padding: 17px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(13, 29, 47, .95), rgba(7, 16, 28, .95));
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    right: -50px;
    bottom: -50px;
    background: rgba(34, 211, 238, .07);
}
.stat strong { display: block; margin: 9px 0 3px; font-size: 34px; line-height: 1; color: #fff; }
.stat > span:last-child { color: var(--muted); font-size: 12px; }
.stat-code { color: var(--cyan); font-size: 10px; }

.console-panel { padding: 16px; margin-bottom: 28px; }
.searchbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.searchbar input { flex: 1; }
.search-prompt { color: var(--green); font-size: 11px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(4, 11, 19, .72); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 13px; border-bottom: 1px solid rgba(29, 52, 76, .75); text-align: left; vertical-align: middle; }
th { color: #8ba6bc; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; background: #091522; }
tbody tr:hover { background: rgba(34, 211, 238, .025); }
tr:last-child td { border-bottom: 0; }
.device-cell { display: flex; align-items: center; gap: 11px; min-width: 250px; }
.table-thumb {
    position: relative;
    flex: 0 0 58px;
    width: 58px;
    height: 46px;
    border: 1px solid var(--line-bright);
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    background: #07111c;
    color: var(--cyan);
}
.table-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.table-thumb span { position: absolute; right: 2px; bottom: 2px; padding: 1px 5px; border-radius: 999px; background: rgba(0,0,0,.78); color: #fff; font-size: 9px; }
.placeholder-thumb { display: grid; place-items: center; font-size: 25px; }
.record-code { color: var(--cyan); font-size: 10px; margin: 2px 0; }
.date-chip { font-family: var(--mono); font-size: 12px; color: #d5e8f7; }
.empty-state { text-align: center; color: var(--muted); padding: 30px; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-family: var(--mono); font-size: 10px; font-weight: 900; white-space: nowrap; border: 1px solid; }
.badge-active { background: rgba(54, 211, 153, .08); color: #84efc1; border-color: rgba(54, 211, 153, .32); }
.badge-expired { background: rgba(251, 113, 133, .08); color: #fda4af; border-color: rgba(251, 113, 133, .32); }
.badge-unknown { background: rgba(251, 191, 36, .08); color: #fcd34d; border-color: rgba(251, 191, 36, .32); }
.badge-neutral { background: rgba(137, 161, 186, .08); color: #a9bed1; border-color: rgba(137, 161, 186, .3); }

.form-section { margin-bottom: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h2 { margin: 3px 0 16px; font-size: 20px; }
.section-code { color: var(--cyan); font-size: 10px; }

.upload-zone { position: relative; }
.file-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.upload-label {
    min-height: 145px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border: 1px dashed #2b667e;
    border-radius: 14px;
    background: rgba(34, 211, 238, .025);
    cursor: pointer;
    text-align: center;
    transition: background .15s ease, border-color .15s ease;
}
.upload-label:hover { background: rgba(34, 211, 238, .06); border-color: var(--cyan); }
.upload-label span:last-child { color: var(--muted); font-size: 12px; font-weight: 500; }
.upload-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--cyan); border: 1px solid #2f667c; font-size: 25px; }
.image-preview-grid, .image-manage-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.preview-card, .image-manage-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #07111c; }
.preview-card img, .image-manage-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.preview-card span { display: block; padding: 7px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-manage-card { cursor: pointer; }
.image-manage-card > span { display: flex; align-items: center; gap: 7px; padding: 8px; margin: 0; font-size: 11px; color: #fecdd3; }
.image-manage-card b { position: absolute; top: 6px; left: 6px; padding: 3px 6px; background: rgba(5,11,20,.82); color: var(--cyan); border-radius: 5px; font-family: var(--mono); font-size: 8px; }
.existing-images-title { margin-top: 18px; font-family: var(--mono); color: var(--muted); font-size: 11px; }

.result-head { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin: 42px 0 14px; }
.result-head h2 { margin: 4px 0 0; font-size: clamp(24px, 4vw, 36px); }
.verified-chip { font-family: var(--mono); color: var(--green); font-size: 11px; border: 1px solid rgba(54,211,153,.3); border-radius: 999px; padding: 7px 10px; }
.machine-card { margin-bottom: 18px; padding: 0; overflow: hidden; }
.device-record { display: grid; grid-template-columns: minmax(280px, 38%) 1fr; }
.device-gallery { min-width: 0; background: #030914; border-right: 1px solid var(--line); padding: 12px; }
.gallery-main { width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 10px; overflow: hidden; position: relative; background: #07111c; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-main span { position: absolute; left: 8px; bottom: 8px; padding: 5px 7px; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; font-family: var(--mono); font-size: 8px; }
.gallery-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 7px; }
.gallery-strip button { border: 1px solid var(--line); border-radius: 6px; padding: 0; overflow: hidden; background: #07111c; aspect-ratio: 1; }
.gallery-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.device-record-body { padding: 22px; min-width: 0; }
.machine-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.machine-name { margin: 2px 0 5px; font-size: clamp(21px, 4vw, 30px); line-height: 1.15; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.meta-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px; background: rgba(4, 11, 19, .62); }
.meta-label { color: var(--muted); font-family: var(--mono); font-size: 9px; display: block; }
.meta-value { display: block; margin-top: 3px; font-family: var(--mono); font-weight: 800; overflow-wrap: anywhere; }
.description { margin-top: 14px; color: #bdd0e0; white-space: normal; overflow-wrap: anywhere; }
.detail-label { display: block; color: var(--cyan); font-size: 9px; margin-bottom: 4px; }
.empty-result { text-align: center; }
.empty-icon { font-family: var(--mono); font-size: 46px; color: var(--red); }

.lightbox[hidden] { display: none; }
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 4, 10, .94);
    backdrop-filter: blur(12px);
}
.lightbox img { max-width: min(1200px, 96vw); max-height: 90vh; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox-close { position: fixed; top: 14px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-bright); background: #07111c; color: #fff; font-size: 28px; }

.login-shell { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 30px 0; }
.login-card { width: min(440px, calc(100% - 24px)); }
.footer { padding: 32px 0 36px; color: #668097; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: .05em; }
.hidden { display: none !important; }

@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .device-record { grid-template-columns: 1fr; }
    .device-gallery { border-right: 0; border-bottom: 1px solid var(--line); }
    .image-preview-grid, .image-manage-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 720px) {
    .container { width: min(100% - 18px, 1180px); }
    .topbar-inner { min-height: 58px; align-items: flex-start; padding: 11px 0; }
    .brand { font-size: 12px; padding-top: 6px; }
    .nav { justify-content: flex-end; gap: 2px; }
    .nav a { font-size: 9px; padding: 6px; }
    .hero { padding-top: 44px; }
    .hero h1 { font-size: clamp(34px, 12vw, 54px); }
    .card { padding: 16px; border-radius: 14px; }
    .lookup-row { grid-template-columns: 1fr; }
    .lookup-row .btn { width: 100%; }
    .grid-2, .grid-3, .meta { grid-template-columns: 1fr; }
    .page-head, .result-head, .machine-head { align-items: stretch; flex-direction: column; }
    .page-head .btn { width: 100%; }
    .machine-head .badge { align-self: flex-start; }
    .searchbar { flex-direction: column; align-items: stretch; }
    .search-prompt { display: none; }
    .searchbar .btn { width: 100%; }
    .image-preview-grid, .image-manage-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .gallery-strip { grid-template-columns: repeat(5, minmax(0,1fr)); }
    .device-record-body { padding: 17px; }
    .mobile-cards table, .mobile-cards thead, .mobile-cards tbody, .mobile-cards th, .mobile-cards td, .mobile-cards tr { display: block; }
    .mobile-cards table { min-width: 0; }
    .mobile-cards thead { display: none; }
    .mobile-cards tr { padding: 14px; border-bottom: 8px solid var(--bg); }
    .mobile-cards td { border: 0; padding: 7px 0; }
    .mobile-cards td::before { content: attr(data-label); display: block; color: #68829a; font-family: var(--mono); font-size: 9px; font-weight: 800; margin-bottom: 3px; }
    .device-cell { min-width: 0; }
    .sticky-actions { position: static; }
}

@media (max-width: 420px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .stat { min-height: 112px; padding: 13px; }
    .stat strong { font-size: 28px; }
    .nav a:nth-child(2), .nav a:nth-child(3) { display: none; }
}

/* AJAX IMAGE MANAGER */
.image-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.image-section-head h2 { margin-bottom: 2px; }
.image-counter { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-family: var(--mono); font-size: 11px; background: rgba(3, 10, 18, .6); }
.image-counter strong { color: var(--cyan); font-size: 17px; }
.file-input:disabled + * { opacity: .5; }
.upload-progress { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(3, 10, 18, .68); }
.upload-progress-bar { height: 8px; overflow: hidden; border-radius: 99px; background: #13263a; }
.upload-progress-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .12s linear; box-shadow: 0 0 16px rgba(34, 211, 238, .45); }
.upload-progress-text { margin-top: 7px; color: var(--cyan-2); font-family: var(--mono); font-size: 11px; }
.ajax-message { margin-bottom: 0; }
.ajax-image-card { cursor: default; }
.image-delete-btn { width: 100%; min-height: 36px; border: 0; border-top: 1px solid rgba(251, 113, 133, .24); background: rgba(251, 113, 133, .09); color: #fecdd3; font-family: var(--mono); font-size: 10px; font-weight: 900; }
.image-delete-btn:hover { background: rgba(251, 113, 133, .18); }
.image-delete-btn:disabled { cursor: wait; opacity: .6; }

/* CUSTOMER LOOKUP: ONE BOX, NO ADMIN ENTRY */
.simple-customer-page { display: block; background: radial-gradient(circle at 50% 0%, rgba(34, 211, 238, .11), transparent 32%), var(--bg); }
.customer-simple-shell { width: min(760px, calc(100% - 24px)); margin: 0 auto; padding: clamp(54px, 12vh, 120px) 0 48px; }
.customer-simple-search { text-align: center; }
.customer-shop-name { color: var(--cyan); font-family: var(--mono); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.customer-simple-search h1 { margin: 8px 0 24px; font-size: clamp(34px, 8vw, 56px); line-height: 1.05; letter-spacing: -.04em; }
.single-lookup-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; max-width: 650px; margin: 0 auto; padding: 7px; border: 1px solid var(--line-bright); border-radius: 16px; background: rgba(7, 17, 29, .94); box-shadow: 0 18px 55px rgba(0, 0, 0, .34), 0 0 30px rgba(34, 211, 238, .05); }
.single-lookup-form input { min-height: 54px; border: 0; background: transparent; font-size: 17px; box-shadow: none; }
.single-lookup-form input:focus { box-shadow: none; }
.single-lookup-form button { min-width: 124px; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--cyan), #38bdf8); color: #021015; font-family: var(--mono); font-size: 12px; font-weight: 950; }
.simple-error { margin: 14px auto 0; color: #fecdd3; font-size: 13px; }
.customer-results { margin-top: 34px; }
.customer-result-summary { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-bottom: 12px; color: var(--muted); }
.customer-result-summary strong { color: var(--text); font-size: 18px; }
.customer-result-summary span { font-size: 13px; }
.simple-device-list { display: grid; gap: 10px; }
.simple-device-card { width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 18px; gap: 13px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-align: left; background: linear-gradient(145deg, rgba(14, 29, 47, .96), rgba(7, 17, 29, .96)); box-shadow: 0 12px 30px rgba(0,0,0,.2); transition: transform .15s ease, border-color .15s ease; }
.simple-device-card:hover { transform: translateY(-1px); border-color: var(--line-bright); }
.simple-device-card > img, .simple-device-placeholder { width: 64px; height: 54px; border-radius: 9px; object-fit: cover; background: #07111c; }
.simple-device-placeholder { display: grid; place-items: center; font-size: 28px; }
.simple-device-main { min-width: 0; }
.simple-device-main strong, .simple-device-main small { display: block; }
.simple-device-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.simple-device-main small { margin-top: 3px; color: var(--muted); }
.simple-device-arrow { color: var(--cyan); font-size: 28px; line-height: 1; }
.simple-empty-result { padding: 28px; border: 1px solid var(--line); border-radius: 14px; text-align: center; background: rgba(7, 17, 29, .9); }
.simple-empty-result strong, .simple-empty-result span { display: block; }
.simple-empty-result span { margin-top: 4px; color: var(--muted); }

.machine-modal[hidden] { display: none !important; }
.machine-modal { position: fixed; inset: 0; z-index: 600; display: grid; place-items: center; padding: 18px; }
.machine-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 4, 10, .82); backdrop-filter: blur(10px); }
.machine-modal-panel { position: relative; width: min(760px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 22px; border: 1px solid var(--line-bright); border-radius: 18px; background: linear-gradient(145deg, #0e1d2f, #07111d); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.machine-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.machine-modal-header h2 { margin: 2px 0 0; font-size: clamp(23px, 5vw, 34px); line-height: 1.1; }
.machine-modal-close { flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #07111c; color: #fff; font-size: 27px; line-height: 1; }
.modal-image-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.modal-image-grid button { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; aspect-ratio: 4 / 3; background: #07111c; }
.modal-image-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-status-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(3, 10, 18, .54); }
.modal-status-line > span:first-child { color: var(--muted); font-size: 13px; }
.modal-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.modal-detail-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(3, 10, 18, .46); }
.modal-detail-grid span, .modal-text-block > span { display: block; color: var(--muted); font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.modal-detail-grid strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.modal-text-block { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(3, 10, 18, .46); }
.modal-text-block p { margin: 6px 0 0; color: #d4e3ef; overflow-wrap: anywhere; }

@media (max-width: 620px) {
    .image-section-head { flex-direction: column; }
    .single-lookup-form { grid-template-columns: 1fr; }
    .single-lookup-form button { min-height: 48px; }
    .simple-device-card { grid-template-columns: 54px minmax(0, 1fr) 18px; }
    .simple-device-card > img, .simple-device-placeholder { width: 54px; height: 48px; }
    .simple-device-card .badge { grid-column: 2 / 3; justify-self: start; margin-top: -6px; }
    .simple-device-arrow { grid-column: 3; grid-row: 1 / span 2; }
    .customer-result-summary { align-items: flex-start; flex-direction: column; gap: 1px; }
    .machine-modal { padding: 0; align-items: end; }
    .machine-modal-panel { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; padding: 17px; }
    .modal-image-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .modal-detail-grid { grid-template-columns: 1fr; }
}
