.cabinet-mark {
  display: inline-block; flex: none;
  width: 2.25rem; height: 2.625rem;
  background: url("/static/cabinet-voice-key-logo.svg") center / contain no-repeat;
}
.cabinet-boot {
  display: grid; place-items: center; min-height: 100svh;
  box-sizing: border-box; padding: 24px;
  background: #fbfcfd; color: #30465b; text-align: center;
}
.cabinet-boot-content { display: grid; justify-items: center; gap: 14px; width: min(100%, 340px); }
.cabinet-boot-content .cabinet-mark { width: 30px; height: 36px; }
.cabinet-boot-status, .cabinet-boot-retry {
  opacity: 0; visibility: hidden;
  animation: cabinet-boot-reveal .22s ease forwards;
}
.cabinet-boot-status {
  margin: 0; color: #526879; font-size: 15px; line-height: 1.45;
  animation-delay: .8s;
}
.cabinet-boot-retry {
  width: 100%; color: #596c7b; font-size: 14px; line-height: 1.5;
  animation-delay: 15s;
}
.cabinet-boot-retry p, .cabinet-boot-noscript { margin: 0 0 12px; }
.cabinet-boot-retry form { display: flex; justify-content: center; }
.cabinet-boot-retry button {
  min-height: 44px; padding: 9px 16px; border: 1px solid #c8d5df;
  border-radius: 10px; background: #fff; color: #355d76;
  font: inherit; font-weight: 650; cursor: pointer;
}
.cabinet-boot-retry button:hover { background: #f3f7f9; }
.cabinet-boot-retry button:focus-visible { outline: 2px solid #527b96; outline-offset: 3px; }
.cabinet-boot-noscript { color: #596c7b; font-size: 14px; line-height: 1.5; }
@keyframes cabinet-boot-reveal { to { opacity: 1; visibility: visible; } }
@media (prefers-reduced-motion: reduce) {
  .cabinet-boot-status, .cabinet-boot-retry { animation-duration: .01ms; }
}
.mobile-brand-name { display: inline-flex; align-items: center; gap: 7px; }
.mobile-brand-name .cabinet-mark { width: 20px; height: 30px; }
.workspace .empty > p { color: #596779; }
.cabinet-auth {
  display: grid; place-items: center; min-height: 100svh;
  padding: clamp(16px, 4vw, 48px); box-sizing: border-box;
  background: #f0f2fa; color: #182345;
}
.cabinet-auth[hidden] { display: none; }
.cabinet-auth-mode .present-workspace-bar { display: none; }
.cabinet-auth-mode #ld-main { max-width: none; width: 100%; padding: 0; }
.cabinet-auth-card {
  width: min(100%, 820px); display: grid; grid-template-columns: .9fr 1fr;
  overflow: hidden; border: 1px solid #dbe0ee; border-radius: 24px;
  background: #fff; box-shadow: 0 20px 64px #18234518;
}
.cabinet-auth-brand {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 18px; padding: clamp(28px, 5vw, 56px); color: #fff; background: #263676;
}
.cabinet-auth-brand .cabinet-mark { width: 52px; height: 76px; }
.cabinet-auth-word { font-size: clamp(32px, 5vw, 50px); font-weight: 750; line-height: 1; letter-spacing: -.06em; }
.cabinet-auth-body { min-width: 0; padding: clamp(26px, 5vw, 54px); }
.cabinet-auth-body h1 { margin: 0 0 8px; font-size: clamp(25px, 4vw, 35px); line-height: 1.15; letter-spacing: -.035em; }
.cabinet-auth-body > p { margin: 0 0 26px; color: #556078; line-height: 1.5; }
.cabinet-auth form { display: grid; gap: 16px; }
.cabinet-auth form label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
.cabinet-auth form input {
  box-sizing: border-box; width: 100%; min-height: 48px; padding: 10px 13px;
  border: 1px solid #b9c3d8; border-radius: 10px; color: #182345; background: #fff; font: inherit; font-size: 16px;
}
.cabinet-auth form input:focus-visible, .cabinet-auth form button:focus-visible { outline: 2px solid #4b63b3; outline-offset: 3px; }
.cabinet-auth form button {
  min-height: 48px; padding: 10px 16px; margin-top: 4px; border: 0; border-radius: 10px;
  color: #fff; background: #263676; font: inherit; font-weight: 700; cursor: pointer;
}
.cabinet-auth form button:hover { background: #334792; }
.cabinet-auth form button:disabled { opacity: .65; cursor: wait; }
.cabinet-auth [role=alert] { margin: 0; color: #a02731; font-size: 14px; }
.cabinet-auth a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; color: #263676; text-decoration: underline; text-underline-offset: 3px; }
.cabinet-auth [hidden] { display: none; }

/* Catalogue folders: keep one readable, responsive path to folder navigation. */
body .workspace:has(#folder-shortcuts) .folder-tiles { margin: 0 0 22px; }
body .workspace:has(#folder-shortcuts) .folder-tiles-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
body .workspace:has(#folder-shortcuts) .folder-tiles-heading { min-width: 0; }
body .workspace:has(#folder-shortcuts) .folder-tiles-heading h2 {
  margin: 0;
  color: #263d50;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 680;
  letter-spacing: -.025em;
}
body .workspace:has(#folder-shortcuts) .folder-tiles-heading > span {
  background: #edf2f5;
  color: #526879;
}
body .workspace:has(#folder-shortcuts) .folder-tiles-controls { gap: 8px; }
body .workspace:has(#folder-shortcuts) .folder-shelf-toggle { display: none !important; }
body .workspace:has(#folder-shortcuts) .folder-create {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #d6e1e8;
  border-radius: 10px;
  background: #fff;
  color: #355d76;
  font-size: 14px;
  font-weight: 620;
}
body .workspace:has(#folder-shortcuts) .folder-create:hover {
  background: #f4f8fa;
  border-color: #b9ccd8;
}
body .workspace:has(#folder-shortcuts) .folder-tiles-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
  gap: 10px;
  overflow: visible;
  padding: 0;
}
body .workspace:has(#folder-shortcuts) .folder-tile {
  min-width: 0;
  min-height: 80px;
  border-color: #dfe7ec;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(30, 56, 74, .035);
}
body .workspace:has(#folder-shortcuts) .folder-mini {
  min-width: 0;
  min-height: 78px;
  padding: 12px;
  gap: 11px;
}
body .workspace:has(#folder-shortcuts) .folder-tile.editable .folder-mini { padding-right: 10px; }
body .workspace:has(#folder-shortcuts) .folder-mini-symbol {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #edf3f6;
  color: #557991;
}
body .workspace:has(#folder-shortcuts) .folder-mini-copy { min-width: 0; overflow-wrap: anywhere; }
body .workspace:has(#folder-shortcuts) .folder-mini-copy strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: #304b5e;
  font-size: 14px;
  font-weight: 640;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: normal;
}
body .workspace:has(#folder-shortcuts) .folder-mini-copy small {
  color: #657b8a;
  font-size: 12px;
  line-height: 1.35;
}
body .workspace:has(#folder-shortcuts) .folder-mini-more {
  position: static;
  transform: none;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin: 0 7px 0 0;
  border-radius: 9px;
  color: #5e7788;
}
body .workspace:has(#folder-shortcuts) .folder-mini-more:hover,
body .workspace:has(#folder-shortcuts) .folder-mini-more[aria-expanded="true"] {
  background: #edf3f6;
  color: #31566d;
}
body .workspace:has(#folder-shortcuts) .folder-mini-more:focus-visible,
body .workspace:has(#folder-shortcuts) .folder-mini:focus-visible,
body .workspace:has(#folder-shortcuts) .folder-show-more:focus-visible,
body .workspace:has(#folder-shortcuts) .folder-create:focus-visible {
  outline: 2px solid #527b96 !important;
  outline-offset: 3px;
}
body .workspace:has(#folder-shortcuts) .folder-show-more {
  display: none;
  min-height: 42px;
  margin: 10px auto 0;
  padding: 8px 13px;
  border-radius: 9px;
  color: #456a80;
  font-size: 14px;
  font-weight: 620;
}
body .workspace:has(#folder-shortcuts) .folder-show-more:hover { background: #edf3f6; color: #2f556d; }
body .workspace:has(#folder-shortcuts) .folder-tiles.folder-has-desktop-overflow .folder-show-more { display: flex !important; }
@media (max-width: 760px) {
  body .workspace:has(#folder-shortcuts) .folder-show-more { display: flex !important; }
  body .workspace:has(#folder-shortcuts) .folder-tiles { margin-bottom: 18px; }
  body .workspace:has(#folder-shortcuts) .folder-tiles-head { align-items: center; margin-bottom: 10px; }
  body .workspace:has(#folder-shortcuts) .folder-tiles-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body .workspace:has(#folder-shortcuts) .folder-tile { min-height: 76px; }
  body .workspace:has(#folder-shortcuts) .folder-mini { min-height: 74px; padding: 11px; gap: 11px; }
  body .workspace:has(#folder-shortcuts) .folder-tile.editable .folder-mini { padding-right: 8px; }
  body .workspace:has(#folder-shortcuts) .folder-mini-copy strong { font-size: 15px; }
  body .workspace:has(#folder-shortcuts) .folder-mini-copy small { font-size: 13px; }
  body .workspace:has(#folder-shortcuts) .folder-mini-more { flex-basis: 44px; width: 44px; height: 44px; margin-right: 7px; }
  body .workspace:has(#folder-shortcuts) .folder-create { min-height: 44px; padding-inline: 11px; }
}
@media (max-width: 380px) {
  body .workspace:has(#folder-shortcuts) .folder-tiles-heading h2 { font-size: 17px; }
  body .workspace:has(#folder-shortcuts) .folder-tiles-head { gap: 8px; }
  body .workspace:has(#folder-shortcuts) .folder-create { padding-inline: 9px; font-size: 13px; }
}
@media (max-width: 620px) {
  .cabinet-auth-card { grid-template-columns: 1fr; max-width: 430px; }
  .cabinet-auth-brand { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 20px 26px; }
  .cabinet-auth-brand .cabinet-mark { width: 32px; height: 46px; }
}

/* On phones choose folders in a searchable, bounded picker instead of growing
   the catalogue with a 120-folder shelf. The selected folder stays in view. */
body .mobile-folder-options {display:flex;flex-direction:column;gap:6px;max-height:min(58dvh,560px);overflow:auto;overscroll-behavior:contain;padding:2px 4px 4px 0;}
body .mobile-folder-option {display:grid;gap:4px;width:100%;min-height:52px;padding:10px 12px;border:1px solid #dfe6eb;border-radius:10px;background:#fff;color:#294458;text-align:left;font:inherit;cursor:pointer;}
body .mobile-folder-option[hidden] {display:none!important;}
body .mobile-folder-option[aria-selected="true"] {border-color:#5682a0;background:#eef5f8;box-shadow:inset 3px 0 #477993;}
body .mobile-folder-option strong {overflow-wrap:anywhere;font-size:14px;line-height:1.3;}
body .mobile-folder-option small {color:#536b7c;font-size:12px;}
body .mobile-folder-option:focus-visible {outline:2px solid #477993;outline-offset:2px;}
@media(max-width:760px) {
  body .workspace:has(#folder-shortcuts) .mobile-folder-picker {display:flex;align-items:stretch;gap:8px;margin:0 0 10px;}
  body .workspace:has(#folder-shortcuts) .mobile-folder-open {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:3px 8px;flex:1;min-width:0;min-height:52px;padding:7px 11px;border:1px solid #d1dee6;border-radius:11px;background:#fff;color:#294458;text-align:left;}
  body .workspace:has(#folder-shortcuts) .mobile-folder-label {grid-column:1;grid-row:1;color:#546c7c;font-size:11px;font-weight:650;}
  body .workspace:has(#folder-shortcuts) .mobile-folder-open strong {grid-column:1;grid-row:2;min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-size:14px;line-height:1.2;}
  body .workspace:has(#folder-shortcuts) .mobile-folder-chevron {grid-column:2;grid-row:1/3;display:grid;place-items:center;width:32px;height:32px;color:#456b83;transform:rotate(90deg);}
  body .workspace:has(#folder-shortcuts) .mobile-folder-chevron .icon {width:16px;height:16px;}
  body .workspace:has(#folder-shortcuts) .mobile-folder-create,body .workspace:has(#folder-shortcuts) .mobile-folder-actions {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:52px;min-height:52px;padding:0 10px;border:1px solid #d1dee6;border-radius:11px;background:#fff;color:#355f78;font:inherit;font-size:13px;font-weight:650;}
  body .workspace:has(#folder-shortcuts) .mobile-folder-create .icon {width:17px;height:17px;}
  body .workspace:has(#folder-shortcuts) .folder-tiles-head,body .workspace:has(#folder-shortcuts) .folder-tiles-grid,body .workspace:has(#folder-shortcuts) .folder-show-more,body .workspace:has(#folder-shortcuts) .folder-tiles.folder-has-desktop-overflow .folder-show-more {display:none!important;}
  body .modal-back.mobile-folder-dialog {align-items:flex-end;padding:0;}
  body .mobile-folder-dialog .modal {width:100%;max-height:88dvh;padding-bottom:max(20px,env(safe-area-inset-bottom));border-radius:20px 20px 0 0;}
}
@media(prefers-reduced-motion:reduce) {body .mobile-folder-option,body .workspace:has(#folder-shortcuts) .mobile-folder-open {transition:none!important;}}

/* Keep the protected-viewer expiry indicator outside the thumbnail rail. */
@media(max-width:767px) {
  .viewer #chip {bottom:calc(166px + env(safe-area-inset-bottom,0px));left:auto;right:10px;max-width:calc(100vw - 20px);transform:none;border-radius:10px;padding:7px 10px;font-size:11px;}
  .viewer header .hbtn,.viewer .arrow,.viewer .control-btn {min-width:44px;min-height:44px;}
  .viewer #v-grid {display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;}
}
@media(max-height:480px) and (orientation:landscape) and (pointer:coarse) {
  .viewer #chip {bottom:calc(52px + env(safe-area-inset-bottom,0px));}
  .viewer header .hbtn,.viewer .arrow,.viewer .control-btn {min-width:44px;min-height:44px;height:44px;}
  .viewer #v-grid {display:inline-flex;}
}
