/* Shared structured-access card and private credential editor. */
.credential-icon{width:19px;height:19px;flex:none;vertical-align:middle}.credential-card{color:var(--cp-ink,var(--text,#181a20));font-size:13px;line-height:1.5;min-width:0}.credential-product{display:flex;align-items:center;gap:12px;border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:12px;padding:15px;margin-bottom:15px}.credential-product>div{min-width:0;flex:1}.credential-product h3{font-size:17px;font-weight:650;line-height:1.4;margin:0 0 5px;overflow-wrap:anywhere}.credential-product small{font-size:11px;color:var(--cp-muted,var(--muted,#626875))}.credential-product img{width:43px;height:54px;object-fit:cover;border-radius:8px;flex:none}.credential-product-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:var(--soft,#f3f5f8);color:var(--cp-red,var(--primary,#c60012));flex:none}.credential-status{border:1px solid #15935c40;color:#08784d;background:#16936212;font-size:10px;padding:4px 8px;border-radius:20px;white-space:nowrap}.credential-status.expired{color:#b53947;background:#b5394714;border-color:#b5394740}.credential-validity{display:flex;align-items:center;gap:9px;margin:0 0 23px;padding:12px;border-radius:10px;background:var(--soft,#f3f5f8);color:var(--cp-muted,var(--muted,#626875));font-size:11px}.credential-card h4{font-size:14px;font-weight:650;margin:0 0 12px}.credential-data{border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:11px;overflow:hidden;margin-bottom:18px}.credential-data-row{display:grid;grid-template-columns:110px minmax(0,1fr) auto;align-items:center;gap:10px;padding:13px 12px}.credential-data-row+.credential-data-row{border-top:1px solid var(--cp-line,var(--line,#e2e5eb))}.credential-label{font-size:11px;color:var(--cp-muted,var(--muted,#626875))}.credential-value{font-size:12px;font-weight:550;white-space:pre-wrap;overflow-wrap:anywhere;min-width:0;user-select:text}.credential-actions{display:flex;align-items:center;gap:3px}.credential-actions button{display:grid;place-items:center;width:32px;height:34px;border:0;border-radius:8px;background:transparent;color:var(--cp-muted,var(--muted,#626875));cursor:pointer}.credential-actions button:hover{background:var(--soft,#f3f5f8);color:var(--cp-ink,var(--text,#181a20))}.credential-actions button.is-copied{color:#098c54;background:#098c5414}.credential-feedback{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}.credential-open{display:flex;align-items:center;justify-content:center;gap:9px;padding:12px 15px;min-height:44px;border-radius:10px;background:var(--cp-red,var(--primary,#c60012));color:white!important;text-decoration:none;font-size:13px;font-weight:600;margin:18px 0}.credential-instructions{margin-top:20px;padding:17px;border-radius:11px;background:var(--soft,#f3f5f8)}.credential-instructions h4{font-size:13px}.credential-instructions p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.8;color:var(--cp-muted,var(--muted,#626875));margin:0}.credential-empty{border:1px dashed var(--cp-line,var(--line,#e2e5eb));padding:18px;color:var(--cp-muted,var(--muted,#626875));border-radius:10px;font-size:12px;line-height:1.7}.credential-support{margin-top:22px;padding-top:18px;text-align:center;border-top:1px solid var(--cp-line,var(--line,#e2e5eb))}.credential-support button,.credential-support a{background:none;border:0;color:var(--cp-red,var(--primary,#c60012));font-size:12px;cursor:pointer;text-decoration:underline}.cp-access-dialog{width:min(660px,calc(100vw - 24px))}.cp-access-dialog .credential-card{margin-top:16px}.cp-access-dialog .credential-card+button{margin-top:16px}
.credential-editor{grid-column:1/-1;min-width:0;margin:20px 0}.credential-editor-layout{display:block}.credential-editor-fields{min-width:0}.credential-editor-fields>.cp-field{margin:20px 0 0}.credential-format{border:0;padding:0;margin:0 0 20px;min-width:0}.credential-format legend{font-size:12px;font-weight:600;margin-bottom:10px}.credential-format>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.credential-format button{font:inherit;font-size:11px;padding:10px 5px;min-height:40px;border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:9px;background:var(--cp-paper,var(--card,#fff));color:var(--cp-muted,var(--muted,#626875));cursor:pointer}.credential-format button:last-child{grid-column:span 2}.credential-format button[aria-pressed=true]{border-color:var(--cp-red,var(--primary,#c60012));background:color-mix(in srgb,var(--cp-red,var(--primary,#c60012)),transparent 94%);color:var(--cp-red,var(--accent,#c60012));font-weight:650}.credential-input-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 14px}.credential-input{display:block;font-size:12px;font-weight:500;min-width:0;margin:0}.credential-input small{font-size:10px;font-weight:400;color:var(--cp-muted,var(--muted,#626875))}.credential-input input,.credential-input textarea{display:block;width:100%;min-width:0;box-sizing:border-box;border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:9px;background:var(--input,var(--cp-paper,#fff));color:var(--cp-ink,var(--text,#181a20));font:inherit;font-size:13px;line-height:1.5;padding:11px 12px;margin-top:7px;min-height:43px}.credential-input-shell{display:block;position:relative}.credential-input-shell:has(button) input{padding-right:42px}.credential-input-shell button{position:absolute;right:4px;top:4px;display:grid;place-items:center;width:36px;height:36px;border:0;background:transparent;color:var(--cp-muted,var(--muted,#626875));border-radius:8px;cursor:pointer}.credential-url{margin-top:18px}.credential-help{font-size:11px!important;line-height:1.7;color:var(--cp-muted,var(--muted,#626875));margin:10px 0 0}.credential-replace{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600}.credential-replace+.credential-help{margin-bottom:18px}.credential-internal-options{margin:16px 0 18px;font-size:11px;color:var(--cp-muted,var(--muted,#626875))}.credential-internal-options summary{cursor:pointer;width:fit-content;margin-bottom:10px}.credential-internal-options .cp-field{max-width:450px}.credential-internal-options>small{display:block;font-size:10px}.credential-product-fields{display:grid;grid-template-columns:2fr 1fr;gap:16px}.credential-product-fields .cp-field{min-width:0}.credential-product-fields input,.credential-product-fields select{max-width:100%;min-width:0}.cp-admin-dialog.credential-editor-dialog{box-sizing:border-box;width:min(1120px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}.credential-editor-dialog>form>button[type=submit]{min-height:44px;float:none;margin:10px 0 0 auto;display:flex}.credential-custom-row{position:relative;display:grid;gap:12px;padding:14px;margin-bottom:12px;border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:10px}.credential-custom-row>.credential-input:first-child{padding-right:34px}.credential-custom-row>[data-custom-remove]{position:absolute;right:10px;top:10px;width:29px;height:29px;background:transparent;border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:7px;color:var(--cp-muted,var(--muted,#626875));cursor:pointer}.credential-custom-secret{display:flex;align-items:flex-start;gap:7px;font-size:11px;color:var(--cp-muted,var(--muted,#626875));line-height:1.6}.credential-editor [hidden]{display:none!important}.credential-editor.compact .credential-editor-layout{grid-template-columns:1fr}.credential-editor.compact .credential-editor.compact .credential-editor.compact details[open]>summary{margin-bottom:15px}
@media(max-width:850px){.credential-editor-layout{grid-template-columns:1fr}.credential-product-fields{grid-template-columns:1fr}.credential-product h3{font-size:15px}}
@media(max-width:500px){.credential-input-grid{grid-template-columns:1fr}.credential-data-row{grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;padding:12px}.credential-label{grid-column:1/-1}.credential-value{grid-column:1;grid-row:2}.credential-actions{grid-column:2;grid-row:2}.credential-actions button{width:36px;height:38px}.credential-product{padding:12px;gap:10px;flex-wrap:wrap}.credential-product>div{flex:1 1 140px}.credential-product img{width:37px;height:46px}.credential-input input,.credential-input textarea{font-size:16px}.credential-format>div{grid-template-columns:repeat(2,minmax(0,1fr))}.credential-format button{min-height:44px}.credential-technical-row{overflow-wrap:anywhere}}
[data-theme=dark] .credential-status{color:#75dfa9;background:#16936218}[data-theme=dark] .credential-actions button.is-copied{color:#75dfa9}[data-theme=dark] .credential-status.expired{color:#ff929e}

/* Inventory uses the same red header and fixed actions as the panel record forms. */
body[data-view=admin] .cp-admin-dialog.credential-editor-dialog{padding:0;border-radius:28px;background:var(--card,#fff);overflow:hidden;border:1px solid var(--line,#e2e5eb)}
body[data-view=admin] .credential-editor-dialog[open]{display:flex;flex-direction:column}
body[data-view=admin] .credential-editor-dialog>.modal-head{display:flex;justify-content:space-between;margin:0}
body[data-view=admin] .credential-editor-dialog .modal-heading{display:flex}
body[data-view=admin] .credential-editor-dialog>form{min-height:0;overflow:hidden;display:flex;flex-direction:column;margin:0}
.credential-form-body{padding:26px 30px;overflow-y:auto;min-height:0;scrollbar-width:thin;overscroll-behavior:contain}
body[data-view=admin] .credential-form-footer{display:grid;grid-template-columns:1fr 1fr;flex:none}
body[data-view=admin] .credential-form-footer .button{justify-content:center;margin:0;display:flex;align-items:center;gap:8px}
body[data-view=admin] .credential-form-footer .button .icon{width:17px;height:17px}
body[data-view=admin] .credential-editor-dialog .credential-input{color:var(--muted);font-weight:600}
body[data-view=admin] .credential-editor-dialog .credential-input input,body[data-view=admin] .credential-editor-dialog .credential-input textarea{background:#f7f7f9;color:#22222b;border-color:#e5e5eb;border-radius:13px;min-height:48px;font-weight:500}
[data-theme=dark] body[data-view=admin] .credential-editor-dialog .credential-input input,[data-theme=dark] body[data-view=admin] .credential-editor-dialog .credential-input textarea{background:#252525;color:#fff;border-color:#ffffff0d}
body[data-view=admin] .credential-editor-dialog .credential-input-shell button{top:6px}
.credential-editor-dialog .credential-editor{margin:6px 0 0}.credential-editor-dialog .credential-internal-options{margin-top:18px;margin-bottom:24px}
.credential-form-body .cp-form-error:empty{display:none}.credential-form-body .cp-form-error{margin-top:16px}
@media(max-width:520px){.credential-form-body{padding:22px 20px}body[data-view=admin] .credential-editor-dialog .credential-input input,body[data-view=admin] .credential-editor-dialog .credential-input textarea{font-size:16px}}

/* Compact credential entry: the customer card is shown only in the customer area. */
body[data-view=admin] .cp-admin-dialog.credential-editor-dialog{width:min(760px,calc(100vw - 28px))}
.credential-editor-layout{display:block}.credential-editor-fields{width:100%}.credential-format>div{grid-template-columns:repeat(5,minmax(0,1fr))}.credential-format button:last-child{grid-column:auto}
@media(max-width:500px){.credential-format>div{grid-template-columns:repeat(2,minmax(0,1fr))}.credential-format button:last-child{grid-column:span 2}}

.credential-feedback.is-error{position:static;width:auto;height:auto;overflow:visible;clip-path:none;color:#b53947;font-size:12px}

[data-theme=dark] .credential-format button[aria-pressed=true]{color:#ff7a85;border-color:#f36b77;background:#f36b7714}

/* Searchable product selector, with the native select retained for submission. */
.product-picker{position:relative;min-width:0}
.product-picker>select[hidden],.product-picker-panel[hidden]{display:none!important}
.product-picker-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:12px 15px;border:1px solid #e5e5eb;border-radius:13px;background:#f7f7f9;color:#22222b;font:inherit;font-size:13px;font-weight:500;text-align:left;cursor:pointer}
.product-picker-trigger>span{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.product-picker-trigger>.icon{width:16px;height:16px;flex:none;transition:transform .15s}
.product-picker-trigger[aria-expanded=true]>.icon{transform:rotate(180deg)}
.product-picker-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.product-picker-panel{position:absolute;top:100%;left:0;right:0;z-index:20;margin-top:7px;padding:9px;background:var(--card,#fff);color:var(--text,#22222b);border:1px solid var(--line,#e5e5eb);border-radius:13px;box-shadow:0 12px 30px #0002;min-width:0;font-weight:400}
.product-picker-search{display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid var(--line,#e5e5eb);border-radius:9px;background:var(--card,#fff)}
.product-picker-search:focus-within{border-color:var(--accent)}
.product-picker-search>.icon{width:17px;height:17px;flex:none;color:var(--muted)}
body[data-view=admin] .admin-form-dialog .product-picker-search input{width:100%;min-width:0;min-height:42px!important;padding:9px 0!important;margin:0;border:0!important;border-radius:0!important;box-shadow:none!important;outline:0;background:transparent!important;color:var(--text);font-size:13px;font-weight:400}
.product-picker-count{font-size:10px!important;color:var(--muted);margin:8px 7px!important;line-height:1.4!important}
.product-picker-list{max-height:min(240px,32dvh);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.product-picker-option{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:42px;padding:10px;border-radius:7px;font-size:12px;font-weight:450;line-height:1.5;cursor:pointer;overflow-wrap:anywhere}
.product-picker-option>.icon{width:16px;height:16px;flex:none;color:var(--accent)}
.product-picker-option:hover,.product-picker-option.is-active{background:var(--soft,#f3f5f8)}
.product-picker-option[aria-selected=true]{color:var(--accent);font-weight:600}
.product-picker-empty{font-size:12px!important;text-align:center;padding:15px 8px;color:var(--muted);line-height:1.6!important;margin:0!important}
[data-theme=dark] .product-picker-trigger{background:#252525;color:#fff;border-color:#ffffff0d}
[data-theme=dark] .product-picker-option[aria-selected=true],[data-theme=dark] .product-picker-option>.icon{color:#ff7a85}
@media(max-width:520px){.product-picker-trigger,body[data-view=admin] .admin-form-dialog .product-picker-search input{font-size:16px}.product-picker-option{min-height:44px;font-size:13px}}

.credential-data-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.credential-card .credential-data-heading h4{margin:0}.credential-copy-all{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:none;min-height:34px;padding:6px 10px;border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:8px;background:var(--cp-paper,var(--card,#fff));color:var(--cp-muted,var(--muted,#626875));font:inherit;font-size:11px;font-weight:550;cursor:pointer}.credential-copy-all:hover{background:var(--soft,#f3f5f8);color:var(--cp-ink,var(--text,#181a20))}.credential-copy-all .credential-icon{width:16px;height:16px}.credential-copy-all.is-copied{color:#098c54;border-color:#098c5440;background:#098c5410}[data-theme=dark] .credential-copy-all.is-copied{color:#75dfa9}@media(max-width:500px){.credential-copy-all{min-height:40px;padding:8px;font-size:11px}.credential-data-heading{gap:8px}.credential-card .credential-data-heading h4{font-size:13px}}

/* Customer access details: clear field/value hierarchy and aligned controls. */
.credential-card{--credential-surface:#f3f5f8}
.credential-card :is(.credential-validity,.credential-instructions){background:var(--credential-surface)}
[data-theme=dark] .credential-card{--credential-surface:#2b2a29}
.credential-card .credential-data-row{grid-template-columns:minmax(0,1fr) auto;gap:3px 16px;padding:14px 16px;min-height:76px}
.credential-card .credential-label{grid-column:1;grid-row:1;align-self:end;font-size:11px;line-height:1.5}
.credential-card .credential-value{grid-column:1;grid-row:2;align-self:start;font-size:14px;font-weight:500;line-height:1.6}
.credential-card .credential-actions{grid-column:2;grid-row:1 / 3;gap:6px}
.credential-card .credential-actions button{width:36px;height:36px;padding:0;border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:9px;background:var(--cp-paper,var(--card,#fff))}
.credential-actions button .credential-icon{width:18px;height:18px;display:block}
.credential-card .credential-actions button:hover,.credential-card .credential-copy-all:hover{background:var(--credential-surface)}
.credential-card .credential-actions button.is-copied{color:#098c54;border-color:#098c5440;background:#098c5410}
.credential-card .credential-copy-all{min-width:137px;min-height:36px;color:var(--cp-ink,var(--text,#181a20));font-size:12px}
.credential-card .credential-copy-all.is-copied{color:#098c54}
.credential-product h3{font-size:15px;font-weight:600;line-height:1.5}
.credential-status{display:inline-flex;align-items:center;gap:6px;background:transparent;font-size:10px;font-weight:500}
.credential-status::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.credential-footer{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;border-top:1px solid var(--cp-line,var(--line,#e2e5eb));padding-top:18px;margin-top:22px}
.credential-footer .credential-support{margin:0;padding:0;border:0;text-align:initial;margin-left:auto}
.credential-footer .credential-back,.credential-footer .credential-support :is(button,a){display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;font-size:12px;font-weight:500;text-decoration:none;line-height:1.4}
.credential-footer .credential-back{padding:9px 12px;border:1px solid var(--cp-line,var(--line,#e2e5eb));border-radius:9px;background:var(--cp-paper,var(--card,#fff));color:var(--cp-ink,var(--text,#181a20));cursor:pointer}
.credential-footer .credential-support :is(button,a){padding:7px 0}
.credential-footer .credential-icon{width:18px;height:18px}
.cp-body dialog.cp-access-dialog{width:min(690px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:24px;border-radius:20px;background:var(--cp-paper)}
.cp-access-dialog .cp-dialog-head{margin-bottom:20px}
.cp-access-dialog .cp-dialog-head>.cp-button{display:grid;place-items:center;flex:none;width:38px;height:38px;min-height:38px;padding:0;font-size:18px;font-weight:400;line-height:1}
.cp-access-dialog .credential-card{margin-top:0}
[data-theme=dark] .credential-card .credential-actions button.is-copied,[data-theme=dark] .credential-card .credential-copy-all.is-copied{color:#75dfa9}
@media(max-width:500px){
 .cp-body dialog.cp-access-dialog{padding:18px 16px;width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:16px}
 .cp-access-dialog .cp-dialog-head h2{font-size:18px}
 .credential-card .credential-data-row{padding:12px;gap:4px 10px;min-height:78px}
 .credential-card .credential-actions{gap:4px}
 .credential-card .credential-actions button{width:36px;height:40px}
 .credential-product h3{font-size:13px}.credential-product>div{flex:1 1 120px}
 .credential-product .credential-status{margin-left:auto}
 .credential-card .credential-copy-all{min-width:126px;min-height:40px;font-size:11px;padding:8px}
 .credential-footer{gap:8px;padding-top:14px;margin-top:18px}
 .credential-footer .credential-back,.credential-footer .credential-support :is(button,a){font-size:11px;min-height:42px;gap:6px}
}
