/* © 2026 Гореньков М. С. КарЧоо. */
#printerProfilesDialog { width:460px; max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); overflow:auto; box-sizing:border-box; border:1px solid var(--line); border-radius:16px; padding:24px; color:var(--ink); background:var(--surface); font:15px/1.45 var(--font); box-shadow:0 24px 80px #123b333d; }
#printerProfilesDialog::backdrop { background:#102c28a6; }
#printerProfilesDialog .pp-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
#printerProfilesDialog h2 { margin:0; color:#164e49; font-size:23px; line-height:1.25; font-weight:700; }
#printerProfilesDialog .pp-close { flex:none; display:grid; place-items:center; width:34px; height:34px; padding:0; font:24px/1 var(--font); color:var(--muted); }
#printerProfilesDialog .pp-lead { margin:8px 0 24px; color:var(--muted); font-size:14px; }
#printerProfilesDialog .pp-field { display:block; margin:0 0 16px; font-size:13px; font-weight:600; }
#printerProfilesDialog input:not([type=checkbox]), #printerProfilesDialog select { display:block; width:100%; min-width:0; box-sizing:border-box; margin-top:7px; padding:10px 12px; min-height:42px; border:1px solid var(--line); border-radius:var(--radius-ctrl); background:var(--surface); color:var(--ink); font:15px/1.4 var(--font); }
#printerProfilesDialog input::placeholder { color:#7d8985; }
#printerProfilesDialog :is(input,select,button,summary):focus-visible { outline:3px solid #84c9bb; outline-offset:3px; }
#printerProfilesDialog .pp-footer { display:flex; justify-content:flex-end; gap:10px; padding-top:16px; border-top:1px solid var(--line); }
#printerProfilesDialog .pp-footer .btn { justify-content:center; min-width:112px; min-height:42px; white-space:normal; }
#printerProfilesDialog #ppStatus { margin:0 0 16px; padding:10px 12px; border-radius:var(--radius-ctrl); background:var(--accent-soft); color:#164e49; font-size:13px; }
#printerProfilesDialog #ppStatus:empty { display:none; }
#printerProfilesDialog [hidden] { display:none!important; }
#calPanel .panel-head h2 { flex:none; margin-right:auto; order:0; }
#calPanel .panel-head > .video-course-camera { order:2; margin-left:0; flex:none; }
#btnPrinterProfiles { order:1; display:inline-flex; align-items:center; gap:8px; min-width:0; max-width:240px; margin:0; font-size:12px; padding:5px 9px; border-radius:8px; }
#btnPrinterProfiles span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#btnPrinterProfiles svg { flex:none; }
#printerProfilesDialog .pp-printer[aria-pressed="true"] { border-color:var(--accent); background:var(--accent-soft); }
#printerProfilesDialog .pp-printer small { color:var(--accent); font-size:12px; font-weight:600; }
@media(max-width:560px) {
  #printerProfilesDialog { padding:20px; }
  #printerProfilesDialog h2 { font-size:21px; }
  #printerProfilesDialog .pp-footer .btn { flex:1; min-width:0; }
}

/* Восстановление после ошибки: одно пояснение и только нужные действия. */
#printerProfilesDialog.pp-has-issue { width:600px; }
#printerProfilesDialog .pp-issue-message { margin:14px 0 24px; color:var(--muted); font-size:15px; line-height:1.55; }
#printerProfilesDialog .pp-issue-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; padding-top:20px; border-top:1px solid var(--line); }
#printerProfilesDialog .pp-issue-actions .btn { justify-content:center; min-height:42px; padding:10px 14px; font-size:14px; }
#printerProfilesDialog .pp-footer { flex-wrap:wrap; }
@media(max-width:560px) {
  #printerProfilesDialog .pp-issue-actions .btn { flex:1 0 auto; }
}

#printerProfilesDialog .pp-saved-printers { display:grid; gap:10px; margin:0 0 22px; }
#printerProfilesDialog .pp-printer { display:flex; flex-direction:column; gap:4px; width:100%; padding:14px 16px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); text-align:left; font:inherit; cursor:pointer; }
#printerProfilesDialog .pp-printer:hover { background:var(--accent-soft); border-color:var(--accent); }
#printerProfilesDialog .pp-printer strong { font-size:15px; overflow-wrap:anywhere; }
#printerProfilesDialog .pp-printer span, #printerProfilesDialog .pp-empty { color:var(--muted); font-size:13px; }
#printerProfilesDialog .pp-empty { margin:0; padding:12px 0; }
#printerProfilesDialog .pp-save-choice { display:flex; gap:4px; padding:4px; margin:0 0 18px; border-radius:10px; background:var(--accent-soft); }
#printerProfilesDialog .pp-save-choice button { flex:1; min-width:0; padding:10px 8px; border:1px solid transparent; border-radius:7px; background:transparent; color:#315e54; font:600 14px/1.3 var(--font); cursor:pointer; }
#printerProfilesDialog .pp-save-choice button[aria-pressed="true"] { background:var(--surface); border-color:var(--line); color:#12695b; box-shadow:0 1px 3px #123b3310; }

/* Выбор раскрывается под кнопкой; список прокручивается, нижнее действие остаётся доступным. */
#printerProfilesDropdown {position:fixed;inset:auto;margin:0;box-sizing:border-box;padding:10px;border:1px solid #b9d4cb;border-radius:12px;background:var(--surface,#fff);color:var(--ink,#243c36);box-shadow:0 10px 30px #153d3326;font:13px/1.4 var(--font,system-ui);overflow:hidden;z-index:35}
#printerProfilesDropdown:popover-open {display:flex;flex-direction:column;gap:8px}
#printerProfilesDropdown:not([popover]):not([hidden]) {display:flex;flex-direction:column;gap:8px}
#printerProfilesDropdown::backdrop {background:transparent;pointer-events:none}
#printerProfilesDropdown .pp-dropdown-title {font-size:13px;font-weight:650;padding:2px 4px;flex:none}
#printerProfilesDropdown .pp-dropdown-list {overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin}
#printerProfilesDropdown .pp-saved-printers {display:grid;gap:6px}
#printerProfilesDropdown .pp-printer-row {display:grid;grid-template-columns:minmax(0,1fr) 30px;align-items:center;gap:5px}
#printerProfilesDropdown .pp-printer {display:flex;flex-direction:column;gap:3px;min-width:0;width:100%;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);text-align:left;font:inherit;cursor:pointer}
#printerProfilesDropdown .pp-printer:hover,#printerProfilesDropdown .pp-printer[aria-pressed="true"] {border-color:var(--accent);background:var(--accent-soft)}
#printerProfilesDropdown .pp-printer strong {font-size:13px;overflow-wrap:anywhere}
#printerProfilesDropdown .pp-printer span {font-size:11px;color:var(--muted)}
#printerProfilesDropdown .pp-printer small {font-size:11px;color:var(--accent);font-weight:650}
#printerProfilesDropdown .pp-delete {display:grid;place-items:center;width:30px;height:32px;padding:0;border:0;border-radius:7px;background:transparent;color:#8a6963;cursor:pointer}
#printerProfilesDropdown .pp-delete:hover {background:var(--danger-soft);color:var(--danger)}
#printerProfilesDropdown .pp-delete-confirm {position:fixed;inset:auto;margin:0;box-sizing:border-box;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;padding:16px;border:1px solid #e7bdb6;border-radius:12px;background:#fffaf8;color:var(--ink,#243c36);font:13px/1.45 var(--font,system-ui);text-align:right;box-shadow:0 10px 32px #4b201c30;z-index:40}
#printerProfilesDropdown .pp-delete-confirm::backdrop {background:transparent;pointer-events:none}
#printerProfilesDropdown .pp-delete-confirm p {margin:0 0 14px;text-align:left;overflow-wrap:anywhere}
#printerProfilesDropdown .pp-delete-confirm .btn {font-size:12px;min-height:30px;padding:5px 10px;margin-left:5px}
#printerProfilesDropdown .pp-empty {margin:0;padding:12px 5px;color:var(--muted)}
#ppDropdownStatus {margin:0;padding:0 4px;color:#73564c;font-size:12px;flex:none}
#ppDropdownStatus:empty {display:none}
#ppDropdownSave {justify-content:center;flex:none;width:100%;font-size:12px;white-space:normal}
#printerProfilesDropdown button:focus-visible {outline:2px solid var(--accent);outline-offset:-2px}
#printerProfilesDropdown button:disabled {opacity:.55;cursor:default}
#btnPrinterProfiles[aria-expanded="true"] > svg:last-child {transform:rotate(180deg)}

/* Подтверждение сохранения и перенос галочки к месту хранения профилей. */
.pp-save-feedback {position:fixed;inset:calc(50dvh - 72px) auto auto 50%;transform:translateX(-50%);width:370px;max-width:calc(100vw - 32px);margin:0;padding:0;border:0;background:transparent;color:#173d39;font:14px/1.45 var(--font,system-ui);overflow:visible;pointer-events:none;z-index:2147483646}
.pp-save-feedback::backdrop {background:transparent;pointer-events:none}
.pp-save-message {box-sizing:border-box;min-height:116px;padding:22px 20px 22px 86px;border:1px solid #b8dcd4;border-radius:18px;background:#fff;box-shadow:0 16px 48px #173d3926}
.pp-save-message strong {display:block;margin-bottom:5px;font-size:17px;line-height:1.3;color:#12695b}
.pp-save-name {display:block;overflow-wrap:anywhere;font-size:13px}
.pp-save-message small {display:block;margin-top:7px;font-size:11px;color:#627b75}
.pp-save-token {position:absolute;top:22px;left:20px;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#087f73;color:white;box-shadow:0 4px 12px #087f7330;transform-origin:center}
.pp-save-token svg {width:32px;height:32px}
.pp-save-token path {stroke:currentColor;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:0}
@media print {.pp-save-feedback {display:none!important}}
