:root {
  --library-text: #17233a;
  --library-muted: #70819a;
  --library-border: rgba(148, 163, 184, .22);
  --library-panel: rgba(255, 255, 255, .86);
  --library-accent: #347ff0;
  --library-accent-soft: #edf5ff;
  --library-danger: #dc5d55;
}

body.mzpi-library-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #edf6fd 0%, #e8f2fb 52%, #eaf4fc 100%) !important;
  color: var(--library-text);
}

body.mzpi-library-page .desktop-actions,
body.mzpi-library-page .gateway-footer { display: none !important; }

.mzpi-library {
  width: min(1350px, calc(100vw - 340px));
  min-height: calc(100vh - 100px);
  margin-left: max(300px, calc(260px + (100vw - 1610px) / 2));
  padding: 54px 32px 64px;
}

.library-heading,
.library-browser {
  max-width: 1350px;
  margin: 0 auto;
}

.library-heading {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-bottom: 18px;
}

.library-heading__actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 9px; }

.library-refresh,
.library-account-button,
.library-theme-button,
.library-back,
.library-view-switch button,
.library-search button,
.library-error button,
.library-selection button,
.library-modal button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.library-refresh,
.library-account-button,
.library-theme-button,
.library-back {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--library-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  color: #41536f;
  font-size: .82rem;
  font-weight: 700;
}

.library-account-button { color: var(--library-accent); }
.library-theme-button { color: #5b7190; }
.library-account-button:hover { border-color: rgba(52, 127, 240, .38); background: #fff; }
.library-account-button.is-logged-in { max-width: 190px; color: #2e6aca; }
.library-account-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.library-refresh:hover,
.library-theme-button:hover,
.library-back:not(:disabled):hover {
  border-color: rgba(52, 127, 240, .32);
  background: #fff;
  color: var(--library-accent);
}

.library-back:disabled { cursor: not-allowed; opacity: .42; }

.library-browser {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 18px;
  background: var(--library-panel);
  box-shadow: 0 12px 32px rgba(36, 70, 115, .07);
}

.library-browser__topline {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
}

.library-breadcrumb {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.library-breadcrumb::-webkit-scrollbar { display: none; }

.library-breadcrumb button {
  flex: 0 0 auto;
  max-width: 180px;
  overflow: hidden;
  padding: 6px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--library-muted);
  cursor: pointer;
  font: inherit;
  font-size: .88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-breadcrumb button:hover,
.library-breadcrumb button.is-current { background: var(--library-accent-soft); color: var(--library-accent); }
.library-breadcrumb i { flex: 0 0 auto; color: #a4b1c0; font-size: .62rem; }

.library-view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--library-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
}

.library-view-switch button {
  display: grid;
  width: 30px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: #8190a4;
}

.library-view-switch button.is-active { background: #e7f0ff; color: var(--library-accent); }

.library-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(560px, 100%);
  min-height: 44px;
  margin: 18px 0 14px;
  padding: 0 6px 0 15px;
  border: 1px solid var(--library-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
}

.library-search:focus-within { border-color: rgba(52, 127, 240, .42); box-shadow: 0 0 0 3px rgba(52, 127, 240, .09); }
.library-search > i { color: var(--library-accent); }
.library-search input { flex: 1 1 auto; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; color: var(--library-text); font: inherit; font-size: .88rem; }
.library-search input::placeholder { color: #95a3b6; }
.library-search button { flex: 0 0 auto; min-height: 32px; padding: 0 13px; border-radius: 8px; background: var(--library-accent); color: #fff; font-size: .78rem; font-weight: 700; }
.library-search button:hover { background: #216ae0; }

.library-directory-actions { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; margin: -2px 0 14px; }
.library-directory-actions:empty { display: none; }
.library-directory-actions button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; border: 1px solid rgba(52, 127, 240, .16); border-radius: 9px; background: #f4f8ff; color: #3974cc; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; }
.library-directory-actions button:hover { border-color: rgba(52, 127, 240, .36); background: #e8f1ff; }

.library-notice { min-height: 0; margin: 0 0 12px; color: var(--library-muted); font-size: .82rem; }
.library-notice:empty { display: none; }
.library-notice.is-warning { color: #a36b0e; }

.library-loading,
.library-empty,
.library-error {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 30px;
  color: var(--library-muted);
  text-align: center;
}

.library-loading[hidden],
.library-empty[hidden],
.library-error[hidden],
.library-selection[hidden],
.library-modal[hidden],
.library-menu[hidden] { display: none !important; }

.library-loading i { color: var(--library-accent); animation: library-spin 1s linear infinite; }
.library-empty > i { color: #9db5d8; font-size: 2rem; }
.library-empty strong,
.library-error strong { color: var(--library-text); }
.library-error > i { color: #e09b53; font-size: 1.7rem; }
.library-error button { margin-top: 6px; padding: 8px 14px; border-radius: 9px; background: #eaf2ff; color: var(--library-accent); font-weight: 700; }

.library-items {
  display: grid;
  gap: 12px;
}

.library-items.is-grid { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.library-items.is-list { grid-template-columns: 1fr; gap: 7px; }

.library-item {
  position: relative;
  display: flex;
  min-width: 0;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .62);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.library-items.is-grid .library-item { min-height: 148px; flex-direction: column; padding: 18px; border-radius: 14px; }
.library-items.is-list .library-item { align-items: center; min-height: 62px; padding: 10px 16px; border-radius: 11px; }
.library-item:hover,
.library-item.is-selected { border-color: rgba(52, 127, 240, .3); background: #fff; box-shadow: 0 7px 18px rgba(48, 82, 128, .08); }
.library-item:hover { transform: translateY(-1px); }

.library-item__icon { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: #edf4ff; color: #5e84c9; font-size: 1.3rem; }
.library-item.is-folder .library-item__icon { background: #fff4d8; color: #e9ab35; }
.library-item.is-image .library-item__icon { background: #e8f8f4; color: #38a987; }
.library-item.is-pdf .library-item__icon { background: #fff0f0; color: #dc6464; }
.library-item.is-office .library-item__icon { background: #ebf3ff; color: #4780df; }
.library-items.is-grid .library-item__icon { margin-bottom: auto; }
.library-items.is-list .library-item__icon { margin-right: 12px; }

.library-item__content { min-width: 0; }
.library-items.is-grid .library-item__content { margin-top: 13px; }
.library-items.is-list .library-item__content { flex: 1 1 auto; }
.library-item__name { display: -webkit-box; overflow: hidden; color: var(--library-text); font-size: .9rem; font-weight: 700; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.library-items.is-list .library-item__name { -webkit-line-clamp: 1; }
.library-item__meta { display: block; overflow: hidden; margin-top: 4px; color: var(--library-muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.library-item__arrow { position: absolute; right: 14px; bottom: 13px; color: #b0c0d2; font-size: .72rem; }
.library-items.is-list .library-item__arrow { position: static; margin-left: 14px; }

.library-selection {
  position: fixed;
  z-index: 180;
  right: max(28px, calc((100vw - 1350px) / 2));
  bottom: 24px;
  left: max(calc(var(--sidebar-width) + 28px), calc((100vw - 1350px + var(--sidebar-width)) / 2));
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 14px 10px 18px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 15px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 34px rgba(28, 54, 90, .16);
  backdrop-filter: blur(12px);
}

.library-selection__file { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; gap: 9px; color: var(--library-text); font-size: .84rem; font-weight: 700; }
.library-selection__file i { color: var(--library-accent); }
.library-selection__file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-selection__actions { display: inline-flex; flex: 0 0 auto; gap: 8px; }
.library-selection__actions button { min-height: 34px; padding: 0 11px; border-radius: 9px; background: #edf4ff; color: var(--library-accent); font-size: .76rem; font-weight: 700; }
.library-selection__actions button:hover { background: #dceaff; }
.library-selection__close { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #f3f6fa; color: #8190a4; }

.library-modal { position: fixed; z-index: 3000; inset: 0; display: grid; place-items: center; padding: 28px; }
.library-modal__backdrop { position: absolute; inset: 0; background: rgba(8, 18, 34, .68); }
.library-modal__dialog { position: relative; z-index: 1; display: flex; width: min(960px, 100%); max-height: min(86vh, 900px); flex-direction: column; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .34); }
.library-modal__dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #edf0f5; }
.library-modal__dialog h2 { overflow: hidden; margin: 0; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.library-modal__dialog header button { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: #f2f5fa; color: #536276; }
.library-modal__dialog img { display: block; width: 100%; min-height: 0; object-fit: contain; }

.library-preview-modal { padding: 22px; }
.library-preview-modal__dialog { width: min(1120px, 100%); height: min(82vh, 820px); max-height: none; }
.library-preview-modal__header { flex: 0 0 auto; }
.library-preview-modal__header > div:first-child { min-width: 0; }
.library-preview-modal__header p { margin: 0 0 4px; color: var(--library-muted); font-size: .72rem; font-weight: 700; }
.library-preview-modal__header h2 { max-width: min(720px, 64vw); }
.library-preview-modal__header-actions { display: inline-flex; flex: 0 0 auto; gap: 8px; }
.library-preview-stage { position: relative; display: grid; flex: 1 1 auto; min-height: 0; place-items: center; overflow: auto; padding: 20px; background: #eef2f6; }
.library-preview-stage img { max-width: 100%; max-height: 100%; transition: transform .2s ease; }
.library-preview-stage iframe { width: 100%; height: 100%; min-height: 420px; border: 0; background: #fff; transform-origin: top center; transition: transform .2s ease; }
.library-preview-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid #edf0f5; background: #fff; }
.library-preview-toolbar__group { display: inline-flex; align-items: center; gap: 7px; }
.library-preview-toolbar button { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; border: 1px solid #e1e7ef; border-radius: 9px; background: #f8fafc; color: #4f627b; font-size: .78rem; font-weight: 700; }
.library-preview-toolbar button:hover { border-color: rgba(52, 127, 240, .4); background: #eef5ff; color: var(--library-accent); }
.library-preview-toolbar__group:first-child button { padding: 0; }
.library-preview-toolbar__group:first-child button[hidden] { display: none; }
.library-preview-toolbar__group > span { min-width: 48px; color: #65758a; font-size: .76rem; font-weight: 700; text-align: center; }

.library-menu { position: fixed; z-index: 5000; min-width: 172px; max-height: calc(100vh - 16px); overflow: auto; padding: 6px; border: 1px solid var(--library-border); border-radius: 11px; background: #fff; box-shadow: 0 12px 28px rgba(20, 43, 75, .2); }
.library-menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: #41536f; cursor: pointer; font: inherit; font-size: .8rem; text-align: left; }
.library-menu button:hover { background: #f0f6ff; color: var(--library-accent); }

.library-auth-modal,
.library-account-modal { z-index: 4200; }
.library-auth-modal__dialog,
.library-account-modal__dialog { position: relative; z-index: 1; width: min(440px, 100%); max-height: min(88vh, 760px); overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .3); }
.library-auth-modal__header,
.library-account-modal__dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 24px 16px; border-bottom: 1px solid #edf1f7; }
.library-auth-modal__header p,
.library-account-modal__dialog header p { margin: 0 0 4px; color: var(--library-accent); font-size: .72rem; font-weight: 700; }
.library-auth-modal__header h2,
.library-account-modal__dialog header h2 { margin: 0; color: var(--library-text); font-size: 1.18rem; }
.library-auth-modal__header > button,
.library-account-modal__dialog > header > button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 9px; background: #f1f5fa; color: #62738b; cursor: pointer; }
.library-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 18px 24px 0; padding: 4px; border-radius: 11px; background: #f2f6fb; }
.library-auth-tabs button { min-height: 34px; border: 0; border-radius: 8px; background: transparent; color: #7b899a; cursor: pointer; font: inherit; font-size: .83rem; font-weight: 700; }
.library-auth-tabs button.is-active { background: #fff; color: var(--library-accent); box-shadow: 0 2px 8px rgba(55, 87, 126, .1); }
.library-auth-form { display: grid; gap: 14px; padding: 19px 24px 24px; }
.library-auth-form[hidden] { display: none; }
.library-auth-form label { display: grid; gap: 6px; color: #52647c; font-size: .78rem; font-weight: 700; }
.library-auth-form label[hidden] { display: none !important; }
.library-auth-form input,
.library-auth-form select { width: 100%; min-width: 0; height: 42px; padding: 0 11px; border: 1px solid #dfe7f0; border-radius: 10px; outline: none; background: #fbfdff; color: var(--library-text); font: inherit; font-size: .86rem; }
.library-auth-form input:focus,
.library-auth-form select:focus { border-color: rgba(52, 127, 240, .54); box-shadow: 0 0 0 3px rgba(52, 127, 240, .1); }
.library-auth-form label > span { display: flex; gap: 8px; }
.library-auth-form label > span input { flex: 1 1 auto; }
.library-auth-form label > span button { flex: 0 0 auto; min-width: 94px; height: 42px; overflow: hidden; padding: 0 10px; border: 1px solid #dfe7f0; border-radius: 10px; background: #fff; color: var(--library-accent); cursor: pointer; font: inherit; font-size: .75rem; font-weight: 700; }
.library-auth-captcha img { display: block; width: 94px; height: 40px; object-fit: contain; }
.library-auth-submit { min-height: 43px; margin-top: 3px; border: 0; border-radius: 10px; background: var(--library-accent); color: #fff; cursor: pointer; font: inherit; font-size: .87rem; font-weight: 700; }
.library-auth-submit:hover { background: #216ae0; }
.library-auth-submit:disabled { cursor: wait; opacity: .65; }
.library-auth-message { min-height: 1.2em; margin: 0; color: #bd5a48; font-size: .77rem; line-height: 1.5; }
.library-auth-message.is-success { color: #2b9a74; }
.library-account-summary { display: flex; align-items: center; gap: 12px; padding: 20px 24px; }
.library-account-summary > i { color: var(--library-accent); font-size: 2.5rem; }
.library-account-summary strong,
.library-account-summary span { display: block; }
.library-account-summary strong { color: var(--library-text); font-size: 1rem; }
.library-account-summary span { margin-top: 4px; color: var(--library-muted); font-size: .76rem; }
.library-account-actions { display: grid; gap: 8px; padding: 0 24px 22px; }
.library-account-actions button { min-height: 42px; border: 1px solid #e2e9f1; border-radius: 10px; background: #fbfdff; color: #425875; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 700; text-align: left; }
.library-account-actions button i { width: 34px; color: var(--library-accent); text-align: center; }
.library-account-actions button:last-child { color: #bb5b55; }
.library-account-actions button:last-child i { color: #cf7169; }
.library-account-form { display: grid; gap: 14px; padding: 0 24px 24px; }
.library-account-form[hidden] { display: none !important; }
.library-account-form label { display: grid; gap: 6px; color: #52647c; font-size: .78rem; font-weight: 700; }
.library-account-form input { width: 100%; min-width: 0; height: 42px; padding: 0 11px; border: 1px solid #dfe7f0; border-radius: 10px; outline: none; background: #fbfdff; color: var(--library-text); font: inherit; font-size: .86rem; }
.library-account-form input:focus { border-color: rgba(52, 127, 240, .54); box-shadow: 0 0 0 3px rgba(52, 127, 240, .1); }
.library-account-form label > span { display: flex; gap: 8px; }
.library-account-form label > span input { flex: 1 1 auto; }
.library-account-form label > span button { flex: 0 0 auto; min-width: 94px; height: 42px; padding: 0 10px; border: 1px solid #dfe7f0; border-radius: 10px; background: #fff; color: var(--library-accent); cursor: pointer; font: inherit; font-size: .75rem; font-weight: 700; }
.library-account-form__heading { display: flex; align-items: center; gap: 12px; padding-top: 18px; }
.library-account-form__heading h3 { margin: 0; color: var(--library-text); font-size: .94rem; }
.library-account-form__heading button { border: 0; background: transparent; color: var(--library-accent); cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; }
.library-account-form__heading button i { margin-right: 5px; }
.library-account-form__hint { margin: 0; color: var(--library-muted); font-size: .78rem; }
.library-favorites { max-height: 260px; overflow: auto; padding: 0 24px 22px; border-top: 1px solid #edf1f7; }
.library-favorites h3 { margin: 15px 0 8px; color: var(--library-text); font-size: .84rem; }
.library-favorites button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 9px 0; border: 0; border-bottom: 1px solid #f0f3f7; background: transparent; color: #50617a; cursor: pointer; font: inherit; font-size: .8rem; text-align: left; }
.library-favorites button i { color: #e5aa39; }

body.dark.mzpi-library-page { background: #0b1120 !important; }
body.dark .library-heading h1,
body.dark .library-empty strong,
body.dark .library-error strong,
body.dark .library-item__name,
body.dark .library-selection__file { color: #e7edf7; }
body.dark .library-heading__description,
body.dark .library-notice,
body.dark .library-item__meta { color: #9eacc1; }
body.dark .library-browser,
body.dark .library-item { border-color: rgba(148, 163, 184, .14); background: rgba(30, 41, 59, .78); }
body.dark .library-item:hover,
body.dark .library-item.is-selected { background: #26354a; }
body.dark .library-refresh,
body.dark .library-theme-button,
body.dark .library-back,
body.dark .library-view-switch,
body.dark .library-search { border-color: rgba(148, 163, 184, .2); background: rgba(30, 41, 59, .78); color: #cfdaea; }
body.dark .library-search input { color: #e2e8f0; }
body.dark .library-selection { border-color: rgba(148, 163, 184, .2); background: rgba(30, 41, 59, .96); }
body.dark .library-modal__dialog,
body.dark .library-menu,
body.dark .library-auth-modal__dialog,
body.dark .library-account-modal__dialog { background: #1e293b; }
body.dark .library-modal__dialog header { border-color: rgba(148, 163, 184, .16); }
body.dark .library-modal__dialog h2,
body.dark .library-menu button,
body.dark .library-auth-modal__header h2,
body.dark .library-account-modal__dialog h2,
body.dark .library-account-summary strong { color: #d8e2ee; }
body.dark .library-auth-tabs { background: #172234; }
body.dark .library-auth-tabs button.is-active,
body.dark .library-auth-form input,
body.dark .library-auth-form select,
body.dark .library-auth-form label > span button,
body.dark .library-account-actions button,
body.dark .library-account-form input,
body.dark .library-account-form label > span button { border-color: rgba(148, 163, 184, .2); background: #26354a; color: #d5dfeb; }
body.dark .library-auth-form label,
body.dark .library-account-form label { color: #b8c5d6; }
body.dark .library-account-actions button:last-child { color: #f2a29c; }
body.dark .library-preview-stage { background: #111b29; }
body.dark .library-preview-toolbar { border-color: rgba(148, 163, 184, .16); background: #1e293b; }
body.dark .library-preview-toolbar button { border-color: rgba(148, 163, 184, .18); background: #26354a; color: #cbd7e5; }
body.dark .library-preview-toolbar__group > span { color: #b2c0d2; }

@media (max-width: 1100px) {
  .mzpi-library { width: 100%; margin: 0; padding: 42px clamp(18px, 5vw, 40px) 76px; }
  .library-selection { right: 24px; left: 24px; }
}

@media (max-width: 700px) {
  body.mzpi-library-page #headerSearchBtn,
  body.mzpi-library-page #headerThemeBtn,
  body.mzpi-library-page .mobile-header-right > a { display: none; }
  .mzpi-library { min-height: 100vh; padding: 28px 14px 88px; }
  .library-heading { align-items: flex-start; margin-bottom: 16px; }
  .library-heading__actions { gap: 6px; }
  .library-heading h1 { font-size: 2rem; }
  .library-heading__description { font-size: .82rem; line-height: 1.55; }
  .library-refresh { width: 38px; min-width: 38px; padding: 0; }
  .library-refresh span { display: none; }
  .library-account-button { min-height: 38px; padding: 0 11px; font-size: .76rem; }
  .library-account-button span { max-width: 104px; }
  .library-browser { padding: 13px; border-radius: 14px; }
  .library-browser__topline { flex-wrap: wrap; gap: 8px; }
  .library-back { min-height: 34px; padding: 0 10px; font-size: .75rem; }
  .library-breadcrumb { order: 3; width: 100%; }
  .library-breadcrumb button { max-width: 132px; font-size: .8rem; }
  .library-view-switch { margin-left: auto; }
  .library-search { width: 100%; margin: 14px 0 10px; }
  .library-items.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .library-items.is-grid .library-item { min-height: 132px; padding: 14px; border-radius: 12px; }
  .library-item__icon { width: 36px; height: 36px; font-size: 1.1rem; }
  .library-item__name { font-size: .82rem; }
  .library-selection { right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); left: 12px; gap: 8px; min-height: 54px; padding: 8px 10px; border-radius: 13px; }
  .library-selection__actions { gap: 5px; }
  .library-selection__actions button { min-height: 32px; padding: 0 8px; font-size: .7rem; }
  .library-selection__close { width: 30px; height: 30px; }
  .library-modal { padding: 14px; }
  .library-modal__dialog { max-height: 82vh; border-radius: 14px; }
  .library-auth-modal__dialog,
  .library-account-modal__dialog { border-radius: 14px; }
  .library-auth-modal__header,
  .library-account-modal__dialog > header { padding: 18px 18px 14px; }
  .library-auth-tabs { margin: 14px 18px 0; }
  .library-auth-form { padding: 16px 18px 20px; }
  .library-account-summary,
  .library-account-actions { padding-right: 18px; padding-left: 18px; }
  .library-favorites { padding-right: 18px; padding-left: 18px; }
  .library-preview-modal { padding: 0; }
  .library-preview-modal__dialog { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .library-preview-stage { padding: 10px; }
  .library-preview-stage iframe { min-height: 360px; }
  .library-preview-toolbar { padding: 10px; }
  .library-preview-toolbar button span { display: none; }
}

@keyframes library-spin { to { transform: rotate(360deg); } }
