:root {
  color-scheme: light;
  --bg: #f3f7fd;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --ink: #142a4c;
  --muted: #63748e;
  --line: #dce7f5;
  --navy: #102f70;
  --navy-deep: #0a1f4e;
  --accent: #4bd5f4;
  --accent-dark: #1559b2;
  --shadow: 0 22px 60px rgba(16, 43, 52, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.session-ending .shell { visibility: hidden; }
.session-status-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: #f3f7fd; color: #102f70; font-size: 17px; font-weight: 700; text-align: center; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(2.45rem, 4.2vw, 3.75rem); font-weight: 750; }
h2 { font-size: 1.45rem; font-weight: 720; }
h3 { font-size: 1.08rem; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #82bc9a; outline-offset: 3px; }

.shell {
  width: min(100% - 64px, 1320px);
  min-height: 100vh;
  margin: auto;
  display: flex;
  flex-direction: column;
}
.top { 
  min-height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #dce5e1;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.1;
}
.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
}
.mark {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--navy);
  border-radius: 12px;
  color: var(--accent);
  font-size: 22px;
  letter-spacing: 0;
}
.top nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.top nav a, .top nav .link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
}
.top nav a:hover, .top nav .link:hover { background: #e7eeeb; }
.top nav form { margin: 0; }
.link { border: 0; background: transparent; color: var(--ink); }
main { flex: 1; padding: 28px 0 72px; }
footer { padding: 20px 0 26px; border-top: 1px solid #dce5e1; color: var(--muted); font-size: 12px; }

.hero {
  position: relative;
  min-height: 555px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(370px, 440px);
  align-items: center;
  gap: clamp(28px, 6vw, 90px);
  overflow: hidden;
  padding: clamp(36px, 5vw, 72px);
  border-radius: 28px;
  background: radial-gradient(circle at 82% 5%, rgba(137, 193, 158, .33), transparent 34%),
              linear-gradient(125deg, #183c48 0%, #102c38 57%, #0e2732 100%);
  box-shadow: 0 20px 55px rgba(15, 44, 53, .18);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image: linear-gradient(rgba(255,255,255,.075) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.075) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, #000, transparent 85%);
}
.hero::after {
  content: "";
  position: absolute;
  left: -110px;
  bottom: -190px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(193, 231, 191, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(193,231,191,.025), 0 0 0 150px rgba(193,231,191,.02);
  pointer-events: none;
}
.hero > div:first-child, .hero > .auth-card { position: relative; z-index: 1; }
.hero h1 { max-width: 640px; margin: 0 0 25px; color: #f7faf7; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p:not(.eyebrow) { max-width: 460px; margin: 0; color: #bdd0d0; font-size: 17px; line-height: 1.7; }
.hero .eyebrow { color: #c5e5bc; }
.eyebrow { margin-bottom: 15px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .18em; }

.auth-card, .panel, .file-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 34px; }
.hero .auth-card { justify-self: end; border-color: rgba(255,255,255,.35); box-shadow: 0 27px 70px rgba(3, 23, 29, .23); }
.auth-card .icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: #e8f2e6;
  color: #427960;
  font-size: 24px;
}
.auth-card h1 { margin-bottom: 10px; font-size: 30px; }
.auth-card h2 { margin-bottom: 8px; font-size: 23px; }
.auth-card p { margin-bottom: 24px; color: var(--muted); font-size: 14px; }
label { display: block; margin: 16px 0 0; font-size: 13px; font-weight: 680; }
label .muted { font-weight: 400; }
input, select, textarea {
  display: block;
  width: 100%;
  min-height: 45px;
  margin-top: 8px;
  padding: 11px 13px;
  border: 1px solid #d8e2de;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: #65a782; box-shadow: 0 0 0 3px #dff0e3; }
input::placeholder, textarea::placeholder { color: #94a29e; }
textarea { resize: vertical; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--navy);
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.button:hover { background: #275164; box-shadow: 0 6px 16px rgba(24,60,72,.17); transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.button span { font-size: 18px; line-height: 0; font-weight: 400; }
.button.secondary { border-color: #dcebe1; background: #eaf4ec; color: #20584a; }
.button.secondary:hover { background: #dcecdf; }
.button.ghost { border-color: var(--line); background: #fff; color: var(--navy); }
.button.ghost:hover { background: #f6faf7; }
.auth-card .button { justify-content: space-between; width: 100%; margin-top: 24px; }
.auth-card .cancel-form { margin-top: 17px; text-align: center; }
.auth-card .cancel-form .link { color: var(--muted); font-size: 13px; }

.heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 20px 0 30px; }
.heading h1 { margin: 0 0 8px; }
.heading p:last-child { margin: 0; color: var(--muted); }
.admin-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 12px 0 18px; padding: 34px 38px; border-radius: 20px; background: radial-gradient(circle at 90% 10%, rgba(185,226,159,.2), transparent 35%), linear-gradient(125deg, #163a46, #0d2935); color: #fff; box-shadow: 0 16px 38px rgba(16,43,52,.12); }
.admin-hero .eyebrow { color: #bde5ac; }
.admin-hero h1 { margin: 0 0 9px; font-size: clamp(2rem, 3.5vw, 3.1rem); }
.admin-hero p:last-child { max-width: 560px; margin: 0; color: #c7d9d7; }
.admin-hero-side { display: grid; justify-items: end; gap: 13px; flex: none; }
.admin-hero-side a { color: #d9f1d3; font-size: 13px; font-weight: 700; }
.admin-hero-side a:hover { text-decoration: underline; }
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-stats > div { min-width: 0; padding: 19px 21px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.admin-stats span, .admin-stats small { display: block; color: var(--muted); font-size: 12px; }
.admin-stats strong { display: block; margin: 4px 0 0; color: var(--navy); font-size: 29px; line-height: 1.2; }
.admin-tabs { margin-bottom: 18px; }
.admin-tabs a { border-radius: 999px; padding: 10px 16px; }
.admin-section .section-head p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.admin-workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.workflow-card { display: flex; flex-direction: column; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbf9; }
.workflow-step { display: inline-block; margin-bottom: 10px; color: #2f755b; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.workflow-card h3 { margin-bottom: 8px; font-size: 18px; }
.workflow-card p { margin-bottom: 7px; font-size: 12px; line-height: 1.5; }
.workflow-card form { display: flex; flex-direction: column; flex: 1; }
.workflow-card form .button { width: 100%; margin-top: auto; white-space: normal; }
.workflow-card form label:last-of-type { margin-bottom: 18px; }
.folder-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); align-items: end; gap: 10px; }
.folder-picker label, .folder-picker input, .folder-picker select { min-width: 0; }
.workflow-card .folder-picker-help { margin: 8px 0 2px; color: var(--muted); font-size: 11px; }
.incoming-path { overflow-wrap: anywhere; }
.incoming-path code { overflow-wrap: anywhere; }
.badge, .tag { display: inline-flex; align-items: center; border-radius: 7px; background: #e8f2e6; color: #326d54; font-size: 11px; font-weight: 750; }
.badge { padding: 10px 14px; }
.tag { padding: 6px 9px; }
.stat { min-width: 165px; padding: 15px 20px; border-radius: 13px; background: #dfeddf; }
.stat strong { display: block; font-size: 27px; line-height: 1.1; }
.stat span, .muted { color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 10px; margin-bottom: 22px; }
.filters input, .filters select { margin: 0; }
.filters input { flex: 1; }
.filters select { max-width: 220px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: -4px 0 18px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: #27624f; font-weight: 700; }
.breadcrumbs a:hover, .file-location:hover { text-decoration: underline; }
.folder-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.folder-card { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(16,43,52,.035); font-weight: 700; overflow-wrap: anywhere; }
.folder-card:hover { border-color: #9ccaae; background: #f8fcf8; }
.folder-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; height: 38px; border-radius: 9px; background: #e8f2e6; color: #326d54; font-size: 20px; }
.folder-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.folder-actions { margin: 0 0 20px; }
.file-location { display: block; margin: 0 0 12px; color: #27624f; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.file-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.file-card { display: flex; flex-direction: column; min-width: 0; padding: 23px; box-shadow: 0 10px 30px rgba(16,43,52,.045); }
.file-card:hover { border-color: #bfd4c6; box-shadow: 0 18px 42px rgba(16,43,52,.09); }
.file-top, .file-meta, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.file-tags { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tag.featured-tag { background: #fff0cd; color: #8c5c0e; }
.file-top { margin-bottom: 20px; }
.file-card h2 { margin-bottom: 9px; }
.file-card p { min-height: 44px; flex: 1; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.file-meta { padding-top: 13px; border-top: 1px solid var(--line); color: #536b74; font-size: 12px; }
.hash { margin: 15px 0; overflow-wrap: anywhere; color: #7b8d91; font: 11px/1.5 ui-monospace, Consolas, monospace; }
.hash-disclosure summary { width: fit-content; color: #245d9d; font: 700 12px/1.5 "Segoe UI Variable", "Segoe UI", Arial, sans-serif; cursor: pointer; }
.hash-disclosure summary:hover { text-decoration: underline; }
.hash-disclosure code { display: block; margin-top: 7px; overflow-wrap: anywhere; font: 11px/1.5 ui-monospace, Consolas, monospace; }
.file-card .button { justify-content: space-between; }
.empty { grid-column: 1 / -1; padding: 48px; border: 1px dashed #cfddd4; border-radius: var(--radius); background: #fff; color: var(--muted); text-align: center; }
.notice { margin: 0 0 20px; padding: 12px 15px; border-radius: 9px; font-size: 13px; }
.notice.ok { background: #e5f5e8; color: #25644a; }
.notice.bad { background: #fff0eb; color: #9d4a3b; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tabs a { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; font-weight: 700; }
.tabs a:hover { background: #eaf4ec; }
.panel { margin-bottom: 22px; padding: 28px; scroll-margin-top: 20px; box-shadow: 0 11px 32px rgba(16,43,52,.045); }
.panel.narrow { max-width: 640px; }
.panel h2 { margin-bottom: 0; }
.panel p { color: var(--muted); }
.panel code { padding: 2px 5px; border-radius: 4px; background: #f0f5f1; }
.section-head { margin-bottom: 21px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.two-col > div + div, .two-col > form + form { padding-left: 30px; border-left: 1px solid var(--line); }
.two-col form .button { margin-top: 18px; }
.folder-import { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.stack { display: grid; gap: 10px; }
.user-list { margin-top: 24px; }
.record { padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; }
.record > summary { display: flex; justify-content: space-between; gap: 15px; cursor: pointer; }
.record[open] > summary { margin-bottom: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.record .two-col { margin-top: 14px; }
.session-control { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 15px 17px; border: 1px solid #dce7f5; border-radius: 10px; background: #f8fbff; }
.session-control strong { color: #173d7e; font-size: 13px; }
.session-control p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.session-control form { flex: none; }
.secret { padding: 14px; border: 1px dashed #92bea0; border-radius: 9px; background: #f0f7ee; font: 700 17px ui-monospace, Consolas, monospace; letter-spacing: .07em; overflow-wrap: anywhere; }
.wrap { display: block; margin: 10px 0; overflow-wrap: anywhere; }
.totp-qr { display: inline-flex; align-items: center; justify-content: center; min-width: 272px; min-height: 272px; margin: 5px 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.totp-qr img, .totp-qr canvas { display: block; max-width: 100%; height: auto; }
.manual-key { margin: 4px 0 20px; color: var(--muted); }
.manual-key summary { color: var(--ink); font-weight: 700; cursor: pointer; }
.manual-key .secret { margin: 12px 0; }
.logs { flex-wrap: wrap; }
.logs input { min-width: 145px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-weight: 700; }
td:last-child { min-width: 180px; white-space: normal; }
.status { font-weight: 700; }
.status.good { color: #2a7552; }
.status.fail { color: #ae5948; }
.log-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 12px; }
.log-filters label { margin: 0; }
.log-filter-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 9px; margin-top: 5px; }
.log-panel td:first-child { width: 44px; }
.log-panel input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: #326d54; }
.log-panel td:last-child { min-width: 180px; white-space: normal; overflow-wrap: anywhere; }
.selected-delete { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.selected-delete label { min-width: 240px; margin: 0; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.pagination a, .pagination span { display: inline-flex; min-width: 35px; min-height: 35px; align-items: center; justify-content: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; }
.pagination a:hover, .pagination a[aria-current="page"] { border-color: #9ac7a5; background: #eaf4ec; color: #20584a; }
.danger-zone { border-color: #ebd4d0; background: #fffaf8; }
.danger-zone summary { color: #9a443c; font-weight: 750; cursor: pointer; }
.danger-zone p { margin: 16px 0 0; font-size: 13px; }
.danger-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 640px; }
.danger-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.button.danger { border-color: #a34b42; background: #a34b42; }
.button.danger:hover { background: #883a33; }
.button.danger-outline { border-color: #d6a9a2; background: #fff; color: #9a443c; }
.button.danger-outline:hover { background: #fff0ed; }

/* Brand system: logo blues across login, library and admin screens. */
.brand { gap: 10px; color: #102c69; font-size: 20px; font-weight: 800; letter-spacing: -.045em; }
.brand-icon { display: block; width: 44px; height: 44px; flex: none; object-fit: contain; }
.brand-domain { color: #1268db; }
.brand small { margin-top: 1px; color: #657793; font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.top { border-bottom-color: #dbe6f4; }
.top nav a:hover, .top nav .link:hover { background: #e9f1fd; }
main { padding-top: 14px; }
.eyebrow { color: #175cb6; }
.button.secondary { border-color: #d7e8fb; background: #eaf3ff; color: #174e9b; }
.button.secondary:hover { background: #dcecff; }
.button.ghost:hover { background: #f2f7ff; }
.badge, .tag { background: #e8f2ff; color: #1556a8; }
.admin-hero { background: radial-gradient(circle at 88% 5%, rgba(71,211,249,.19), transparent 36%), linear-gradient(125deg, #071e4a, #104dad); }
.admin-hero .eyebrow { color: #91e6fa; }
.admin-hero-side a { color: #c9f1ff; }
.admin-stats strong { color: #103575; }
.workflow-step { color: #1762ba; }
.workflow-card { background: #f8fbff; }
.admin-tabs a:hover { background: #e8f2ff; }
.folder-card:hover { border-color: #9ec7f6; background: #f7fbff; }
.folder-icon { background: #e8f2ff; color: #185aaf; }
.breadcrumbs a, .file-location { color: #1659ad; }
.file-card:hover { border-color: #b8d4f4; }
.stat { background: #e6f1ff; }
.pagination a:hover, .pagination a[aria-current="page"] { border-color: #a8cbef; background: #e9f3ff; color: #154f9d; }
input:focus, select:focus, textarea:focus { border-color: #68a9ec; box-shadow: 0 0 0 3px #e4f1ff; }

.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 450px); min-height: 575px; overflow: hidden; border: 1px solid #dbe6f3; border-radius: 26px; background: #fff; box-shadow: 0 24px 70px rgba(12,43,98,.14); }
.login-story { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; padding: clamp(38px, 6vw, 78px); overflow: hidden; background: radial-gradient(circle at 80% 5%, rgba(69,217,246,.25), transparent 30%), linear-gradient(142deg, #071a42 0%, #0b347c 54%, #1265d8 100%); color: #fff; }
.login-story::after { content: ""; position: absolute; right: -145px; bottom: -245px; width: 470px; height: 470px; border: 1px solid rgba(128,223,255,.28); border-radius: 50%; box-shadow: 0 0 0 70px rgba(128,223,255,.04), 0 0 0 145px rgba(128,223,255,.025); pointer-events: none; }
.login-story > * { position: relative; z-index: 1; }
.login-app-logo { display: block; width: 104px; height: 104px; margin: 0 0 40px; object-fit: contain; filter: drop-shadow(0 15px 25px rgba(0,11,40,.24)); }
.login-story .eyebrow { color: #87def8; }
.login-story h1 { max-width: 690px; margin: 0 0 20px; color: #fff; font-size: clamp(2.5rem, 4.1vw, 4.2rem); line-height: 1.08; }
.login-story h1 em { color: #8ce9ff; font-style: normal; }
.login-story > p:not(.eyebrow) { max-width: 520px; color: #d4e7ff; font-size: 16px; line-height: 1.7; }
.login-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.login-chips span { padding: 8px 11px; border: 1px solid rgba(169,230,255,.28); border-radius: 999px; background: rgba(255,255,255,.08); color: #e1f5ff; font-size: 11px; font-weight: 700; }
.login-panel { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: clamp(30px, 4vw, 54px); background: #fff; }
.login-full-logo { display: block; width: min(100%, 250px); height: auto; margin: 0 0 38px; object-fit: contain; }
.login-kicker { margin: 0 0 8px; color: #1566bf; font-size: 10px; font-weight: 800; letter-spacing: .19em; }
.login-panel h2 { margin: 0 0 10px; color: #102950; font-size: 28px; }
.login-help { margin: 0 0 15px; color: var(--muted); font-size: 14px; }
.login-panel form label { margin-top: 18px; }
.login-panel .button { justify-content: space-between; width: 100%; margin-top: 24px; background: #125fc6; border-color: #125fc6; }
.login-panel .button:hover { background: #0c4fae; }
.login-panel .cancel-form { margin-top: 14px; text-align: center; }
.login-panel .cancel-form .link { font-size: 13px; }
.login-footnote { margin: 26px 0 0; color: #8694a8; font-size: 11px; text-align: center; }

.library-heading { align-items: center; min-height: 92px; margin: 0 0 9px; padding: 12px 18px; border: 1px solid #dbeafb; border-radius: 16px; background: linear-gradient(115deg, #ecf5ff, #f9fcff); }
.library-title { display: flex; align-items: center; gap: 17px; }
.library-title img { display: block; width: 58px; height: 58px; flex: none; object-fit: contain; }
.library-heading .eyebrow { margin: 0 0 4px; font-size: 10px; }
.library-heading h1 { margin: 0 0 3px; color: #102d6a; font-size: 30px; }
.library-heading p:last-child { color: #597089; font-size: 13px; }
.library-heading .stat { padding: 10px 16px; border: 1px solid #d6e7fb; border-radius: 11px; }
.library-heading .stat strong { font-size: 23px; }
.library-heading .stat span { font-size: 11px; }
.library-heading + .notice { margin-top: 0; }
.library-heading ~ .filters { margin-bottom: 11px; }
.library-heading ~ .breadcrumbs { margin-bottom: 8px; }
.library-heading ~ .folder-grid { margin-bottom: 14px; }

.category-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 20px; }
.category-add { align-self: start; padding: 22px; border: 1px solid #dce8f6; border-radius: 13px; background: #f8fbff; }
.category-add .button { margin-top: 18px; }
.category-list { display: grid; align-content: start; gap: 9px; }
.category-actions { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 18px; }
.category-actions .button { margin-top: 14px; }
.category-actions p { margin: 0; font-size: 12px; }
.category-panel .section-head p:last-child { margin: 8px 0 0; font-size: 13px; }
.order-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 14px 0; padding: 10px 12px; border: 1px solid #d8e6f7; border-radius: 9px; background: #f5f9ff; }
.order-controls span { margin-right: auto; color: #315378; font-size: 12px; font-weight: 700; }
.order-controls form { margin: 0; }
.order-controls .button { min-height: 34px; padding: 6px 10px; font-size: 11px; }

.library-section { margin: 18px 0 22px; }
#file-list { scroll-margin-top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.library-location { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 16px; margin: 12px 0 16px; color: #526985; font-size: 12px; }
.library-location a { display: inline-flex; align-items: center; min-height: 33px; padding: 6px 11px; border: 1px solid #d8e7f7; border-radius: 8px; background: #fff; color: #1759aa; font-weight: 700; }
.library-location a:hover { background: #eef6ff; }
.library-location span { overflow-wrap: anywhere; }
.library-location b { padding: 0 4px; color: #9bacc2; }
.library-search-panel { display: grid; grid-template-columns: minmax(230px, .85fr) minmax(0, 1.15fr); align-items: center; gap: 22px; margin: 15px 0 22px; padding: 20px 24px; border: 1px solid #d9e7f7; border-radius: 15px; background: #fff; box-shadow: 0 10px 30px rgba(17, 62, 123, .045); }
.library-search-panel .eyebrow { margin: 0 0 3px; font-size: 9px; }
.library-search-panel h2 { margin: 0 0 4px; color: #102f70; font-size: 19px; }
.library-search-panel p:last-child { margin: 0; color: #6d7f96; font-size: 12px; }
.library-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.library-search-form input[type="search"] { min-width: 0; min-height: 48px; margin: 0; border-color: #cbdff4; background: #f8fbff; }
.library-search-button { min-height: 48px; padding-inline: 21px; background: #125fc6; border-color: #125fc6; font-size: 13px; }
.library-search-button:hover { background: #0c4fae; }
.library-clear { grid-column: 1 / -1; justify-self: end; color: #1761b9; font-size: 11px; font-weight: 700; }
.library-clear:hover { text-decoration: underline; }
.library-categories { margin-top: 0; padding: 4px 0 19px; border-bottom: 1px solid #dae7f6; }
.library-section .section-head { margin-bottom: 12px; }
.library-section .section-head h2 { margin: 0; color: #102d6a; font-size: 20px; }
.library-section .section-head .eyebrow { margin: 0 0 4px; font-size: 9px; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.category-card { display: grid; align-content: start; min-width: 0; min-height: 112px; padding: 14px 16px; border: 1px solid #dbe8f7; border-radius: 13px; background: #fff; box-shadow: 0 7px 22px rgba(14, 53, 114, .035); transition: border-color .15s, background .15s, transform .15s; }
.category-card:hover { border-color: #9fc8f5; background: #f7fbff; transform: translateY(-2px); }
.category-card.selected { border-color: #70abea; background: #edf6ff; }
.category-card-icon { display: inline-grid; place-items: center; width: 29px; height: 29px; margin-bottom: 8px; border-radius: 8px; background: #e5f1ff; color: #175bae; font-size: 17px; line-height: 1; }
.category-card strong { overflow-wrap: anywhere; color: #173a75; font-size: 13px; line-height: 1.25; }
.category-card small { margin-top: 4px; color: #6c7f9a; font-size: 11px; }
.check-option { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 19px; color: #3d5877; font-size: 12px; line-height: 1.45; font-weight: 550; }
.check-option input { flex: none; width: 17px; height: 17px; min-height: 17px; margin: 0; accent-color: #155cba; }
.lockout-notice p { margin: 7px 0 8px; }
.lockout-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lockout-list span { display: inline-block; padding: 5px 8px; border: 1px solid #efc8c0; border-radius: 6px; background: #fff9f7; font-size: 11px; }

.admin-hero.compact { padding: 27px 34px; }
.admin-hero.compact h1 { font-size: clamp(2rem, 3vw, 2.7rem); }
.admin-menu { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.admin-menu a { display: inline-flex; align-items: center; min-height: 39px; padding: 8px 13px; border: 1px solid #d9e7f7; border-radius: 9px; background: #fff; color: #274b7f; font-size: 12px; font-weight: 700; }
.admin-menu a:hover { background: #f0f7ff; }
.admin-menu a[aria-current="page"] { border-color: #165db8; background: #165db8; color: #fff; }
.admin-stats > a { min-width: 0; padding: 19px 21px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.admin-stats > a:hover { border-color: #a9c9ef; box-shadow: 0 7px 20px rgba(20, 69, 132, .07); }
.admin-stats > a span, .admin-stats > a small { display: block; color: var(--muted); font-size: 12px; }
.admin-stats > a strong { display: block; margin: 4px 0 0; color: #103575; font-size: 29px; line-height: 1.2; }
.admin-file-filters select { max-width: 180px; }
.listing-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px 16px; }
.listing-tools > .muted { white-space: nowrap; }
.view-switch { display: inline-flex; align-items: center; gap: 3px; margin: 0; padding: 3px; border: 1px solid #d7e5f5; border-radius: 10px; background: #edf4fc; }
.view-switch button { min-height: 33px; padding: 5px 12px; border: 0; border-radius: 7px; background: transparent; color: #516b8a; font-size: 12px; font-weight: 750; white-space: nowrap; }
.view-switch button:hover { color: #124f9f; background: #e2eefc; }
.view-switch button.selected { background: #fff; color: #154e9a; box-shadow: 0 2px 7px rgba(16, 51, 99, .12); }
.file-table-wrap { overflow-x: auto; border: 1px solid #dbe7f5; border-radius: 13px; background: #fff; box-shadow: 0 8px 28px rgba(16, 48, 95, .045); }
.file-table { min-width: 1050px; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.library-data-table { table-layout: fixed; }
.library-data-table thead th:nth-child(1) { width: 34%; }
.library-data-table thead th:nth-child(2) { width: 12%; }
.library-data-table thead th:nth-child(3) { width: 14%; }
.library-data-table thead th:nth-child(4) { width: 8%; }
.library-data-table thead th:nth-child(5) { width: 8%; }
.library-data-table thead th:nth-child(6) { width: 11%; }
.library-data-table thead th:nth-child(7) { width: 13%; }
.file-table thead { background: #f1f6fd; }
.file-table th, .file-table td { padding: 14px 13px; border-bottom: 1px solid #e4ecf6; vertical-align: middle; white-space: normal; }
.file-table thead th { color: #4b6687; font-size: 12px; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }
.file-table tbody tr:last-child > * { border-bottom: 0; }
.file-table tbody tr:hover { background: #f8fbff; }
.file-table td:last-child { min-width: 105px; }
.file-table-name { width: 34%; min-width: 290px; font-weight: 400; }
.file-table-name strong { display: inline; color: #15376e; font-size: 17px; font-weight: 750; overflow-wrap: anywhere; }
.file-table-name small { display: block; margin-top: 3px; color: #70829b; font-size: 12px; overflow-wrap: anywhere; }
.file-table-description { display: -webkit-box; margin-top: 5px; overflow: hidden; color: #586d88; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.table-hash { margin-top: 6px; color: #70829b; font-size: 11px; }
.table-hash summary { width: fit-content; color: #225da5; cursor: pointer; }
.table-hash code { display: block; margin-top: 3px; white-space: normal; overflow-wrap: anywhere; }
.table-folder-cell { width: 180px; max-width: 180px; }
.table-folder-label { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-data-table .table-folder-cell { width: auto; max-width: none; }
.library-data-table .table-folder-label { max-width: 100%; }
.library-data-table .table-version { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-location { color: #185bab; font-weight: 700; }
.table-location:hover, .table-manage:hover, .table-download:hover { text-decoration: underline; }
.table-action { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.library-data-table .table-action { min-width: 108px; min-height: 42px; padding: 9px 15px; font-size: 14px; }
.table-scroll-hint { display: none; margin: 7px 0 0; color: #6a7f9c; font-size: 11px; }
.table-management { margin-bottom: 17px; padding: 13px; border: 1px solid #cbdff7; border-radius: 13px; background: #f6faff; }
.table-management .record { background: #fff; }
.table-status { display: inline-flex; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.table-status.is-active { background: #e4f4ea; color: #27724d; }
.table-status.is-inactive { background: #f0f2f5; color: #6c7889; }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; }
.table-manage { color: #1556a8; font-weight: 750; white-space: nowrap; }
.table-download { color: #307157; font-weight: 750; white-space: nowrap; }
.user-delete-trigger { margin-top: 18px; }
#file-records { scroll-margin-top: 18px; }
.admin-file-list .record { scroll-margin-top: 18px; }
.admin-file-list .record > summary { align-items: center; }
.admin-file-list .record > summary strong { min-width: 0; overflow-wrap: anywhere; }
.admin-file-list .record > summary .muted { max-width: 60%; text-align: right; overflow-wrap: anywhere; }
.admin-file-meta { display: flex; flex-wrap: wrap; gap: 7px 17px; color: #536781; font-size: 12px; }
.admin-file-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding-left: 28px; border-left: 1px solid var(--line); }
.admin-file-actions p { margin: 0 0 10px; font-size: 12px; }
.admin-file-actions .button { margin-top: 0; }
.feature-controls { width: 100%; padding: 14px; border: 1px solid #dbe8f7; border-radius: 10px; background: #f8fbff; }
.feature-controls strong { color: #164b91; font-size: 13px; }
.feature-controls .order-controls { margin: 10px 0 0; padding: 0; border: 0; background: transparent; }
.feature-controls .order-controls span { flex: 1 0 100%; }
.category-delete-trigger { margin-top: 16px; }
.confirm-dialog { width: min(100% - 28px, 520px); max-height: min(90vh, 760px); padding: 28px; border: 1px solid #dbe6f5; border-radius: 17px; background: #fff; color: var(--ink); box-shadow: 0 25px 80px rgba(4, 25, 62, .28); }
.confirm-dialog::backdrop { background: rgba(7, 24, 58, .62); backdrop-filter: blur(3px); }
.confirm-dialog h2 { margin-bottom: 12px; overflow-wrap: anywhere; }
.confirm-dialog p { color: var(--muted); font-size: 13px; }
.confirm-dialog .eyebrow { color: #a34038; font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 23px; }
.dialog-folder-preview { max-height: 135px; overflow: auto; padding: 9px 12px; border: 1px solid #e0eaf5; border-radius: 8px; background: #f8fbff; font-size: 12px; }
.dialog-folder-preview ul { margin: 5px 0 0; padding-left: 18px; }
.dialog-folder-preview li { overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .login-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 410px); }
  .login-story { padding: 42px; }
  .login-story h1 { font-size: clamp(2.3rem, 4vw, 3.4rem); }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 30px; padding: 44px; }
  .hero h1 { font-size: clamp(2.4rem, 4vw, 3.2rem); }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-workflow .workflow-card:last-child { grid-column: 1 / -1; }
  .log-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .login-layout { display: flex; flex-direction: column; min-height: 0; }
  .login-panel { order: 1; padding: 34px; }
  .login-story { order: 2; padding: 30px 34px; }
  .login-app-logo { width: 70px; height: 70px; margin-bottom: 14px; }
  .login-story h1 { font-size: 2rem; }
  .login-story > p:not(.eyebrow) { font-size: 13px; }
  .login-chips { margin-top: 12px; }
  .login-full-logo { width: 210px; margin-bottom: 23px; }
  .shell { width: min(100% - 32px, 600px); }
  .top { min-height: 72px; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .top nav { width: 100%; gap: 0; }
  main { padding: 18px 0 48px; }
  .hero { display: block; min-height: 0; padding: 34px 24px 24px; border-radius: 20px; }
  .hero h1 { max-width: 500px; margin-bottom: 14px; font-size: clamp(2.1rem, 8vw, 3.15rem); }
  .hero p:not(.eyebrow) { font-size: 14px; line-height: 1.6; }
  .hero .auth-card { max-width: none; margin-top: 27px; padding: 27px; }
  .heading { align-items: flex-start; }
  .heading h1 { font-size: 2.6rem; }
  .stat { display: none; }
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .two-col > div + div, .two-col > form + form { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .file-grid { grid-template-columns: 1fr; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .folder-card { gap: 8px; padding: 10px; font-size: 12px; }
  .folder-icon { flex-basis: 30px; height: 30px; font-size: 16px; }
  .filters { flex-wrap: wrap; }
  .filters input, .filters select { width: 100%; max-width: none; flex: 1 0 100%; }
  .filters .button { flex: 1; }
  .panel { padding: 20px; }
  .record > summary { display: block; }
  .record > summary .muted { display: block; margin-top: 5px; }
  .session-control { align-items: stretch; flex-direction: column; }
  .session-control .button { width: 100%; }
  .admin-hero { display: block; padding: 27px; }
  .admin-hero-side { display: flex; justify-content: space-between; justify-items: start; margin-top: 20px; }
  .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-stats > div { padding: 13px; }
  .admin-stats strong { font-size: 23px; }
  .admin-workflow { grid-template-columns: 1fr; }
  .admin-workflow .workflow-card:last-child { grid-column: auto; }
  .folder-picker { grid-template-columns: 1fr; gap: 0; }
  .folder-picker label + label { margin-top: 10px; }
  .log-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heading.admin-heading { display: block; }
  .heading.admin-heading .button { margin-top: 16px; }
  .category-layout { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-menu { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .admin-menu a { flex: none; }
  .admin-file-actions { padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .admin-file-list .record > summary .muted { max-width: none; text-align: left; }
  .admin-file-filters select { max-width: none; }
  .library-search-panel { grid-template-columns: 1fr; gap: 13px; padding: 18px; }
  .library-search-form { grid-template-columns: minmax(0, 1fr) auto; }
  .library-search-button { padding-inline: 14px; }
  .library-section .section-head { flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; }
  .library-section .section-head > .muted { width: 100%; }
  #file-records > .section-head { flex-wrap: wrap; align-items: flex-start; }
  .listing-tools { width: 100%; justify-content: space-between; }
  .file-table { min-width: 1050px; }
  .table-scroll-hint { display: block; }
  .library-heading { min-height: 0; padding: 14px 16px; }
  .library-title { gap: 11px; }
  .library-title img { width: 50px; height: 50px; }
  .library-heading h1 { font-size: 25px; }
  .library-heading p:last-child { font-size: 11px; }
  .library-heading ~ .filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .library-heading ~ .filters input { grid-column: 1 / -1; }
  .library-heading ~ .filters select { min-width: 0; max-width: none; }
  .library-heading ~ .filters .button { min-width: 82px; }
}
@media (max-width: 420px) {
  .login-panel { padding: 25px; }
  .login-story { padding: 26px; }
  .login-story h1 { font-size: 1.7rem; }
  .shell { width: min(100% - 24px, 390px); }
  .top nav { gap: 2px; }
  .top nav a, .top nav .link { padding: 0 7px; font-size: 12px; }
  .brand { gap: 8px; font-size: 11px; }
  .brand small { font-size: 9px; }
  .mark { width: 36px; height: 36px; font-size: 18px; }
  .hero { padding: 27px 17px 17px; }
  .hero .auth-card { padding: 22px; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-stats > a { padding: 13px; }
  .admin-stats > a strong { font-size: 23px; }
  .admin-hero-side { display: grid; justify-items: start; }
  .log-filters, .danger-fields { grid-template-columns: 1fr; }
  .category-actions { grid-template-columns: 1fr; }
  .library-search-form { grid-template-columns: 1fr; }
  .library-search-button { width: 100%; }
}
