.network-service { display: grid; gap: 18px; }
.network-toolbar, .network-panel, .network-expired { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.network-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 24px 28px; }
.network-toolbar h2 { margin: 4px 0 7px; font-size: clamp(23px, 3vw, 31px); letter-spacing: -.035em; }
.network-toolbar p, .network-note { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.network-toolbar .field { min-width: 190px; margin: 0; }
.network-toolbar select { width: 100%; }
.network-panel { padding: 24px 28px 28px; }
.network-panel-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 17px; }
.network-panel-head h3 { margin: 5px 0 0; font-size: 20px; }
.network-panel-head > span { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.network-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.network-item { min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); }
.network-item-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.network-kind { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.network-item h3 { margin: 7px 0 0; font-size: 16px; line-height: 1.35; }
.network-item p { margin: 13px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.network-preview { display: grid; width: 100%; margin-top: 14px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-soft); cursor: zoom-in; text-align: left; }
.network-preview img { display: block; width: 100%; height: 180px; object-fit: contain; background: #fff; }
.network-preview span { padding: 8px 11px; font-size: 11px; }
.network-preview:hover, .network-preview:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus-ring); }
.network-lightbox { margin: 0; text-align: center; }
.network-lightbox img { display: block; max-width: 100%; max-height: 70vh; margin: auto; object-fit: contain; background: #fff; }
.network-lightbox figcaption { margin-top: 12px; color: var(--ink-soft); font-size: 13px; }
.network-date { flex-shrink: 0; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.network-date.expired { color: #a34e4e; }
.network-file { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; overflow-wrap: anywhere; }
.network-file a { color: var(--accent); text-decoration: underline; }
.network-expired { padding: 17px 20px; }
.network-expired summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.network-expired .network-grid { margin-top: 16px; }
.network-note { padding: 0 4px 8px; }
.managed-service-list { display: grid; gap: 10px; }
.managed-service-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; }
.managed-service-row strong { display: block; }
.managed-service-row small { display: block; margin-top: 4px; color: var(--ink-soft); }
.managed-service-list { padding: 12px; }
.managed-service-row { padding: 18px; border-radius: 16px; background: #fff; }
.managed-service-row .managed-service-heading strong { display: inline; }
.managed-service-row .service-facts { display: flex; }
.managed-service-row .service-facts b { color: #273a3d; }
.managed-service-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .network-toolbar { display: grid; padding: 20px; }
  .network-toolbar .field { min-width: 0; }
  .network-panel { padding: 20px; }
  .network-item-heading { display: block; }
  .network-date { display: block; margin-top: 8px; }
  .managed-service-row { align-items: stretch; flex-direction: column; }
}
.barcode-service { max-width: 100%; }
.barcode-shortcut { position: sticky; top: 8px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-soft); }
.barcode-shortcut span { font-weight: 700; }
.barcode-shortcut-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@media (max-width: 540px) { .barcode-shortcut { flex-wrap: wrap; } .barcode-shortcut-actions { width: 100%; } .barcode-shortcut-actions .button { flex: 1 1 auto; } }
.barcode-search { display: flex; align-items: end; gap: 12px; margin: 22px 0; }
.barcode-search .field { flex: 1; }
.barcode-search .field small { display: block; margin-top: 5px; color: var(--ink-soft); }
.barcode-quick-search { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 15px; }
.barcode-quick-search button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-alt); color: var(--ink); cursor: pointer; }
.barcode-quick-search button:hover, .barcode-quick-search button:focus-visible { border-color: var(--accent); color: var(--accent); }
.barcode-ocr-feedback { margin: 8px 0 18px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-alt); }
.barcode-ocr-feedback p { margin: 5px 0 12px; color: var(--ink-soft); }
.barcode-ocr-feedback details { margin-top: 7px; }
.barcode-ocr-feedback pre { max-height: 160px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.barcode-match-flags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.barcode-match-flags span { padding: 4px 7px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.barcode-match-flags .matched { background: #e2f5e9; color: #17633d; }
.barcode-match-flags .unmatched { background: #eef0f3; color: #59616b; }
.modal:has(.ean-photo-dialog) { width: min(94vw, 900px); }
.modal:has(.ean-photo-dialog) .modal-head { position: sticky; top: 0; z-index: 2; }
.ean-photo-dialog { padding: 20px 24px 0; }
.ean-photo-intro { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.ean-photo-intro p { max-width: 580px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.ean-photo-intro span { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; background: var(--surface-alt); font-weight: 700; font-size: 12px; }
.ean-photo-add { display: flex; align-items: center; gap: 9px; margin: 16px 0 8px; }
#ean-photo-status { margin: 10px 0 14px; font-size: 12px; }
.ean-photo-list { display: grid; gap: 13px; padding-bottom: 20px; }
.ean-photo-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ean-photo-card-head { display: flex; align-items: center; gap: 14px; }
.ean-photo-thumb { position: relative; width: 88px; height: 88px; flex: 0 0 auto; overflow: hidden; padding: 0; border: 0; border-radius: 12px; background: var(--surface-alt); cursor: zoom-in; }
.ean-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ean-photo-thumb span { position: absolute; right: 0; bottom: 0; left: 0; padding: 4px; background: rgba(10, 20, 28, .72); color: #fff; font-size: 10px; text-align: center; }
.ean-photo-thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ean-photo-full { margin-top: 14px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); }
.ean-photo-full img { display: block; width: 100%; max-height: 62vh; margin: auto; object-fit: contain; }
.ean-photo-card-head > div { flex: 1; min-width: 0; }
.ean-photo-card-head strong, .ean-photo-card-head small, .ean-photo-number { display: block; }
.ean-photo-number { margin-bottom: 4px; color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.ean-photo-card-head strong { font-size: 17px; }
.ean-photo-card-head small { margin-top: 4px; color: var(--ink-soft); }
.ean-photo-card-head > button { align-self: start; }
.ean-photo-message { margin: 12px 0 7px; color: var(--ink-soft); font-size: 13px; }
.ean-photo-options { display: grid; gap: 5px; margin-top: 10px; }
.ean-photo-option { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 52px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); }
.ean-photo-option > div { min-width: 0; }
.ean-photo-option strong, .ean-photo-option small { display: block; overflow-wrap: anywhere; }
.ean-photo-option strong { font-size: 12px; line-height: 1.25; }
.ean-photo-option small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.ean-photo-option button { flex: 0 0 auto; min-height: 36px; padding: 6px 10px; }
.ean-photo-more { margin-top: 10px; }
.ean-photo-manual { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.ean-photo-manual summary { width: fit-content; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.ean-photo-manual form { display: flex; gap: 8px; margin-top: 10px; }
.ean-photo-manual input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; }
.ean-photo-footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -24px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -8px 22px rgba(0, 0, 0, .04); font-weight: 700; }
@media (max-width: 640px) {
  .modal-backdrop:has(.ean-photo-dialog) { padding: 0; }
  .modal:has(.ean-photo-dialog) { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .ean-photo-dialog { padding: 14px 15px 0; }
  .ean-photo-intro { align-items: center; }
  .ean-photo-intro p { font-size: 12px; }
  .ean-photo-add { display: grid; grid-template-columns: 1fr 1fr; }
  .ean-photo-add button { width: 100%; min-height: 44px; padding-inline: 8px; }
  .ean-photo-card { padding: 12px; }
  .ean-photo-card-head { gap: 10px; }
  .ean-photo-thumb { width: 74px; height: 74px; }
  .ean-photo-card-head > button:last-child { padding: 5px; }
  .ean-photo-option { align-items: center; }
  .ean-photo-option button { min-height: 40px; }
  .ean-photo-manual form { flex-direction: column; }
  .ean-photo-footer { margin: 0 -15px; padding: 10px 15px; }
}
.barcode-results { display: grid; gap: 6px; }
.barcode-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 58px; padding: 9px 12px; border: 1px solid var(--line, #dce3eb); border-radius: 10px; background: var(--surface, #fff); }
.barcode-row strong, .barcode-row small { display: block; }
.barcode-row strong { font-size: 13px; line-height: 1.25; }
.barcode-row small { margin-top: 2px; color: var(--muted, #657385); font-size: 11px; }
@media (max-width: 700px) { .barcode-search { flex-direction: column; align-items: stretch; } .barcode-row { align-items: center; } }
.barcode-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: start; gap: 22px; }
.barcode-results, .barcode-basket { min-width: 0; }
.barcode-results h3, .barcode-basket h3 { margin: 0 0 8px; }
.barcode-row { margin-top: 0; }
.barcode-row-copy { min-width: 0; }
.barcode-row-action { flex: 0 0 auto; }
.ean13-svg { display: block; width: min(100%, 205px); height: auto; background: #fff; }
.barcode-basket { position: sticky; top: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-alt); }
.barcode-basket-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 11px; color: var(--ink-soft); }
.barcode-basket-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; }
.barcode-basket-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.barcode-picked { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.barcode-picked strong, .barcode-picked small { display: block; }
.barcode-picked strong { font-size: 12px; }
.barcode-picked small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
@media (max-width: 1150px) { .barcode-workspace { grid-template-columns: 1fr; } .barcode-basket { position: static; } .barcode-basket-list { max-height: none; } }
@media (max-width: 620px) { .barcode-row-action button { min-height: 40px; } .barcode-basket-head { align-items: stretch; flex-direction: column; } }
.modal:has(.ean-scan-mode) { width: min(94vw, 740px); }
.ean-scan-mode { padding: 12px 20px 24px; background: #fff; color: #111; text-align: center; }
.ean-scan-mode h3 { margin: 8px 0; font-size: clamp(20px, 4vw, 29px); line-height: 1.2; }
.ean-scan-mode p { color: #444; }
.ean-scan-mode #ean-scan-display > strong { display: block; font: 700 clamp(21px, 5vw, 32px)/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.ean-scan-mode .ean13-svg { width: min(100%, 340px); margin: 15px auto; }
.ean-scan-controls { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 20px; }
.ean-scan-controls span { min-width: 52px; font-weight: 700; }

/* EAN workspace: aligned search, compact results and a clear scan queue. */
.barcode-service, .orbit-shell .barcode-service { overflow: visible; padding: 0; border: 0; background: transparent; box-shadow: none; }
.barcode-service .barcode-service-head { padding: 0 0 20px; }
.barcode-service .barcode-service-head h2 { font-size: clamp(22px, 2vw, 28px); }
.barcode-service .barcode-service-head p { font-size: 14px; }
.barcode-main { min-width: 0; padding: clamp(16px, 2vw, 26px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.barcode-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin: 0; }
.barcode-search .field { min-width: 0; margin: 0; }
.barcode-search .field span { display: block; margin-bottom: 8px; font-weight: 650; }
.barcode-search input { width: 100%; min-width: 0; min-height: 48px; }
.barcode-search-actions { display: flex; align-items: center; gap: 8px; }
.barcode-search-actions .button { min-height: 48px; white-space: nowrap; }
.barcode-search-hint { margin: 8px 0 17px; color: var(--ink-soft); font-size: 12px; }
.barcode-quick-search { margin-bottom: 22px; }
.barcode-quick-search button { min-height: 36px; padding: 7px 13px; }
.barcode-workspace { grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); gap: 16px; }
.barcode-results, .barcode-basket { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-alt); }
.barcode-results { align-content: start; }
.barcode-results h3, .barcode-basket h3 { margin: 0; font-size: 17px; }
.barcode-results > .muted { margin: 4px 0 10px; font-size: 12px; }
.barcode-results-empty { margin: 14px 0 0; padding: 24px 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--ink-soft); text-align: center; }
.barcode-row { min-width: 0; margin-top: 5px; background: var(--surface); }
.barcode-row-copy { overflow: hidden; }
.barcode-row-copy strong, .barcode-picked strong { overflow: hidden; text-overflow: ellipsis; }
.barcode-basket { position: sticky; top: 18px; }
.barcode-basket-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.barcode-basket-title span { color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.barcode-basket > .muted { margin: 7px 0 16px; font-size: 12px; line-height: 1.4; }
.barcode-basket-head { padding: 0 0 12px; }
.barcode-updated { margin: 18px 0 0; color: var(--ink-soft); font-size: 12px; }
.ean-photo-full { position: relative; }
.ean-photo-collapse { position: sticky; top: 8px; z-index: 1; display: block; margin: 0 0 8px auto; }
.ean-photo-full img { max-height: min(58dvh, 620px); }
.ean-scan-mode .ean13-svg { max-width: 340px; }
.barcode-results { gap: 0; padding: 14px; }
.barcode-results > .muted { margin-bottom: 6px; }
.barcode-row { min-height: 0; margin: 0; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.barcode-row { transition: background-color 140ms ease, box-shadow 140ms ease; }
.barcode-row:focus-within { background: color-mix(in srgb, var(--accent, #195d65) 10%, #fff); box-shadow: inset 3px 0 var(--accent, #195d65); }
@media (hover: hover) { .barcode-row:hover { background: color-mix(in srgb, var(--accent, #195d65) 10%, #fff); box-shadow: inset 3px 0 var(--accent, #195d65); } }
@media (prefers-reduced-motion: reduce) { .barcode-row { transition: none; } }
.barcode-row:last-child { border-bottom: 0; }
.barcode-row-copy strong { font-size: 13px; line-height: 1.2; }
.barcode-row-copy small { margin-top: 1px; font-size: 11px; line-height: 1.2; }
.barcode-row-action .button { min-height: 34px; padding: 5px 10px; }
@media (max-width: 1150px) {
  .barcode-workspace { grid-template-columns: minmax(0, 1fr); }
  .barcode-basket { position: static; }
}
@media (max-width: 700px) {
  .barcode-service .barcode-service-head { padding-bottom: 16px; }
  .barcode-main { padding: 15px; border-radius: 16px; }
  .barcode-search { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .barcode-search-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .barcode-search-actions .button { width: 100%; padding-inline: 10px; }
  .barcode-quick-search { gap: 6px; margin-bottom: 16px; }
  .barcode-quick-search button { font-size: 12px; }
  .barcode-results, .barcode-basket { padding: 12px; }
  .barcode-row { gap: 8px; padding: 7px 2px; }
  .barcode-row-action button { min-height: 34px; }
  .ean-photo-full img { max-height: 50dvh; }
  .ean-scan-mode { padding: 8px 15px 20px; }
  .ean-scan-mode h3 { font-size: 21px; }
  .ean-scan-controls { gap: 8px; }
  .ean-scan-controls .button { padding-inline: 10px; }
}
.modal-backdrop:has(.ean-photo-dialog) { backdrop-filter: none; }
.modal-backdrop:has(.ean-photo-dialog) .modal { animation: none; }
.modal:has(.ean-photo-dialog) { display: flex; flex-direction: column; overflow: hidden; }
.modal:has(.ean-photo-dialog) .modal-head { position: static; flex: 0 0 auto; }
.ean-photo-dialog { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
.ean-photo-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px 0; }
.ean-photo-footer { position: static; flex: 0 0 auto; margin: 0; }
.ean-photo-thumb .ean-photo-placeholder { position: static; display: grid; place-items: center; width: 100%; height: 100%; padding: 8px; background: var(--surface-alt); color: var(--ink-soft); font-size: 10px; }
@media (max-width: 640px) {
  .ean-photo-scroll { padding: 14px 15px 0; }
  .ean-photo-footer { margin: 0; padding: 10px 15px max(10px, env(safe-area-inset-bottom)); }
}
