:root {
  --ink: #1f2a37;
  --muted: #667085;
  --soft: #f4f7fa;
  --line: #e5eaf0;
  --paper: #ffffff;
  --navy: #163b5c;
  --blue: #1f74b8;
  --blue-soft: #eaf4fb;
  --teal: #168477;
  --teal-soft: #e8f6f2;
  --amber: #a76800;
  --amber-soft: #fff5df;
  --red: #b93834;
  --red-soft: #fff0ef;
  --shadow: 0 14px 36px rgba(24, 44, 66, .08);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--soft); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; overflow: hidden; background: #eaf2f5; }
.login-backdrop { position: absolute; inset: 0; background: radial-gradient(circle at 18% 12%, rgba(255,255,255,.95), transparent 34%), linear-gradient(135deg, #eef6f7 0%, #e7eff7 60%, #f3f7f3 100%); }
.login-backdrop::after { content: ""; position: absolute; width: 460px; height: 460px; right: -180px; bottom: -220px; border: 1px solid rgba(22,59,92,.12); border-radius: 50%; box-shadow: 0 0 0 34px rgba(22,59,92,.03), 0 0 0 68px rgba(22,59,92,.025); }
.login-panel { position: relative; width: min(100%, 720px); background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 24px 70px rgba(25, 54, 73, .16); padding: clamp(28px, 6vw, 54px); }
.brand-mark { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--navy); font-weight: 800; font-size: 24px; box-shadow: 0 8px 18px rgba(22,59,92,.2); }
.brand-mark.small { width: 34px; height: 34px; border-radius: 9px; font-size: 18px; flex: 0 0 auto; box-shadow: none; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .13em; margin: 24px 0 10px; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 560px; font-size: clamp(28px, 5vw, 43px); line-height: 1.12; letter-spacing: -.035em; margin-bottom: 16px; }
.login-lead { color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 520px; margin-bottom: 18px; }
.login-notice { display: inline-flex; gap: 9px; align-items: center; color: var(--teal); background: var(--teal-soft); border: 1px solid #cdeee7; border-radius: 99px; padding: 8px 12px; font-size: 13px; margin-bottom: 28px; }
.notice-dot, .status-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); display: inline-block; box-shadow: 0 0 0 4px rgba(22,132,119,.13); }
.login-accounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 28px; }
.account-card { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px; color: var(--ink); transition: .2s ease; }
.account-card:hover, .account-card.selected { border-color: #90c2e5; box-shadow: 0 6px 18px rgba(31,116,184,.1); transform: translateY(-1px); }
.account-card strong { display: block; font-size: 14px; margin-bottom: 6px; }
.account-card span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.account-role { color: var(--blue) !important; font-weight: 700; }
.login-form label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.login-input-row { display: flex; gap: 10px; }
.login-input-row input { min-width: 0; flex: 1; }
.login-footnote { color: #8a96a3; font-size: 12px; margin: 17px 0 0; }
.form-error { color: var(--red); min-height: 18px; font-size: 12px; margin: 8px 0 0; }

.workspace-view { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #e9f2f7; padding: 22px 14px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.sidebar-brand { display: flex; gap: 10px; align-items: center; padding: 4px 10px 24px; }
.sidebar-brand strong { display: block; font-size: 14px; letter-spacing: .01em; }
.sidebar-brand span { display: block; color: #93b3c7; font-size: 11px; margin-top: 4px; }
.user-chip { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); border-radius: 10px; padding: 12px; margin: 0 4px 22px; }
.user-chip .user-name { font-weight: 700; font-size: 13px; }
.user-chip .user-role { color: #a9c5d5; font-size: 11px; margin-top: 5px; }
.main-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #b9ceda; padding: 11px 12px; border-radius: 8px; display: flex; gap: 10px; align-items: center; text-align: left; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: #e8f2f8; color: var(--navy); font-weight: 800; }
.nav-icon { width: 18px; text-align: center; font-size: 16px; }
.sidebar-footer { margin-top: auto; padding: 12px 4px 0; border-top: 1px solid rgba(255,255,255,.12); }
.local-status { font-size: 11px; color: #a9c5d5; display: flex; align-items: center; gap: 8px; margin: 2px 8px 12px; }
.button { border: 1px solid transparent; border-radius: 8px; padding: 10px 14px; display: inline-flex; gap: 7px; align-items: center; justify-content: center; line-height: 1; font-weight: 700; font-size: 13px; transition: .2s ease; white-space: nowrap; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 5px 13px rgba(31,116,184,.18); }
.button-primary:hover { background: #175c94; transform: translateY(-1px); }
.button-secondary { color: var(--navy); background: #fff; border-color: #cbd9e2; }
.button-secondary:hover { border-color: #8bb6d2; background: #f7fbfd; }
.button-quiet { color: #526c7d; background: transparent; border-color: transparent; }
.button-quiet:hover { background: rgba(255,255,255,.1); color: #fff; }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #f4cbca; }
.button-danger:hover { background: #ffe1df; }
.button-teal { color: #fff; background: var(--teal); }
.button-teal:hover { background: #126f64; }
.full-width { width: 100%; }

.main-content { min-width: 0; }
.topbar { position: relative; min-height: 88px; padding: 22px clamp(20px, 4vw, 46px); background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.breadcrumb { color: #8a96a3; font-size: 12px; margin: 0 0 6px; }
.topbar h2 { font-size: 24px; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.role-switch { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 11px; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; font-size: 12px; }
.role-switch:hover { border-color: #aac8d9; }
.role-menu { position: absolute; top: 72px; right: 46px; width: 215px; z-index: 15; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; padding: 6px; }
.role-option { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 7px; font-size: 12px; color: var(--ink); }
.role-option:hover { background: var(--blue-soft); }
.role-option small { display: block; color: var(--muted); margin-top: 3px; }
.view-root { padding: clamp(20px, 4vw, 42px); max-width: 1500px; }
.toast-region { position: fixed; z-index: 30; right: 25px; top: 96px; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); pointer-events: none; }
.toast { padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .24s ease both; }
.toast.success { border-color: #bfe3d7; background: #f2fbf8; color: #146a5e; }
.toast.error { border-color: #f1c5c4; background: #fff7f6; color: #9e2d2a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h3 { margin: 0 0 5px; font-size: 20px; }
.section-heading p { color: var(--muted); margin: 0; font-size: 13px; line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 17px; }
.stat-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.stat-icon { color: var(--blue); font-size: 18px; }
.stat-number { font-size: 28px; font-weight: 800; margin: 12px 0 6px; letter-spacing: -.04em; }
.stat-foot { color: #8a96a3; font-size: 11px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .8fr); gap: 18px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 19px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 4px; }
.panel-heading h3 { font-size: 15px; margin: 0; }
.panel-heading a, .text-button { color: var(--blue); font-size: 12px; border: 0; background: transparent; padding: 0; }
.resource-list { display: grid; }
.resource-row { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid #eef1f4; }
.resource-row:last-child { border-bottom: 0; }
.resource-row h4 { margin: 0 0 6px; font-size: 14px; }
.resource-meta { color: var(--muted); font-size: 11px; line-height: 1.6; }
.resource-side { text-align: right; display: grid; align-content: space-between; justify-items: end; gap: 8px; }
.resource-side .button { padding: 7px 10px; font-size: 11px; }
.tag { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 8px; font-size: 11px; font-weight: 700; line-height: 1; }
.tag-blue { color: var(--blue); background: var(--blue-soft); }
.tag-green { color: var(--teal); background: var(--teal-soft); }
.tag-amber { color: var(--amber); background: var(--amber-soft); }
.tag-red { color: var(--red); background: var(--red-soft); }
.tag-gray { color: #607080; background: #eef2f5; }
.steps { display: grid; gap: 15px; padding: 3px 0; }
.step { display: grid; grid-template-columns: 27px 1fr; gap: 10px; }
.step-mark { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 800; }
.step strong { font-size: 12px; display: block; margin-bottom: 3px; }
.step p { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
.empty-state { padding: 28px 10px; text-align: center; color: var(--muted); font-size: 13px; }

.filter-bar { display: grid; grid-template-columns: minmax(190px, 1.6fr) repeat(4, minmax(105px, .75fr)); gap: 9px; margin-bottom: 17px; }
.input, select, textarea { width: 100%; border: 1px solid #d4dde5; border-radius: 7px; background: #fff; color: var(--ink); padding: 10px 11px; outline: 0; }
.input:focus, select:focus, textarea:focus { border-color: #74add0; box-shadow: 0 0 0 3px rgba(31,116,184,.1); }
.resource-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.resource-card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.resource-card:hover { border-color: #b5d2e3; box-shadow: 0 7px 20px rgba(25,70,98,.07); }
.resource-card-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.resource-card h3 { font-size: 14px; line-height: 1.45; margin: 0; }
.resource-card p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; }
.resource-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.resource-card-footer .button { padding: 7px 10px; font-size: 11px; }
.catalog-count { color: var(--muted); font-size: 12px; margin: 0 0 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-weight: 700; text-align: left; background: #f8fafb; }
th, td { padding: 12px 11px; border-bottom: 1px solid #edf1f3; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 220px; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-actions .button { font-size: 11px; padding: 7px 9px; }

.timeline { display: grid; }
.timeline-row { display: grid; grid-template-columns: 104px 1fr; gap: 17px; padding: 15px 0; border-bottom: 1px solid #edf1f3; }
.timeline-row:last-child { border-bottom: 0; }
.timeline-time { color: #8a96a3; font-size: 11px; }
.timeline-main strong { font-size: 12px; display: block; margin-bottom: 4px; }
.timeline-main span { color: var(--muted); font-size: 11px; }
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.backup-card { border: 1px solid var(--line); border-radius: 9px; padding: 18px; }
.backup-card h3 { font-size: 15px; margin-bottom: 7px; }
.backup-card p { color: var(--muted); font-size: 12px; line-height: 1.65; min-height: 44px; }
.danger-note { color: var(--amber); background: var(--amber-soft); border: 1px solid #f2dfad; border-radius: 7px; padding: 10px 11px; font-size: 11px; line-height: 1.55; margin: 16px 0; }
.account-table { margin-top: 18px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(18, 35, 47, .42); }
.modal { width: min(100%, 620px); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 12px; box-shadow: 0 24px 80px rgba(15,34,48,.25); }
.modal.wide { width: min(100%, 840px); }
.modal-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 21px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0 0 5px; font-size: 18px; }
.modal-header p { color: var(--muted); font-size: 12px; margin: 0; }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: #f3f6f8; color: var(--muted); }
.icon-button:hover { background: #e9eef2; color: var(--ink); }
.modal-body { padding: 20px 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 22px 20px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 700; color: #495765; }
.field small { color: #8a96a3; font-size: 10px; line-height: 1.4; }
.resource-detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.detail-block { padding-bottom: 17px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.detail-block:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.detail-block h4 { margin: 0 0 9px; font-size: 12px; color: var(--muted); }
.detail-title { font-size: 22px; line-height: 1.3; margin-bottom: 11px; }
.detail-description { color: #536273; font-size: 13px; line-height: 1.75; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-meta dt { font-size: 10px; color: #8a96a3; margin-bottom: 4px; }
.detail-meta dd { font-size: 12px; margin: 0; }
.version-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef1f3; }
.version-row:last-child { border-bottom: 0; }
.version-row strong { font-size: 12px; }
.version-row span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.version-current { color: var(--teal); font-size: 10px; font-weight: 700; }

@media (max-width: 1080px) {
  .resource-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-bar .search-field { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .workspace-view { display: block; }
  .sidebar { min-height: auto; padding: 12px 14px; position: sticky; top: 0; z-index: 20; }
  .sidebar-brand { padding: 3px 4px 12px; }
  .user-chip { display: none; }
  .main-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .nav-item { min-width: max-content; padding: 9px 11px; }
  .nav-item span:last-child { display: none; }
  .sidebar-footer { position: absolute; right: 12px; top: 10px; border: 0; padding: 0; }
  .local-status { display: none; }
  .sidebar-footer .button { width: auto; font-size: 0; padding: 9px; }
  .sidebar-footer .button span { font-size: 16px; }
  .topbar { padding: 18px 20px; align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; justify-content: end; }
  .topbar h2 { font-size: 20px; }
  .role-switch { display: none; }
  .role-menu { display: none !important; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .resource-detail-grid, .backup-grid { grid-template-columns: 1fr; }
  .view-root { padding: 22px 17px 36px; }
}
@media (max-width: 580px) {
  .login-panel { padding: 28px 21px; }
  .login-accounts { grid-template-columns: 1fr; }
  .login-input-row { display: grid; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 13px; }
  .stat-number { font-size: 24px; }
  .resource-catalog { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar .search-field { grid-column: 1 / -1; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .panel { padding: 15px; }
  .timeline-row { grid-template-columns: 1fr; gap: 5px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal-backdrop { padding: 10px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
}

/* Local prototype: readable navigation and forms on narrow screens. */
.prototype-banner { margin:0; padding:9px clamp(20px,4vw,46px); background:#eaf4f7; color:#476371; font-size:12px; line-height:1.6; border-bottom:1px solid #dce8ed; }
.login-accounts { grid-template-columns:repeat(2,minmax(0,1fr)); }
.login-input-row input { border:1px solid #cbd9e2; border-radius:8px; padding:11px; }
.filter-bar { grid-template-columns:minmax(180px,1.5fr) repeat(2,minmax(140px,1fr)); }
.filter-bar .search-field { grid-column:1/-1; }
.sidebar .button-quiet { color:#bdd1dd; }
.modal-footer { flex-wrap:wrap; }
.modal input, .modal select, .modal textarea { min-width:0; }
.modal-body, .resource-card, td.wrap, .timeline-main, .detail-meta dd { overflow-wrap:anywhere; }
button:disabled { cursor:default; opacity:.5; }
button:focus-visible, a:focus-visible { outline:3px solid #70b5df; outline-offset:3px; }
.form-error { line-height:1.5; }
@media(max-width:820px) {
  .main-nav { scrollbar-width:thin; }
  .nav-item { flex:0 0 auto; min-width:auto; font-size:12px; gap:5px; padding:9px; }
  .nav-item span:last-child { display:inline; }
  .role-switch { display:inline-flex; font-size:11px; }
  .role-menu { display:block !important; right:18px; top:98px; }
  .role-menu.hidden { display:none !important; }
  .topbar { flex-wrap:wrap; }
  .topbar-actions { margin-left:auto; }
  .sidebar-footer .button { font-size:11px; }
  .sidebar-footer .button span { font-size:13px; }
  .prototype-banner { padding:8px 20px; font-size:11px; }
}
@media(max-width:580px) {
  .login-accounts { grid-template-columns:1fr; }
  .filter-bar { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .filter-bar select { min-width:0; font-size:12px; }
  .resource-row { gap:9px; }
  .resource-row > div:first-child { min-width:0; }
  .resource-side { flex:0 0 74px; }
  .toast-region { top:138px; }
}
body.modal-open { overflow:hidden; }
.modal { display:flex; flex-direction:column; overflow:hidden; }
.modal-header, .modal-footer { flex:0 0 auto; background:#fff; }
.modal-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
@media(max-width:820px) { .nav-item { width:auto; } }

/* Usability review: common tasks first, explicit actions, readable controls. */
:root { --blue:#176ca8; --muted:#536477; }
.workspace-view { grid-template-columns:218px minmax(0,1fr); }
.sidebar { position:sticky; top:0; height:100vh; }
.topbar { min-height:80px; padding:18px 28px; gap:12px; }
.breadcrumb { display:none; }
.topbar h2 { font-size:23px; }
.topbar-actions { gap:8px; }
.button, .resource-card-footer .button, .resource-side .button, .table-actions .button { min-height:44px; padding:10px 14px; font-size:14px; line-height:1.3; box-shadow:none; }
.button-primary:hover { transform:none; }
.role-switch { min-height:44px; color:#465c70; font-size:13px; }
.role-option { min-height:52px; font-size:14px; }
.role-menu { right:28px; top:calc(100% - 6px); width:260px; z-index:25; }
.nav-item { min-height:46px; font-size:14px; }
.view-root { padding:24px 28px 36px; max-width:1600px; }
.prototype-banner { padding:6px 28px; font-size:12px; color:#596f7b; background:#f0f5f7; }
.page-hint { margin:0 0 16px; color:var(--muted); font-size:14px; line-height:1.7; }
.account-card { position:relative; min-height:144px; padding:18px; border-color:#d2dee7; }
.account-card strong { font-size:19px; margin:10px 0 6px; }
.account-card span { font-size:13px; }
.account-card .account-enter { display:block; color:var(--blue); margin-top:14px; font-weight:700; }
.account-card.recommended { background:#f0f7fc; border-color:#83b5d6; }
.login-panel { padding:36px 40px; }
.login-lead { margin-bottom:14px; }
.login-notice { margin-bottom:22px; }
.login-accounts { gap:12px; margin-bottom:20px; }
.manual-login { font-size:13px; color:var(--muted); }
summary { cursor:pointer; min-height:40px; padding:9px 0; font-size:13px; color:var(--navy); }
.manual-login form { padding-top:10px; }
.task-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
.task-card { padding:22px; text-align:left; background:#fff; border:1px solid #cbdce8; border-radius:10px; color:var(--ink); }
.task-card:hover { border-color:var(--blue); background:#f6fbfe; }
.task-card strong { display:block; font-size:19px; margin-bottom:10px; }
.task-card strong span { float:right; color:var(--blue); }
.task-card > span { font-size:13px; color:var(--muted); line-height:1.6; }
.search-panel { border:1px solid var(--line); border-radius:10px; padding:18px; background:#fff; margin-bottom:20px; }
.search-row { display:flex; gap:10px; margin-bottom:16px; }
.search-row input { min-width:0; flex:1; padding:12px 14px; min-height:46px; font-size:15px; }
.search-row button { min-width:86px; }
.filter-main { display:grid; grid-template-columns:repeat(3,minmax(110px,1fr)) auto; align-items:end; gap:12px; }
.filter-field { min-width:0; display:grid; gap:6px; }
.filter-field label { color:#536477; font-size:13px; }
.filter-field select { min-width:0; height:44px; font-size:14px; }
.filter-extra { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding-top:4px; padding-bottom:4px; }
.more-filters { margin-top:8px; }
.more-filters summary { color:var(--blue); min-height:38px; }
.results-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.results-heading .catalog-count { margin:0; font-size:14px; font-weight:700; color:#40596c; }
.results-heading > span { font-size:12px; color:var(--muted); }
.resource-catalog { gap:16px; }
.resource-card { padding:19px; gap:12px; }
.resource-card h3 { font-size:17px; line-height:1.55; }
.resource-card p { font-size:13px; line-height:1.65; }
.resource-card .card-description { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.resource-card-footer { padding-top:10px; border-top:1px solid #edf1f3; justify-content:space-between; }
.resource-meta { font-size:12px; }
.tag { padding:6px 9px; font-size:12px; }
.status-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.status-tab { display:inline-flex; align-items:center; gap:8px; border:1px solid #d3dfe7; background:#fff; border-radius:8px; padding:9px 13px; font-size:14px; min-height:44px; color:#4b6172; }
.status-tab span { background:#edf2f6; color:#425d70; border-radius:12px; padding:2px 7px; min-width:24px; font-size:12px; }
.status-tab.active { background:var(--navy); color:#fff; border-color:var(--navy); font-weight:700; }
.status-tab.active span { color:#fff; background:#ffffff26; }
.resource-panel { padding:0; overflow:hidden; }
.resource-table { font-size:13px; }
.resource-table th { padding:14px; }
.resource-table td { padding:16px 14px; vertical-align:top; white-space:normal; }
.resource-table td.wrap { min-width:190px; }
.resource-table td.wrap strong { font-size:15px; line-height:1.6; display:inline-block; margin-bottom:4px; }
.resource-table .state-cell { min-width:130px; max-width:220px; }
.resource-table .updated-cell { font-size:12px; min-width:90px; color:var(--muted); }
.resource-table .action-cell { min-width:175px; width:190px; }
.resource-table .table-actions { gap:8px; }
.next-step { display:block; font-size:12px; color:#607080; line-height:1.6; margin-top:8px; }
.review-note { margin:8px 0; font-size:13px; color:#87591b; line-height:1.65; }
.empty-state { grid-column:1/-1; padding:30px 20px; font-size:14px; }
.empty-state h3 { font-size:18px; margin-bottom:8px; }
.empty-state p { font-size:14px; margin-bottom:16px; }
.icon-button { width:44px; height:44px; font-size:22px; flex:0 0 auto; }
.modal-header { padding:18px 22px; }
.modal-header h3 { font-size:20px; }
.modal-header p { line-height:1.6; }
.modal { width:min(100%,700px); }
.modal-body { scroll-padding:15px; }
.modal-footer { gap:8px; padding:14px 22px; align-items:center; }
.footer-hint { color:var(--muted); font-size:12px; margin-right:auto; }
.form-intro { display:flex; gap:12px; align-items:center; justify-content:space-between; margin-bottom:16px; }
.form-intro p { color:var(--muted); font-size:13px; line-height:1.6; margin:0; }
.form-section { border:0; padding:0; margin:0 0 20px; min-width:0; }
.form-section legend { font-size:14px; font-weight:700; color:var(--navy); padding:0 0 12px; width:100%; }
.field label { font-size:13px; }
.field .input, .field select, .field textarea { min-height:44px; font-size:14px; }
.field-note { color:var(--muted); line-height:1.65; font-size:12px; margin:10px 0 0; }
.form-error { font-size:13px; }
.form-error:empty { display:none; }
.form-error:not(:empty) { background:#fff1ef; color:#a12d28; padding:10px 12px; border-radius:6px; }
.help-steps { padding-left:22px; margin:0 0 20px; font-size:15px; line-height:1.9; }
.help-steps li { padding:4px 0; }
.help-boundary { border-top:1px solid var(--line); padding-top:6px; }
.help-boundary p { color:var(--muted); font-size:13px; line-height:1.8; }
.backup-card { background:#fff; padding:22px; }
.backup-card h3 { font-size:18px; }
.backup-card p { font-size:14px; }
.toast-region { z-index:75; top:85px; }
@media(max-width:1200px) {
  .resource-catalog { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .resource-table .directory-cell { min-width:160px; }
}
@media(max-width:820px) {
  .workspace-view { display:block; }
  .sidebar { position:static; height:auto; min-height:0; }
  .sidebar-brand { padding-bottom:12px; }
  .main-nav { flex-wrap:wrap; overflow:visible; }
  .nav-item { min-height:44px; padding:10px 12px; }
  .sidebar-footer { top:10px; }
  .sidebar { position:relative; }
  .topbar { padding:16px 18px; gap:14px; }
  .topbar h2 { font-size:22px; }
  .topbar-actions { width:100%; margin:0; justify-content:flex-start; flex-wrap:wrap; }
  #role-switch-btn { margin-left:auto; }
  #quick-upload-btn { order:3; }
  .role-menu { top:calc(100% - 4px); right:18px; }
  .prototype-banner { padding:7px 18px; font-size:11px; }
  .view-root { padding:18px 16px 30px; }
  .task-grid { grid-template-columns:1fr; }
  .filter-main { grid-template-columns:1fr 1fr; gap:10px; }
  .clear-filters { width:100%; }
  .search-panel { padding:14px; }
  .results-heading > span { display:none; }
  .status-tabs { gap:6px; }
  .status-tab { padding:8px 10px; font-size:13px; }
  .table-wrap { overflow:visible; }
  .resource-table, .resource-table tbody { display:block; }
  .resource-table thead { display:none; }
  .resource-table tr { display:flex; flex-direction:column; padding:18px; border-bottom:1px solid var(--line); gap:10px; }
  .resource-table tr:last-child { border-bottom:0; }
  .resource-table td, .resource-table td.wrap, .resource-table .state-cell, .resource-table .updated-cell, .resource-table .action-cell { display:block; border:0; padding:0; width:auto; min-width:0; max-width:none; }
  .resource-table .state-cell { order:1; }
  .resource-table .updated-cell { order:2; }
  .resource-table .action-cell { order:3; padding-top:12px; border-top:1px solid #edf1f3; }
  .resource-table .updated-cell::before { content:'更新：'; }
  .resource-table .table-actions .button { flex:1 1 auto; }
  .table-actions .resource-meta { flex-basis:100%; }
  .resource-table .directory-cell { color:var(--muted); font-size:12px; }
  .next-step { display:inline; margin-left:8px; }
  .login-panel { padding:28px 22px; }
  .modal-footer { padding:12px 14px; }
  .footer-hint { display:none; }
  .modal-footer .button { padding:10px 12px; }
}
@media(max-width:580px) {
  .resource-catalog { grid-template-columns:1fr; }
  .resource-card { padding:18px; }
  .resource-card-footer .button { flex:1; }
  .login-view { padding:18px 12px; }
  .account-card { min-height:126px; }
  .login-accounts { grid-template-columns:1fr; }
  .account-card strong { font-size:18px; }
  .form-intro { align-items:flex-start; }
  .form-intro button { flex:0 0 auto; }
  .form-grid { gap:14px; }
  .filter-extra { grid-template-columns:1fr; }
  .toast-region { top:18px; right:16px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation:none!important; transition:none!important; } }
.account-grid { font-size:14px; }
.account-grid select { min-height:44px; font-size:14px; }
@media(max-width:820px) {
  .account-grid, .account-grid tbody { display:block; }
  .account-grid thead { display:none; }
  .account-grid tr { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:18px 0; border-bottom:1px solid var(--line); }
  .account-grid td { display:flex; flex-direction:column; gap:7px; padding:0; border:0; white-space:normal; min-width:0; }
  .account-grid td::before { content:attr(data-label); font-size:12px; color:var(--muted); }
  .account-grid .tag { align-self:flex-start; }
  .account-grid select { width:100%; }
  .account-grid td:last-child .button { width:100%; }
}
body.modal-open .toast-region { display:none; }
@media(max-width:820px) {
  .topbar { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.12fr); gap:10px; padding:14px 16px; }
  .topbar > div:first-child { grid-column:1; grid-row:1; }
  .topbar-actions { display:contents; }
  #role-switch-btn { grid-column:1; grid-row:2; margin:0; min-width:0; width:100%; padding:8px; }
  #role-switch-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #quick-upload-btn { grid-column:2; grid-row:2; width:100%; padding:10px 7px; font-size:13px; }
  .role-menu { right:16px; }
}

/* Resource homepage: quiet surfaces, clear typography and explicit actions. */
:root {
  --ink:#1d1d1f; --muted:#6e6e73; --soft:#f5f5f7; --line:#e5e5e7;
  --navy:#1d1d1f; --blue:#0071e3; --blue-soft:#edf5ff;
  --shadow:0 12px 36px rgba(0,0,0,.06);
  -webkit-font-smoothing:antialiased;
}
.workspace-view { display:block; }
.sidebar { position:sticky; top:0; z-index:25; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px 24px; min-height:68px; height:auto; padding:10px max(24px,calc((100vw - 1280px)/2)); background:rgba(250,250,252,.97); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); color:var(--ink); border-bottom:1px solid var(--line); }
.sidebar-brand { padding:0; gap:8px; }
.sidebar-brand strong { font-size:14px; }
.sidebar-brand span { color:var(--muted); font-size:10px; margin-top:3px; }
.brand-mark,.brand-mark.small { background:var(--ink); box-shadow:none; border-radius:10px; }
.user-chip,.local-status { display:none; }
.main-nav { display:grid; justify-items:center; gap:8px; }
.primary-nav,.management-nav { display:flex; align-items:center; flex-wrap:wrap; justify-content:center; gap:7px; }
.management-nav { grid-column:1/-1; justify-content:flex-end; width:100%; padding-top:7px; border-top:1px solid var(--line); }
.management-label { margin-right:5px; color:var(--muted); font-size:12px; }
.nav-item { width:auto; min-height:48px; padding:11px 18px; color:#515154; font-size:15px; font-weight:500; border-radius:24px; }
.nav-icon { display:none; }
.nav-item:hover { color:var(--ink); background:#eaeaec; }
.nav-item.active { color:#084f9e; background:#d8eaff; box-shadow:inset 0 0 0 1px #9bc8f7; font-weight:650; }
.main-nav [data-view="overview"],.public-nav [data-public-home] { color:#084f9e; background:#d8eaff; box-shadow:inset 0 0 0 1px #9bc8f7; }
.main-nav [data-view="overview"]:hover,.public-nav [data-public-home]:hover { background:#c4e0ff; }
.main-nav [data-view="overview"].active,.public-nav [data-public-home].active { color:#fff; background:#075fbd; box-shadow:none; }
.sidebar-footer { position:static; margin:0; padding:0; border:0; }
.sidebar .button-quiet { color:var(--muted); font-size:12px; font-weight:400; padding:10px 0; }
.button { border-radius:24px; font-weight:500; min-height:44px; padding:12px 20px; box-shadow:none; }
.button-primary { background:var(--blue); }
.button-primary:hover { background:#0077ed; box-shadow:0 3px 10px #0071e31a; transform:none; }
.button-secondary { color:var(--blue); border-color:#b8cbe2; background:#fff; }
.button-secondary:hover { color:#0064c8; background:#f5f9ff; border-color:#0071e3; }
.button-quiet:hover { background:#eaeaec; color:var(--ink); }
.button-danger { border-radius:12px; }
input,select,textarea { border-radius:12px; }
.topbar { min-height:96px; max-width:1328px; margin:auto; padding:24px; background:transparent; border-bottom:0; }
.topbar h2 { font-size:28px; letter-spacing:-.04em; }
.topbar-actions { gap:8px; }
.breadcrumb { color:var(--muted); }
.role-switch { background:#fff; border-radius:24px; min-height:44px; color:#515154; padding:10px 15px; }
.role-menu { right:24px; top:calc(100% - 4px); border-radius:18px; box-shadow:0 12px 45px #00000015; }
.role-option { border-radius:12px; min-height:52px; font-size:13px; }
.prototype-banner { text-align:center; background:#fff; color:var(--muted); border-color:var(--line); font-size:11px; padding:9px 20px; }
.view-root { max-width:1328px; margin:auto; padding:26px 24px 60px; }
.panel,.search-panel,.backup-card { border:0; border-radius:22px; box-shadow:none; }
.panel { padding:24px; }
.search-panel { padding:24px; }
.resource-card { border:0; border-radius:22px; padding:24px; box-shadow:none; }
.resource-card h3 { font-weight:600; letter-spacing:-.02em; }
.status-tab { border-radius:24px; border-color:var(--line); }
.status-tab.active { background:#1d1d1f; border-color:#1d1d1f; }
.resource-panel { padding:0; }
.tag { border-radius:7px; }
.backup-card { padding:28px; }
.modal { border-radius:24px; box-shadow:0 24px 90px #00000025; }
.modal-backdrop { background:rgba(0,0,0,.32); backdrop-filter:blur(6px); }
.modal-header { background:#fff; padding:22px 26px; }
.modal-header h3 { font-weight:600; letter-spacing:-.02em; }
.modal-body { padding:24px 26px; }
.modal-footer { padding:16px 26px; background:#fff; }
.icon-button { border-radius:50%; color:#6e6e73; }
.detail-title { margin-top:18px; font-size:28px; line-height:1.4; }
.detail-meta dt { font-size:12px; }
.detail-meta dd { font-size:14px; line-height:1.6; }
.detail-description { font-size:15px; }
.login-view { background:var(--soft); }
.login-backdrop { background:radial-gradient(ellipse at 50% 0,#fff 15%,#f5f5f7 75%); }
.login-backdrop::after { display:none; }
.login-panel { width:min(100%,780px); border:0; border-radius:28px; padding:40px 48px; box-shadow:0 16px 55px #00000008; }
.login-panel h1 { font-size:36px; line-height:1.25; }
.login-back { margin:0 0 24px; padding:0; color:var(--blue); }
.account-card { border-radius:18px; border-color:var(--line); padding:22px; }
.account-card:hover { transform:translateY(-2px); box-shadow:0 8px 22px #00000008; }
.account-card.recommended { background:#f4f9ff; border-color:#aad1f8; }
.login-notice { font-size:12px; }
.public-nav { position:sticky; top:0; z-index:25; display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:68px; padding:10px max(24px,calc((100vw - 1280px)/2)); background:rgba(250,250,252,.97); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); border-bottom:1px solid var(--line); }
.home-brand { color:var(--ink); text-decoration:none; display:flex; align-items:center; gap:10px; font-size:20px; font-weight:700; letter-spacing:-.035em; white-space:nowrap; }
.home-brand strong { font-size:inherit; font-weight:inherit; letter-spacing:inherit; }
.public-nav nav { display:flex; align-items:center; gap:7px; }
.home-login-button { flex:0 0 auto; min-height:48px; padding:11px 22px; border:1px solid var(--blue); border-radius:24px; background:#fff; color:var(--blue); font-size:16px; font-weight:650; }
.home-login-button:hover { color:#fff; background:var(--blue); }
.home-nav-link,.home-text-link { min-height:44px; padding:8px 0; border:0; background:transparent; color:var(--blue); font-size:15px; }
.home-nav-link { color:#515154; font-size:13px; }
.home-text-link:hover,.home-nav-link:hover { text-decoration:underline; text-underline-offset:4px; }
.home-active .view-root { max-width:none; padding:0; }
.home-active .topbar { min-height:76px; padding-top:14px; padding-bottom:14px; }
.home-active .topbar h2 { font-size:22px; }
.home-active .breadcrumb { display:none; }
.home-content { max-width:1280px; margin:auto; padding:0 0 36px; }
.home-hero { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-top:22px; padding:22px 28px; min-height:0; border:1px solid #c9def4; border-radius:20px; background:linear-gradient(110deg,#eaf4ff 0%,#f2f7fd 65%,#e6f1fc 100%); }
.hero-kicker { font-size:12px; font-weight:500; margin:0 0 5px; color:var(--muted); }
.hero-copy h1 { font-size:32px; font-weight:650; line-height:1.3; letter-spacing:-.035em; max-width:none; margin:0 0 7px; }
.hero-description { font-size:15px; line-height:1.7; color:#4c5867; margin:0; }
.hero-actions { display:flex; align-items:center; flex-shrink:0; }
.home-library { margin-top:18px; padding:22px; border:1px solid #cbd9e8; border-radius:20px; background:#eaf0f7; scroll-margin-top:90px; }
.home-library-layout { display:grid; grid-template-columns:minmax(0,1fr) 280px; grid-template-areas:"main ranking"; gap:20px; align-items:start; }
.home-library-main { grid-area:main; min-width:0; }
.home-ranking-panel { grid-area:ranking; margin:0; position:sticky; top:18px; border:1px solid #c5d5e7; background:#fff; }
.home-ranking-panel .panel-heading { align-items:stretch; flex-direction:column; gap:10px; }
.home-ranking-panel .panel-heading h3 { white-space:nowrap; }
.home-ranking-panel .ranking-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.home-ranking-panel .ranking-tabs button { min-width:0; padding:7px 4px; white-space:nowrap; }
.home-ranking-panel .ranking-list { grid-template-columns:minmax(0,1fr); }
.library-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:14px; }
.section-kicker { font-size:13px; font-weight:600; color:#6e6e73; margin:0 0 10px; }
.library-heading h2 { font-size:24px; font-weight:650; letter-spacing:-.035em; margin:0; line-height:1.25; }
.library-note { margin:0; color:var(--muted); font-size:12px; text-align:right; line-height:1.7; }
.library-note span { display:block; }
.toast-region { top:auto; bottom:24px; right:24px; }
.toast { border-radius:16px; }
.home-toolbar { padding:12px 16px; border:1px solid #d4dfe9; border-radius:16px; background:#fff; }
.home-mobile-filters { display:none; }
.home-search-form { display:flex; align-items:center; gap:12px; padding:5px 6px 5px 18px; background:#f5f5f7; border:1px solid #e5e5e7; border-radius:32px; margin-bottom:8px; }
.search-symbol { font-size:24px; color:#86868b; }
.home-search-form input { flex:1; min-width:0; background:transparent; border:0; outline:0; color:var(--ink); font-size:15px; padding:8px 0; }
.home-search-form:focus-within { outline:3px solid #0071e35c; outline-offset:2px; }
.home-chip-row { display:flex; flex-wrap:wrap; gap:8px; padding-bottom:8px; border-bottom:1px solid #ededf0; }
.home-chip { min-height:44px; border:1px solid transparent; border-radius:24px; background:#f5f5f7; color:#515154; padding:10px 18px; font-size:14px; }
.home-chip:hover { background:#eaeaec; }
.home-chip.active { background:#1d1d1f; color:#fff; }
.home-type-row { display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; padding-top:4px; }
.home-type { min-height:44px; border:0; border-bottom:2px solid transparent; background:transparent; color:#6e6e73; font-size:13px; padding:8px 2px; }
.home-type.active { color:var(--blue); border-bottom-color:var(--blue); font-weight:600; }
.home-reset { min-height:44px; background:transparent; color:var(--blue); border:0; font-size:12px; margin-left:auto; }
.home-count { font-size:13px; color:#6e6e73; margin:12px 4px 8px; }
.home-resource-grid { display:grid; grid-template-columns:1fr; gap:0; background:#fff; border:1px solid #cbd8e5; border-radius:16px; overflow:hidden; scroll-margin-top:90px; }
.home-resource-card { min-width:0; padding:18px 20px; display:flex; align-items:center; gap:24px; background:#fff; border-bottom:1px solid #dfe5ec; }
.home-resource-card:last-child { border-bottom:0; }
.home-resource-card:hover { background:#fafbfc; }
.home-card-body { flex:1; min-width:0; }
.home-card-body h3 { font-size:18px; line-height:1.45; font-weight:600; letter-spacing:-.015em; margin:0 0 7px; overflow-wrap:anywhere; }
.home-card-meta { display:flex; flex-wrap:wrap; gap:4px 12px; font-size:12px; line-height:1.5; color:var(--muted); margin-bottom:4px; }
.home-card-meta span:first-child { color:var(--blue); font-weight:500; }
.home-card-description { font-size:13px; line-height:1.6; color:var(--muted); margin:0; overflow-wrap:anywhere; }
.home-card-actions { display:flex; align-items:center; flex-shrink:0; gap:8px; }
.home-card-actions .button { padding:10px 18px; font-size:13px; }
.resource-preview { width:min(100%,560px); }
.resource-preview .modal-header,.resource-preview .modal-body { padding:16px 20px; }
.resource-preview .modal-footer { padding:12px 20px; }
.resource-preview .detail-title { font-size:21px; margin:12px 0 10px; }
.resource-preview .detail-description { font-size:14px; margin-bottom:16px; }
.resource-preview .detail-meta { gap:10px 16px; }
.home-empty { grid-column:1/-1; text-align:center; background:#fff; border-radius:24px; padding:50px 20px; }
.home-empty > span { color:#86868b; font-size:48px; }
.home-empty h3 { font-size:22px; margin:15px 0 12px; }
.home-empty p { font-size:14px; color:#6e6e73; }
.home-footer { padding:18px 4px 0; margin-top:24px; border-top:1px solid #dedee3; display:flex; justify-content:space-between; gap:16px; font-size:11px; color:#86868b; line-height:1.7; }
.home-footer strong { font-weight:500; }
.forum-layout { display:grid; grid-template-columns:minmax(0,1fr) 280px; grid-template-areas:"main ranking"; gap:20px; align-items:start; }
.forum-main { grid-area:main; min-width:0; }
.forum-ranking-panel { grid-area:ranking; margin:0; position:sticky; top:18px; }
.forum-ranking-panel .panel-heading { display:block; }
.forum-ranking-panel .panel-heading h3 { margin-bottom:12px; }
.forum-ranking-panel .ranking-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.forum-ranking-panel .ranking-tabs button { min-width:0; padding:7px 4px; white-space:nowrap; }
@media(max-width:1280px) { .home-content { margin:0 36px; } .sidebar { gap:16px; } .nav-item { padding:10px; } }
@media(max-width:1000px) { .sidebar { grid-template-columns:1fr auto; gap:6px 16px; padding:10px 24px; } .main-nav { grid-row:2; grid-column:1/-1; justify-content:flex-start; } .sidebar-footer { grid-column:2; grid-row:1; } }
@media(max-width:820px) {
  .home-library-layout,.forum-layout { display:flex; flex-direction:column; gap:18px; }
  .home-library-main,.forum-main { order:0; width:100%; }
  .home-ranking-panel,.forum-ranking-panel { position:static; order:1; width:100%; }
  .forum-ranking-panel .ranking-list { grid-template-columns:minmax(0,1fr); }
  .sidebar { position:relative; top:auto; min-height:0; padding:12px 18px 8px; }
  .sidebar-brand { padding:0; }
  .sidebar .button-quiet { font-size:11px; }
  .ranking-custom-range { flex-wrap:wrap; }
  .sidebar-footer .button span { font-size:13px; }
  .main-nav { gap:3px; padding:4px 0 0; overflow:visible; }
  .nav-item { min-height:44px; font-size:12px; padding:8px 12px; }
  .nav-item span:last-child { display:inline; }
  .topbar { display:grid; margin:0; padding:18px; }
  .topbar h2 { font-size:24px; }
  .topbar-actions { display:contents; }
  .role-menu { top:calc(100% - 5px); right:16px; }
  .view-root { padding:22px 18px 40px; }
  .home-active .topbar { padding:14px 18px; }
  .home-content { margin:0 24px; }
  .hero-copy h1 { font-size:26px; }
  .home-text-link { font-size:13px; }
  .home-resource-card { gap:16px; padding:14px 16px; }
  .home-card-actions { flex-direction:column; }
  .panel { padding:20px; } .resource-panel { padding:0; }
  .modal-footer { padding:12px 16px; }
  .modal-footer .button { padding:10px 12px; }
}
@media(max-width:580px) {
  .public-nav { padding:10px 18px; gap:8px; min-height:66px; }
  .home-brand { gap:7px; } .home-brand strong { font-size:13px; }
  .public-nav .brand-mark { width:30px; height:30px; font-size:16px; }
  .public-nav nav { gap:0; } .home-nav-link { display:none; }
  .public-nav .button { padding:10px 14px; font-size:12px; }
  .home-content { margin:0 18px; }
  .home-hero { display:block; padding:16px 0 10px; }
  .hero-copy h1 { font-size:24px; margin-bottom:4px; }
  .hero-kicker { font-size:11px; }
  .hero-description { font-size:12px; }
  .hero-actions { margin-top:2px; }
  .home-text-link { font-size:12px; }
  .home-library { padding-top:12px; scroll-margin-top:82px; }
  .library-heading { display:block; margin-bottom:10px; }
  .library-heading h2 { font-size:18px; }
  .library-note { text-align:left; font-size:11px; margin-top:4px; }
  .library-note span { display:inline; } .library-note span+span::before { content:' · '; }
  .home-toolbar { padding:12px; border-radius:14px; }
  .home-mobile-filters { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px; gap:10px; align-items:end; }
  .home-mobile-filters label { font-size:11px; color:var(--muted); display:grid; gap:6px; }
  .home-mobile-filters select { min-width:0; width:100%; min-height:44px; font-size:12px; padding:8px; border:1px solid var(--line); background:#f9f9fb; color:var(--ink); }
  .home-mobile-filters .home-reset { margin:0; padding:8px 0; }
  .home-chip-row,.home-type-row { display:none; }
  .home-search-form { padding-left:12px; gap:7px; margin-bottom:10px; }
  .home-search-form input { font-size:13px; }
  .home-search-form .button { padding:10px 16px; font-size:13px; }
  .home-chip-row { gap:6px; padding-bottom:12px; }
  .home-chip { padding:8px 12px; font-size:12px; }
  .home-type-row { gap:0 15px; padding-top:6px; }
  .home-type { font-size:12px; }
  .home-reset { margin-left:0; font-size:12px; padding:8px 0; }
  .home-count { font-size:12px; margin-top:12px; }
  .home-resource-grid { border-radius:14px; }
  .home-resource-card { display:block; padding:14px; }
  .home-card-body h3 { font-size:16px; }
  .home-card-meta { font-size:11px; gap:3px 9px; }
  .home-card-description { font-size:12px; }
  .home-card-actions { flex-direction:row; flex-wrap:wrap; margin-top:10px; }
  .home-card-actions .button { flex:0 1 auto; padding:10px 16px; }
  .resource-preview .modal-header,.resource-preview .modal-body { padding:14px 16px; }
  .resource-preview .modal-footer { padding:12px 16px; }
  .resource-preview .detail-meta { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-footer { display:block; margin-top:30px; padding-top:24px; }
  .home-footer span { display:block; margin-top:6px; }
  .login-panel { padding:26px 22px; border-radius:24px; }
  .login-panel h1 { font-size:28px; }
  .account-card { padding:18px; }
  .modal { border-radius:20px; }
  .modal-header,.modal-body { padding:18px; }
  .detail-title { font-size:23px; }
  .detail-meta { grid-template-columns:1fr; }
  .resource-card { padding:20px; }
  .panel { padding:18px; } .resource-panel { padding:0; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }

/* File and link lists stay compact and text-only. */
.attachment-tools { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.attachment-tools>span { color:var(--muted); font-size:12px; }
.link-entry { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) auto; gap:12px; align-items:end; }
.link-entry .field { min-width:0; }
.link-entry input { width:100%; min-width:0; min-height:44px; padding:10px 12px; border:1px solid #cbd5e1; border-radius:10px; background:#fff; color:var(--ink); font:inherit; font-size:14px; }
.upload-attachments { border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.attachment-item { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:10px 12px; min-width:0; }
.attachment-item+.attachment-item { border-top:1px solid var(--line); }
.attachment-item>div { min-width:0; flex:1; }
.attachment-item strong { display:block; font-size:13px; font-weight:600; overflow-wrap:anywhere; }
.attachment-item span { display:block; margin-top:3px; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.attachment-item .button { flex-shrink:0; min-height:44px; white-space:nowrap; }
.attachment-actions { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-end; flex-shrink:0; }
.attachment-empty { padding:12px; margin:0; color:var(--muted); font-size:13px; }
.attachment-detail { margin:20px 0; }
.attachment-detail h4 { margin-bottom:8px; }
.attachment-detail .attachment-item { padding-left:0; padding-right:0; }
.activity-preview { min-height:360px; display:grid; place-items:center; border:1px solid var(--line); border-radius:12px; background:#f7fafc; overflow:hidden; }
.activity-preview-image img { display:block; max-width:100%; max-height:62vh; object-fit:contain; }
.activity-preview-pdf { min-height:clamp(420px,65vh,720px); }
.activity-preview-pdf iframe { width:100%; height:clamp(420px,65vh,720px); border:0; background:#fff; }
.activity-preview-text { width:100%; max-height:62vh; overflow:auto; margin:0; padding:18px; white-space:pre-wrap; word-break:break-word; color:#263746; background:#fff; font:13px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace; }
.activity-preview-unavailable { padding:34px 24px; text-align:center; color:var(--muted); line-height:1.7; }
.login-options { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:-3px; }
.login-options .check-label { margin:0; }
.text-button { border:0; padding:0; background:transparent; color:#075fbd; font:inherit; font-size:12px; cursor:pointer; }
.text-button:hover { color:#084c92; text-decoration:underline; }
.help-callout { padding:18px; border:1px solid #cfe1f5; border-radius:14px; background:#f5f9ff; color:#30465b; line-height:1.7; }
.help-callout strong { color:#075fbd; }
.legal-note { color:#6a5a3b; background:#fffaf0; border:1px solid #f0dfb4; border-radius:9px; padding:9px 11px; line-height:1.6; }
@media(max-width:680px) {
  .link-entry { grid-template-columns:minmax(0,1fr); gap:10px; }
  .link-entry .button { justify-self:start; min-height:44px; }
  .attachment-tools .button { min-height:44px; }
}
@media(max-width:380px) {
  .attachment-item { flex-wrap:wrap; }
  .attachment-item>div { flex-basis:100%; }
}

/* Portal workflows: compact forms, readable text, and explicit actions. */
.portal-form { display:grid; gap:14px; min-width:0; }
.portal-form input:not([type=checkbox]):not([type=radio]),.portal-form select,.portal-form textarea,
.portal-search input { width:100%; min-width:0; min-height:44px; border:1px solid #cbd5e1; border-radius:10px; padding:10px 12px; background:#fff; color:var(--ink); font-size:14px; }
.portal-form label,.portal-search { font-size:13px; color:var(--muted); }
.portal-form .field { min-width:0; }
.portal-form .field input { margin-top:6px; }
.portal-form details { border-top:1px solid var(--line); padding-top:12px; }
.portal-form details .field { margin-top:12px; }
.portal-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.portal-tabs { margin-bottom:18px; }
.activity-scope-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; width:min(100%,440px); margin:0 0 18px; }
.activity-scope-tabs .button { min-width:0; min-height:42px; padding:10px 12px; line-height:1.35; white-space:normal; }
.activity-scope-tabs .button[aria-pressed="true"] { box-shadow:0 4px 12px rgba(31,116,184,.2); }
.portal-list { display:grid; gap:12px; }
.portal-row { display:flex; gap:18px; align-items:center; justify-content:space-between; }
.portal-row>div:first-child { min-width:0; flex:1; }
.portal-row h3 { font-size:18px; margin:12px 0 8px; overflow-wrap:anywhere; }
.portal-row p { font-size:14px; line-height:1.65; color:var(--muted); margin-bottom:8px; overflow-wrap:anywhere; }
.portal-search { display:grid; gap:8px; margin-bottom:18px; max-width:540px; }
.portal-prose { white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.85; }
.portal-excerpt { white-space:pre-wrap; overflow-wrap:anywhere; }
.portal-row .portal-actions { flex-shrink:0; }
.roster-list { max-height:300px; overflow:auto; }
.roster-list>div,.reply-row,.draw-history { padding:12px 0; border-bottom:1px solid var(--line); }
.roster-list span,.draw-history span,.draw-history strong { display:block; font-size:12px; line-height:1.8; }
.draw-history strong { font-size:15px; }
.ranking-panel { margin:16px 0 22px; padding:18px 20px; }
.ranking-panel .panel-heading { margin:0; padding:0; border:0; }
.ranking-tabs { display:flex; gap:6px; }
.ranking-tabs button { min-height:36px; padding:7px 12px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--muted); cursor:pointer; }
.ranking-tabs button.active,.ranking-tabs button[aria-pressed="true"] { color:var(--blue); border-color:var(--blue); background:#eff6ff; }
.ranking-custom-range { display:flex; align-items:end; gap:8px; margin-top:8px; color:var(--muted); font-size:12px; }
.ranking-custom-range label { display:grid; gap:4px; min-width:0; }
.ranking-custom-range input { min-height:34px; padding:6px 8px; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:#fff; font:inherit; }
.ranking-custom-range>span { padding-bottom:9px; }
.ranking-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; margin-top:14px; }
.ranking-row { display:flex; align-items:center; gap:10px; min-width:0; padding:10px 12px; border-radius:10px; background:#f7f9fc; font-size:13px; }
.ranking-row strong { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ranking-row>span:last-child { color:var(--muted); white-space:nowrap; }
.ranking-place { display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:#e7edf5; color:var(--ink); font-weight:700; }
@media(max-width:380px) {
  .activity-scope-tabs { width:100%; }
  .activity-scope-tabs .button { padding:9px 6px; font-size:12px; }
}
.draw-roster { max-height:360px; overflow:auto; border:1px solid var(--line); border-radius:12px; }
.draw-person { display:flex; gap:12px; align-items:center; padding:12px; min-height:56px; border-bottom:1px solid var(--line); }
.draw-person strong { color:var(--ink); font-size:14px; }
.draw-person small { display:block; line-height:1.8; }
.draw-search-row { display:flex; align-items:flex-end; gap:12px; margin-bottom:10px; }
.draw-search-row .portal-search { flex:1; margin-bottom:0; }
.draw-filter-selected { flex:0 0 auto; margin-bottom:7px; white-space:nowrap; }
.draw-selection-summary { margin:10px 0 12px; padding:10px 12px; border:1px solid #cfe0eb; border-radius:10px; background:#f7fbfe; }
.draw-selection-summary strong { display:block; margin-bottom:7px; color:var(--navy); font-size:13px; }
.draw-selected-list { display:flex; flex-wrap:wrap; gap:6px; max-height:76px; overflow:auto; }
.draw-selected-chip { display:inline-flex; align-items:center; min-height:26px; padding:3px 9px; border-radius:999px; background:#e1f2ff; color:#145b89; font-size:12px; }
@media(max-width:580px) {
  .draw-search-row { display:block; }
  .draw-filter-selected { display:inline-flex; margin-top:8px; }
}
.check-label { display:flex; gap:10px; align-items:center; min-height:44px; }
.check-label input,.draw-person input { width:20px; height:20px; flex:0 0 auto; accent-color:var(--blue); }
.review-choice-group { border:0; padding:0; margin:0 0 16px; display:grid; gap:8px; }
.review-choice-group legend { margin-bottom:8px; font-weight:700; }
.review-choice { display:flex; align-items:flex-start; gap:12px; padding:12px 14px; border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.review-choice:has(input:checked) { border-color:var(--blue); background:#f2f7ff; }
.review-choice:focus-within { outline:2px solid var(--blue); outline-offset:2px; }
.review-choice-group[aria-invalid="true"] .review-choice { border-color:#d83a3a; }
.review-choice input { width:18px; height:18px; margin:2px 0 0; flex:0 0 auto; accent-color:var(--blue); }
.review-choice span { display:grid; gap:3px; }
.review-choice small { color:var(--muted); line-height:1.5; }
.portal-form summary { min-height:44px; padding:12px 0; cursor:pointer; }
.portal-form .table-wrap { max-height:320px; overflow:auto; }
#account-results .table-wrap { overflow-x:auto; }
.login-panel .login-form { margin-bottom:14px; }
.login-panel .login-form label { margin:0; }
.login-panel .login-accounts { margin-top:16px; grid-template-columns:repeat(2,minmax(0,1fr)); }
@media(max-width:820px) {
  .main-nav { display:flex; flex-wrap:nowrap; overflow-x:auto; max-width:100%; padding-bottom:6px; }
  .main-nav .nav-item { width:auto; flex-shrink:0; }
  .main-nav .nav-item span:last-child { display:inline; }
  .public-nav { flex-wrap:wrap; gap:12px; }
  .public-nav nav { display:flex; gap:6px; flex-wrap:wrap; }
  .public-nav nav .button { padding:10px 12px; font-size:12px; }
  .portal-row { flex-direction:column; align-items:stretch; gap:12px; }
  .section-heading { flex-wrap:wrap; }
  .portal-row .portal-actions { flex-shrink:1; }
}
@media(max-width:580px) {
  #account-results table,#account-results tbody,#account-results tr,#account-results td { display:block; width:100%; }
  #account-results thead { display:none; }
  #account-results tr { padding:12px 0; border-bottom:1px solid var(--line); }
  #account-results td { border:0; padding:6px 0; white-space:normal; overflow-wrap:anywhere; }
  #account-results td::before { content:attr(data-label); display:block; color:var(--muted); font-size:11px; margin-bottom:4px; }
  #account-results .portal-actions { gap:8px; }
}

/* 1.1 navigation polish: stable action order, clear blue guest navigation, compact mobile wrap. */
.topbar-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.topbar-actions #role-switch-btn { order:1; }
.topbar-actions #quick-upload-btn { order:2; }
.topbar-actions .button,.topbar-actions .role-switch { min-height:44px; }
.public-nav nav .button-primary { color:#fff; font-size:16px; font-weight:600; letter-spacing:-.01em; }
.public-nav nav .button-primary:focus-visible,.topbar-actions button:focus-visible { outline:3px solid #7bb8f5; outline-offset:3px; }
.site-legal-footer,.home-footer span { overflow-wrap:anywhere; }
@media(max-width:820px) {
  .public-nav nav .button-primary { font-size:15px; padding:10px 8px; }
  .topbar > div:first-child { grid-column:1/-1; grid-row:1; }
  .topbar-actions { display:grid; grid-column:1/-1; grid-row:2; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; width:100%; }
  .topbar-actions #role-switch-btn,.topbar-actions #quick-upload-btn { grid-column:auto; grid-row:auto; justify-self:stretch; width:100%; margin:0; }
  .topbar-actions .button,.topbar-actions .role-switch { min-height:42px; padding:9px 12px; }
}
@media(max-width:420px) {
  .topbar-actions .button,.topbar-actions .role-switch { font-size:12px; padding:8px 10px; }
  .public-nav { gap:8px; }
  .public-nav nav { gap:2px 10px; }
}

/* Keep primary navigation equally legible before and after login. */
.sidebar { grid-template-columns:auto minmax(0,1fr); }
.sidebar-brand { grid-column:1; grid-row:1; }
.sidebar-brand strong { font-size:18px; font-weight:700; letter-spacing:-.03em; }
.sidebar .main-nav { display:contents; }
.sidebar-footer { display:none; }
.primary-nav { grid-column:2; grid-row:1; justify-content:flex-end; }
.management-nav { grid-column:1/-1; grid-row:2; justify-content:flex-end; }
.sidebar .management-nav .nav-item { min-height:40px; padding:8px 13px; font-size:13px; }
.primary-nav .nav-item,.public-nav .nav-item { min-height:48px; padding:11px 18px; font-size:16px; font-weight:600; color:#fff; background:var(--blue); box-shadow:none; }
.primary-nav .nav-item:hover,.public-nav .nav-item:hover { background:#0065cb; }
.primary-nav .nav-item.active,.public-nav .nav-item.active { background:#084c92; box-shadow:0 0 0 2px #9ac8fa; }
.primary-nav [data-view="overview"]:not(.active) { color:#084f9e; background:#d8eaff; box-shadow:inset 0 0 0 1px #9bc8f7; }
.home-library .section-kicker { margin:0 0 4px; color:#49627d; }
.home-count { font-weight:500; color:#384a5d; }
.home-empty { border:1px solid #d2dce7; }
.site-legal-footer { max-width:1280px; margin:0 auto; padding:20px 24px 28px; color:var(--muted); font-size:12px; line-height:1.8; }
.home-active .site-legal-footer { display:none; }
@media(max-width:1000px) {
  .sidebar { grid-template-columns:1fr; }
  .primary-nav { grid-column:1; grid-row:2; justify-content:flex-start; }
  .management-nav { grid-column:1; grid-row:3; justify-content:flex-start; }
  .public-nav { flex-wrap:wrap; }
  .public-nav nav { width:auto; }
}
@media(max-width:820px) {
  .sidebar { grid-template-columns:1fr; }
  .home-library-main { width:100%; }
  .primary-nav,.management-nav { flex-wrap:nowrap; justify-content:flex-start; width:100%; overflow-x:auto; scrollbar-width:thin; }
  .home-login-button { min-height:46px; padding:10px 18px; font-size:15px; }
  .primary-nav .nav-item,.public-nav .nav-item { min-height:48px; padding:11px 16px; font-size:15px; }
  .management-nav .nav-item { min-height:40px; padding:8px 12px; font-size:13px; }
  .management-label { flex:0 0 auto; }
  .home-hero { padding:20px 22px; }
  .home-library { padding:18px; }
}
@media(max-width:580px) {
  .sidebar .main-nav { gap:6px; }
  .primary-nav,.public-nav nav { gap:5px; }
  .home-brand { max-width:calc(100vw - 108px); overflow:hidden; text-overflow:ellipsis; font-size:16px; }
  .sidebar-brand strong { font-size:16px; }
  .public-nav { align-items:center; }
  .public-nav nav { order:3; width:100%; overflow-x:auto; padding-bottom:2px; }
  .home-login-button { order:2; }
  .primary-nav .nav-item,.public-nav .nav-item { min-height:46px; padding:10px 8px; font-size:14px; white-space:nowrap; }
  .management-nav { padding-top:5px; }
  .home-hero { margin-top:14px; padding:16px; border-radius:16px; }
  .hero-copy h1 { font-size:24px; }
  .hero-description { font-size:13px; }
  .home-library { margin-top:12px; padding:14px; border-radius:16px; }
}

/* Editorial marks: text and symbols identify featured content without relying on color alone. */
.quality-badge { display:inline-flex; align-items:center; gap:0; flex-shrink:0; padding:3px 9px; border:1px solid; border-radius:7px; font-size:12px; font-weight:600; line-height:1.5; letter-spacing:0; white-space:nowrap; vertical-align:middle; }
.quality-resource { color:#805400; background:#fff5d6; border-color:#ead291; }
.quality-post { color:#a33d12; background:#fff0e6; border-color:#efc4a7; }
.pin-badge { color:#075fbd; background:#edf6ff; border-color:#9bc8f7; }
.quality-title,.quality-meta { display:flex; align-items:flex-start; flex-wrap:wrap; gap:8px; }
.quality-title-text { min-width:0; overflow-wrap:anywhere; }
.quality-title-badges,.reply-badges { display:inline-flex; align-items:center; flex-wrap:wrap; gap:6px; flex:0 0 auto; }
.quality-meta { justify-content:flex-end; }
.resource-card-top { flex-wrap:wrap; }
.reply-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }

/* Large-screen draw result: readable from a projector or shared display. */
.draw-stage,.draw-result { min-height:clamp(430px,58vh,600px); display:grid; place-items:center; align-content:center; gap:22px; text-align:center; padding:42px 24px; }
.draw-stage-label,.draw-stage-hint,.draw-result-label { margin:0; color:var(--muted); font-size:clamp(16px,1.8vw,21px); }
.draw-rolling { min-width:min(100%,760px); padding:34px 28px; border:3px solid #9bc8f7; border-radius:26px; background:linear-gradient(135deg,#edf6ff,#fff); color:#075fbd; font-size:clamp(48px,8vw,96px); font-weight:750; line-height:1.2; letter-spacing:-.04em; box-shadow:0 18px 45px rgba(18,95,164,.12); }
.draw-result-label { color:#075fbd; font-weight:650; }
.draw-winners { display:grid; gap:18px; width:min(100%,900px); }
.draw-winner { display:grid; gap:7px; padding:24px 30px; border:1px solid #c7dff7; border-radius:22px; background:linear-gradient(110deg,#eef7ff,#fff); text-align:center; box-shadow:0 12px 28px rgba(18,95,164,.08); }
.draw-winner span { color:#4c5867; font-size:clamp(20px,2.8vw,32px); line-height:1.4; }
.draw-winner strong { color:#075fbd; font-size:clamp(42px,6vw,76px); line-height:1.15; letter-spacing:-.04em; }
.draw-stage + *,.draw-result + * { min-height:44px; }
@media(max-width:580px) {
  .login-options { align-items:flex-start; flex-direction:column; gap:8px; }
  .draw-stage,.draw-result { min-height:360px; padding:30px 14px; gap:17px; }
  .draw-rolling { min-width:0; width:100%; padding:26px 14px; font-size:clamp(38px,12vw,66px); }
  .draw-winner { padding:20px 16px; }
  .draw-winner strong { font-size:clamp(36px,11vw,58px); }
}

/* Navigation spacing: keep the top row clear without making the buttons feel oversized. */
.public-nav nav { gap:5px; }
.primary-nav .nav-item,.public-nav .nav-item { min-height:44px; padding:9px 14px; font-size:14px; }
.home-login-button { min-height:44px; padding:9px 17px; font-size:14px; }
@media(max-width:820px) {
  .primary-nav .nav-item,.public-nav .nav-item { min-height:42px; padding:9px 12px; font-size:14px; }
  .home-login-button { min-height:42px; padding:9px 15px; font-size:14px; }
}

/* Unified platform header: logged-in and guest layouts keep the same navigation positions. */
.platform-header { box-sizing:border-box; }
.sidebar.platform-header { position:sticky; top:0; z-index:25; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:0 28px; min-height:78px; height:auto; padding:12px max(24px,calc((100vw - 1328px)/2)); background:rgba(250,250,252,.97); color:var(--ink); border-bottom:1px solid var(--line); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); }
.sidebar.platform-header .header-brand { grid-column:1; grid-row:1; padding:0; min-width:0; }
.sidebar.platform-header .header-brand .home-brand { display:block; max-width:300px; font-size:18px; font-weight:700; letter-spacing:-.03em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar.platform-header .user-chip { display:none; }
.sidebar.platform-header .header-toolbar { grid-column:2; grid-row:1; display:flex; align-items:center; justify-content:flex-end; gap:18px; min-width:0; }
.sidebar.platform-header { padding-top:0; padding-bottom:0; }
.sidebar.platform-header .header-toolbar { height:78px; }
.sidebar.platform-header .main-nav { display:block; min-width:0; }
.sidebar.platform-header .primary-nav { display:flex; align-items:center; justify-content:flex-end; gap:6px; min-width:0; }
.sidebar.platform-header .header-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.sidebar.platform-header .management-nav { grid-column:1/-1; grid-row:2; display:flex; justify-content:flex-end; align-items:center; gap:6px; width:100%; margin-top:9px; padding-top:9px; border-top:1px solid var(--line); }
.sidebar.platform-header .management-nav.hidden { display:none !important; }
.sidebar.platform-header .management-label { margin-right:4px; color:var(--muted); font-size:12px; }
.sidebar.platform-header .management-nav .nav-item { min-height:38px; padding:8px 13px; font-size:13px; color:#126b58; background:#e8f6f2; border:1px solid #c7e8df; }
.sidebar.platform-header .management-nav .nav-item:hover,.sidebar.platform-header .management-nav .nav-item.active { color:#fff; background:#168477; border-color:#168477; box-shadow:0 6px 14px rgba(22,132,119,.18); }
.header-action { min-height:46px; border-radius:24px; transition:transform .18s ease,box-shadow .18s ease,background .18s ease; }
.header-action:hover { transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,113,227,.18); }
.sidebar.platform-header .role-switch { border-color:#b8cbe2; background:#fff; color:#515154; min-height:46px; padding:10px 15px; }
.sidebar.platform-header .role-switch:hover { border-color:#0071e3; background:#f5f9ff; }
.sidebar.platform-header .role-menu { top:calc(100% - 4px); right:max(24px,calc((100vw - 1328px)/2)); }
.sidebar.platform-header .role-option:hover { color:#126b58; background:#e8f6f2; }
.sidebar.platform-header .role-option-danger:hover { color:var(--red); background:var(--red-soft); }
.public-nav.platform-header { display:flex; align-items:center; justify-content:space-between; gap:28px; min-height:78px; padding:12px max(24px,calc((100vw - 1328px)/2)); }
.public-nav.platform-header .header-brand { min-width:0; }
.public-nav.platform-header .header-brand .home-brand { display:block; max-width:300px; font-size:18px; font-weight:700; letter-spacing:-.03em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.public-nav.platform-header .header-toolbar { display:flex; align-items:center; justify-content:flex-end; gap:18px; min-width:0; }
.public-nav.platform-header .primary-nav { display:flex; align-items:center; gap:6px; min-width:0; }
.public-nav.platform-header .header-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.public-nav.platform-header .header-action { min-height:46px; }
.public-nav.platform-header .public-upload { display:inline-flex; }
.public-nav.platform-header .home-login-button { min-height:46px; padding:10px 18px; border-radius:24px; }
.public-nav.platform-header .home-login-button { width:101px; min-width:101px; }
.sidebar.platform-header #quick-upload-btn { height:46px; }
.public-nav.platform-header .nav-item,.sidebar.platform-header .primary-nav .nav-item { min-height:46px; padding:10px 16px; border-radius:24px; font-size:15px; font-weight:650; color:#fff; background:var(--blue); box-shadow:0 5px 13px rgba(31,116,184,.15); transition:transform .18s ease,box-shadow .18s ease,background .18s ease; }
.public-nav.platform-header .nav-item:hover,.sidebar.platform-header .primary-nav .nav-item:hover { background:#0065cb; transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,113,227,.2); }
.public-nav.platform-header .nav-item.active,.sidebar.platform-header .primary-nav .nav-item.active { background:#084c92; box-shadow:0 0 0 2px #9ac8fa,0 8px 18px rgba(8,76,146,.18); }
.public-nav.platform-header .nav-item[data-public-home],.sidebar.platform-header .primary-nav .nav-item[data-view="overview"]:not(.active) { color:#fff; background:var(--blue); box-shadow:0 5px 13px rgba(31,116,184,.15); }
.public-nav.platform-header .nav-item[data-public-home]:hover,.sidebar.platform-header .primary-nav .nav-item[data-view="overview"]:not(.active):hover { color:#fff; background:#0065cb; }
.public-nav.platform-header .nav-item[data-public-home].active { color:#fff; background:#084c92; box-shadow:0 0 0 2px #9ac8fa,0 8px 18px rgba(8,76,146,.18); }
.topbar-menu { position:relative; }
@media(max-width:1000px) {
  .sidebar.platform-header { grid-template-columns:1fr; gap:10px; padding:0 24px 12px; }
  .sidebar.platform-header .header-brand,.sidebar.platform-header .header-toolbar { grid-column:1; }
  .sidebar.platform-header .header-toolbar { grid-row:2; justify-content:flex-start; flex-wrap:wrap; }
  .sidebar.platform-header .management-nav { grid-row:3; justify-content:flex-start; overflow-x:auto; }
  .public-nav.platform-header { flex-wrap:wrap; gap:10px 18px; }
  .public-nav.platform-header .header-toolbar { width:100%; justify-content:flex-start; flex-wrap:wrap; }
}
@media(max-width:580px) {
  .sidebar.platform-header { padding:0 16px 8px; }
  .sidebar.platform-header .header-brand .home-brand,.public-nav.platform-header .header-brand .home-brand { max-width:calc(100vw - 32px); font-size:16px; }
  .sidebar.platform-header .header-toolbar,.public-nav.platform-header .header-toolbar { gap:8px; }
  .sidebar.platform-header .header-toolbar { height:auto; min-height:78px; }
  .sidebar.platform-header .primary-nav,.public-nav.platform-header .primary-nav { width:100%; overflow-x:auto; justify-content:flex-start; padding-bottom:2px; }
  .sidebar.platform-header .header-actions,.public-nav.platform-header .header-actions { width:100%; justify-content:flex-start; }
  .public-nav.platform-header .header-actions { width:auto; margin-left:auto; }
  .public-nav.platform-header .header-toolbar { display:grid; grid-template-columns:1fr auto; }
  .public-nav.platform-header .primary-nav { grid-column:1/-1; grid-row:1; }
  .public-nav.platform-header .header-actions { grid-column:1/-1; grid-row:2; }
  .public-nav.platform-header .nav-item,.sidebar.platform-header .primary-nav .nav-item { min-height:42px; padding:9px 11px; font-size:13px; }
  .header-action,.public-nav.platform-header .home-login-button { min-height:42px; padding:9px 13px; font-size:13px; }
}
@media(max-width:580px) {
  .primary-nav .nav-item,.public-nav .nav-item { min-height:40px; padding:8px 10px; font-size:13px; }
  .home-login-button { min-height:40px; padding:8px 13px; font-size:13px; }
}

/* The logged-in platform header is the same full-width row as the guest header. */
.workspace-view { display:block; }
@media (min-width:581px) and (max-width:1000px) {
  .sidebar.platform-header .header-actions { width:auto; }
}
@media (min-width:581px) and (max-width:1000px) {
  .sidebar.platform-header .header-toolbar { transform:translateY(-3px); }
}
@media(max-width:580px) {
  .sidebar.platform-header { padding-left:18px; padding-right:18px; }
  .sidebar.platform-header .header-toolbar { display:grid; grid-template-columns:1fr auto; align-items:start; min-height:0; }
  .sidebar.platform-header .primary-nav { grid-column:1/-1; grid-row:1; }
  .sidebar.platform-header .header-actions { grid-column:1/-1; grid-row:2; width:auto; }
}
@media(max-width:580px) {
  .sidebar.platform-header { padding-left:24px; padding-right:24px; }
}
.sidebar.platform-header .header-action { font-size:16px; padding:10px 18px; }
.sidebar.platform-header #role-switch-btn { width:101px; min-width:101px; }
@media(max-width:580px) {
  .public-nav.platform-header .header-actions { margin-left:0; }
  .sidebar.platform-header .header-action { font-size:13px; padding:9px 13px; }
}
@media(min-width:581px) {
  .sidebar.platform-header #quick-upload-btn { width:136px; height:46px; }
  .sidebar.platform-header #role-switch-btn { width:101px; min-width:101px; height:46px; }
}
.public-nav.platform-header .home-login-button { width:120px; min-width:120px; }
@media(min-width:581px) {
  .sidebar.platform-header #role-switch-btn { width:120px; min-width:120px; }
}
@media(max-width:580px) {
  .sidebar.platform-header #role-switch-btn { width:120px; min-width:120px; }
}
.sidebar.platform-header #role-switch-btn { padding-left:12px; padding-right:12px; white-space:nowrap; }

/* Header action refinement: upload/account (or upload/login) are the green secondary actions. */
.sidebar.platform-header .header-actions .header-action,
.public-nav.platform-header .header-actions .header-action {
  color:#126b58;
  background:#e8f6f2;
  border:1px solid #c7e8df;
  box-shadow:0 5px 13px rgba(22,132,119,.12);
}
.sidebar.platform-header .header-actions .header-action:hover,
.public-nav.platform-header .header-actions .header-action:hover {
  color:#fff;
  background:#168477;
  border-color:#168477;
  box-shadow:0 8px 18px rgba(22,132,119,.22);
}
.sidebar.platform-header .topbar-menu .role-menu,
.public-nav.platform-header .topbar-menu .role-menu {
  top:calc(100% + 8px);
  right:0;
}
.sidebar.platform-header .topbar-menu .role-menu { width:240px; }
@media(min-width:581px) {
  .public-nav.platform-header .public-upload { width:136px; }
}
@media(max-width:580px) {
  .public-nav.platform-header .public-upload { width:104px; }
}

/* Unified header control system: one rhythm, one type scale, color is the only tier difference. */
.platform-header .header-toolbar { gap:8px; }
.platform-header .primary-nav,
.platform-header .header-actions,
.platform-header .management-nav { gap:8px; }
.platform-header .nav-item,
.platform-header .header-action {
  height:46px;
  min-height:46px;
  padding:0 16px;
  border-radius:24px;
  font-family:inherit;
  font-size:15px;
  font-weight:650;
  line-height:1;
  letter-spacing:0;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.platform-header .nav-item { gap:8px; }
.platform-header .header-action { gap:8px; }
.platform-header .management-nav .nav-item {
  height:40px;
  min-height:40px;
  padding:0 14px;
  font-size:13px;
}
@media(max-width:580px) {
  .platform-header .nav-item,
  .platform-header .header-action {
    height:42px;
    min-height:42px;
    padding:0 12px;
    font-size:13px;
  }
  .platform-header .management-nav .nav-item {
    height:38px;
    min-height:38px;
    padding:0 12px;
    font-size:12px;
  }
}

/* Override earlier layout layers so every header gap uses the same 8px rhythm. */
.sidebar.platform-header .header-toolbar,
.public-nav.platform-header .header-toolbar { gap:8px; }
.sidebar.platform-header .primary-nav,
.public-nav.platform-header .primary-nav,
.sidebar.platform-header .header-actions,
.public-nav.platform-header .header-actions { gap:8px; }

/* Adversarial UI review · 2026-10-28
   One final layer keeps the visual language consistent across the public home,
   teacher workspace, review tables, forms and small screens. */
:root {
  --ink:#202b38;
  --muted:#657487;
  --soft:#f5f7fa;
  --line:#dfe6ee;
  --paper:#fff;
  --navy:#173f62;
  --blue:#176fba;
  --blue-deep:#0d5594;
  --blue-soft:#edf6ff;
  --teal:#168477;
  --teal-soft:#e9f7f3;
  --shadow:0 10px 28px rgba(25,55,82,.07);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;
  font-synthesis:none;
}
body { background:var(--soft); color:var(--ink); line-height:1.55; }
h1,h2,h3,h4,strong,button,.button { letter-spacing:-.012em; }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible { outline:3px solid rgba(23,111,186,.28); outline-offset:3px; }

/* Header: stable rhythm, clear tiers, and one visible active state. */
.public-nav.platform-header,
.sidebar.platform-header { min-height:74px; padding-left:max(20px,calc((100vw - 1328px)/2)); padding-right:max(20px,calc((100vw - 1328px)/2)); background:rgba(255,255,255,.94); border-bottom-color:#dce4ec; }
.public-nav.platform-header .header-brand .home-brand,
.sidebar.platform-header .header-brand .home-brand { color:#164e78; font-size:20px; font-weight:750; letter-spacing:0; white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
.platform-header .primary-nav .nav-item { height:44px; min-height:44px; padding:0 16px; border:1px solid #d3e4f2; border-radius:13px; background:#ecf5fc; color:#075f9f; box-shadow:none; font-size:14px; font-weight:700; }
.platform-header .primary-nav .nav-item:hover { color:#064979; background:#dceefa; border-color:#afd0e8; transform:translateY(-1px); box-shadow:0 5px 12px rgba(23,111,186,.12); }
.platform-header .primary-nav .nav-item.active { color:#fff; background:var(--blue-deep); border-color:var(--blue-deep); box-shadow:0 5px 14px rgba(13,85,148,.22); }
.platform-header .header-actions .header-action { height:44px; min-height:44px; border-radius:13px; font-size:14px; font-weight:700; }
.public-nav.platform-header .home-login-button { border-color:#b9e1d7; background:var(--teal-soft); color:#116a5b; }
.public-nav.platform-header .home-login-button:hover { background:var(--teal); border-color:var(--teal); color:#fff; }
.platform-header .header-actions .header-action { border-color:#b9e1d7; background:var(--teal-soft); color:#116a5b; box-shadow:none; }
.platform-header .header-actions .header-action:hover { background:var(--teal); border-color:var(--teal); color:#fff; transform:translateY(-1px); box-shadow:0 5px 12px rgba(22,132,119,.16); }
.platform-header .role-menu { border-color:#dce5ec; box-shadow:0 18px 42px rgba(21,47,70,.14); }
.prototype-banner { padding:8px 20px; background:#f9fbfd; color:#748293; border-bottom-color:#e4ebf1; font-size:12px; }

/* Page frame and headings: reduce empty space while keeping a calm reading width. */
.topbar { min-height:88px; padding:21px 24px 17px; }
.topbar h2 { color:#1d2a39; font-size:27px; font-weight:750; }
.breadcrumb { margin-bottom:5px; color:#7a8998; font-size:12px; }
.view-root { padding:26px 24px 56px; }
.section-heading { align-items:center; margin-bottom:18px; }
.section-heading h3 { color:#203143; font-size:22px; font-weight:750; letter-spacing:-.025em; }
.section-heading p { color:#6f7e8d; font-size:13px; }
.panel,.search-panel,.backup-card,.resource-card { border:1px solid #dce5ed; box-shadow:0 4px 16px rgba(28,56,78,.035); }
.panel { border-radius:16px; }
.search-panel,.backup-card,.resource-card { border-radius:16px; }
.panel-heading { padding-bottom:13px; border-bottom-color:#e7edf2; }
.panel-heading h3 { color:#243648; font-size:16px; font-weight:750; }
.empty-state { min-height:108px; display:grid; place-items:center; padding:26px 16px; color:#748293; }

/* Public home: the tinted area separates the library without overpowering it. */
.home-content { max-width:1328px; padding-bottom:44px; }
.home-hero { margin-top:20px; padding:28px 30px; border-color:#c8dff3; border-radius:18px; background:linear-gradient(120deg,#f0f7ff 0%,#f7fbff 68%,#eef7ff 100%); box-shadow:0 6px 18px rgba(35,104,160,.045); }
.hero-kicker { margin-bottom:7px; color:#52738d; font-size:13px; font-weight:700; }
.hero-copy h1 { color:#172536; font-size:35px; font-weight:780; line-height:1.25; }
.hero-description { color:#536576; font-size:15px; }
.home-text-link { font-size:14px; font-weight:700; }
.home-library { margin-top:20px; padding:24px; border-color:#d5e1ec; border-radius:18px; background:linear-gradient(180deg,#f5f9fd 0%,#eef4f9 100%); box-shadow:0 7px 20px rgba(25,55,82,.045); }
.library-heading { margin-bottom:16px; }
.section-kicker,.home-library .section-kicker { margin:0 0 7px; color:#285b85; font-size:17px; font-weight:750; line-height:1.4; letter-spacing:.04em; }
.library-heading h2 { color:#1f3042; font-size:25px; font-weight:780; }
.library-note { color:#6c7d8d; font-size:12px; }
.home-toolbar { padding:15px; border-color:#dbe5ee; border-radius:15px; box-shadow:0 3px 12px rgba(28,56,78,.03); }
.home-search-form { background:#f7f9fb; border-color:#dce5ed; }
.home-search-form input { font-size:15px; }
.home-chip { background:#f1f4f7; color:#495b6c; }
.home-chip.active { background:#1f2d3b; color:#fff; }
.home-type { color:#617486; }
.home-type.active { color:var(--blue-deep); }
.home-resource-grid { border-color:#d6e0e9; border-radius:15px; box-shadow:0 3px 14px rgba(28,56,78,.03); }
.home-resource-card { min-height:112px; padding:19px 20px; }
.home-resource-card:hover { background:#fafdff; }
.home-card-body h3 { color:#203143; font-size:18px; font-weight:720; }
.home-card-meta { color:#748293; }
.home-card-description { color:#627386; }
.home-card-actions .button { min-width:82px; }
.home-ranking-panel { border-color:#d4e0ea; border-radius:16px; box-shadow:0 5px 16px rgba(28,56,78,.04); }
.home-ranking-panel .panel-heading h3 { font-size:15px; }
.ranking-tabs button { min-height:38px; border-color:#d6e0e9; color:#556a7c; background:#fff; }
.ranking-tabs button.active,.ranking-tabs button[aria-pressed="true"] { color:var(--blue-deep); border-color:#8ebee4; background:#f0f8ff; }
.ranking-row { min-height:45px; border:1px solid #e5ebf1; background:#f8fafc; }
.home-footer { color:#798796; border-top-color:#d8e1e9; }

/* Workspace cards, forms, tables and moderation controls share the same density. */
.stats-grid { gap:14px; }
.stat-card { border-color:#dce5ed; border-radius:16px; box-shadow:0 4px 14px rgba(28,56,78,.03); }
.stat-number { color:#173f62; }
.resource-card { padding:20px; }
.resource-card h3 { font-size:17px; color:#223548; }
.resource-card p { color:#647587; font-size:13px; }
.resource-card-footer { padding-top:12px; border-top-color:#e7edf2; }
.filter-bar { gap:10px; }
.filter-bar .input,.filter-bar select { min-height:44px; }
.table-wrap { border:1px solid #dfe7ee; border-radius:14px; background:#fff; }
table { font-size:13px; }
th { color:#52677a; background:#f5f8fa; font-size:12px; }
th,td { padding:13px 14px; border-bottom-color:#e7edf2; }
tbody tr:hover { background:#fbfdff; }
.table-actions .button { min-height:40px; }
.portal-actions { gap:8px; }
.portal-actions .button,.status-tab { min-height:42px; }
.portal-form { gap:12px; }
.portal-form label,.portal-search { color:#52677a; font-weight:650; }
.portal-form input:not([type=checkbox]):not([type=radio]),.portal-form select,.portal-form textarea,.portal-search input { min-height:46px; border-color:#cfdbe5; }
.portal-form input:not([type=checkbox]):not([type=radio]):focus,.portal-form select:focus,.portal-form textarea:focus,.portal-search input:focus { border-color:#70add6; box-shadow:0 0 0 3px rgba(23,111,186,.12); }
.tag { font-weight:700; }

/* Third pass: compact but touch friendly small screens. */
@media(max-width:820px) {
  .public-nav.platform-header,.sidebar.platform-header { min-height:70px; padding-left:18px; padding-right:18px; }
  .public-nav.platform-header .header-brand .home-brand,.sidebar.platform-header .header-brand .home-brand { font-size:18px; }
  .platform-header .primary-nav .nav-item { height:42px; min-height:42px; padding:0 13px; font-size:13px; }
  .platform-header .header-actions .header-action { height:42px; min-height:42px; font-size:13px; }
  .topbar { min-height:82px; padding:18px; }
  .topbar h2 { font-size:24px; }
  .view-root { padding:22px 18px 42px; }
  .home-content { margin:0 18px; }
  .home-hero { padding:23px 22px; }
  .hero-copy h1 { font-size:29px; }
  .home-library { padding:20px; }
  .home-resource-card { min-height:0; }
}
@media(max-width:580px) {
  .public-nav.platform-header,.sidebar.platform-header { padding-left:14px; padding-right:14px; }
  .public-nav.platform-header .header-brand .home-brand,.sidebar.platform-header .header-brand .home-brand { max-width:calc(100vw - 28px); font-size:18px; }
  .platform-header .primary-nav { padding-bottom:3px; }
  .platform-header .primary-nav .nav-item { height:40px; min-height:40px; padding:0 11px; font-size:12px; border-radius:11px; }
  .platform-header .header-actions .header-action { height:40px; min-height:40px; font-size:12px; border-radius:11px; }
  .prototype-banner { font-size:11px; }
  .topbar { padding:16px; }
  .topbar h2 { font-size:22px; }
  .view-root { padding:18px 14px 34px; }
  .section-heading h3 { font-size:20px; }
  .home-content { margin:0 14px; }
  .home-hero { margin-top:14px; padding:18px 0 12px; border-width:0 0 1px; border-radius:0; background:transparent; box-shadow:none; }
  .hero-copy h1 { font-size:25px; }
  .hero-description { font-size:13px; }
  .home-library { margin-top:14px; padding:14px; border-radius:15px; }
  .library-heading h2 { font-size:21px; }
  .home-toolbar { padding:11px; }
  .home-resource-card { padding:16px; }
  .home-card-body h3 { font-size:16px; }
  .home-card-description { font-size:12px; }
  .home-card-actions .button { min-height:42px; }
  .panel { border-radius:14px; }
  .table-wrap { border-radius:12px; }
}

@media(max-width:580px) {
  /* Logged-in header gets its own second and third rows so account actions never
     cover the four primary navigation buttons. */
  .sidebar.platform-header { grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto auto; align-items:center; row-gap:8px; }
  .sidebar.platform-header .header-brand { grid-column:1; grid-row:1; }
  .sidebar.platform-header .sidebar-footer { grid-column:2; grid-row:1; }
  .sidebar.platform-header .header-toolbar { grid-column:1/-1; grid-row:2; display:grid; grid-template-columns:1fr; grid-template-rows:auto auto; grid-auto-rows:auto; gap:8px; width:100%; min-width:0; height:auto !important; min-height:0; }
  .sidebar.platform-header .main-nav { grid-column:1; grid-row:1; width:100%; min-width:0; display:block; }
  .sidebar.platform-header .primary-nav { width:100%; min-width:0; overflow-x:auto; justify-content:flex-start; }
  .sidebar.platform-header .header-actions { grid-column:1; grid-row:2; width:100%; min-width:0; justify-content:flex-start; }
  .sidebar.platform-header .management-nav { grid-column:1/-1; grid-row:3; width:100%; min-width:0; justify-content:flex-start; }
}

.ranking-more { width:100%; min-height:40px; margin-top:10px; padding:8px 12px; border:1px solid #c8d9e8; border-radius:10px; background:#f7fbff; color:var(--blue-deep); font-size:13px; font-weight:700; }
.ranking-more:hover { background:#edf6ff; border-color:#8ebee4; }
.ranking-full-list { display:grid; gap:8px; max-height:min(62vh,620px); overflow:auto; padding-right:3px; }
.ranking-full-list .ranking-row { min-height:46px; }

/* 1.1.2: feedback stays inside the active dialog. */
.modal-message { flex:0 0 auto; margin:0; padding:12px 24px; border-bottom:1px solid var(--line); background:#f0f7ff; color:#185a8d; font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
.modal-message.form-error { background:#fff4f2; color:#a73126; }
.attachment-audit-note { padding:10px 12px; border-radius:10px; background:#edf6ff; }
.attachment-audit-history { margin:10px 0 16px; }
.attachment-audit-history summary { cursor:pointer; min-height:40px; padding:8px 0; font-size:14px; color:var(--blue); }

/* Multi-person draw results use bounded pages, retaining readable names. */
.modal.draw-result-modal { width:min(1120px,calc(100vw - 40px)); }
.draw-result-modal .modal-body { padding:16px 24px; }
.draw-result.draw-result-grid { min-height:0; padding:8px 0; gap:16px; }
.draw-result-grid .draw-winners { width:100%; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.draw-result-grid .draw-winners[data-columns="1"] { grid-template-columns:minmax(0,1fr); }
.draw-result-grid .draw-winners[data-columns="2"] { grid-template-columns:repeat(2,minmax(0,1fr)); }
.draw-result-grid .draw-winner { min-width:0; padding:16px 12px; gap:6px; border-radius:16px; box-shadow:none; overflow-wrap:anywhere; }
.draw-result-grid .draw-winner small { color:var(--muted); font-size:12px; }
.draw-result-grid .draw-winner span { font-size:clamp(16px,1.8vw,24px); }
.draw-result-grid .draw-winner strong { font-size:clamp(30px,3.6vw,48px); line-height:1.2; letter-spacing:0; }
.draw-result-single .draw-winner { padding:32px 16px; }
.draw-result-single .draw-winner strong { font-size:clamp(42px,6vw,76px); }
.draw-result-pager { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px; margin-right:auto; }
.draw-result-pager label { display:flex; align-items:center; gap:6px; font-size:13px; }
.draw-result-pager select { min-height:40px; max-width:110px; padding:6px 8px; border:1px solid var(--line); border-radius:10px; background:white; color:var(--ink); font:inherit; }
.draw-result-pager .button { min-height:40px; }
@media(max-width:899px) {
  .draw-result-grid .draw-winners { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:579px) {
  .modal.draw-result-modal { width:calc(100vw - 20px); }
  .draw-result-modal .modal-body { padding:12px; }
  .draw-result-grid .draw-winner { padding:12px 8px; }
  .draw-result-grid .draw-winner span { font-size:14px; }
  .draw-result-grid .draw-winner strong { font-size:28px; }
  .draw-result-grid .draw-result-label { font-size:18px; }
  .draw-result-single .draw-winner strong { font-size:48px; }
  .draw-result-modal .modal-footer { justify-content:center; gap:10px; }
  .draw-result-pager { width:100%; margin-right:0; }
}
@media(max-width:579px) {
  .draw-result-pager label { white-space:nowrap; flex-shrink:0; }
  .draw-result-pager .button { padding:8px 10px; font-size:13px; }
}
@media(max-width:579px) {
  .sidebar.platform-header .primary-nav,
  .public-nav.platform-header .primary-nav { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); width:100%; gap:6px; overflow:visible; }
  .platform-header .primary-nav .nav-item { min-width:0; width:100%; padding:0 4px; white-space:nowrap; }
}

/* Confirmation layer preserves the form underneath and uses native focus trapping. */
.confirmation-dialog { width:min(440px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:0; margin:auto; border:1px solid #dfe7ef; border-radius:22px; color:var(--ink); background:#fff; box-shadow:0 24px 80px #122d4a38; overflow:auto; }
.confirmation-dialog::backdrop { background:rgb(20 35 50 / 38%); backdrop-filter:blur(3px); }
.confirmation-content { padding:26px 26px 20px; }
.confirmation-content h3 { margin:0 0 12px; font-size:21px; line-height:1.4; }
.confirmation-content p { margin:0; font-size:15px; line-height:1.75; white-space:pre-line; overflow-wrap:anywhere; color:#506176; }
.confirmation-actions { display:flex; gap:12px; justify-content:flex-end; padding:16px 26px; border-top:1px solid #e4ebf2; background:#f8fafc; }
.confirmation-actions .button { min-width:88px; min-height:44px; }
@media(max-width:579px) { .confirmation-content { padding:22px 20px 18px; } .confirmation-actions { padding:14px 20px; } }

/* Personal forum filters keep fixed labels and a separate warm color. */
.portal-tabs .forum-personal-tab { color:#775817; background:#fff6d8; border-color:#e7d49a; }
.portal-tabs .forum-personal-tab:hover { color:#674800; background:#ffedb7; border-color:#d3b861; }
.portal-tabs .forum-personal-tab[aria-pressed="true"] { color:#5d410a; background:#ffe39a; border-color:#c5a04c; box-shadow:0 3px 10px #a17a1720; font-weight:700; }
.forum-my-reply { margin:10px 0; padding:10px 12px; border-radius:10px; background:#fffaeb; color:#66562f; font-size:14px; line-height:1.65; overflow-wrap:anywhere; }
.forum-sort-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:-6px 0 14px; }
.forum-sort-tabs .button { min-height:38px; padding:8px 14px; border:1px solid #d6e0e9; border-radius:999px; background:#fff; color:#556a7c; }
.forum-sort-tabs .button[aria-pressed="true"] { border-color:#8ebee4; background:#f0f8ff; color:var(--blue-deep); font-weight:700; }
@media(max-width:580px) {
  .forum-sort-tabs { margin-top:-8px; }
  .forum-sort-tabs .button { flex:1 1 132px; min-height:42px; }
}

/* 1.4.0: activity actions, notices and AI share the established blue palette. */
.home-notices,.home-results { margin:0 0 32px; padding:24px; border:1px solid #bdd7ee; border-radius:20px; background:#e6f2ff; }
.home-results { background:#f7fbf8; border-color:#d9e9df; }
.home-notice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.home-notice-card { display:flex; flex-direction:column; justify-content:space-between; align-items:stretch; gap:16px; min-width:0; padding:20px; background:#fff; border:1px solid #dce7ef; border-radius:16px; }
.home-notice-card h3 { margin:12px 0 8px; font-size:18px; line-height:1.5; overflow-wrap:anywhere; }
.home-notice-card p { line-height:1.7; overflow-wrap:anywhere; }
.home-notice-card .tag+.tag { margin-left:6px; }
.home-notice-card .button { min-height:44px; text-align:center; text-decoration:none; }
.activity-copy { flex:1; min-width:0; overflow-wrap:anywhere; }
.activity-actions { display:grid; grid-template-columns:repeat(3,minmax(92px,1fr)); gap:8px; max-width:410px; align-self:center; }
.activity-actions .button { min-height:44px; white-space:nowrap; }
.activity-actions [data-checkout] { color:#8a5912; border-color:#e1c48e; background:#fff6df; }
.activity-actions [data-draw-open] { background:#087e8b; border-color:#087e8b; }
.activity-status-banner { display:flex; flex-wrap:wrap; gap:8px; padding:14px 16px; background:#eef7ff; border-left:4px solid #1975ba; border-radius:8px; margin-bottom:16px; }
.early-checkout-list { padding:12px; border:1px solid #e5cda6; background:#fffbef; border-radius:10px; margin:12px 0; }
.early-checkout-person { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; margin:8px 0; }
.activity-inline-preview { margin-top:16px; border-top:1px solid #d7e3ed; padding-top:12px; }
.ai-content .section-heading { align-items:center; }
.ai-categories { margin:20px 0; }
@media(max-width:899px) { .home-notice-grid { grid-template-columns:1fr; } .activity-actions { width:100%; max-width:none; } }
@media(max-width:579px) {
  .sidebar.platform-header .primary-nav,.public-nav.platform-header .primary-nav { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .platform-header .primary-nav .nav-item { min-height:44px; height:auto; }
  .home-notices,.home-results { padding:14px; margin-bottom:20px; }
  .home-notice-card { padding:16px; }
  .home-notices .library-heading,.home-results .library-heading { flex-wrap:wrap; gap:8px; }
  .activity-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .activity-actions .button { font-size:13px; padding:9px 8px; }
}

/* Radio controls remain compact on Windows and high-DPI browsers. */
.portal-form .review-choice input[type="radio"],.review-choice input[type="radio"] { width:18px; height:18px; min-width:18px; min-height:18px; max-width:18px; max-height:18px; padding:0; flex:0 0 18px; }
.review-choice > span { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; }

/* Keep footer identity, version and contact on one row when space permits. */
.home-footer { display:flex; flex-direction:column; gap:8px; }
.home-footer-info { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 20px; min-width:0; }
.home-footer-info strong { font-size:13px; font-weight:650; max-width:100%; }
.home-footer-info .home-footer-version { display:inline; margin:0; font-size:12px; color:#52677a; white-space:nowrap; }
.home-footer .home-footer-legal { flex:0 1 auto; min-width:0; max-width:none; margin:0; }

.home-footer-info .home-footer-contact { display:inline; margin:0; font-size:12px; color:#52677a; white-space:nowrap; }
.home-footer-contact a { color:#285b85; text-decoration:underline; text-underline-offset:3px; overflow-wrap:anywhere; }
.home-footer-contact a:hover { color:#17436a; }
.home-footer-contact a:focus-visible { outline:2px solid #285b85; outline-offset:3px; border-radius:2px; }

/* Keep the platform name intact, with a single deliberate line-break position. */
.public-nav.platform-header .header-brand .home-brand,
.sidebar.platform-header .header-brand .home-brand { overflow-wrap:normal; word-break:normal; line-height:1.5; }
.platform-header .home-brand > span { display:inline-block; white-space:nowrap; font:inherit; color:inherit; letter-spacing:inherit; margin:0; }
@media(min-width:1200px) {
  .public-nav.platform-header .header-brand .home-brand,
  .sidebar.platform-header .header-brand .home-brand { max-width:400px; }
}

/* AI grade choices remain available on small screens. */
.ai-content .ai-grades { display:flex; }


/* Keep the activity section title prominent and its description on the same line. */
.home-notice-heading { display:flex; align-items:baseline; gap:12px; min-width:0; }
.home-notices .home-notice-heading h2 { margin:0; color:#285b85; font-size:24px; font-weight:780; line-height:1.4; letter-spacing:.02em; white-space:nowrap; }
.home-notice-subtitle { margin:0; color:#60758a; font-size:14px; font-weight:500; line-height:1.5; white-space:nowrap; }
@media(max-width:579px) {
  .home-notice-heading { gap:10px; }
  .home-notices .home-notice-heading h2 { font-size:22px; }
  .home-notice-subtitle { font-size:13px; }
}

/* Textbook directory administration and responsive unit editor. */
.textbook-guide{padding:14px 18px;margin-bottom:20px;border:1px solid #d7e6f6;border-radius:12px;background:#f0f7ff;color:#33506b;line-height:1.7}
.textbook-guide p{margin:4px 0}.textbook-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr));gap:16px}.textbook-card{padding:20px;min-width:0;overflow-wrap:anywhere}.textbook-card .section-heading{gap:10px;align-items:start}.textbook-card .section-heading h3{font-size:18px}.textbook-card .portal-actions{margin-top:14px;flex-wrap:wrap}.textbook-card p{line-height:1.7}.textbook-unit-row{display:grid;grid-template-columns:72px minmax(120px,1fr) 116px 66px;gap:10px;align-items:end;margin:12px 0;padding:12px;border:1px solid #dbe3ed;border-radius:10px}.textbook-unit-row .field{min-width:0}.textbook-unit-row label{display:block;font-size:13px}.textbook-unit-row input:not([type=checkbox]),.textbook-unit-row select{width:100%;min-width:0}.textbook-unit-row .check-label{display:flex;align-self:center}.textbook-unit-row .check-label input{width:auto}
@media(max-width:600px){.textbook-unit-row{grid-template-columns:60px minmax(0,1fr);gap:10px}.textbook-unit-row .check-label{justify-self:start}.textbook-card{padding:16px}.textbook-card .section-heading{flex-wrap:wrap}}

/* Compact section identity keeps a prominent title and a quiet inline subtitle. */
.library-heading {align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:16px}
.section-title-inline {display:flex;align-items:baseline;gap:12px;min-width:0}
.library-heading .section-title-inline h2,.ai-content .section-title-inline h2 {margin:0;font-size:24px;font-weight:780;line-height:1.4;white-space:nowrap;color:#285b85}
.library-heading .section-subtitle,.ai-content .section-subtitle {margin:0;font-size:14px;font-weight:500;line-height:1.5;color:#60758a;white-space:nowrap}
.home-results .section-title-inline h2 {color:#28644a}
.home-results .portal-actions {flex-wrap:wrap;gap:8px}
.results-empty {margin:0;color:#607568;font-size:14px;line-height:1.7}
.result-date {margin:8px 0 0;font-size:12px;color:#718176}
.result-card-actions {display:flex;align-items:stretch;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:auto}
.result-card-actions .button {flex:1 1 132px;min-width:0;white-space:nowrap}
.result-archive {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.research-tabs {grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(0,1fr));width:min(100%,620px)}
.research-results-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;color:var(--muted);font-size:14px}
.research-results-heading p {margin:0}
.research-results .result-article h3 {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.research-results .result-article .resource-meta {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.result-pagination {display:flex;justify-content:center;align-items:center;gap:12px;margin:20px 0 8px}
.result-pagination span {min-width:92px;text-align:center;color:var(--muted);font-size:14px}
.list-pagination {flex-wrap:wrap}
.list-pagination label {display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:14px;color:var(--muted)}
.list-pagination select {min-height:40px;max-width:84px;border:1px solid var(--line);border-radius:10px;background:white;padding:6px 10px;font:inherit;color:var(--ink)}
.list-pagination span {min-width:0}
.home-more {display:flex;justify-content:center;margin-top:20px}
.home-more:empty {display:none}
.password-change-panel {width:min(100%,560px)}
.password-change-panel h1 {font-size:clamp(25px,4vw,32px)}
.result-management {display:grid;gap:12px}
.result-manage-row {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #e0e8e3}
.result-manage-row>div,.result-manage-row>strong {min-width:0;overflow-wrap:anywhere}
.result-manage-row .portal-actions {justify-content:flex-end;flex-wrap:wrap;flex-shrink:0}
.result-manage-row .button {flex:0 1 auto;white-space:nowrap}
#result-published {width:18px;height:18px;min-height:18px;flex:0 0 18px}
.home-notices,.home-results {margin-bottom:20px}
.section-heading {margin-bottom:16px}
.section-heading>div {min-width:0}
.section-heading>.button,.section-heading>.portal-actions {flex-shrink:0}
@media(max-width:579px){
  .home-library .library-heading,.home-results .library-heading,.home-notices .library-heading {display:flex;align-items:center;gap:10px}
  .section-title-inline {gap:10px}
  .library-heading .section-title-inline h2,.ai-content .section-title-inline h2 {font-size:22px}
  .library-heading .section-subtitle,.ai-content .section-subtitle {font-size:13px}
  .home-results .portal-actions {width:100%}
  .result-card-actions {justify-content:stretch}
  .result-card-actions .button {flex-basis:calc(50% - 4px)}
  .result-manage-row {align-items:stretch;flex-direction:column}
  .result-manage-row .portal-actions {justify-content:flex-start;width:100%}
  .result-manage-row .button {flex:1 1 120px}
  .result-archive {grid-template-columns:1fr}
  .research-tabs {width:100%;gap:6px}
  .research-tabs .button {padding:9px 5px;font-size:12px}
  .research-results-heading {align-items:flex-start;flex-direction:column}
  .result-pagination {gap:8px}
  .result-pagination .button {min-width:86px;padding-inline:10px}
  .ai-content .section-heading {flex-direction:row;flex-wrap:wrap;align-items:center;gap:12px}
  .home-results .button {min-height:44px}
}

/* Standard unit filter follows the compact grade/volume/type row. */
.search-panel > .filter-field { margin-top:12px; }


/* Consolidated 1.5.0 design layer. Later rules intentionally override legacy component rules. */
/* 1.5.0 design layer, consolidated into styles.css for the active entry. */
:root {
  --ink:#1d1d1f; --muted:#626267; --soft:#f5f5f7; --line:#dedee3; --paper:#fff;
  --navy:#1d1d1f; --blue:#006edb; --blue-deep:#005bb5; --blue-soft:#edf5ff;
  --teal:#21705b; --teal-soft:#edf7f2; --amber:#805500; --amber-soft:#fff6df;
  --red:#b42324; --red-soft:#fff1f0; --shadow:0 6px 24px rgba(0,0,0,.045);
  --management-soft:#ffdbcf; --management-line:#f2b8a7; --management-ink:#7d332b;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
}
body { background:var(--soft); color:var(--ink); font-size:15px; line-height:1.6; }
h1,h2,h3,h4,strong,.button,button { letter-spacing:0; }
h1,h2,h3,h4 { color:var(--ink); }
.action-icon { display:none; }
button,.button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
button,.button { transition:background-color .16s ease,border-color .16s ease,color .16s ease; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible { outline:3px solid #0071e3; outline-offset:3px; }
button:disabled,.button:disabled { opacity:1; color:#77777d; background:#ececf0; border-color:#dedee3; box-shadow:none; transform:none; cursor:not-allowed; }
.button { min-height:42px; padding:10px 17px; border-radius:999px; font-size:14px; font-weight:550; line-height:1.25; box-shadow:none; }
.button-primary { color:#fff; background:var(--blue); border-color:var(--blue); box-shadow:none; }
.button-primary:hover { color:#fff; background:var(--blue-deep); border-color:var(--blue-deep); box-shadow:none; transform:none; }
.button-secondary { color:var(--blue-deep); background:#fff; border-color:#c6d9ee; }
.button-secondary:hover { color:var(--blue-deep); background:#edf5ff; border-color:#8bb7e7; transform:none; }
.button-quiet { color:var(--muted); }.button-quiet:hover { color:var(--ink); background:#eaeaf0; }
.button-danger { color:var(--red); background:var(--red-soft); border-color:#edb9b6; }
.button-danger:hover { color:#8f171b; background:#ffe5e2; }
.text-button,.home-text-link { color:var(--blue-deep); font-size:14px; font-weight:550; }

/* Navigation has one clear active state; uploading is the main action. */
:is(.public-nav.platform-header,.sidebar.platform-header) { background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); box-shadow:none; padding-left:max(24px,calc((100vw - 1280px)/2)); padding-right:max(24px,calc((100vw - 1280px)/2)); }
:is(.public-nav.platform-header,.sidebar.platform-header) .header-brand .home-brand { max-width:400px; font-size:20px; font-weight:680; color:var(--ink); line-height:1.45; }
:is(.public-nav.platform-header,.sidebar.platform-header) .header-toolbar { gap:20px; transform:none; }
:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav { gap:8px; }
:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav .nav-item { min-height:44px; height:44px; width:auto; border:1px solid var(--line); border-radius:999px; padding:0 13px; color:#49494f; background:#fff; font-size:14px; font-weight:550; box-shadow:none; transform:none; }
:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav .nav-item:hover { color:var(--blue-deep); background:var(--blue-soft); border-color:#b8d4f3; box-shadow:none; transform:none; }
:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav .nav-item.active { color:#fff; background:var(--blue); border-color:var(--blue); box-shadow:none; transform:none; font-weight:650; }
:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav .nav-item.active:hover { color:#fff; background:var(--blue-deep); border-color:var(--blue-deep); }
.platform-header .nav-icon { display:none; }
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions .header-action { box-sizing:border-box; width:auto; min-width:92px; height:44px; min-height:44px; padding:0 17px; font-size:14px; font-weight:550; border-radius:999px; border:1px solid var(--line); background:#fff; color:#424247; box-shadow:none; transform:none; }
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions .header-action:hover { color:var(--ink); border-color:#b5b5bc; background:#f5f5f7; box-shadow:none; transform:none; }
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions :is(#quick-upload-btn,.public-upload) { color:#fff; background:var(--blue); border-color:var(--blue); width:auto; }
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions :is(#quick-upload-btn,.public-upload):hover { background:var(--blue-deep); border-color:var(--blue-deep); color:#fff; }
.sidebar.platform-header .header-actions :is(#quick-upload-btn,#role-switch-btn) { height:44px; min-height:44px; }
.sidebar.platform-header .header-actions #role-switch-btn { background:#fff; border-color:var(--line); color:#424247; }
.sidebar.platform-header .header-actions #role-switch-btn:hover { background:#eaeaf0; border-color:#b5b5bc; color:var(--ink); }
.sidebar.platform-header .management-nav { margin:0; padding:8px 0; gap:8px; }
.sidebar.platform-header .management-nav .nav-item { border:1px solid var(--management-line); background:var(--management-soft); color:var(--management-ink); font-weight:550; border-radius:999px; box-shadow:none; min-height:40px; height:40px; }
.sidebar.platform-header .management-nav .nav-item:hover { color:var(--management-ink); background:#ffcfbe; border-color:#e8a18e; box-shadow:none; }
.sidebar.platform-header .management-nav .nav-item.active { color:#fff; background:var(--red); border-color:var(--red); box-shadow:none; font-weight:650; }
.sidebar.platform-header .management-nav .nav-item.active:hover { color:#fff; background:#971d20; border-color:#971d20; }
.sidebar.platform-header .management-nav .nav-item:focus-visible { outline-color:var(--red); }
.sidebar.platform-header .management-label { display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;margin-right:4px;padding:0 14px;min-height:40px;box-sizing:border-box;border:1px solid var(--red);border-radius:999px;background:var(--red);color:#fff;font-size:13px;font-weight:650;white-space:nowrap;cursor:default;user-select:none; }
.platform-header .role-menu { border:1px solid var(--line); border-radius:15px; box-shadow:0 16px 45px #0000001a; padding:6px; }
.role-option { min-height:42px; font-size:14px; border-radius:9px; }
.sidebar.platform-header .role-option:hover { background:#f1f1f5; color:var(--ink); }
.role-option small,.menu-heading small { color:var(--muted); font-size:12px; line-height:1.6; }
.platform-header .menu-heading { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; padding:10px 10px 12px; margin-bottom:4px; border-bottom:1px solid var(--line); }
.platform-header .menu-heading strong { flex:0 0 auto; font-size:15px; font-weight:650; white-space:nowrap; }
.platform-header .menu-heading small { flex:1 1 130px; min-width:0; overflow-wrap:anywhere; }

/* Page hierarchy and shared frame. */
.topbar { max-width:1280px; margin:0 auto; padding:26px 0 12px; min-height:0; background:transparent; border:0; }
.topbar h2 { color:var(--ink); font-size:28px; font-weight:680; line-height:1.3; }
.home-active .topbar { display:none; }
.prototype-banner { background:transparent; border:0; color:#6b6b70; font-size:12px; padding:8px 24px; line-height:1.6; }
.view-root { max-width:1280px; margin:0 auto; padding:20px 0 44px; }
.section-heading { gap:14px; margin-bottom:18px; align-items:center; }
.section-heading h3 { color:var(--ink); font-size:23px; font-weight:650; line-height:1.4; }
.section-heading p { color:var(--muted); font-size:14px; line-height:1.65; }
.section-heading h3.visually-hidden { margin:0; padding:0; border:0; }
.panel,.resource-card,.search-panel,.backup-card,.stat-card { border-color:var(--line); border-radius:18px; box-shadow:none; }
.panel { padding:22px; }.panel-heading { border-bottom-color:#e8e8ed; padding-bottom:14px; }
.panel-heading h3 { color:var(--ink); font-size:17px; font-weight:650; }

/* Home keeps distinct section tints and an easy reading rhythm. */
.home-content { max-width:1280px; margin:0 auto; padding-bottom:36px; }
.home-hero { margin:0 0 24px; padding:34px 30px; border:1px solid #e2e4eb; border-radius:22px; background:#fff; box-shadow:none; }
.hero-kicker { color:var(--muted); font-size:13px; font-weight:550; margin-bottom:10px; }
.hero-copy h1 { max-width:none; font-size:40px; font-weight:700; line-height:1.25; letter-spacing:-.025em; color:var(--ink); margin-bottom:12px; }
.hero-description { color:var(--muted); font-size:16px; line-height:1.7; margin-bottom:0; }
.home-notices,.home-results,.home-library { padding:24px; margin:0 0 24px; border:1px solid #dce5f2; border-radius:22px; box-shadow:none; }
.home-notices { background:#eef5ff; }.home-results { background:#f0f5f2; border-color:#dde6e0; }.home-library { background:#f0f1f5; border-color:#e1e2e8; }
.home-notices .home-notice-heading h2,.library-heading .section-title-inline h2,.ai-content .section-title-inline h2 { color:var(--ink); font-size:25px; font-weight:680; line-height:1.4; letter-spacing:0; }
.home-notice-subtitle,.library-heading .section-subtitle,.ai-content .section-subtitle { color:var(--muted); font-size:14px; font-weight:450; }
.home-notice-heading,.section-title-inline { flex-wrap:wrap; gap:4px 12px; }
.library-note { font-size:12px; color:var(--muted); line-height:1.65; }.home-notice-grid { gap:16px; }
.home-notice-card { padding:22px; border:1px solid #e2e7ef; border-radius:17px; gap:16px; background:#fff; box-shadow:none; }
.home-notice-card h3 { font-size:18px; font-weight:650; line-height:1.55; margin:10px 0; }
.home-notice-card p { font-size:14px; color:var(--muted); line-height:1.7; }
.home-notice-card .button { min-height:42px; }.home-notice-card .resource-meta { font-size:13px; }
.results-empty { color:var(--muted); font-size:14px; }
.home-toolbar { border-color:var(--line); border-radius:16px; background:#fff; padding:16px; box-shadow:none; }
.home-search-form { background:#f5f5f7; border-color:#e0e0e5; }.home-search-form input { font-size:15px; }
.home-chip { background:#f1f1f4; color:#515157; font-size:13px; font-weight:500; min-height:40px; }.home-chip.active { color:#fff; background:#303034; }
.home-type { color:var(--muted); font-size:13px; font-weight:500; min-height:40px; }.home-type.active { color:var(--blue-deep); font-weight:650; }
.home-count { color:var(--muted); font-size:13px; }.home-resource-grid { border-color:var(--line); border-radius:17px; box-shadow:none; }
.home-resource-card { padding:21px; min-height:0; }.home-resource-card:hover { background:#fafafd; }
.home-card-body h3 { color:var(--ink); font-size:18px; font-weight:650; line-height:1.55; }
.home-card-meta { color:var(--muted); font-size:12px; line-height:1.7; }.home-card-description { color:var(--muted); font-size:13px; line-height:1.7; }
.home-ranking-panel,.forum-ranking-panel { border-color:var(--line); border-radius:17px; box-shadow:none; }
.ranking-tabs button { min-height:38px; color:var(--muted); border-color:var(--line); background:#fff; border-radius:9px; font-size:13px; }
.ranking-tabs button.active,.ranking-tabs button[aria-pressed=true] { color:var(--blue-deep); border-color:#b8d4f3; background:var(--blue-soft); }
.ranking-row { min-height:44px; background:#f7f7f9; border-color:#e9e9ee; border-radius:10px; color:#4f4f55; font-size:13px; }.ranking-row strong { font-weight:600; }
.ranking-more { color:var(--blue-deep); border-color:#d1ddeb; background:#fff; font-weight:550; }
.home-footer { border-color:var(--line); color:var(--muted); padding-top:18px; }.home-footer-info { gap:4px 20px; }
.home-footer-info strong { font-weight:600; color:#626267; }.home-footer-info :is(.home-footer-version,.home-footer-contact) { color:var(--muted); }
.home-footer-contact a { color:var(--blue-deep); }.home-footer .home-footer-legal,.site-legal-footer { color:#6a6a70; font-size:12px; line-height:1.8; }

/* Content cards, activity actions and forum controls. */
.resource-card { padding:22px; gap:14px; }.resource-card:hover { border-color:#c7c7cf; box-shadow:0 5px 18px #00000006; }
.resource-card h3 { font-size:18px; font-weight:650; line-height:1.55; color:var(--ink); }
.resource-card p,.resource-card .resource-meta { color:var(--muted); font-size:13px; line-height:1.75; }
.resource-card-footer { border-color:#e8e8ed; padding-top:12px; }.resource-card-footer .button { font-size:13px; min-height:40px; padding:9px 14px; }
.resource-meta,.catalog-count,.results-heading { font-size:13px; color:var(--muted); line-height:1.7; }
.portal-list { gap:14px; }.portal-row h3 { font-size:19px; font-weight:650; line-height:1.5; margin:10px 0; color:var(--ink); }
.portal-row p { font-size:15px; color:var(--muted); line-height:1.75; }.portal-row .resource-meta { font-size:13px; }
.portal-prose { font-size:15px; line-height:1.85; color:#39393e; }.portal-excerpt { color:var(--muted); }
.portal-tabs .button,.forum-sort-tabs .button { box-shadow:none; font-size:14px; }
.portal-tabs .forum-personal-tab { background:#fff7e1; border-color:#e6d49e; color:#735317; }
.portal-tabs .forum-personal-tab:hover { background:#fff0c5; border-color:#d7bd77; color:#634711; }
.portal-tabs .forum-personal-tab[aria-pressed=true] { background:#ffe9b0; border-color:#c7a352; color:#634711; box-shadow:none; }
.activity-actions [data-draw-open] { color:var(--blue-deep); background:#edf5ff; border-color:#bbd5f3; }.activity-actions [data-draw-open]:hover { color:var(--blue-deep); background:#e1eeff; }
.activity-actions [data-checkout] { color:#805500; background:#fff7e5; border-color:#e7d29e; }
.activity-actions .button:disabled { color:#77777d; background:#ececf0; border-color:#dedee3; }
/* Filters use green; blue remains the primary navigation and action color. */
:is(.activity-scope-tabs,.portal-tabs,.forum-sort-tabs,.ranking-tabs) :is(.button,button),.button:is([data-catalog-zone],[data-catalog-ai]),.status-tab,.home-chip,.home-type { color:var(--muted);background:#fff;border:1px solid var(--line);border-radius:999px;box-shadow:none;transform:none; }
:is(.activity-scope-tabs,.portal-tabs,.forum-sort-tabs,.ranking-tabs) :is(.button,button):hover,.button:is([data-catalog-zone],[data-catalog-ai]):hover,.status-tab:hover,.home-chip:hover,.home-type:hover { color:var(--teal);background:var(--teal-soft);border-color:#a5cebc;box-shadow:none;transform:none; }
:is(.activity-scope-tabs,.portal-tabs,.forum-sort-tabs,.ranking-tabs) :is(.button,button)[aria-pressed="true"],.button:is([data-catalog-zone],[data-catalog-ai])[aria-pressed="true"],.status-tab.active,.home-chip.active,.home-type.active { color:#fff;background:var(--teal);border-color:var(--teal);font-weight:650;box-shadow:none; }
:is(.activity-scope-tabs,.portal-tabs,.forum-sort-tabs,.ranking-tabs) :is(.button,button)[aria-pressed="true"]:hover,.button:is([data-catalog-zone],[data-catalog-ai])[aria-pressed="true"]:hover,.status-tab.active:hover,.home-chip.active:hover,.home-type.active:hover { color:#fff;background:#195844;border-color:#195844; }
.home-type { padding:8px 13px; }.home-type-row { gap:8px; }
.status-tab.active span { color:#fff;background:#ffffff26; }
.activity-status-banner { border-left-color:var(--blue); background:var(--blue-soft); }
.tag { font-size:12px; font-weight:550; line-height:1.3; padding:4px 8px; }.tag-gray { background:#f0f0f3; color:#626267; }
.tag-blue { color:var(--blue-deep); background:var(--blue-soft); }.tag-green { color:#23634f; background:#edf7f1; }.quality-badge { font-weight:550; }

/* Comfortable form controls and grouped dialogs. */
.search-panel { padding:22px; }
.input,select,textarea,.portal-form input:not([type=checkbox]):not([type=radio]),.portal-form select,.portal-form textarea,.portal-search input { border-color:#c9c9d1; border-radius:11px; color:var(--ink); background:#fff; min-height:44px; font-size:15px; line-height:1.45; }
.input:focus,select:focus,textarea:focus,.portal-form input:not([type=checkbox]):not([type=radio]):focus,.portal-form textarea:focus,.portal-search input:focus { border-color:var(--blue); box-shadow:0 0 0 3px #0071e318; }
input::placeholder,textarea::placeholder { color:#727278; opacity:1; }
.portal-form { gap:15px; }.portal-form label,.portal-search,.filter-field label,.field label { color:#515157; font-size:14px; font-weight:550; }
.portal-form .field input { margin-top:7px; }.form-section legend { color:var(--ink); font-size:16px; font-weight:650; padding-bottom:12px; }
.field-note,.page-hint,.next-step,.form-intro p { color:var(--muted); font-size:13px; line-height:1.75; }
.form-section { margin-bottom:18px; }.form-grid { gap:16px; }.check-label { line-height:1.65; }
input[type=checkbox],input[type=radio] { accent-color:var(--blue); }input[readonly] { background:#f5f5f7 !important; color:#626267 !important; }
.modal { border-radius:22px; border:1px solid #e6e6eb; box-shadow:0 24px 90px #00000026; }
.modal-header { padding:22px 24px; border-bottom-color:var(--line); }.modal-header h3 { font-size:23px; font-weight:650; line-height:1.45; color:var(--ink); }
.modal-header p { font-size:14px; line-height:1.7; color:var(--muted); }.modal-body { padding:24px; }
.modal-footer { padding:16px 24px; border-top-color:var(--line); background:#fff; }.icon-button { background:#f2f2f6; color:#626267; box-shadow:none; }
.detail-title,.resource-preview .detail-title { font-size:23px; font-weight:650; line-height:1.5; }.detail-description { font-size:15px; color:#515157; line-height:1.85; }
.detail-meta dt { font-size:12px; color:var(--muted); }.detail-meta dd { font-size:14px; line-height:1.7; }.detail-block h4 { font-size:14px; color:var(--muted); }
.version-row strong { font-size:14px; }.version-row span { font-size:12px; }.attachment-detail { border-color:var(--line); border-radius:14px; }
.attachment-item { border-color:var(--line); background:#f8f8fa; }.attachment-item span,.attachment-empty,.attachment-tools { color:var(--muted); font-size:13px; line-height:1.65; }
.confirmation-dialog { border-radius:20px; }.confirmation-message { color:#424247; font-size:15px; line-height:1.8; }

/* Tables, catalog maintenance and backups. */
.table-wrap { border-color:var(--line); border-radius:14px; }table { font-size:14px; }th { color:#626267; background:#f5f5f7; font-size:13px; font-weight:600; }
th,td { padding:14px; border-bottom-color:#e8e8ed; }tbody tr:hover { background:#fafafd; }.resource-table .updated-cell { color:var(--muted); font-size:13px; }
.textbook-guide { color:#515157; background:#f0f3f8; border-color:#dce2ec; font-size:14px; }.textbook-unit-row { background:#f8f8fa; border-color:var(--line); }
.backup-card h3 { color:var(--ink); font-size:20px; font-weight:650; }.backup-card p { color:var(--muted); font-size:14px; line-height:1.75; }
.stat-number { color:var(--ink); font-weight:650; }.stat-foot,.stat-label { color:var(--muted); font-size:13px; }

/* Login belongs to the same visual system; no external assets. */
.login-view { background:#f5f5f7; }.login-backdrop { background:radial-gradient(ellipse at 50% 20%,#fff,#f5f5f7 70%); }.login-backdrop::after { display:none; }
.login-panel { background:#fff; border:1px solid #e1e1e7; border-radius:24px; box-shadow:0 12px 50px #00000009; max-width:640px; padding:36px 40px; }
.brand-mark { background:var(--ink); border-radius:12px; box-shadow:none; }.eyebrow { color:var(--muted); font-size:12px; font-weight:500; letter-spacing:.03em; }
.login-panel h1 { font-size:30px; font-weight:680; line-height:1.4; letter-spacing:-.015em; }.login-lead { color:var(--muted); font-size:15px; }
.login-footnote { color:#6b6b70; font-size:12px; line-height:1.75; }.account-card { border-color:var(--line); box-shadow:none; }
.account-card:hover { background:var(--blue-soft); transform:none; box-shadow:none; }.account-card strong { font-size:14px; }.account-card span { font-size:12px; color:var(--muted); }

@media(max-width:1350px) {
  .home-content,.view-root,.topbar { margin-left:28px; margin-right:28px; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .header-toolbar { gap:10px; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav .nav-item { padding:0 11px; }
}
@media(min-width:1001px) and (max-width:1160px) { :is(.public-nav.platform-header,.sidebar.platform-header) .header-brand .home-brand { max-width:280px; font-size:19px; } }
@media(max-width:1000px) {
  :is(.public-nav.platform-header,.sidebar.platform-header) { padding:14px 24px 10px; gap:10px; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .header-toolbar { height:auto; width:100%; justify-content:space-between; }
  .sidebar.platform-header .management-nav { justify-content:flex-start; }
  .portal-row { flex-direction:column; align-items:stretch; }.activity-actions { width:100%; max-width:none; }
}
@media(max-width:820px) {
  .home-content,.view-root,.topbar { margin-left:20px; margin-right:20px; }.topbar { padding-top:22px; }.topbar h2 { font-size:26px; }
  .hero-copy h1 { font-size:34px; }.home-hero { padding:26px; }.home-notices,.home-results,.home-library { padding:20px; }
  .modal-header,.modal-body { padding:20px; }.modal-footer { padding:14px 20px; }
}
@media(max-width:580px) {
  :is(.public-nav.platform-header,.sidebar.platform-header) { position:relative; padding:10px 16px 8px; gap:8px; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .header-brand .home-brand { max-width:100%; font-size:17px; line-height:1.45; }
  :is(.public-nav.platform-header,.sidebar.platform-header) { display:grid; grid-template-columns:minmax(0,1fr) auto; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .header-brand { grid-column:1; grid-row:1; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .header-toolbar { display:contents; }
  :is(.public-nav.platform-header,.sidebar.platform-header) :is(.main-nav,.primary-nav) { grid-column:1 / -1; grid-row:2; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .header-actions { grid-column:2; grid-row:1; width:auto; gap:4px; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .header-actions .header-action { width:38px; min-width:38px; height:44px; padding:0 5px; }
  .platform-header .header-actions .action-label { display:none; }
  .platform-header .action-icon { display:inline; font-size:20px; }
  .platform-header #quick-upload-btn > span:last-child,.platform-header #role-switch-btn > span:last-child { display:none; }
  .sidebar.platform-header .management-nav { grid-column:1 / -1; grid-row:3; }
  .sidebar.platform-header .management-label { position:sticky; left:0; z-index:1; background:var(--red); padding-right:14px; }
  .sidebar.platform-header .management-label::after { content:' ↔'; }
  .public-nav.platform-header .header-actions { grid-column:1 / -1; grid-row:3; justify-content:flex-end; }
  .public-nav.platform-header .header-actions .header-action { width:auto; min-width:70px; }

  :is(.public-nav.platform-header,.sidebar.platform-header) .main-nav { display:block; width:100%; padding:0; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; padding:0; width:100%; overflow:visible; }
  :is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav .nav-item { min-width:0; width:100%; padding:0 3px; height:44px; min-height:44px; font-size:13px; border-radius:999px; }

  :is(.public-nav.platform-header,.sidebar.platform-header) .header-actions .header-action { font-size:13px; height:44px; min-height:44px; padding:0 15px; min-width:38px; }
  .sidebar.platform-header .management-nav { margin:0; padding:2px 0 0; scroll-padding:8px; }.sidebar.platform-header .management-nav .nav-item { font-size:13px; min-height:40px; }
  .home-content,.view-root,.topbar { margin-left:16px; margin-right:16px; }.view-root { padding:18px 0 32px; }
  .topbar { padding-top:20px; padding-bottom:8px; }.topbar h2 { font-size:25px; }.prototype-banner { font-size:12px; padding:8px 16px; }
  .home-hero { margin-top:8px; margin-bottom:20px; padding:23px 20px; border:1px solid #e2e4eb; border-radius:18px; }
  .hero-copy h1 { font-size:30px; line-height:1.3; }.hero-description { font-size:14px; }.hero-kicker { font-size:12px; }
  .home-notices,.home-results,.home-library { padding:16px; border-radius:18px; margin-bottom:20px; }
  .home-notices .home-notice-heading h2,.library-heading .section-title-inline h2 { font-size:22px; }.home-notice-subtitle,.library-heading .section-subtitle { font-size:13px; }
  .home-notice-card { padding:18px; border-radius:14px; }.home-notice-card h3 { font-size:18px; }
  .home-toolbar { padding:12px; }.home-resource-card { padding:18px 16px; }.home-card-body h3 { font-size:17px; }.home-card-description { font-size:13px; }.home-card-meta { font-size:12px; }
  .home-resource-card .button,.portal-actions .button { min-height:44px; }.panel,.search-panel,.resource-card,.backup-card { padding:18px; border-radius:16px; }
  .portal-row h3 { font-size:18px; }.portal-row p { font-size:14px; }.section-heading h3 { font-size:22px; }.section-heading p { font-size:14px; }
  .input,select,textarea,.portal-form input:not([type=checkbox]):not([type=radio]),.portal-form select,.portal-form textarea,.portal-search input { font-size:16px; }
  .modal { border-radius:18px; }.modal-header,.modal-body { padding:18px; }.modal-header h3 { font-size:21px; }.modal-footer { padding:14px 18px; }
  .portal-form { gap:14px; }.form-grid { gap:14px; }.login-panel { padding:26px 22px; border-radius:20px; }.login-panel h1 { font-size:26px; }
  .home-footer-info { gap:4px 16px; }.home-footer-info strong { font-size:13px; }.home-footer .home-footer-legal { font-size:12px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; } }

/* Retire the older home shortcut emphasis and lifted tab shadows. */
:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav .nav-item:is([data-public-home],[data-view="overview"]):not(.active) { color:#49494f; background:#fff; border-color:var(--line); box-shadow:none; }
:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav .nav-item:is([data-public-home],[data-view="overview"]):not(.active):hover { color:var(--blue-deep); background:var(--blue-soft); border-color:#b8d4f3; box-shadow:none; transform:none; }
.activity-scope-tabs .button,.status-tab,.portal-tabs .button { box-shadow:none; transform:none; }
.home-mobile-reset,.home-mobile-filters button { font-size:13px; }
.home-mobile-filters label { font-size:13px; }
.home-mobile-filters select { font-size:14px; }
.timeline-time { color:var(--muted); font-size:13px; }
.resource-card h3,.resource-card p,.home-card-body h3,.home-card-description,.detail-title,.modal-header h3 { overflow-wrap:anywhere; }

/* Compact mobile header: full brand, main navigation, then management and account tools. */
@media(max-width:580px) {
  .sidebar.platform-header .header-brand { grid-column:1 / -1; grid-row:1; }
  .sidebar.platform-header .header-actions { grid-column:2; grid-row:3; width:auto; gap:6px; }
  .sidebar.platform-header .header-actions :is(#quick-upload-btn,#role-switch-btn) { display:flex; justify-content:center; align-items:center; width:44px; min-width:44px; max-width:44px; height:44px; padding:0; }
  .sidebar.platform-header .management-nav { grid-column:1; grid-row:3; min-width:0; max-width:100%; margin:0; }
  .sidebar.platform-header .header-brand .home-brand { font-size:17px; }
  .sidebar.platform-header .management-label { display:none; }
  .sidebar.platform-header .management-nav::after { content:'↔'; position:sticky; right:0; align-self:stretch; display:flex; align-items:center; background:var(--paper); padding:0 4px; color:var(--muted); }
  .sidebar.platform-header .management-nav.hidden::after { display:none; }
}

/* Activity attendance and details remain prominent; maintenance actions are quieter. */
.activity-actions:has([data-attendance-export]) { grid-template-columns:repeat(3,minmax(0,1fr)); }
.activity-actions :is([data-attendance-export],[data-activity-edit],[data-activity-pin]) { background:transparent; border-color:transparent; color:var(--muted); border-radius:8px; padding:8px 4px; font-weight:500; }
.activity-actions :is([data-attendance-export],[data-activity-edit],[data-activity-pin]):hover { background:var(--soft); color:var(--blue-deep); }

/* Orange actions for the account tools and personal discussion tabs. */
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions #quick-upload-btn {
  color:#fff;
  background:#b45309;
  border-color:#b45309;
}
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions #quick-upload-btn:hover {
  color:#fff;
  background:#92400e;
  border-color:#92400e;
}
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions #role-switch-btn {
  color:#78350f;
  background:#fff1df;
  border-color:#f0b56e;
}
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions #role-switch-btn:hover {
  color:#713f12;
  background:#ffe3bd;
  border-color:#d97706;
}
.portal-tabs .forum-personal-tab {
  color:#78350f;
  background:#fff1df;
  border-color:#f0b56e;
  box-shadow:none;
}
.portal-tabs .forum-personal-tab:hover {
  color:#713f12;
  background:#ffe3bd;
  border-color:#d97706;
}
.portal-tabs .forum-personal-tab[aria-pressed="true"] {
  color:#fff;
  background:#b45309;
  border-color:#b45309;
  box-shadow:none;
  font-weight:700;
}
.portal-tabs .forum-personal-tab[aria-pressed="true"]:hover {
  color:#fff;
  background:#92400e;
  border-color:#92400e;
}
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions :is(#quick-upload-btn,#role-switch-btn):focus-visible,
.portal-tabs .forum-personal-tab:focus-visible {
  outline:3px solid #f59e0b;
  outline-offset:2px;
}
:is(.public-nav.platform-header,.sidebar.platform-header) .header-actions :is(#quick-upload-btn,#role-switch-btn):disabled,
.portal-tabs .forum-personal-tab[aria-pressed]:disabled {
  color:#77777d;
  background:#ececf0;
  border-color:#dedee3;
  cursor:not-allowed;
}

/* The same daily guide is shared by both role-specific help views. */
.usage-guide { color:var(--ink); font-size:15px; line-height:1.85; }
.usage-guide .usage-intro { margin:0 0 16px; color:var(--muted); }
.usage-guide .usage-part-title { font-size:18px; margin:24px 0 12px; }
.usage-guide .usage-part-title:first-of-type { margin-top:12px; }
.usage-chapter { border:1px solid var(--line); border-radius:12px; margin:10px 0; background:#fff; }
.usage-chapter > summary { padding:14px 16px; font-weight:650; cursor:pointer; line-height:1.65; }
.usage-chapter > summary:hover { background:var(--soft); border-radius:12px; }
.usage-chapter > summary:focus-visible { outline:2px solid var(--blue); outline-offset:2px; border-radius:12px; }
.usage-chapter[open] > summary { border-bottom:1px solid var(--line); }
.usage-chapter-body { padding:4px 18px 16px; overflow-wrap:anywhere; }
.usage-chapter-body :is(ul,ol) { padding-left:22px; margin:12px 0; }
.usage-chapter-body li { margin:9px 0; }
.usage-chapter-body p { margin:12px 0 0; }
.usage-chapter-body a { color:var(--blue-deep); text-decoration:underline; text-underline-offset:3px; }
.usage-chapter-body .usage-flow { padding:12px; border-radius:8px; background:var(--blue-soft); color:var(--blue-deep); }
.usage-permission-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:12px; }
.usage-permission-grid section { min-width:0; background:var(--soft); border-radius:8px; padding:12px; }
.usage-permission-grid h5 { font-size:15px; margin:0; }
@media(max-width:580px) {
  .usage-guide { font-size:14px; }
  .usage-chapter > summary { padding:12px; }
  .usage-chapter-body { padding:2px 12px 12px; }
  .usage-permission-grid { grid-template-columns:1fr; }
}

/* 1.5.0 · reviewed result images and accessible carousel */
.gallery-home-empty { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:0 0 24px; padding:16px 20px; border:1px dashed #d4dce5; border-radius:18px; background:#fafbfc; color:var(--muted); font-size:14px; }
.result-carousel { margin:0 0 24px; padding:14px 18px; border:1px solid #dee5e2; border-radius:22px; background:#f4f7f5; overflow:hidden; }
.result-carousel[hidden],.result-slide[hidden],.result-slide-copy[hidden],.carousel-controls[hidden],.carousel-thumbnails[hidden],.carousel-thumbnail[hidden] { display:none; }
.carousel-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; }
.carousel-heading h2 { margin:0; font-size:22px; line-height:1.3; font-weight:680; color:var(--ink); }
.carousel-heading .section-subtitle { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.carousel-heading .portal-actions { flex-wrap:wrap; }
.news-carousel-layout { display:grid; grid-template-columns:minmax(0,1.9fr) minmax(270px,1fr); gap:22px; height:250px; }
.result-slides { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; min-height:0; height:100%; border-radius:13px; overflow:hidden; background:#e8eeeb; }
.result-slide { min-width:0; min-height:0; height:100%; }
.result-slide-media { display:flex; align-items:center; justify-content:center; width:100%; height:100%; min-width:0; background:#e8eeeb; }
.result-slide-media img { display:block; width:100%; height:100%; object-fit:contain; }
.news-sidebar { display:flex; flex-direction:column; align-items:stretch; min-width:0; min-height:0; padding:2px 0; }
.news-copy-list { flex:1; min-height:0; }
.result-slide-copy { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:0; }
.result-slide-copy h3 { margin:0; font-size:23px; line-height:1.4; font-weight:650; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.result-slide-link { color:#0066cc; font-size:13px; line-height:1.6; text-decoration:none; white-space:nowrap; }
.result-slide-link:hover { text-decoration:underline; }
.result-slide-copy p { margin:0; }
.news-eyebrow { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#4b6558; font-size:12px; line-height:1.5; }
.carousel-thumbnails { display:flex; gap:8px; min-width:0; margin-top:12px; }
.carousel-thumbnail { position:relative; display:block; flex:0 1 calc((100% - 24px)/4); min-width:0; height:50px; padding:2px; border:2px solid transparent; border-radius:8px; overflow:hidden; background:#e8eeeb; cursor:pointer; }
.carousel-thumbnail img { display:block; width:100%; height:100%; object-fit:contain; border-radius:4px; }
.carousel-thumbnail[aria-pressed="true"] { border-color:#3d7359; background:#fff; }
.carousel-thumbnail:hover { border-color:#85a793; }
.carousel-thumb-number { position:absolute; bottom:2px; right:3px; min-width:14px; padding:0 2px; border-radius:3px; background:rgba(20,38,29,.7); color:#fff; font-size:10px; line-height:1.4; }
.carousel-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:12px; }
.carousel-controls .button { min-height:34px; padding:5px 12px; font-size:12px; }
.carousel-arrows { display:flex; gap:6px; }.carousel-arrows .button { font-size:22px; min-width:34px; padding:0 8px; line-height:1; }
.carousel-count { color:#5b665f; font-size:12px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.gallery-toolbar .portal-actions { flex-wrap:wrap; }.gallery-toolbar button[aria-pressed="true"] { background:#e5f1e9; border-color:#a4c8b0; color:#24543a; }
.gallery-toolbar .gallery-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-bottom:12px; }
.gallery-tabs .button { min-width:0; padding:8px 5px; font-size:12px; white-space:normal; line-height:1.5; }
.gallery-source-filter { display:flex; align-items:center; gap:12px; margin-bottom:12px; min-width:0; }
.gallery-source-filter label { flex:none; margin:0; font-size:13px; }
.gallery-source-filter select { min-width:0; width:100%; text-overflow:ellipsis; }
.gallery-selection-bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; margin:0 0 16px; padding:9px 12px; border-radius:10px; background:#f5f7f6; font-size:13px; color:#59665e; }
.gallery-selection-bar .check-label { margin:0; display:flex; align-items:center; gap:7px; }
.gallery-selection-bar select { margin-left:auto; width:auto; max-width:100%; min-height:36px; padding:5px 26px 5px 10px; border:1px solid #d4ddd7; border-radius:8px; background:#fff; color:#32463a; font:inherit; }
.gallery-select { flex:none; display:flex; align-items:center; justify-content:center; width:22px; min-height:40px; cursor:pointer; }
.gallery-select input,.gallery-selection-bar input { width:17px; height:17px; margin:0; accent-color:#367154; }
.gallery-item [data-gallery-edit]:not(:first-child) { background:transparent; border-color:transparent; box-shadow:none; color:#506258; }
#gallery-rights-label[hidden] { display:none; }
.gallery-replace-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0; }
.gallery-replace-option { display:flex; align-items:center; gap:10px; min-width:0; padding:10px; border:1px solid #dce4df; border-radius:12px; cursor:pointer; }
.gallery-replace-option:has(input:checked) { border-color:#3b7857; background:#eff7f1; }
.gallery-replace-option input { flex:none; width:17px; height:17px; accent-color:#367154; }
.gallery-replace-option > span:last-child { min-width:0; flex:1; overflow-wrap:anywhere; }
.gallery-replace-option strong { font-size:14px; line-height:1.5; }
.gallery-replace-option small { display:block; margin-top:5px; font-size:12px; color:#607067; }
.gallery-replace-option .gallery-replace-thumb { width:72px; height:60px; }
.gallery-list { display:grid; gap:12px; }.gallery-item { display:flex; align-items:center; gap:18px; border:1px solid #e1e5e8; border-radius:14px; padding:14px; }
.gallery-thumb { position:relative; display:flex; align-items:center; justify-content:center; width:150px; height:100px; flex:none; overflow:hidden; border-radius:10px; background:#f0f2f4; color:#6d7278; font-size:12px; text-align:center; }
.gallery-thumb img { width:100%; height:100%; object-fit:contain; }.gallery-thumb span { display:none; padding:8px; }.gallery-thumb.gallery-missing span,.gallery-thumb:not(:has(img)) span { display:block; }
.gallery-item-copy { min-width:0; flex:1; }.gallery-item-copy strong { font-size:16px; overflow-wrap:anywhere; }.gallery-item-copy p { margin:7px 0; font-size:13px; line-height:1.6; }.gallery-item-copy .portal-actions { flex-wrap:wrap; gap:8px; }
.gallery-edit-preview { width:100%; height:210px; margin-bottom:18px; }.gallery-staged { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }.gallery-staged-item { min-width:0; }.gallery-staged-item img { display:block; width:100%; height:100px; object-fit:contain; background:#f0f2f4; border-radius:8px; margin-bottom:8px; }.gallery-staged-item button { font-size:12px; padding:7px 10px; min-height:34px; }
.result-slide a:focus-visible,.carousel-controls button:focus-visible,.carousel-thumbnail:focus-visible,.result-slide-link:focus-visible { outline:3px solid #236dc1; outline-offset:3px; }
@media (max-width:767px) {
  .result-carousel { padding:14px; border-radius:18px; margin-bottom:20px; }.carousel-heading { flex-wrap:wrap; gap:8px; }.carousel-heading h2 { font-size:21px; }.carousel-heading .section-subtitle { font-size:12px; }
  .news-carousel-layout { display:flex; flex-direction:column; height:auto; gap:12px; }.result-slides { height:clamp(170px,52vw,240px); flex:none; border-radius:10px; }.news-sidebar { padding:0; }.news-copy-list { flex:none; }.result-slide-copy { gap:5px; }.result-slide-copy h3 { font-size:18px; -webkit-line-clamp:2; }.news-eyebrow { display:none; }.result-slide-link { font-size:12px; }
  .carousel-thumbnails { display:none; }.carousel-controls { gap:10px; padding-top:10px; }.carousel-controls .button { min-height:40px; }.carousel-arrows .button { min-width:40px; }
  .gallery-toolbar .gallery-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .gallery-replace-list { grid-template-columns:minmax(0,1fr); }.gallery-replace-option { padding:8px; }
  .gallery-selection-bar { gap:10px; padding:8px; }.gallery-selection-bar select { margin-left:0; width:100%; }
  .gallery-item { align-items:flex-start; padding:10px; gap:8px; }.gallery-item > .gallery-thumb { width:60px; height:70px; }.gallery-select { width:18px; }.gallery-item-copy strong { font-size:14px; }.gallery-item-copy .button { padding:5px 9px; font-size:12px; min-height:36px; }
  .gallery-edit-preview { width:100%; height:180px; }.gallery-staged { grid-template-columns:minmax(0,1fr); }.gallery-staged-item img { height:140px; }
}
.carousel-playback { margin:6px 0 0; color:var(--muted); font-size:11px; line-height:1.5; }
.gallery-home-empty .portal-actions { flex-wrap:wrap; }

/* Public result links and both public ranking summaries. */
.home-ranking-stack { grid-area:ranking; display:grid; align-content:start; gap:16px; min-width:0; }
.home-ranking-stack .ranking-panel { grid-area:auto; position:static; margin:0; }
.home-forum-ranking .panel-heading { display:flex; flex-direction:column; align-items:stretch; gap:10px; }
.home-forum-ranking .ranking-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.home-forum-ranking .ranking-tabs button { min-width:0; padding:7px 4px; white-space:nowrap; }
.home-forum-ranking .ranking-list { grid-template-columns:minmax(0,1fr); }
.carousel-shortfall { margin:3px 0 0; font-size:11px; line-height:1.4; }
a.result-slide-media { text-decoration:none; cursor:pointer; }

@media(max-width:820px) { .home-ranking-stack { width:100%; order:1; } }



/* Match navigation columns to enabled primary features on narrow screens. */
:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav { grid-template-columns:repeat(var(--primary-count,4),minmax(0,1fr)); }

:is(.public-nav.platform-header,.sidebar.platform-header) .primary-nav[data-primary-count="3"] { --primary-count:3; }
