:root {
  --soft: var(--surface-soft);
  --navy: var(--primary-deep);
  --blue: var(--primary);
  --blue-dark: var(--primary-strong);
  --green: var(--success);
  --amber: var(--warning);
  --danger: var(--error);
  --shadow: var(--shadow-md);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--soft); }
body { margin: 0; color: var(--ink); background: var(--page); font-family: inherit; min-height: 100vh; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-dark); }
[hidden] { display: none !important; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 9px 13px; background: #fff; border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.shell { width: min(1520px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 48px; outline: none; }
.eyebrow { margin: 0 0 9px; color: var(--blue-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; font-weight: 760; line-height: 1.14; letter-spacing: -.025em; }
h1 { font-size: clamp(34px, 4.3vw, 58px); }
h2 { font-size: 23px; }
p { color: var(--muted); }

.status { margin: 20px 0; padding: 12px 14px; border-left: 3px solid var(--blue); border-radius: 5px 9px 9px 5px; color: #365466; background: #eef7fb; font-size: 13px; }
.status.error { border-color: var(--danger); color: var(--danger); background: #fff1f1; }
.status.success { border-color: var(--green); color: var(--green); background: #edf8f3; }
.marking-attention { margin: 24px 0 0; }
.certificate-policy { margin-bottom: 0; padding: 12px 14px; border-radius: 10px; background: var(--soft); font-size: 13px; }

.primary, .secondary { min-height: 44px; border-radius: 10px; padding: 10px 17px; border: 1px solid transparent; cursor: pointer; font-weight: 720; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.primary { color: #fff; background: var(--blue-dark); box-shadow: 0 8px 18px rgba(14,102,143,.17); }
.primary:hover { background: #0b587c; transform: translateY(-1px); }
.secondary { color: var(--navy); border-color: #c8d8df; background: #fff; }
.secondary:hover { border-color: #9bbac8; background: #f8fbfc; }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.full { width: 100%; }

.panel { padding: 26px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 7px 24px rgba(27,63,83,.06); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.certificate-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 13px; }
.certificate-option { display: block; position: relative; padding: 18px 18px 18px 48px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; }
.certificate-option:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(23,134,184,.12); }
.certificate-option input { position: absolute; left: 18px; top: 21px; }
.certificate-option strong, .certificate-option span, .certificate-option small { display: block; }
.certificate-option strong { margin-bottom: 5px; }
.certificate-option span { color: #4e6674; }
.certificate-option small { margin-top: 8px; color: var(--muted); }

.pending { max-width: 610px; margin: 10vh auto 0; text-align: center; padding: 52px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.pending h1 { font-size: 38px; }
.pending-mark { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 50%; color: #fff; background: var(--green); font-size: 30px; }

.hero { padding: 10px 0 38px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.hero h1 { font-size: 28px; }
.hero-actions { display: flex; gap: 11px; }
.action-link { min-width: 190px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.8); text-decoration: none; }
.action-link strong, .action-link span { display: block; }
.action-link span { margin-top: 4px; color: var(--blue-dark); font-size: 12px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.summary-grid article { padding: 20px 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.summary-grid span, .summary-grid small { display: block; color: var(--muted); }
.summary-grid strong { display: block; margin: 3px 0; font-size: 30px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-nav-menu { position: relative; display: inline-flex; }
.admin-menu-toggle { border: 0; background: transparent; cursor: pointer; gap: 5px; }
.admin-menu-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--transition); }
.admin-menu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.admin-menu-list { position: absolute; z-index: 40; top: calc(100% + 10px); left: 50%; display: grid; width: max-content; min-width: 190px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 14px 38px rgba(25, 61, 82, .16); transform: translateX(-50%); }
.admin-menu-list button { min-height: 39px; padding: 8px 11px; border: 0; border-radius: 8px; color: var(--ink-soft); background: transparent; cursor: pointer; text-align: left; font: inherit; font-size: 13px; font-weight: 680; }
.admin-menu-list button:hover, .admin-menu-list button[aria-pressed="true"] { color: var(--primary-strong); background: var(--mint); }
.side-stack { display: grid; gap: 18px; }

.table-list, .request-list { display: grid; }
.list-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(140px, .8fr) minmax(280px, 1fr); gap: 16px; align-items: center; padding: 15px 2px; border-top: 1px solid #e9eff2; }
.list-row:first-child { border-top: 0; }
.list-row strong, .list-row span, .list-row small { display: block; }
.list-row span, .list-row small { color: var(--muted); }
.badge { display: inline-flex !important; width: max-content; padding: 4px 8px; border-radius: 999px; color: var(--green) !important; background: #eaf7f1; font-size: 11px; font-weight: 750; }
.user-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.delete-user-button { border: 0; padding: 6px 8px; border-radius: 8px; color: var(--danger); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.delete-user-button:hover { background: #fff0f0; }
.request-card { padding: 15px 0; border-top: 1px solid #e9eff2; }
.request-card:first-child { border-top: 0; }
.request-card strong, .request-card small { display: block; }
.request-card small { margin: 5px 0 12px; color: var(--muted); }
.request-actions { display: flex; gap: 8px; }
.request-actions button { min-height: 36px; padding: 7px 11px; }
.empty { padding: 22px 0; color: var(--muted); text-align: center; }

dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 24px 80px rgba(16,42,58,.28); }
dialog::backdrop { background: rgba(20,43,57,.45); backdrop-filter: blur(3px); }
#integration-dialog { max-height: calc(100dvh - 32px); overflow: auto; }
#integration-dialog form { padding: 18px 22px; }
#integration-dialog .dialog-heading { margin-bottom: 10px; }
#integration-dialog label { gap: 3px; margin: 7px 0; }
#integration-dialog input:not([type=checkbox]), #integration-dialog select { min-height: 38px; padding: 7px 10px; }
#integration-dialog .panel-actions { margin-top: 12px; }
.integration-key-guide { padding: 9px 12px; margin: 8px 0 0; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.integration-key-guide[hidden] { display: none; }
.integration-key-guide > summary { cursor: pointer; font-weight: 700; }
.integration-key-guide[open] > summary { margin-bottom: 10px; }
.integration-key-guide p { margin: 8px 0; }
.integration-key-guide ul { padding-left: 20px; margin: 8px 0; }
.integration-key-guide summary { cursor: pointer; font-weight: 600; }
.integration-key-guide a { display: inline-block; margin-top: 8px; }
.integration-key-guide code { font-size: 11px; overflow-wrap: anywhere; }
.integration-key-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
#integration-dialog .integration-enabled { display: flex; align-items: center; gap: 10px; }
#integration-dialog .integration-enabled input { width: 20px; height: 20px; min-height: 20px; margin: 0; }
[data-admin-section=integrations] > select { display: block; width: 100%; min-height: 44px; margin: 6px 0 12px; padding: 9px 11px; border: 1px solid #cbd9e0; border-radius: 9px; color: var(--ink); background: #fff; }
#integration-list article { min-width: 0; overflow-wrap: anywhere; }
#integration-list button { margin-right: 8px; margin-top: 8px; }
dialog form { padding: 28px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-close-button { width: 38px; height: 38px; border: 0; border-radius: 9px; color: var(--muted); background: var(--soft); cursor: pointer; font-size: 24px; }
dialog label { display: grid; gap: 6px; margin: 13px 0; color: #3f5664; font-size: 13px; font-weight: 700; }
dialog input, dialog select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #cbd9e0; border-radius: 9px; color: var(--ink); background: #fff; }
#withdrawal-dispatch-products { margin: 15px 0; }
#withdrawal-dispatch-products summary { width: max-content; color: var(--blue-dark); cursor: pointer; font-weight: 720; text-decoration: underline; text-underline-offset: 3px; }
#withdrawal-dispatch-items { max-height: 240px; overflow-y: auto; margin: 10px 0 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; }
#withdrawal-dispatch-items p { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
#withdrawal-dispatch-items p:first-child { border-top: 0; }
dialog .withdrawal-check { display: flex; align-items: flex-start; gap: 10px; }
dialog .withdrawal-check input { width: 20px; height: 20px; min-height: 20px; flex: 0 0 auto; margin: 0; }
#withdrawal-place-preview { overflow-wrap: anywhere; }
.form-error { color: var(--danger); font-size: 13px; }
.danger-button { min-height: 44px; padding: 10px 17px; border: 1px solid #8f3030; border-radius: 10px; color: #fff; background: var(--danger); cursor: pointer; font-weight: 750; }
.danger-button:hover { background: #8f3030; }
.danger-button:disabled { cursor: not-allowed; opacity: .5; }
.delete-safety-note { padding: 12px 14px; border-radius: 10px; color: #6d4b22; background: #fff7e8; font-size: 13px; }
.chz-auth-panel { border-color: #c8dde5; background: linear-gradient(155deg, #fff 0, #f2f9fb 100%); }
.admin-chz-context { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; height:54px; min-width:0; padding:7px 8px 7px 13px; gap:10px; border:1px solid #d5e0e6; border-radius:13px; background:#eef2f4; box-shadow:var(--shadow-xs); }
.chz-state-dot { flex:0 0 auto; width:10px; height:10px; border-radius:50%; background:#78909c; box-shadow:0 0 0 4px rgba(120,144,156,.12); }
.admin-chz-copy { min-width:0; line-height:1.15; }
.admin-chz-copy strong,.admin-chz-copy small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.admin-chz-copy strong { font-size:11px; }
.admin-chz-copy small { margin-top:3px; color:var(--muted); font-size:9px; }
.admin-chz-context.is-ok .chz-state-dot { background:var(--green); box-shadow:0 0 0 4px rgba(35,122,90,.13); }
.admin-chz-context.is-warning .chz-state-dot { background:var(--amber); box-shadow:0 0 0 4px rgba(165,103,18,.13); }
.admin-chz-context.is-error .chz-state-dot { background:var(--danger); box-shadow:0 0 0 4px rgba(163,61,61,.13); }
.chz-auth-button { display:grid; width:32px; height:32px; padding:0; place-items:center; border:1px solid #bfd1da; border-radius:10px; color:var(--blue-dark); background:#fff; cursor:pointer; }
.chz-auth-button:hover { border-color:#88b4c8; background:#f8fcfe; }
.chz-auth-button svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.chz-auth-button .chz-auth-icon-download { display:none; }
.chz-auth-button.is-update .chz-auth-icon-refresh { display:none; }
.chz-auth-button.is-update .chz-auth-icon-download { display:block; }
.chz-auth-dialog { width:min(920px,calc(100% - 32px)); height:min(760px,calc(100dvh - 32px)); }
.chz-auth-dialog-shell { display:grid; grid-template-rows:auto minmax(0,1fr); height:100%; padding:20px; }
.chz-auth-dialog .dialog-heading { align-items:center; margin-bottom:14px; }
.chz-auth-dialog-heading { justify-content:flex-end; }
.chz-auth-dialog iframe { width:100%; height:100%; min-height:0; border:1px solid var(--line); border-radius:14px; background:#f4f7fa; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 16px; border-radius: 11px; color: #fff; background: var(--navy); box-shadow: var(--shadow); }

:focus-visible { outline: 3px solid rgba(23,134,184,.34); outline-offset: 2px; }
@media (max-width: 880px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .list-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .user-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .hero { align-items: stretch; flex-direction: column; }
  .summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1240px); padding-top: 26px; }
  .panel, .pending { padding: 22px; }
  .hero-actions { flex-direction: column; width: 100%; }
  .action-link { min-width: 0; }
  .list-row { grid-template-columns: 1fr; gap: 6px; }
  .user-actions { justify-content: flex-start; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
}
/* Partner management uses the shared cabinet panels, controls and typography. */
.partner-card { padding: 1rem 0; border-bottom: 1px solid #dce5ea; }
.partner-card h3 { margin: 0 0 .4rem; }
.partner-card p { margin: .4rem 0; overflow-wrap: anywhere; }
.partner-card .panel-actions { flex-wrap: wrap; justify-content: flex-start; }
[data-admin-section="partners"] { min-width: 0; }
[data-admin-section="devices"] { min-width: 0; }
.devices-heading { margin-bottom: 20px; }
.devices-heading p { margin: 7px 0 0; font-size: 13px; }
.devices-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.devices-toolbar > .device-field { width: min(100%, 380px); }
.device-field { display: grid; gap: 6px; min-width: 0; }
.device-field label, #device-pair-form > label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
[data-admin-section="devices"] input:not([type="checkbox"]), [data-admin-section="devices"] select { width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid #cbd9e0; border-radius: 9px; color: var(--ink); background: #fff; }
[data-admin-section="devices"] :is(button, a, input, select, summary):focus-visible { outline: 3px solid #80bce7; outline-offset: 3px; }
[data-admin-section="devices"] button { font-size: 13px; }
.device-connect-panel { margin-top: 20px; padding: 20px; border: 1px solid #d7e7f0; border-radius: 13px; background: #f7fafc; }
.device-connect-grid, .device-preview-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
.device-connect-step { min-width: 0; }
.device-connect-step + .device-connect-step { border-left: 1px solid #dce7ed; padding-left: 26px; }
.device-connect-panel h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font-size: 15px; }
.device-step-number { display: inline-grid; place-items: center; flex: 0 0 25px; height: 25px; border-radius: 8px; color: var(--primary-strong); background: #e1effa; font-size: 12px; font-weight: 800; }
.device-connect-panel p { margin: 10px 0 14px; font-size: 13px; line-height: 1.5; }
.device-location-toggle { display: inline-flex; max-width: 100%; padding: 3px; gap: 3px; border: 1px solid #d9e4eb; border-radius: 10px; background: #edf3f7; }
.device-location-toggle button.secondary { min-height: 36px; padding: 7px 12px; border-color: transparent; background: transparent; box-shadow: none; }
.device-location-toggle button[aria-pressed="true"].secondary { background: #fff; border-color: #c3dcea; color: var(--primary-strong); box-shadow: 0 1px 4px #183e5010; }
.device-inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.device-inline-actions a { font-size: 13px; font-weight: 650; text-underline-offset: 3px; }
#device-pair-form { display: grid; gap: 7px; margin: 14px 0 0; }
.device-code-actions { display: grid; grid-template-columns: minmax(130px, 1fr) auto; gap: 10px; }
#device-pair-code { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.device-inline-status { padding: 11px 13px; border-radius: 9px; color: var(--ink-soft); background: #edf4f9; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.device-inline-status:empty { display: none; }
#device-pair-preview { margin-top: 20px; padding-top: 20px; border-top: 1px solid #dce7ed; }
#device-pair-preview .device-found { margin-top: -5px; overflow-wrap: anywhere; }
.device-found strong { color: var(--ink); }
.devices-list-heading { display: flex; align-items: center; gap: 9px; margin: 24px 0 12px; }
.devices-list-heading h3 { font-size: 15px; margin: 0; }
.device-count { display: inline-grid; place-items: center; min-width: 24px; padding: 3px 7px; border-radius: 7px; font-size: 12px; font-weight: 650; color: #536d7f; background: #edf3f7; }
.device-list { display: grid; gap: 12px; }
.device-card { min-width: 0; padding: 17px 18px 0; border: 1px solid #dce6ed; border-radius: 12px; background: #fff; }
.device-card-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding-bottom: 15px; }
.device-card-identity { min-width: 0; }
.device-card h4 { margin: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.device-computer-name { margin: 4px 0 0; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.device-computer-name span { color: #536d7f; }
.device-history { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.device-history > summary { padding: 9px 0; font-size: 13px; color: var(--muted); cursor: pointer; }
.device-history > .device-list { margin-top: 8px; }
.device-history .device-card { background: #fafcfd; }
.device-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 0; font-size: 12px; line-height: 1.4; }
.device-card-meta span { color: #627a8c; }
.device-connection { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 9px; border-radius: 8px; font-size: 12px; font-weight: 650; }
.device-connection::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.device-connection.is-online { color: #21734e; background: #eaf7f0; }
.device-connection.is-offline { color: #a3434b; background: #fff0f1; }
.device-connection.is-unassigned { color: #86601e; background: #fff5df; }
.device-connection.is-revoked { color: #627587; background: #eef2f5; }
.device-card-actions { display: flex; align-items: center; gap: 8px; }
.device-card-actions > button.secondary { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.device-more { position: relative; }
.device-more > summary { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #d2dfe7; border-radius: 8px; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-soft); background: #fff; list-style: none; }
.device-more > summary::-webkit-details-marker { display: none; }
.device-more[open] > summary, .device-more > summary:hover { background: #eef5fa; border-color: #8fbad7; }
.device-more-content { position: absolute; z-index: 15; top: calc(100% + 7px); right: 0; width: 230px; max-width: calc(100vw - 70px); padding: 12px; border: 1px solid #d9e5ed; border-radius: 11px; background: #fff; box-shadow: 0 10px 28px #17374820; }
.device-more-content p { margin: 0 0 12px; overflow-wrap: anywhere; }
.device-more-content small, .device-more-content strong { display: block; font-size: 12px; line-height: 1.5; }
.device-more-content strong { color: var(--ink); }
.device-more-content button { width: 100%; }
.device-danger.secondary { color: #a3434b; }
.device-danger.secondary:hover { background: #fff0f1; border-color: #e5bcc2; }
.device-rename-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 16px; }
.device-rename-form input { flex: 1 1 220px; }
.device-access { border-top: 1px solid #e5edf2; }
.device-access > summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; color: var(--ink-soft); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.device-access > summary::-webkit-details-marker { display: none; }
.device-access > summary::after { content: ""; width: 6px; height: 6px; margin-left: auto; margin-right: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.device-access[open] > summary::after { transform: rotate(225deg); }
.device-access-body { padding: 0 0 16px; }
.device-access-body > p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
.device-scope-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; margin-bottom: 8px; border-radius: 9px; background: #f5f8fa; }
.device-scope-row > div { min-width: 0; }
.device-scope-row strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.device-scope-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.device-scope-row button { flex-shrink: 0; min-height: 36px; padding: 7px 10px; }
.device-assign-row { display: flex; align-items: end; gap: 10px; margin-top: 12px; }
.device-assign-row .device-field { flex: 1; }
.device-assign-row > button { flex-shrink: 0; }
.device-access-body .device-print-hint { margin: 12px 0 0; font-size: 12px; }
.devices-empty { padding: 28px 16px; text-align: center; border: 1px dashed #ccdae4; border-radius: 12px; background: #fafcfd; }
.devices-empty strong { font-size: 14px; }
.devices-empty p { margin: 8px 0 0; font-size: 13px; }
@media (max-width: 1000px) {
  .device-card-header { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .device-card-identity { grid-column: 1 / -1; }
  .device-card-actions { justify-self: end; }
  .device-connection { justify-self: start; }
  .device-code-actions { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .devices-heading { flex-direction: row; }
  .devices-toolbar { align-items: stretch; flex-direction: column; }
  .devices-toolbar > .device-field { width: 100%; }
  .device-connect-grid, .device-preview-fields { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .device-connect-panel { padding: 15px; }
  .device-connect-step + .device-connect-step { border-left: 0; padding: 18px 0 0; border-top: 1px solid #dce7ed; }
  .device-card { padding: 14px 12px 0; }
  .device-card-header { grid-template-columns: minmax(0, 1fr); }
  .device-card-actions { justify-self: stretch; justify-content: space-between; }
  .device-assign-row, .device-scope-row { align-items: stretch; flex-direction: column; }
  .device-rename-form > button { flex: 1; }
  .device-location-toggle { display: flex; }
  .device-location-toggle button.secondary { flex: 1; font-size: 12px; padding-inline: 6px; }
}
.partner-check { display: flex; align-items: center; gap: .65rem; margin: .65rem 0; }
.partner-check input { width: auto; flex: 0 0 auto; }
#partner-dialog { width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; }
#partner-dialog-content > label:not(.partner-check) { display: grid; gap: .4rem; margin: .8rem 0; }
#partner-organization { display: block; width: min(100%, 460px); min-height: 44px; margin: .5rem 0 1rem; padding: 9px 11px; border: 1px solid #cbd9e0; border-radius: 9px; color: var(--ink); background: #fff; }
.partner-refresh { justify-self: start; }
[data-admin-section=withdrawals] > label { display: block; margin-top: 14px; color: #3f5664; font-size: 13px; font-weight: 700; }
[data-admin-section=withdrawals] > select { display: block; width: 100%; min-height: 44px; margin: 6px 0 12px; padding: 9px 11px; border: 1px solid #cbd9e0; border-radius: 9px; color: var(--ink); background: #fff; }
#withdrawal-list > .panel { min-width: 0; overflow-wrap: anywhere; }
#withdrawal-list { gap: 14px; margin-top: 14px; }
.withdrawal-card { box-shadow: none; }
.withdrawal-place-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
.withdrawal-place-toolbar p { margin:0; font-size:13px; }
.admin-context-row { display:grid; grid-template-columns:minmax(250px,.8fr) minmax(600px,1.5fr); align-items:start; gap:30px; margin:0 0 20px; }
.admin-workspace-context { display:grid; grid-template-columns:minmax(190px,1fr) minmax(190px,1fr) minmax(220px,1.2fr); align-items:end; width:100%; min-width:0; margin:0; gap:11px; }
.admin-workspace-context .context-selector { height:54px; min-width:0; }
.admin-workspace-context .select-wrap select { min-width:0; }
.admin-workspace-context .admin-warehouse-selector { min-width:0; }
.admin-workspace-context p { grid-column:1/-1; margin:0; }
.admin-workspace-context p:empty { display:none; }
.withdrawal-row { display:grid; grid-template-columns:minmax(140px,1fr) minmax(150px,1fr) minmax(140px,1fr); align-items:center; gap:18px; padding:18px 0; border-bottom:1px solid #e2e9ee; }
.withdrawal-row h3 { margin:0; font-size:16px; }
.withdrawal-row p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.withdrawal-row small { display:block; margin-top:6px; font-size:12px; color:var(--muted); }
.withdrawal-row-actions { justify-self:end; max-width:100%; }
.withdrawal-row-actions button { max-width:100%; }
.withdrawal-state-accepted .withdrawal-row-state strong { color:var(--green); }
.withdrawal-state-rejected .withdrawal-row-state strong,.withdrawal-state-partially_accepted .withdrawal-row-state strong { color:var(--danger); }
.withdrawal-success { display:grid; place-items:center; width:62px; height:62px; border-radius:50%; background:#e6f4ed; color:var(--green); font-size:36px; }
.withdrawal-success[hidden] { display:none; }
#withdrawal-dispatch-dialog,#withdrawal-dispatch-products { width:min(620px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; }
#withdrawal-dispatch-form,.withdrawal-products-shell { padding:24px; }
.withdrawal-products-list { max-height:min(55dvh,460px); overflow-y:auto; overscroll-behavior:contain; }
.withdrawal-products-list p { padding:12px 0; margin:0; border-bottom:1px solid #e2e9ee; }
.withdrawal-text-button { padding:8px 0; border:0; background:none; color:var(--blue); font:inherit; text-align:left; cursor:pointer; }
#withdrawal-dispatch-section { display:none; }
.withdrawal-history-action { display:flex; justify-content:flex-end; margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
#withdrawal-history-dialog { width:min(760px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; }
.withdrawal-history-shell { padding:24px; }
#withdrawal-history-list { gap:0; }
@media(max-width:1240px) { .shell { width:min(100% - 32px,1180px); } .admin-context-row { grid-template-columns:minmax(220px,.8fr) minmax(0,1.5fr); gap:18px; } }
@media(max-width:900px) { .admin-context-row { grid-template-columns:1fr; gap:10px; } }
@media(max-width:700px) { .shell { width:min(100% - 24px,660px); } .admin-workspace-context { grid-template-columns:1fr; gap:10px; } .withdrawal-row { grid-template-columns:1fr; gap:10px; } .withdrawal-row-actions { justify-self:start; } .admin-menu-list { right:0; left:auto; transform:none; } .chz-auth-dialog-shell { padding:14px; } }
.withdrawal-card-heading { display: flex; align-items: flex-start; gap: 12px; }
.withdrawal-card-heading h3 { margin: 0; font-size: 19px; }
.withdrawal-card-heading p { margin: 5px 0 0; }
.withdrawal-state-marker { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(23,134,184,.12); }
.withdrawal-state-accepted .withdrawal-state-marker { background: var(--green); box-shadow: 0 0 0 5px rgba(35,122,90,.13); }
.withdrawal-state-rejected .withdrawal-state-marker, .withdrawal-state-partially_accepted .withdrawal-state-marker { background: var(--danger); box-shadow: 0 0 0 5px rgba(163,61,61,.12); }
.withdrawal-state-outcome_unknown .withdrawal-state-marker { background: var(--amber); box-shadow: 0 0 0 5px rgba(165,103,18,.13); }
.withdrawal-state-progress { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; margin: 20px 0; padding: 0; list-style: none; }
.withdrawal-state-progress li { position: relative; padding-top: 17px; color: var(--muted); font-size: 11px; text-align: center; }
.withdrawal-state-progress li::before { content: ""; position: absolute; top: 0; left: 50%; width: 9px; height: 9px; border: 2px solid #c8d8df; border-radius: 50%; background: #fff; transform: translateX(-50%); z-index: 1; }
.withdrawal-state-progress li:not(:first-child)::after { content: ""; position: absolute; top: 5px; right: 50%; width: 100%; height: 2px; background: #dce7ec; }
.withdrawal-state-progress li.is-done, .withdrawal-state-progress li.is-current { color: var(--navy); font-weight: 720; }
.withdrawal-state-progress li.is-done::before { border-color: var(--green); background: var(--green); }
.withdrawal-state-progress li.is-current::before { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,134,184,.12); }
.withdrawal-state-progress li.is-done::after, .withdrawal-state-progress li.is-current::after { background: var(--green); }
.withdrawal-state-note { padding: 11px 13px; border-radius: 9px; color: #6d4b22; background: #fff7e8; font-size: 13px; }
.withdrawal-sign-button { margin-top: 4px; }
#withdrawal-signing-dialog { width: min(560px, calc(100% - 32px)); }
.withdrawal-signing-shell { padding: 28px; }
.withdrawal-signing-content { display: flex; flex-direction: column; align-items: center; min-height: 250px; padding: 22px 6px 4px; text-align: center; }
.withdrawal-signing-content > strong { margin-top: 17px; font-size: 20px; }
.withdrawal-signing-content > p { max-width: 430px; margin: 8px 0 24px; }
#withdrawal-signing-dialog[data-state="done"] .withdrawal-signing-content > strong { color: var(--green); }
#withdrawal-signing-dialog[data-state="error"] .withdrawal-signing-content > strong { color: var(--danger); }
.withdrawal-signing-steps { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); width: 100%; margin: auto 0 0; padding: 0; list-style: none; }
.withdrawal-signing-steps li { position: relative; padding-top: 19px; color: var(--muted); font-size: 11px; }
.withdrawal-signing-steps li::before { content: ""; position: absolute; top: 0; left: 50%; width: 10px; height: 10px; border: 2px solid #c8d8df; border-radius: 50%; background: #fff; transform: translateX(-50%); z-index: 1; }
.withdrawal-signing-steps li:not(:first-child)::after { content: ""; position: absolute; top: 5px; right: 50%; width: 100%; height: 2px; background: #dce7ec; }
.withdrawal-signing-steps li.is-current { color: var(--navy); font-weight: 750; }
.withdrawal-signing-steps li.is-current::before { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,134,184,.12); }
.withdrawal-signing-steps li.is-done { color: var(--green); font-weight: 750; }
.withdrawal-signing-steps li.is-done::before { border-color: var(--green); background: var(--green); }
.withdrawal-signing-steps li.is-done::after, .withdrawal-signing-steps li.is-current::after { background: var(--green); }
#withdrawal-place-address { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #cbd9e0; border-radius: 9px; font: inherit; color: var(--ink); resize: vertical; }
#withdrawal-place-dialog { width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
#withdrawal-place-dialog .panel-actions { flex-wrap: wrap; }
#withdrawal-place-dialog select { max-width: 100%; }
#withdrawal-place-form { position: relative; }
#withdrawal-place-dialog .dialog-heading { position: relative; align-items: center; z-index: 2; }
#withdrawal-place-dialog .dialog-heading h2 { margin: 0; }
#withdrawal-place-cancel { flex-shrink: 0; }
#withdrawal-place-content { transition: opacity .12s ease, filter .12s ease; }
#withdrawal-place-form[aria-busy="true"] #withdrawal-place-content { opacity: .3; filter: blur(2px); pointer-events: none; }
.place-progress { position: absolute; inset: 82px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: rgba(237,244,247,.68); border-radius: 0 0 18px 18px; z-index: 1; }
.place-progress[hidden] { display: none; }
.place-progress strong { max-width: 360px; font-size: 16px; }
.place-progress > span:last-child { max-width: 360px; color: var(--muted); font-size: 13px; }
.place-progress-spinner { width: 32px; height: 32px; border: 3px solid #cbdce8; border-top-color: #2386c8; border-radius: 50%; animation: place-progress-spin .8s linear infinite; }
#integration-catalog-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
#integration-catalog-content { transition: opacity .12s ease; }
#integration-catalog-dialog[aria-busy="true"] #integration-catalog-content { opacity: .35; pointer-events: none; }
#integration-catalog-dialog[aria-busy="true"] #integration-catalog-status::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 10px; border: 2px solid #cbdce8; border-top-color: #2386c8; border-radius: 50%; vertical-align: middle; animation: place-progress-spin .8s linear infinite; }
.integration-catalog-products { max-height: 360px; overflow: auto; }
.integration-catalog-product { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #dce7ec; overflow-wrap: anywhere; }
.integration-catalog-product span { color: var(--muted); }
.integration-catalog-warehouses { list-style: none; padding: 0; }
.integration-catalog-warehouses li { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.integration-catalog-warehouses li > span { flex: 1 1 100%; }
.integration-catalog-warehouses select { max-width: 100%; flex: 1 1 220px; }
#integration-catalog-content input { width: 100%; box-sizing: border-box; }
.integration-preview { overflow-x: auto; }
.integration-preview table { width: 100%; border-collapse: collapse; font-size: 14px; }
.integration-preview th, .integration-preview td { padding: 10px; text-align: left; border-bottom: 1px solid #dce4eb; }
#integration-pools-content label { display: inline-flex; flex-direction: column; gap: 6px; margin: 8px 16px 8px 0; }
#integration-pools-content [aria-busy="true"] .form-message::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 10px; border: 2px solid #cbdce8; border-top-color: #2386c8; border-radius: 50%; animation: place-progress-spin .8s linear infinite; }
#integration-mapping-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
#integration-mapping-content input, #integration-mapping-content select { width: 100%; box-sizing: border-box; margin-bottom: 12px; }
#integration-mapping-dialog[aria-busy="true"] #integration-mapping-status::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 10px; border: 2px solid #cbdce8; border-top-color: #2386c8; border-radius: 50%; vertical-align: middle; animation: place-progress-spin .8s linear infinite; }
@keyframes place-progress-spin { to { transform: rotate(360deg); } }
#device-pair-resources { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 8px; min-width: 0; margin: 16px 0; padding: 12px; border: 1px solid #dbe5ed; border-radius: 10px; }
#device-pair-resources legend { padding: 0 5px; font-size: 12px; font-weight: 700; }
#device-pair-resources label { display: flex; align-items: flex-start; gap: 8px; padding: 9px; border: 1px solid #dce6ed; border-radius: 8px; background: #fff; font-size: 13px; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere; }
#device-pair-resources label:has(input:checked) { border-color: #78afd6; background: #eff7fd; }
#device-pair-resources input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; }
@media (prefers-reduced-motion: reduce) { .place-progress-spinner { animation: none; } #withdrawal-place-content { transition: none; } }
@media (max-width: 540px) {
  #withdrawal-place-dialog .panel-actions { display: grid; grid-template-columns: 1fr; }
  #withdrawal-place-dialog .panel-actions button { width: 100%; }
  #withdrawal-place-save { grid-row: 1; }
}
