:root {
  color-scheme: light;
  --navy: #0b2a4a;
  --navy-2: #123b64;
  --blue: #1769d2;
  --blue-dark: #0e54ad;
  --teal: #15998f;
  --ink: #10243a;
  --muted: #647489;
  --line: #d9e2ec;
  --surface: #ffffff;
  --background: #f4f7fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; }
.site-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(24px, calc((100vw - 1380px) / 2)); color: #fff; background: var(--navy); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-size: 1.05rem; font-weight: 750; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid #55c9bd; border-radius: 10px; color: #8fe1da; font-size: .76rem; letter-spacing: .04em; }
.admin-link { color: #dcecff; font-size: .92rem; text-decoration: none; }
.admin-link:hover { color: #fff; text-decoration: underline; }
.account-actions { display: flex; align-items: center; gap: 18px; }
.account-name { color: #dcecff; font-size: .9rem; }
.account-actions form { margin: 0; }
.sign-out { padding: 7px 10px; border: 1px solid #93aec8; border-radius: 7px; color: #fff; background: transparent; cursor: pointer; }
.sign-out:hover, .sign-out:focus-visible { background: #214c74; }
main { min-height: calc(100vh - 136px); }
.sign-in-shell { min-height: calc(100vh - 136px); display: grid; place-items: center; padding: 32px 20px; }
.sign-in-card { width: min(100%, 440px); padding: 38px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 50px rgba(14, 49, 82, .09); }
.sign-in-card h1 { font-size: clamp(2rem, 4vw, 2.5rem); }
.sign-in-intro, .sign-in-help { color: var(--muted); }
.sign-in-intro { margin-bottom: 25px; }
.sign-in-help { margin: 21px 0 0; font-size: .9rem; }
.sign-in-form { display: grid; gap: 7px; }
.sign-in-form label { margin-top: 9px; font-weight: 700; }
.sign-in-form input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #bdcad8; border-radius: 9px; color: var(--ink); background: #fff; }
.sign-in-form input:focus { outline: 3px solid rgba(23, 105, 210, .18); border-color: var(--blue); }
.sign-in-form button { min-height: 48px; margin-top: 17px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 750; cursor: pointer; }
.sign-in-form button:hover { background: var(--blue-dark); }
.form-error { padding: 12px 14px; border: 1px solid #f3b4b4; border-radius: 9px; color: #9b2323; background: #fff0f0; }
.library-shell, .detail-shell { width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 56px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 7px; color: var(--teal) !important; font-size: .78rem; font-weight: 800; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.08; letter-spacing: -.035em; }
.page-heading p { margin-bottom: 0; color: var(--muted); }
.count { min-width: 155px; display: grid; padding: 17px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(14, 49, 82, .05); }
.count strong { color: var(--blue); font-size: 1.65rem; line-height: 1; }
.count span { margin-top: 6px; color: var(--muted); font-size: .8rem; }
.search-panel { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 32px rgba(14, 49, 82, .06); }
.search-panel label { display: grid; gap: 6px; color: #334b64; font-size: .82rem; font-weight: 700; }
.search-field input, .filters select { width: 100%; min-height: 46px; border: 1px solid #bdcad8; border-radius: 9px; background: #fff; color: var(--ink); }
.search-field input { padding: 0 15px; font-size: 1rem; }
.filters { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 14px; margin-top: 17px; }
.filters select { padding: 0 12px; }
.search-field input:focus, .filters select:focus { outline: 3px solid rgba(23, 105, 210, .18); border-color: var(--blue); }
.form-actions { display: flex; align-items: center; gap: 18px; margin-top: 19px; }
.form-actions button { min-height: 44px; padding: 0 22px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 750; cursor: pointer; }
.form-actions button:hover { background: var(--blue-dark); }
.form-actions a { color: var(--blue-dark); font-size: .9rem; }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 34px 0 14px; }
.results-heading h2 { margin: 0; font-size: 1.3rem; }
.results-heading span { color: var(--muted); font-size: .85rem; }
.resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.resource-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 25px rgba(16, 49, 79, .055); transition: transform .18s ease, box-shadow .18s ease; }
.resource-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(16, 49, 79, .1); }
.preview { height: 160px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #eef4fa, #e2ebf4); text-decoration: none; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.file-icon { display: grid; place-items: center; width: 70px; height: 84px; border-radius: 6px 6px 10px 10px; color: #fff; background: #d34a4a; font-size: .85rem; font-weight: 850; letter-spacing: .08em; box-shadow: 0 10px 18px rgba(116, 44, 44, .2); }
.card-body { padding: 17px; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.badges span { padding: 4px 8px; border-radius: 999px; color: #075d57; background: #dcf6f2; font-size: .72rem; font-weight: 800; }
.badges span + span { color: #3d5d83; background: #e8f0fa; }
.resource-card h3 { min-height: 48px; margin-bottom: 7px; font-size: 1rem; line-height: 1.35; }
.resource-card h3 a { text-decoration: none; }
.resource-card h3 a:hover { color: var(--blue); }
.path { min-height: 38px; margin-bottom: 10px; color: var(--muted); font-size: .79rem; }
.description { min-height: 42px; margin-bottom: 12px; color: #4d6075; font-size: .84rem; }
.file-meta { display: flex; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid #e7edf3; color: var(--muted); font-size: .74rem; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.card-actions a, .download-large { display: grid; min-height: 41px; place-items: center; border-radius: 8px; font-size: .88rem; font-weight: 750; text-decoration: none; }
.card-actions .secondary { border: 1px solid #b7c7d8; color: var(--blue-dark); }
.card-actions .primary, .download-large { color: #fff; background: var(--blue); }
.card-actions .primary:hover, .download-large:hover { background: var(--blue-dark); }
.empty-state { padding: 70px 20px; border: 1px dashed #b8c8d8; border-radius: 16px; background: #fff; text-align: center; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); }
.empty-icon { color: var(--teal); font-size: 3rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; }
.pagination a { padding: 9px 14px; border: 1px solid #b7c7d8; border-radius: 8px; color: var(--blue-dark); background: #fff; font-size: .88rem; font-weight: 700; text-decoration: none; }
.pagination span { color: var(--muted); font-size: .85rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 22px; color: var(--muted); font-size: .86rem; }
.breadcrumb a { color: var(--blue-dark); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr); gap: 26px; align-items: start; }
.document-preview { min-height: 680px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #e8eef4; }
.document-preview img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.document-preview iframe { width: 100%; height: 760px; border: 0; }
.resource-information { padding: 28px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 10px 28px rgba(14, 49, 82, .06); }
.resource-information h1 { font-size: 2rem; }
.resource-information > p { color: var(--muted); }
.resource-information dl { margin: 25px 0; border-top: 1px solid var(--line); }
.resource-information dl div { display: grid; grid-template-columns: 95px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.resource-information dt { color: var(--muted); font-size: .82rem; }
.resource-information dd { margin: 0; font-size: .88rem; font-weight: 700; }
.download-large { width: 100%; min-height: 48px; }
.back-link { display: inline-block; margin-top: 18px; color: var(--blue-dark); font-size: .9rem; }
footer { min-height: 64px; display: grid; place-items: center; padding: 14px 20px; color: #c9d8e8; background: var(--navy); font-size: .82rem; text-align: center; }

@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
  .resource-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .site-header { padding: 0 20px; }
  .library-shell, .detail-shell { width: min(100% - 28px, 1380px); padding-top: 28px; }
  .page-heading { align-items: flex-start; }
  .count { display: none; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .document-preview { min-height: 460px; }
}
@media (max-width: 540px) {
  .brand span:last-child { font-size: .93rem; }
  .admin-link { font-size: .8rem; }
  .site-header { flex-wrap: wrap; padding-block: 12px; }
  .account-actions { gap: 10px; flex-wrap: wrap; }
  .account-name { display: none; }
  .sign-in-card { padding: 26px 20px; }
  h1 { font-size: 2.1rem; }
  .search-panel { padding: 16px; }
  .filters, .resource-grid { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; text-align: center; }
  .preview { height: 190px; }
  .resource-card h3, .path, .description { min-height: auto; }
  .document-preview iframe { height: 520px; }
  .resource-information { padding: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
