:root {
  --surface: #f8fafc;
  --surface-low: #f3f6fa;
  --surface-card: #ffffff;
  --primary: #006ebc;
  --primary-bright: #006ebc;
  --primary-soft: color-mix(in srgb, var(--primary) 18%, #ffffff);
  --surface-strong: color-mix(in srgb, var(--primary) 14%, #ffffff);
  --ink: #111c2d;
  --muted: #526071;
  --line: #c0c7d2;
  --danger: #ba1a1a;
  --success: #24734c;
  --shadow: 0 8px 24px rgba(17, 28, 45, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  width: 288px;
  height: 100vh;
  flex: 0 0 288px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  background: var(--surface-card);
  border-right: 1px solid rgba(192, 199, 210, 0.75);
  transition: width 180ms ease, flex-basis 180ms ease, padding 180ms ease;
}

.brand-block,
.login-brand,
.reader-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-copy,
.nav-text {
  transition: opacity 140ms ease, width 140ms ease;
  white-space: nowrap;
}

.brand-block strong,
.reader-title strong {
  display: block;
  color: var(--primary);
  font-size: 20px;
  line-height: 1.2;
}

.brand-block span,
.reader-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.sidebar-toggle {
  position: absolute;
  right: -15px;
  top: 50%;
  z-index: 30;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(192, 199, 210, 0.7);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 0 4px 12px rgba(17, 28, 45, 0.08);
}

.sidebar-toggle span {
  font-size: 20px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.brand-mark.large {
  width: 60px;
  height: 60px;
  font-size: 18px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a,
.logout-form button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  overflow: hidden;
}

.nav-list a:hover,
.logout-form button:hover {
  background: var(--surface-low);
  color: var(--primary);
}

.nav-list a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.logout-form {
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(192, 199, 210, 0.5);
}

.main-shell {
  min-width: 0;
  flex: 1;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 44px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(192, 199, 210, 0.45);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.topbar-menu-button {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--surface-low);
  color: var(--primary);
  cursor: pointer;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.portal-search {
  position: relative;
  width: clamp(220px, 25vw, 320px);
}

.portal-search span {
  position: absolute;
  left: 13px;
  top: 50%;
  color: #6e7b8c;
  transform: translateY(-50%);
}

.portal-search input {
  width: 100%;
  height: 38px;
  padding: 8px 16px 8px 42px;
  border: 1px solid #d7deea;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(17, 28, 45, 0.02);
}

.portal-search input::placeholder {
  color: #8b97a8;
  font-weight: 600;
}

.topbar-icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #405066;
  cursor: pointer;
}

.topbar-icon-button:hover {
  background: var(--surface-low);
  color: var(--primary);
}

.language-switcher {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid #d7deea;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
}

.language-switcher .material-symbols-outlined {
  font-size: 18px;
}

.language-switcher select {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  outline: 0;
  cursor: pointer;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid #dfe7f4;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #111c2d);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.user-chip,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

body.sidebar-collapsed .sidebar {
  width: 82px;
  flex-basis: 82px;
  padding: 24px 12px;
}

body.sidebar-collapsed .brand-block {
  justify-content: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .sidebar-footer {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar-toggle {
  right: -15px;
}

body.sidebar-collapsed .nav-list a,
body.sidebar-collapsed .logout-form button {
  justify-content: center;
  gap: 0;
  padding: 12px;
}

body.sidebar-collapsed .nav-list a .material-symbols-outlined,
body.sidebar-collapsed .logout-form button .material-symbols-outlined {
  font-size: 24px;
}

.content {
  width: min(1280px, calc(100% - 48px));
  flex: 1;
  margin: 0 auto;
  padding: 36px 0 64px;
}

.site-footer {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 24px;
  color: #7e8b9c;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.site-footer a,
.login-copyright a,
.sidebar-footer a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover,
.login-copyright a:hover,
.sidebar-footer a:hover {
  color: var(--primary-bright);
  text-decoration: underline;
}

.back-to-top-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(192, 199, 210, 0.7);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(17, 28, 45, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease, background 160ms ease;
}

.back-to-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top-button:hover {
  background: var(--primary);
  color: #fff;
}

.back-to-top-button:focus-visible {
  outline: 3px solid rgba(0, 112, 184, 0.18);
  outline-offset: 3px;
}

.back-to-top-button .material-symbols-outlined {
  font-size: 28px;
}

.sidebar-footer {
  width: auto;
  margin: auto 0 0;
  padding: 0 14px 14px;
  color: #7e8b9c;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
}

.magazine-head {
  margin-top: 0;
}

.welcome-band,
.library-header,
.activity-panel,
.analytics-panel,
.admin-card,
.detail-layout {
  background: var(--surface-card);
  border: 1px solid rgba(192, 199, 210, 0.5);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.welcome-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
}

.welcome-band h2,
.library-header h2,
.section-head h2,
.admin-card h2,
.detail-copy h2 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.25;
}

.welcome-band p,
.library-header p,
.detail-copy p,
.doc-body p {
  color: var(--muted);
  line-height: 1.6;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0 40px;
}

.stat-card {
  min-height: 144px;
  display: grid;
  align-content: space-between;
  padding: 22px;
  border: 1px solid rgba(192, 199, 210, 0.45);
  border-radius: 14px;
  background: var(--surface-card);
  box-shadow: 0 4px 18px rgba(17, 28, 45, 0.04);
}

.stat-card .material-symbols-outlined {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.analytics-panel {
  margin: 0 0 40px;
  padding: 28px;
}

.analytics-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.analytics-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(192, 199, 210, 0.45);
  border-radius: 999px;
  background: #f8fafc;
}

.analytics-summary strong {
  color: var(--primary);
  font-size: 16px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.read-chart {
  min-height: 260px;
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  gap: 14px;
  align-items: end;
  padding: 22px;
  border: 1px solid rgba(192, 199, 210, 0.45);
  border-radius: 12px;
  background: #f8fafc;
}

.read-chart-day {
  height: 210px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.read-chart-day i {
  width: min(34px, 80%);
  align-self: end;
  display: block;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #36a3ff, var(--primary));
  box-shadow: 0 8px 18px rgba(0, 112, 184, 0.16);
}

.read-chart-day span {
  color: var(--ink);
  font-size: 13px;
}

.top-read-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(192, 199, 210, 0.45);
  border-radius: 12px;
  background: #fff;
}

.top-read-list h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.25;
}

.top-read-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(192, 199, 210, 0.45);
}

.top-read-list div:last-of-type {
  border-bottom: 0;
}

.top-read-list span {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.top-read-list strong {
  min-width: 34px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dff5e9;
  color: #17613e;
  font-size: 13px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 18px;
}

.section-head.inline {
  margin: 0 0 22px;
}

.text-button,
.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  min-height: 46px;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary);
}

.primary-button.small {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 14px;
}

.secondary-button {
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--primary);
}

.small-table-button {
  min-height: 36px;
  padding: 8px 12px;
}

.text-button {
  color: var(--primary);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(192, 199, 210, 0.7);
  background: var(--surface-card);
  color: var(--primary);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
  gap: 24px;
  align-items: start;
}

.doc-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
}

.doc-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, #ffffff);
  border-radius: 14px;
  background: var(--primary);
  box-shadow: 0 4px 18px rgba(17, 28, 45, 0.04);
  cursor: pointer;
}

.doc-card:hover,
.doc-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(17, 28, 45, 0.08);
}

.doc-card:focus-visible {
  outline: 3px solid var(--primary-soft);
  outline-offset: 3px;
}

.cover,
.detail-cover {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 18px;
  overflow: hidden;
  background: #eef5fb;
  color: var(--primary);
}

.detail-cover::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, #ffffff);
  border-radius: 10px;
}

.detail-cover .material-symbols-outlined {
  font-size: 56px;
}

.detail-cover strong {
  font-size: 32px;
}

.cover small,
.detail-cover small {
  color: var(--muted);
  font-weight: 800;
}

.cover.has-thumbnail {
  height: 220px;
  min-height: 0;
  padding: 0;
  background: #e8eef5;
}

.cover.has-thumbnail img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
}

.volume-badge {
  position: absolute;
  right: 0;
  top: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: color-mix(in srgb, var(--primary) 84%, #ffffff);
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(17, 28, 45, 0.16);
}

.cover-art {
  width: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 26px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, #ffffff);
  border-radius: 10px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, #ffffff), #eef6fc);
}

.cover-art .material-symbols-outlined {
  font-size: 56px;
}

.cover-art strong {
  font-size: 34px;
  line-height: 1;
}

.cover-art small {
  color: var(--muted);
  font-weight: 800;
}

.cover-art em {
  width: 100%;
  max-width: 250px;
  margin-top: 12px;
  color: color-mix(in srgb, var(--primary) 70%, var(--ink));
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.doc-body {
  padding: 18px;
  background: var(--primary);
  color: #fff;
}

.issue-date {
  width: max-content;
  display: block;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.doc-body h3 {
  min-height: 46px;
  margin: 6px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.doc-body p:not(.eyebrow) {
  min-height: 44px;
  margin: 0 0 18px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: rgba(255, 255, 255, 0.86);
}

.doc-body .primary-button {
  background: #fff;
  color: var(--primary);
}

.doc-body .primary-button:hover {
  background: color-mix(in srgb, #ffffff 88%, var(--primary));
}

.doc-actions,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-panel {
  margin-top: 40px;
  padding: 28px;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-list div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-low);
}

.activity-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

.activity-list strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 900;
}

.activity-detail {
  min-width: 0;
}

.activity-list em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  word-break: break-word;
}

.activity-list small {
  flex: 0 0 auto;
  margin-left: auto;
}

.activity-list small,
.muted {
  color: var(--muted);
}

.activity-pagination {
  margin-top: 16px;
}

.library-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
  padding: 32px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar label {
  position: relative;
}

.filter-bar label span {
  position: absolute;
  left: 12px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
}

.filter-bar input,
.filter-bar select,
.stack-form input,
.stack-form select,
.stack-form textarea {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-card);
  color: var(--ink);
}

.filter-bar input {
  width: 260px;
  padding-left: 42px;
}

.filter-bar input:focus,
.filter-bar select:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.auth-form input:focus {
  outline: 3px solid rgba(0, 112, 184, 0.16);
  border-color: var(--primary-bright);
}

.detail-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 44px;
  padding: 34px;
}

.detail-cover {
  min-height: 460px;
  border-radius: 12px;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.meta-list div {
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-low);
}

.meta-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-list dd {
  margin: 6px 0 0;
  word-break: break-word;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.profile-page {
  align-items: stretch;
}

.content.upload-management {
  width: min(1040px, calc(100% - 48px));
  display: block;
  padding-top: 44px;
}

.upload-page-head {
  margin-bottom: 32px;
}

.upload-page-head h2 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.25;
}

.upload-form-card {
  padding: 32px;
  border-radius: 12px;
}

.upload-form {
  display: grid;
  gap: 24px;
}

.upload-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.upload-form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.upload-field input,
.upload-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--ink);
  font-weight: 600;
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.upload-field textarea {
  min-height: 116px;
  resize: vertical;
}

.upload-field input:focus,
.upload-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 112, 184, 0.12);
}

.upload-field input[type="file"] {
  min-height: 50px;
  padding: 10px;
  border-style: dashed;
  cursor: pointer;
}

.upload-field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 112, 184, 0.28);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
}

.upload-progress {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-low);
}

.upload-progress progress::-webkit-progress-bar {
  background: var(--surface-low);
}

.upload-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--primary);
}

.upload-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--primary);
}

.upload-submit-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.upload-submit-button {
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 8px;
}

.upload-list-section {
  margin-top: 72px;
}

.upload-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.upload-list-head h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.upload-list-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.upload-repository-link {
  min-height: auto;
  padding: 0 0 4px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.upload-repository-link:hover {
  border-bottom-color: var(--primary);
}

.upload-repository-link .material-symbols-outlined {
  font-size: 18px;
}

.upload-table-card {
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}

.upload-table th,
.upload-table td {
  padding: 18px 24px;
}

.upload-table th {
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.upload-table tbody tr:hover {
  background: color-mix(in srgb, var(--primary) 5%, #ffffff);
}

.upload-table th:last-child,
.upload-table td:last-child {
  text-align: right;
}

.upload-title-cell {
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
}

.upload-cover-thumb {
  width: 40px;
  height: 56px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(192, 199, 210, 0.45);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--primary);
}

.upload-cover-thumb.has-thumbnail {
  background: #e8eef5;
}

.upload-cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-status-pill {
  border: 1px solid rgba(0, 112, 184, 0.12);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
}

.upload-actions {
  justify-content: flex-end;
}

.upload-actions form {
  margin: 0;
}

.admin-card {
  padding: 28px;
}

.admin-card.wide {
  grid-column: 1 / -1;
}

.admin-grid > .admin-card:not(.wide) {
  grid-column: span 1;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.smtp-warning {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(186, 26, 26, 0.16);
  border-radius: 10px;
  background: rgba(186, 26, 26, 0.06);
  color: #7f1d1d;
}

.smtp-warning .material-symbols-outlined {
  color: var(--danger);
}

.smtp-warning strong {
  display: block;
  font-size: 14px;
}

.smtp-warning p {
  margin: 4px 0 0;
  color: #5f2930;
  font-size: 13px;
  line-height: 1.5;
}

.smtp-warning code {
  color: var(--danger);
  font-weight: 800;
}

.smtp-warning.compact {
  margin-bottom: 20px;
  padding: 12px;
}

.smtp-warning.compact p {
  font-size: 12px;
}

.content.admin-console {
  width: min(1280px, calc(100% - 48px));
  display: block;
  padding: 36px 0 64px;
}

.admin-console-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.admin-console-head h2 {
  margin: 0 0 8px;
  color: #111c2d;
  font-size: 32px;
  line-height: 1.25;
}

.admin-console-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.admin-console-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.admin-console-card {
  overflow: hidden;
  border: 1px solid rgba(192, 199, 210, 0.5);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-invite-card {
  padding: 28px 32px 32px;
}

.admin-console-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-console-title > .material-symbols-outlined {
  color: var(--primary);
  font-size: 24px;
}

.admin-console-title p {
  margin: 0 0 2px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.admin-console-title h3 {
  margin: 0;
  color: #111c2d;
  font-size: 24px;
  line-height: 1.25;
}

.admin-invite-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.admin-invite-form label {
  display: grid;
  gap: 8px;
  color: #405066;
  font-size: 14px;
  font-weight: 800;
}

.admin-invite-form input,
.admin-invite-form select,
.admin-permission-form select,
.admin-status-select,
.admin-user-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f9ff;
  color: #111c2d;
  font-size: 14px;
  font-weight: 600;
  outline: 0;
}

.admin-invite-form input:focus,
.admin-invite-form select:focus,
.admin-permission-form select:focus,
.admin-status-select:focus,
.admin-user-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 112, 184, 0.14);
  background: #fff;
}

.admin-invite-form .primary-button {
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  border-radius: 8px;
}

.admin-list-card {
  min-width: 0;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid rgba(192, 199, 210, 0.45);
}

.admin-user-search {
  position: relative;
  width: min(256px, 34vw);
}

.admin-user-search .material-symbols-outlined {
  position: absolute;
  left: 13px;
  top: 50%;
  color: var(--muted);
  font-size: 22px;
  transform: translateY(-50%);
}

.admin-user-search input {
  min-height: 42px;
  padding-left: 42px;
  border-radius: 999px;
  background: #fff;
  font-weight: 500;
}

.admin-user-table-wrap {
  overflow-x: auto;
}

.admin-user-table {
  min-width: 720px;
}

.admin-user-table th,
.admin-user-table td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(192, 199, 210, 0.45);
  vertical-align: middle;
}

.admin-user-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-user-table td {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.admin-user-table th:last-child,
.admin-user-table td:last-child {
  width: 92px;
  text-align: center;
}

.admin-user-cell {
  min-width: 280px;
}

.admin-user-cell strong {
  display: block;
  color: var(--ink) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.35;
  word-break: break-word;
}

.admin-user-cell span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-permission-form {
  display: grid;
  min-width: 150px;
}

.admin-permission-form select {
  min-height: 38px;
  padding: 7px 10px;
  border-color: rgba(0, 112, 184, 0.24);
  background-color: #eef6ff;
  color: #005791;
  font-weight: 800;
}

.admin-role-label {
  color: var(--ink);
  font-weight: 800;
}

.admin-status-select {
  width: 116px;
  min-height: 32px;
  padding: 5px 28px 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.admin-status-select.active {
  border-color: rgba(36, 115, 76, 0.24);
  background-color: #dff5e9;
  color: #17613e;
}

.admin-status-select.pending {
  border-color: rgba(178, 104, 0, 0.24);
  background-color: #fff0d3;
  color: #835100;
}

.admin-status-select.inactive {
  border-color: rgba(186, 26, 26, 0.2);
  background-color: #ffdad6;
  color: #93000a;
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.admin-status-badge i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.admin-status-badge.active {
  background: #dff5e9;
  color: #17613e;
}

.admin-status-badge.active i {
  background: #24734c;
}

.admin-status-badge.pending {
  background: #fff0d3;
  color: #835100;
}

.admin-status-badge.pending i {
  background: #b26800;
}

.admin-status-badge.inactive {
  background: #ffdad6;
  color: #93000a;
}

.admin-status-badge.inactive i {
  background: #ba1a1a;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.admin-row-actions form {
  margin: 0;
}

.admin-delete-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #ffdad6;
  color: var(--danger);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.admin-delete-button:hover {
  background: var(--danger);
  color: #fff;
  transform: translateY(-1px);
}

.admin-delete-button .material-symbols-outlined {
  font-size: 20px;
}

.admin-list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-list-pager {
  display: flex;
  gap: 8px;
}

.admin-list-pager a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.admin-list-pager a:not(.disabled):hover {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-list-pager a.disabled {
  pointer-events: none;
  opacity: 0.46;
}

.content.settings-page {
  width: min(1280px, calc(100% - 48px));
  display: block;
  padding: 36px 0 64px;
}

.settings-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.settings-page-head h2 {
  margin: 4px 0 8px;
  color: #111c2d;
  font-size: 32px;
  line-height: 1.25;
}

.settings-page-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.settings-save-button {
  min-width: 150px;
}

.settings-form {
  display: grid;
  gap: 20px;
}

.settings-locale-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px 24px;
  border: 1px solid rgba(192, 199, 210, 0.5);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.settings-locale-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-locale-card > div:first-child > .material-symbols-outlined {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf4ff;
  color: var(--primary);
}

.settings-locale-card h3,
.settings-locale-card p {
  margin: 0;
}

.settings-locale-card h3 {
  color: #111c2d;
  font-size: 18px;
}

.settings-locale-card p:not(.eyebrow) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.settings-locale-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid #d7deea;
  border-radius: 999px;
  background: var(--surface-low);
}

.settings-locale-tabs a {
  min-width: 42px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #405066;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.settings-locale-tabs a.active {
  background: var(--primary);
  color: #fff;
}

.settings-card {
  padding: 24px;
  border: 1px solid rgba(192, 199, 210, 0.5);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.settings-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(192, 199, 210, 0.45);
}

.settings-card-title > .material-symbols-outlined {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf4ff;
  color: var(--primary);
}

.settings-card-title h3 {
  margin: 0;
  color: #111c2d;
  font-size: 22px;
  line-height: 1.25;
}

.settings-title-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  padding-top: 20px;
}

.settings-grid label,
.settings-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #405066;
  font-size: 14px;
  font-weight: 800;
}

.settings-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-field-head > label {
  min-width: 0;
}

.translation-chip,
.translation-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.translation-chip.source {
  background: #eaf4ff;
}

.translation-lock {
  cursor: pointer;
}

.translation-lock input,
.settings-sync-toggle input {
  width: auto;
  min-height: 0;
  margin: 0;
  accent-color: var(--primary);
}

.settings-sync-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #405066;
  font-size: 13px;
  font-weight: 800;
}

.settings-grid input,
.settings-grid textarea,
.settings-field input,
.settings-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f9ff;
  color: #111c2d;
  font-size: 14px;
  font-weight: 600;
  outline: 0;
}

.settings-grid textarea,
.settings-field textarea {
  resize: vertical;
}

.settings-grid input:focus,
.settings-grid textarea:focus,
.settings-field input:focus,
.settings-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 112, 184, 0.14);
  background: #fff;
}

.settings-grid .translation-lock input,
.settings-sync-toggle input {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.settings-grid .wide,
.settings-field.wide {
  grid-column: 1 / -1;
}

.settings-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.settings-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 20px;
}

.settings-asset-grid label {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: #405066;
  font-size: 14px;
  font-weight: 800;
}

.settings-asset-grid img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  padding: 14px;
  border: 1px solid rgba(192, 199, 210, 0.45);
  border-radius: 10px;
  background: #f8fafc;
}

.settings-asset-grid input {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f9ff;
  color: #111c2d;
  font-size: 13px;
  font-weight: 700;
}

.permission-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(192, 199, 210, 0.7);
  border-radius: 10px;
}

.permission-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.permission-fieldset label,
.permission-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.permission-fieldset input,
.permission-checks input {
  width: 15px;
  height: 15px;
}

.permission-form {
  display: grid;
  gap: 10px;
  min-width: 360px;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.form-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.inline-fields select {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.permission-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.content.profile-page {
  width: min(1280px, calc(100% - 48px));
  display: block;
  padding: 36px 0 64px;
}

.profile-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.profile-page-head h2 {
  margin: 0 0 8px;
  color: #111c2d;
  font-size: 32px;
  line-height: 1.25;
}

.profile-page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.profile-head-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-action-button {
  min-width: 108px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

.profile-action-button .material-symbols-outlined {
  font-size: 20px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.profile-main-column {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.profile-side-column {
  min-width: 0;
}

.profile-glass-card {
  background: #fff;
  border: 1px solid rgba(192, 199, 210, 0.5);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.profile-hero-card {
  position: relative;
  min-height: 144px;
  display: flex;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  padding: 28px;
}

.profile-hero-card::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -82px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: #d0e4ff;
  filter: blur(44px);
  opacity: 0.38;
  pointer-events: none;
}

.profile-avatar-form {
  position: relative;
  z-index: 1;
  margin: 0;
}

.profile-avatar-large {
  position: relative;
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 4px solid #f8fafc;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #111c2d);
  color: #fff;
  cursor: pointer;
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(17, 28, 45, 0.1);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.profile-avatar-large input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-avatar-large img,
.profile-avatar-large > span:first-of-type {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.profile-avatar-large img {
  object-fit: cover;
}

.profile-avatar-large > span:first-of-type {
  display: grid;
  place-items: center;
}

.profile-avatar-camera {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(17, 28, 45, 0.52);
  color: #fff;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 160ms ease, transform 160ms ease;
}

.profile-avatar-camera .material-symbols-outlined {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 24px;
}

.profile-avatar-large:hover,
.profile-avatar-large:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17, 28, 45, 0.18);
}

.profile-avatar-large:hover .profile-avatar-camera,
.profile-avatar-large:focus-within .profile-avatar-camera {
  opacity: 1;
  transform: scale(1);
}

.profile-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.profile-hero-copy h3 {
  margin: 0 0 6px;
  color: #111c2d;
  font-size: 24px;
  line-height: 1.25;
}

.profile-hero-copy p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.profile-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(192, 199, 210, 0.32);
  border-radius: 999px;
  background: #e0e3e5;
  color: #626567;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.profile-chip.active {
  border-color: rgba(0, 112, 184, 0.14);
  background: #d0e4ff;
  color: var(--primary);
}

.profile-chip.active i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
}

.profile-chip.verified {
  background: #e4ecff;
  color: #1d2c43;
}

.profile-chip .material-symbols-outlined {
  font-size: 16px;
}

.profile-info-card,
.profile-security-card {
  padding: 28px;
}

.profile-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(192, 199, 210, 0.45);
}

.profile-card-title > .material-symbols-outlined {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf4ff;
  color: var(--primary);
  font-size: 24px;
}

.profile-card-title.security > .material-symbols-outlined {
  background: #fff1f0;
  color: var(--danger);
}

.profile-card-title h3 {
  margin: 0;
  color: #111c2d;
  font-size: 24px;
  line-height: 1.25;
}

.profile-info-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  padding-top: 22px;
}

.profile-info-form label,
.profile-password-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #405066;
  font-size: 14px;
  font-weight: 800;
}

.profile-info-form input,
.profile-info-form textarea,
.profile-password-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f9ff;
  color: #111c2d;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.profile-info-form input:focus,
.profile-info-form textarea:focus,
.profile-password-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 112, 184, 0.1);
  background: #fff;
}

.profile-info-form input[readonly] {
  color: #1f2b3d;
}

.profile-info-form textarea {
  min-height: 96px;
  resize: vertical;
}

.profile-info-form .wide {
  grid-column: 1 / -1;
}

.profile-field-with-icon > span {
  position: relative;
  display: block;
}

.profile-field-with-icon .material-symbols-outlined {
  position: absolute;
  left: 12px;
  top: 50%;
  color: #9aa3af;
  font-size: 18px;
  transform: translateY(-50%);
}

.profile-field-with-icon input {
  padding-left: 38px;
}

.profile-security-card {
  position: sticky;
  top: 92px;
}

.profile-security-card > p {
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.profile-password-form {
  display: grid;
  gap: 16px;
}

.profile-password-field {
  position: relative;
  display: block;
}

.profile-password-field input {
  padding-right: 46px;
  font-size: 14px;
}

.profile-password-field button {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9aa3af;
  cursor: pointer;
  transform: translateY(-50%);
}

.profile-password-field button:hover {
  color: var(--primary);
}

.profile-password-field .material-symbols-outlined {
  font-size: 20px;
}

.password-strength {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.password-strength i {
  height: 5px;
  border-radius: 999px;
  background: #e4ecff;
}

.profile-password-form small {
  color: #717882;
  font-size: 13px;
  font-weight: 800;
}

.profile-update-password {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.profile-update-password:hover {
  background: var(--primary);
  color: #fff;
}

.profile-update-password .material-symbols-outlined {
  font-size: 21px;
}

.permission-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.upload-panel {
  max-width: 720px;
}

.upload-management .admin-card.wide {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
}

.table-actions {
  white-space: nowrap;
}

.table-actions > * {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.table-actions > * + * {
  margin-left: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(192, 199, 210, 0.45);
  text-align: left;
}

.empty-cell {
  padding: 24px 12px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-pages a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-low);
  color: var(--muted);
  font-weight: 800;
}

.pagination-pages a.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.pagination .disabled {
  pointer-events: none;
  opacity: 0.48;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.text-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 800;
}

.magazine-editor {
  max-width: 980px;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.editor-preview {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, #ffffff);
  border-radius: 14px;
  background: var(--surface-low);
}

.editor-preview img {
  width: 100%;
  height: 360px;
  display: block;
  object-fit: cover;
  background: #fff;
}

.editor-preview .material-symbols-outlined {
  width: 100%;
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 72px;
}

.editor-preview p {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state .material-symbols-outlined {
  font-size: 48px;
  color: var(--primary);
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 700;
}

.flash.success {
  background: rgba(36, 115, 76, 0.11);
  color: var(--success);
}

.flash.error {
  background: rgba(186, 26, 26, 0.09);
  color: var(--danger);
}

.login-page {
  background: #fbfdff var(--login-bg-image, url("/assets/usm-login-illustration.jpg")) center / cover no-repeat;
}

.login-shell {
  position: relative;
  width: min(1088px, calc(100% - 40px));
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  margin: 0 auto;
  padding-top: clamp(72px, 11.5vh, 96px);
}

.login-panel {
  width: min(292px, 100%);
  margin-left: 2px;
}

.login-logo {
  display: block;
  width: 260px;
  max-width: 100%;
  height: auto;
  margin-bottom: 18px;
}

.login-lead,
.login-foot {
  color: var(--muted);
  line-height: 1.45;
}

.login-lead {
  margin: 0 0 22px;
  color: #1f3147;
  font-size: 15px;
  font-weight: 500;
}

.login-foot {
  margin: 24px 0 0;
  text-align: center;
  font-size: 13px;
}

.login-foot a,
.login-label-row a {
  color: var(--primary-bright);
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 20px;
  margin-top: 0;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.auth-form label span {
  position: relative;
}

.auth-form i {
  position: absolute;
  left: 0;
  top: 50%;
  color: #b8c1cb;
  transform: translateY(-50%);
  font-size: 19px;
}

.auth-form input {
  width: 100%;
  height: 44px;
  padding: 10px 34px 10px 34px;
  border: 0;
  border-bottom: 1px solid #d5dce8;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.auth-form input::placeholder {
  color: #a6b1bf;
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #b8c1cb;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle span {
  font-size: 19px;
}

.password-toggle:hover {
  color: var(--primary);
}

.login-label-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-label-row a {
  font-size: 11px;
}

.remember-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  margin-top: -1px;
  color: #43516a !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

.remember-row input {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid #d5dce8;
  border-radius: 2px;
}

.remember-row span {
  position: static !important;
}

.login-panel .primary-button {
  width: 100%;
  min-height: 42px;
  margin-top: 2px;
  border-radius: 6px;
  background: var(--primary);
  font-size: 14px;
}

.login-panel .primary-button:hover {
  background: var(--primary);
}

.login-copyright {
  position: absolute;
  left: 2px;
  bottom: clamp(42px, 6.8vh, 58px);
  width: auto;
  margin: 0;
  padding: 0;
  color: #7e8b9c;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
}

.info-shell {
  align-items: center;
  padding-top: 0;
}

.info-panel {
  width: min(420px, 100%);
}

.info-panel h1 {
  margin: 8px 0 12px;
  font-size: 30px;
  line-height: 1.2;
}

.info-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.info-panel .primary-button {
  margin-top: 18px;
}

.info-panel.in-app {
  width: min(720px, 100%);
  padding: 34px;
}

.quick-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.reader-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at center 45%, rgba(255, 255, 255, 0.92), rgba(218, 227, 238, 0.76) 38%, #cfd9e6 100%);
}

.reader-toolbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(249, 249, 255, 0.94);
  border-bottom: 1px solid rgba(192, 199, 210, 0.55);
  backdrop-filter: blur(14px);
}

.reader-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-indicator {
  min-width: 130px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.reader-stage {
  position: relative;
  height: calc(100vh - 188px);
  height: calc(100dvh - 188px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 22px 108px;
  perspective: 2200px;
}

body.reader-focus-mode {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.96), #dbe5f0 62%, #cfd9e6 100%);
}

body.reader-focus-mode .reader-toolbar,
body.reader-focus-mode .thumb-strip {
  display: none;
}

body.reader-focus-mode .reader-stage {
  height: 100vh;
  height: 100dvh;
  padding: 24px 92px;
}

.reader-focus-exit {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 140;
  width: 58px;
  height: 58px;
  display: none;
  place-items: center;
  border: 1px solid rgba(192, 199, 210, 0.64);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--primary);
  cursor: pointer;
  opacity: 0.82;
  box-shadow: 0 10px 28px rgba(17, 28, 45, 0.14);
  backdrop-filter: blur(12px);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

body.reader-focus-mode .reader-focus-exit {
  display: grid;
}

.reader-focus-exit:hover,
.reader-focus-exit:focus-visible {
  background: #fff;
  opacity: 1;
  transform: translateY(-1px);
}

.reader-focus-exit:focus-visible {
  outline: 3px solid rgba(0, 112, 184, 0.18);
  outline-offset: 3px;
}

.reader-focus-exit .material-symbols-outlined {
  font-size: 31px;
}

.book-wrap {
  transform-origin: center;
  transition: transform 180ms ease;
  position: relative;
  backface-visibility: hidden;
  contain: layout paint;
  will-change: transform;
}

.book-wrap.is-zoomed {
  cursor: grab;
  z-index: 20;
  touch-action: none;
}

.book-wrap.is-panning {
  cursor: grabbing;
  transition: none !important;
}

.book-wrap.is-pinching {
  touch-action: none;
  transition: none !important;
}

.reader-zoomed .page-nav {
  pointer-events: none;
  opacity: 0.42;
}

.book-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2.5%;
  bottom: 2.5%;
  z-index: 32;
  width: 26px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(17, 28, 45, 0.18), rgba(255, 255, 255, 0.28) 42%, rgba(17, 28, 45, 0.12));
  filter: blur(0.2px);
  opacity: 0.55;
  transform: translateX(-50%);
}

.reader-portrait .book-wrap::before {
  display: none;
}

.reader-pdf-landscape .book-wrap::before,
.reader-pdf-square .book-wrap::before {
  top: 4%;
  bottom: 4%;
  opacity: 0.42;
}

.book-wrap::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -24px;
  height: 34px;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(17, 28, 45, 0.26), transparent 72%);
  filter: blur(10px);
}

.flip-book {
  filter: drop-shadow(0 26px 38px rgba(17, 28, 45, 0.22));
}

.single-page-reader {
  display: grid;
  place-items: center;
  position: relative;
  filter: drop-shadow(0 18px 28px rgba(17, 28, 45, 0.16));
  perspective: 1200px;
}

.single-page {
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(17, 28, 45, 0.04);
  transform-origin: center;
  transition: opacity 220ms ease, transform 260ms ease;
  will-change: transform, opacity;
}

.single-page.is-turning-next {
  opacity: 0;
  transform: rotateY(-24deg) translateX(-10px) scale(0.985);
}

.single-page.is-turning-prev {
  opacity: 0;
  transform: rotateY(24deg) translateX(10px) scale(0.985);
}

.single-page.is-entering-next,
.single-page.is-entering-prev {
  opacity: 0.01;
}

.reader-single-mode .book-wrap {
  touch-action: none;
}

.reader-single-mode .book-wrap::before {
  display: none;
}

.page {
  overflow: hidden;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(17, 28, 45, 0.04);
}

.pdf-page-shell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: #fff;
}

.pdf-page-shell canvas {
  display: block;
  background: white;
}

.hard .pdf-page-shell {
  background: #fff;
}

.page-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(192, 199, 210, 0.7);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow);
  transform: translateY(-50%);
}

.page-nav.left {
  left: 24px;
}

.page-nav.right {
  right: 24px;
}

.page-nav span {
  font-size: 34px;
}

.page-nav:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.thumb-strip {
  height: 112px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 24px;
  background: var(--surface-card);
  border-top: 1px solid rgba(192, 199, 210, 0.55);
}

.thumb-strip button {
  width: 54px;
  height: 72px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px solid rgba(192, 199, 210, 0.7);
  border-radius: 8px;
  background: var(--surface-low);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  overflow: hidden;
}

.reader-pdf-square .thumb-strip button {
  width: 70px;
  height: 70px;
}

.reader-pdf-landscape .thumb-strip button {
  width: 88px;
  height: 58px;
}

.thumb-strip canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(17, 28, 45, 0.14);
}

.thumb-strip button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.reader-error {
  padding: 40px;
  border-radius: 14px;
  background: white;
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 980px) {
  .sidebar {
    display: none;
  }

  .topbar {
    padding: 0 20px;
  }

  .topbar-menu-button {
    display: grid;
  }

  .portal-search {
    width: min(280px, 38vw);
  }

  .content {
    width: min(100% - 32px, 760px);
  }

  .stat-grid,
  .doc-grid,
  .doc-grid.compact,
  .upload-form-grid,
  .upload-form-grid.compact,
  .admin-grid,
  .profile-grid,
  .detail-layout,
  .library-header,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .meta-list {
    grid-template-columns: 1fr;
  }

  .content.profile-page {
    width: min(100% - 32px, 760px);
    padding-top: 42px;
  }

  .content.admin-console {
    width: min(100% - 32px, 760px);
  }

  .content.settings-page {
    width: min(100% - 32px, 760px);
  }

  .admin-console-layout {
    grid-template-columns: 1fr;
  }

  .admin-user-search {
    width: min(280px, 42vw);
  }

  .profile-page-head,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-page-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 32px;
  }

  .profile-side-column {
    width: 100%;
  }

  .profile-security-card {
    position: static;
  }

  .reader-toolbar {
    height: auto;
    min-height: 76px;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .reader-tools {
    width: 100%;
    overflow-x: auto;
  }

  .reader-stage {
    height: calc(100vh - 248px);
    height: calc(100dvh - 248px);
    align-items: flex-start;
    padding: 14px 46px 18px;
  }

  body.reader-focus-mode .reader-stage {
    height: 100vh;
    height: 100dvh;
    align-items: center;
    padding: 18px 54px;
  }

  .reader-focus-exit {
    top: 12px;
    right: 12px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .page-nav {
    width: 42px;
    height: 42px;
  }

  .page-nav.left {
    left: 8px;
  }

  .page-nav.right {
    right: 8px;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 120;
    width: 288px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    padding: 24px 16px;
    transform: translateX(-106%);
    transition: transform 180ms ease;
    box-shadow: 18px 0 40px rgba(17, 28, 45, 0.16);
  }

  body.sidebar-pinned .sidebar,
  body.sidebar-pinned.sidebar-collapsed .sidebar {
    transform: translateX(0);
  }

  body.sidebar-pinned .brand-copy,
  body.sidebar-pinned .nav-text,
  body.sidebar-pinned .sidebar-footer {
    width: auto;
    opacity: 1;
  }

  body.sidebar-pinned .sidebar-toggle {
    display: grid;
  }

  body.sidebar-pinned .nav-list a,
  body.sidebar-pinned .logout-form button {
    justify-content: flex-start;
    padding-inline: 14px;
  }

  .main-shell {
    width: 100%;
  }
}

@media (min-width: 761px) and (max-width: 980px) and (orientation: portrait) {
  .login-page {
    min-height: 100vh;
    min-height: 100dvh;
    background:
      linear-gradient(180deg, rgba(247, 251, 255, 0.94), rgba(238, 245, 251, 0.96)),
      var(--login-bg-image, url("/assets/usm-login-illustration.jpg")) center / cover no-repeat;
  }

  .login-shell {
    width: min(100% - 64px, 520px);
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
  }

  .login-panel {
    width: min(420px, 100%);
    margin: 0 auto;
    padding: 38px 34px 36px;
    border: 1px solid rgba(192, 199, 210, 0.48);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 54px rgba(17, 28, 45, 0.14);
  }

  .login-logo {
    width: min(260px, 82%);
    margin-inline: auto;
  }

  .login-lead,
  .login-foot {
    text-align: center;
  }

  .login-copyright {
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    text-align: center;
  }
}

@media (max-width: 640px) {
  .reader-page {
    height: var(--reader-vh, 100vh);
    min-height: 0;
    overflow: hidden;
  }

  .reader-toolbar {
    min-height: 150px;
    gap: 12px;
    padding: 12px 14px;
  }

  .reader-title {
    width: 100%;
    gap: 10px;
  }

  .reader-title .icon-button {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
  }

  .reader-title strong {
    font-size: 24px;
  }

  .reader-title span {
    max-width: calc(100vw - 94px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reader-tools {
    display: grid;
    grid-template-columns: minmax(96px, 1fr) 42px minmax(72px, 94px) 42px 42px;
    gap: 6px;
    padding-bottom: 2px;
    overflow: visible;
  }

  .page-indicator {
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
  }

  .reader-tools .icon-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .reader-tools input[type="range"] {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .reader-stage {
    height: calc(var(--reader-vh, 100vh) - 244px);
    min-height: 0;
    padding: 10px 14px 12px;
  }

  .reader-pdf-landscape .reader-stage,
  .reader-pdf-square .reader-stage {
    align-items: flex-start;
  }

  .reader-single-mode .reader-stage {
    justify-content: center;
    align-items: flex-start;
  }

  body.reader-focus-mode .reader-stage {
    height: var(--reader-vh, 100vh);
    align-items: center;
    padding: 12px 46px;
  }

  body.reader-focus-mode {
    height: var(--reader-vh, 100vh);
    overflow: hidden;
  }

  .thumb-strip {
    height: 94px;
    padding: 10px 14px;
  }

  .thumb-strip button {
    width: 48px;
    height: 64px;
  }

  .reader-pdf-landscape .thumb-strip button {
    width: 78px;
    height: 52px;
  }

  .book-wrap::after {
    bottom: -14px;
    height: 22px;
  }

  .welcome-band,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-band,
  .library-header,
  .detail-layout,
  .analytics-panel,
  .upload-form-card,
  .admin-card {
    padding: 22px;
  }

  .analytics-summary {
    width: 100%;
  }

  .read-chart {
    min-height: 220px;
    gap: 8px;
    padding: 16px;
  }

  .read-chart-day {
    height: 170px;
  }

  .topbar {
    gap: 12px;
    padding: 0 14px;
  }

  .topbar-brand {
    font-size: 17px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .portal-search {
    display: none;
  }

  .topbar-icon-button {
    width: 32px;
    height: 32px;
  }

  .language-switcher {
    height: 34px;
    padding: 0 6px;
  }

  .welcome-band h2,
  .library-header h2,
  .section-head h2,
  .upload-page-head h2,
  .admin-card h2,
  .detail-copy h2 {
    font-size: 24px;
  }

  .content.profile-page {
    padding: 28px 0 64px;
  }

  .content.admin-console {
    padding: 28px 0 64px;
  }

  .content.settings-page {
    padding: 28px 0 64px;
  }

  .admin-console-head,
  .admin-list-head,
  .admin-list-foot,
  .settings-page-head,
  .settings-locale-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-locale-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .admin-console-head h2 {
    font-size: 24px;
  }

  .admin-console-title h3 {
    font-size: 22px;
  }

  .admin-invite-card,
  .admin-list-head {
    padding: 22px;
  }

  .admin-user-search {
    width: 100%;
  }

  .settings-save-button,
  .settings-grid,
  .settings-asset-grid {
    width: 100%;
  }

  .settings-grid,
  .settings-asset-grid {
    grid-template-columns: 1fr;
  }

  .profile-page-head h2 {
    font-size: 24px;
  }

  .profile-page-head p,
  .profile-security-card > p {
    font-size: 14px;
  }

  .profile-head-actions,
  .profile-action-button {
    width: 100%;
  }

  .profile-head-actions {
    flex-direction: column-reverse;
  }

  .profile-hero-card {
    align-items: center;
    flex-direction: column;
    padding: 28px 22px;
    text-align: center;
  }

  .profile-chip-row {
    justify-content: center;
  }

  .profile-info-card,
  .profile-security-card {
    padding: 24px 20px;
  }

  .profile-info-form {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-card-title h3 {
    font-size: 22px;
  }

  .profile-info-form input,
  .profile-info-form textarea,
  .profile-password-form input {
    min-height: 44px;
    font-size: 14px;
  }

  .content.upload-management {
    width: min(100% - 32px, 760px);
    padding-top: 28px;
  }

  .upload-list-section {
    margin-top: 44px;
  }

  .upload-list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-submit-row,
  .upload-submit-button {
    width: 100%;
  }

  .filter-bar,
  .filter-bar input,
  .filter-bar select,
  .filter-bar button {
    width: 100%;
  }

  .back-to-top-button {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}

@media (orientation: landscape) and (max-height: 640px) and (pointer: coarse) {
  .reader-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.reader-focus-mode .reader-stage {
    height: 100vh;
    height: 100dvh;
    align-items: center;
    padding: 10px 56px;
  }

  body.reader-focus-mode .reader-focus-exit {
    top: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
  }

  body.reader-focus-mode .page-nav {
    width: 46px;
    height: 46px;
  }

  body.reader-focus-mode .page-nav.left {
    left: 12px;
  }

  body.reader-focus-mode .page-nav.right {
    right: 12px;
  }
}

@media (max-width: 760px) {
  body:not(.login-page):not(.reader-page) {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--primary) 8%, #ffffff) 0 148px, var(--surface-low) 148px 100%);
  }

  .app-shell {
    display: block;
    padding-bottom: 92px;
  }

  .main-shell {
    min-height: auto;
  }

  .topbar {
    position: relative;
    z-index: 1;
    height: 178px;
    align-items: flex-start;
    gap: 14px;
    padding: 28px 18px 84px;
    overflow: hidden;
    border: 0;
    border-radius: 0 0 30px 30px;
    background:
      linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 68%, #8d5cf6) 100%);
    box-shadow: 0 18px 34px rgba(0, 110, 188, 0.18);
    color: #fff;
  }

  .topbar::after {
    content: "USM";
    position: absolute;
    right: -18px;
    bottom: 38px;
    color: rgba(255, 255, 255, 0.12);
    font-size: 82px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
  }

  .topbar-brand,
  .topbar-actions {
    position: relative;
    z-index: 1;
  }

  .topbar-brand {
    min-width: 0;
    color: #fff;
    font-size: 20px;
  }

  .topbar-brand > span {
    max-width: 210px;
    white-space: normal;
    line-height: 1.18;
  }

  .topbar-menu-button {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
    gap: 8px;
  }

  .language-switcher {
    height: 36px;
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(12px);
  }

  .language-switcher select {
    color: #fff;
  }

  .language-switcher option {
    color: var(--ink);
  }

  .topbar-avatar {
    width: 40px;
    height: 40px;
    border-color: rgba(255, 255, 255, 0.72);
    background: #fff;
    color: var(--primary);
    box-shadow: 0 8px 18px rgba(17, 28, 45, 0.16);
  }

  .portal-search {
    display: none;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed;
    inset: auto 14px 14px;
    z-index: 100;
    width: auto;
    height: 70px;
    flex-basis: auto;
    display: flex;
    padding: 6px 8px;
    border: 1px solid rgba(192, 199, 210, 0.58);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 38px rgba(17, 28, 45, 0.16);
    backdrop-filter: blur(16px);
  }

  .brand-block,
  .sidebar-footer,
  .logout-form,
  .sidebar-toggle {
    display: none;
  }

  .nav-list {
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(58px, 1fr);
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-list a,
  body.sidebar-collapsed .nav-list a {
    min-height: 56px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 18px;
    color: #90a0b3;
  }

  .nav-list a.active {
    background: var(--primary-soft);
    color: var(--primary);
  }

  .nav-list a .material-symbols-outlined,
  body.sidebar-collapsed .nav-list a .material-symbols-outlined {
    font-size: 24px;
  }

  .nav-text,
  body.sidebar-collapsed .nav-text {
    width: auto;
    max-width: 68px;
    display: block;
    overflow: hidden;
    color: inherit;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1.1;
    opacity: 1;
    text-align: center;
    white-space: normal;
  }

  .content,
  .content.profile-page,
  .content.admin-console,
  .content.settings-page,
  .content.upload-management {
    position: relative;
    z-index: 2;
    width: min(100% - 28px, 430px);
    margin: -64px auto 0;
    padding: 0 0 76px;
  }

  .site-footer:not(.sidebar-footer):not(.login-copyright) {
    width: min(100% - 28px, 430px);
    padding-bottom: 104px;
  }

  .flash {
    border-radius: 18px;
  }

  .welcome-band,
  .library-header,
  .detail-layout,
  .analytics-panel,
  .activity-panel,
  .admin-card,
  .upload-form-card,
  .profile-glass-card,
  .settings-card,
  .settings-locale-card,
  .admin-console-card {
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(17, 28, 45, 0.08);
  }

  .welcome-band {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
    background: rgba(255, 255, 255, 0.98);
  }

  .welcome-band .primary-button {
    width: 100%;
  }

  .welcome-band h2,
  .section-head h2,
  .upload-page-head h2,
  .admin-console-head h2,
  .profile-page-head h2,
  .settings-page-head h2 {
    font-size: 25px;
    line-height: 1.2;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 24px;
  }

  .stat-card {
    min-height: 116px;
    padding: 16px;
    border-radius: 20px;
  }

  .stat-card .material-symbols-outlined {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .stat-card small {
    font-size: 12px;
    line-height: 1.25;
  }

  .section-head {
    align-items: center;
    flex-direction: row;
    margin: 24px 0 12px;
  }

  .magazine-head {
    margin: 0 0 18px;
    padding: 20px;
    border: 1px solid rgba(192, 199, 210, 0.5);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 28px rgba(17, 28, 45, 0.08);
  }

  .section-head.inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .text-button {
    flex: 0 0 auto;
    font-size: 13px;
  }

  .analytics-panel,
  .activity-panel,
  .admin-card {
    padding: 20px;
  }

  .analytics-grid {
    gap: 14px;
  }

  .analytics-summary span {
    flex: 1 1 0;
    justify-content: center;
  }

  .read-chart {
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    min-height: 190px;
    gap: 6px;
    padding: 14px;
    overflow-x: auto;
  }

  .read-chart-day {
    height: 145px;
  }

  .top-read-list {
    padding: 18px;
    border-radius: 18px;
  }

  .doc-grid,
  .doc-grid.compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .doc-card {
    width: 100%;
    border-radius: 22px;
  }

  .doc-grid .empty-state {
    width: 100%;
  }

  .cover {
    min-height: 190px;
  }

  .cover.has-thumbnail {
    height: 198px;
  }

  .doc-body {
    padding: 16px;
  }

  .doc-body h3 {
    min-height: 0;
    font-size: 17px;
  }

  .doc-body p:not(.eyebrow) {
    min-height: 40px;
    margin-bottom: 14px;
  }

  .activity-list div {
    border-radius: 16px;
  }

  .activity-list small {
    flex-basis: 100%;
    margin-left: 0;
  }

  .pagination {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .pagination::-webkit-scrollbar {
    display: none;
  }

  .upload-page-head,
  .admin-console-head,
  .profile-page-head,
  .settings-page-head {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid rgba(192, 199, 210, 0.5);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 28px rgba(17, 28, 45, 0.08);
  }

  .upload-form-grid,
  .upload-form-grid.compact,
  .settings-grid,
  .settings-asset-grid,
  .profile-info-form,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .upload-list-section {
    margin-top: 34px;
  }

  .upload-list-head {
    margin-bottom: 16px;
  }

  .table-wrap,
  .admin-user-table-wrap {
    margin: 0 -20px;
    padding: 0 20px;
    overflow-x: auto;
  }

  .profile-hero-card {
    border-radius: 26px;
  }

  .back-to-top-button {
    bottom: 98px;
  }
}

@media (max-width: 760px) {
  .login-page {
    min-height: 100vh;
    background: #f7fbff;
  }

  .login-shell {
    width: min(100%, 430px);
    min-height: 100vh;
    flex-direction: column;
    align-items: stretch;
    margin: 0 auto;
    padding: 22px 16px 34px;
  }

  .login-shell::before {
    content: "";
    flex: 0 0 332px;
    border-radius: 30px;
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--primary) 82%, #ffffff), color-mix(in srgb, var(--primary) 52%, #d65cff)),
      var(--login-bg-image, url("/assets/usm-login-illustration.jpg")) center / cover no-repeat;
    background-blend-mode: multiply, normal;
    box-shadow: 0 18px 40px rgba(0, 110, 188, 0.18);
  }

  .login-panel {
    position: relative;
    z-index: 1;
    width: calc(100% - 24px);
    margin: -92px auto 0;
    padding: 28px 22px 30px;
    border: 1px solid rgba(192, 199, 210, 0.46);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 36px rgba(17, 28, 45, 0.12);
  }

  .login-logo {
    width: min(220px, 82%);
    margin: 0 auto 16px;
  }

  .login-lead,
  .login-foot {
    text-align: center;
  }

  .auth-form {
    gap: 16px;
  }

  .auth-form input {
    height: 48px;
    padding: 10px 42px 10px 42px;
    border: 1px solid #d9e2ee;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
  }

  .auth-form i {
    left: 14px;
    z-index: 1;
  }

  .password-toggle {
    right: 8px;
  }

  .remember-row input {
    height: 16px;
    width: 16px;
  }

  .login-panel .primary-button {
    min-height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 58%, #d65cff));
  }

  .login-copyright {
    position: static;
    width: calc(100% - 24px);
    margin: 20px auto 0;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .topbar {
    padding-inline: 14px;
  }

  .topbar-brand {
    font-size: 18px;
  }

  .topbar-brand > span {
    max-width: 180px;
  }

  .language-switcher {
    width: 48px;
    justify-content: center;
  }

  .language-switcher .material-symbols-outlined {
    display: none;
  }

  .doc-card {
    flex-basis: 86vw;
  }

}
