:root {
  color-scheme: light;
  --ink: #17233d; --ink-soft: #40506e; --muted: #71809b; --line: #e5eaf1;
  --surface: #fff; --paper: #f6f8fb; --blue: #4168d9; --blue-dark: #2f54bd;
  --blue-pale: #edf2ff; --green: #2f7d59; --red: #b63f4f;
  --shadow: 0 16px 46px rgba(32, 51, 89, .08);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { height: 76px; display: flex; align-items: center; gap: 32px; padding: 0 clamp(20px, 5vw, 76px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 750; letter-spacing: -.035em; }
.brand img { display: block; }
.brand-small { font-size: 18px; flex: 0 0 auto; }
.topnav { display: flex; align-items: center; gap: 24px; margin-left: auto; color: #687792; font-size: 13px; font-weight: 600; }
.topnav > a { padding: 10px 0; }
.topnav > a:hover, .table-link:hover { color: var(--blue); }
.nav-logout { margin: 0; }
.identity-chip { display: flex; align-items: center; gap: 9px; padding-left: 20px; border-left: 1px solid var(--line); font-size: 12px; font-weight: 650; }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: var(--blue-dark); background: #eaf0ff; font-size: 14px; }
.identity-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-pill, .admin-badge, .count-pill, .status-pill, .result-pill { display: inline-flex; align-items: center; border-radius: 999px; font-size: 11px; font-weight: 700; }
.role-pill { padding: 5px 9px; color: #4661a8; background: var(--blue-pale); }
.page-shell { width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 52px 0 64px; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 22px 0 30px; color: #98a2b4; font-size: 11px; border-top: 1px solid #e8edf3; }
.eyebrow { margin: 0 0 12px; color: #7182a8; font-size: 10px; font-weight: 750; letter-spacing: .17em; }
.muted { color: var(--muted); line-height: 1.7; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.045em; line-height: 1.18; }
h2 { margin-bottom: 7px; font-size: 19px; letter-spacing: -.025em; }
h3 { font-size: 15px; }
.welcome-row, .page-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.welcome-row { margin: 0 0 30px; }
.welcome-row .muted, .page-heading .muted { margin-bottom: 0; font-size: 13px; }
.welcome-meta { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; color: #63718a; background: white; font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #56ae79; box-shadow: 0 0 0 4px #e7f4ec; }
.tool-panel, .surface-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 18px rgba(37,57,91,.025); }
.tool-panel { padding: 28px; }
.section-heading, .table-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.section-heading { margin-bottom: 25px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.count-pill { padding: 4px 8px; color: #687ba5; background: #eef2f8; vertical-align: 3px; }
.search-box { display: flex; align-items: center; gap: 9px; width: 245px; padding: 0 12px; border: 1px solid #e4e9f0; border-radius: 9px; background: #fbfcfe; }
.search-box:focus-within { border-color: #a8b9ed; box-shadow: 0 0 0 3px rgba(65,104,217,.1); }
.search-box svg { width: 17px; height: 17px; fill: none; stroke: #8492a9; stroke-width: 1.8; }
.search-box input { width: 100%; height: 39px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.library-layout { display: grid; grid-template-columns: 190px minmax(0,1fr); min-height: 300px; border-top: 1px solid #edf0f5; }
.category-sidebar { padding: 23px 19px 16px 0; border-right: 1px solid #edf0f5; }
.category-sidebar h3 { margin-bottom: 15px; color: #4f5e79; font-size: 12px; }
.category-item { display: flex; justify-content: space-between; width: 100%; margin: 3px 0; padding: 10px 11px; border: 0; border-radius: 8px; color: #697891; background: transparent; text-align: left; font-size: 12px; }
.category-item span { color: #8c98aa; }
.category-item:hover, .category-item.is-selected { color: var(--blue-dark); background: #eef3ff; }
.category-empty { max-width: 150px; color: #9aa5b5; font-size: 11px; line-height: 1.7; }
.tool-results { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 34px 24px; }
.empty-state { width: min(450px, 100%); text-align: center; }
.empty-art { position: relative; width: 104px; height: 93px; margin: 0 auto 22px; }
.empty-center { position: absolute; inset: 22px 27px; display: grid; place-items: center; border: 1px solid #d9e2f3; border-radius: 17px; color: #4669be; background: linear-gradient(145deg,#fff,#eff4ff); box-shadow: 0 9px 22px rgba(54,82,145,.11); font-size: 17px; font-weight: 800; letter-spacing: -.05em; }
.empty-square { position: absolute; width: 25px; height: 25px; border: 1px solid #d8e6e0; border-radius: 8px; background: #f1f8f4; transform: rotate(11deg); }
.square-a { top: 10px; right: 10px; }.square-b { bottom: 3px; left: 7px; background: #fff7e9; border-color: #eee4cc; transform: rotate(-11deg); }
.empty-spark { position: absolute; top: 0; left: 7px; color: #e2af53; font-size: 18px; }
.empty-state h3 { margin-bottom: 9px; font-size: 15px; }
.empty-state p { max-width: 380px; margin: 0 auto; color: #8490a4; font-size: 12px; line-height: 1.75; }
.empty-state.compact { padding: 48px 25px; text-align: center; }
.empty-state.compact h2 { font-size: 16px; }
.home-shell { width: min(1600px, calc(100% - 64px)); padding-top: 42px; }
.tool-library { margin: 0 0 18px; }
.library-heading { margin: 0 0 20px; }
.tool-groups { display: grid; gap: 18px; }
.tool-group { min-width: 0; padding: 24px 26px 26px; border: 1px solid #e8edf3; border-radius: 17px; background: #fff; box-shadow: 0 4px 18px rgba(37,57,91,.025); }
.tool-group[hidden] { display: none; }
.tool-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 17px; }
.tool-group-title { display: flex; min-width: 0; align-items: center; gap: 12px; }
.tool-group-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #eef2fb; }
.tool-group-icon img { width: 21px; height: 21px; }
.tool-group-icon-external { background: #f0f4fa; }
.tool-group-title .eyebrow { margin: 0 0 3px; font-size: 9px; }
.tool-group-title h3 { display: flex; align-items: center; gap: 8px; margin: 0; color: #202b40; font-size: 19px; letter-spacing: -.025em; }
.tool-group-note { color: #8994a6; font-size: 11px; }
.tool-grid { display: grid; width: 100%; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 12px; align-self: start; }
.tool-card { position: relative; display: flex; min-width: 0; min-height: 92px; align-items: center; gap: 13px; padding: 13px 35px 13px 13px; border: 1px solid #dfe5ec; border-radius: 11px; background: #f6f8fb; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease; }
.tool-card[hidden] { display: none; }
.tool-card:hover { transform: translateY(-2px); border-color: #cbd7f5; background: #fff; box-shadow: 0 10px 24px rgba(32,51,89,.09); }
.tool-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #eaf0ff; }
.tool-icon img { width: 25px; height: 25px; }
.tool-card-external .tool-icon { background: #edf1f7; }
.tool-card-copy { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; gap: 4px; }
.tool-card strong { overflow: hidden; color: #263143; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.tool-card-description { overflow: hidden; color: #8993a2; font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.tool-card-meta { display: flex; min-width: 0; align-items: center; gap: 8px; overflow: hidden; color: #9aa3b1; font-size: 9px; line-height: 1.3; }
.tool-card-category { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-host { overflow: hidden; color: #9aa3b1; text-overflow: ellipsis; white-space: nowrap; }
.tool-card-category + .tool-host::before { margin-right: 8px; color: #c0c6cf; content: "·"; }
.tool-arrow { position: absolute; top: 8px; right: 9px; display: grid; width: 17px; height: 17px; place-items: center; color: #98a2b1; font-size: 13px; }
.tool-group-empty { grid-column: 1 / -1; margin: 0; padding: 25px 12px; color: #939dad; font-size: 12px; }
.empty-tools-group { padding: 45px 20px; }
.empty-tools-group .empty-state { margin: 0 auto; }
.empty-filter { color: var(--muted); font-size: 12px; }
.help-strip { display: flex; align-items: center; gap: 13px; margin-top: 18px; padding: 16px 19px; border: 1px solid #e3e9f4; border-radius: 12px; background: #f1f4fa; }
.help-icon { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border: 1px solid #d4dced; border-radius: 50%; color: #7082a7; font-family: Georgia,serif; font-size: 14px; font-style: italic; }
.help-strip div { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
.help-strip div strong { font-size: 12px; }.help-strip div span { color: #75839a; }
.help-strip > a { margin-left: auto; color: var(--blue-dark); font-size: 11px; font-weight: 700; }
.page-heading { margin-bottom: 28px; }
.page-heading .eyebrow { margin-bottom: 10px; }
.admin-badge { padding: 8px 11px; color: #6479ad; background: #ecf1fb; letter-spacing: .08em; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; min-height: 137px; flex-direction: column; justify-content: space-between; padding: 19px 20px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.stat-card > span { color: #6b7890; font-size: 12px; font-weight: 600; }
.stat-card strong { font-size: 31px; letter-spacing: -.05em; }
.stat-card small { color: #98a2b0; font-size: 10px; }
.stat-green strong { color: #37815f; }.stat-muted strong { color: #7f8ba0; }.stat-blue strong { color: #4568cc; }
.admin-shortcuts { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.shortcut-card { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: white; transition: border .15s ease, transform .15s ease; }
.shortcut-card:hover { transform: translateY(-1px); border-color: #c5d2f3; }
.shortcut-icon, .mini-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #5571bd; background: #eef2ff; font-size: 10px; font-weight: 750; }
.shortcut-card div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.shortcut-card strong { font-size: 12px; }.shortcut-card small { color: #8a96aa; font-size: 10px; }
.shortcut-card .tool-arrow { position: static; margin-left: auto; }
.admin-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.surface-card { padding: 22px; }
.table-card { min-width: 0; padding: 21px 0 0; overflow: hidden; }
.table-heading { padding: 0 22px 16px; }
.table-heading h2 { font-size: 15px; }
.table-heading p { margin: 0; font-size: 11px; }
.table-heading > a { color: var(--blue-dark); font-size: 11px; font-weight: 650; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 11px; }
thead { color: #77849b; background: #f8f9fc; font-size: 10px; }
th, td { padding: 12px 14px; border-top: 1px solid #edf0f5; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 22px; }
td { color: #485772; }
td small { display: block; margin-top: 5px; color: #8d98a9; font-size: 10px; }
.result-pill { padding: 4px 8px; }.result-ok { color: #3b7958; background: #eaf5ee; }.result-warn { color: #9b6a2d; background: #fff4e2; }
.table-empty { padding: 24px; color: #9aa4b4; text-align: center; }
.table-empty[colspan] { padding-left: 22px; }
.table-empty:not(td) { margin: 0; padding: 20px 22px; font-size: 11px; }
.table-heading + .table-scroll table { border-top: 1px solid var(--line); }
.account-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 17px; }
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.card-heading h2 { margin: 0 0 4px; font-size: 16px; }.card-heading p { margin: 0; font-size: 11px; }
.profile-list { margin: 0; }
.profile-list div { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #edf0f4; font-size: 12px; }
.profile-list div:last-child { border-bottom: 0; }
.profile-list dt { color: #8390a4; }.profile-list dd { margin: 0; color: #34425d; font-weight: 600; text-align: right; }
.form-stack { display: flex; flex-direction: column; gap: 9px; }
.form-stack > label, .form-field > label, .mini-form > label { margin-top: 3px; color: #45536c; font-size: 11px; font-weight: 650; }
input, select { min-width: 0; border: 1px solid #dce3ed; border-radius: 8px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus { border-color: #9eb2ed; box-shadow: 0 0 0 3px rgba(65,104,217,.11); }
.form-stack input, .form-stack select, .form-field input, .form-field select, .inline-edit input, .inline-edit select, .mini-form input { height: 39px; padding: 0 11px; font-size: 12px; }
.field-hint { margin: 0 0 4px; color: #8b97aa; font-size: 10px; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: background .15s ease, box-shadow .15s ease; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 5px 12px rgba(65,104,217,.15); }
.button-primary:hover { background: var(--blue-dark); }
.button-quiet { color: #53627d; border-color: #e0e6ef; background: white; }
.button-quiet:hover { border-color: #cbd5e5; background: #fafbfe; }
.button-danger { color: white; background: #bd4d5c; }.button-danger:hover { background: #a93b4a; }
.button-danger-quiet { color: #a3404c; border-color: #f0dce0; background: #fff8f8; }
.button-small { min-height: 30px; padding: 0 10px; font-size: 10px; }
.button-full { width: 100%; min-height: 47px; margin-top: 12px; }
.alert { margin: 0 0 17px; padding: 12px 14px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; line-height: 1.6; }
.alert-error { color: #8d3542; border-color: #f0d9dc; background: #fff3f4; }
.alert-success { color: #326d4d; border-color: #d5eadc; background: #eff8f2; }
.alert-info { color: #536784; border-color: #dae5f4; background: #f0f5fb; }
.create-user-card { margin-bottom: 17px; }
.create-user-form { display: grid; grid-template-columns: 1fr 1.1fr 1.2fr .8fr .9fr auto; gap: 11px; align-items: end; }
.form-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.form-field select { padding: 0 9px; }
.form-field .checkbox-field { display: flex; min-height: 39px; align-items: center; gap: 8px; margin: 0; color: #596780; font-size: 10px; font-weight: 550; white-space: nowrap; }
.checkbox-field input { width: 15px; height: 15px; accent-color: var(--blue); }
.create-submit { align-self: end; }
.users-card { padding-top: 21px; }
.search-small { width: 210px; }
.user-table { min-width: 1040px; }
.user-table td { white-space: normal; vertical-align: top; }
.inline-edit { display: grid; grid-template-columns: minmax(90px,1fr) 110px auto; align-items: center; gap: 6px; }
.inline-edit input, .inline-edit select { width: 100%; height: 33px; font-size: 10px; }
.inline-edit button { min-height: 31px; }
.table-link { display: inline-block; margin-top: 8px; color: #5770b5; font-size: 10px; }
.status-pill { padding: 5px 8px; }.status-active { color: #397956; background: #e9f5ed; }.status-inactive { color: #8a6270; background: #f5edf0; }
.actions-cell { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; min-width: 220px; }
.actions-cell form { margin: 0; }
.action-details { position: relative; }
.action-details summary { padding: 7px 2px; color: #5b6a83; cursor: pointer; font-size: 10px; }
.action-details .text-danger { color: #a44651; }
.mini-form { position: absolute; z-index: 3; top: 26px; right: 0; display: flex; width: 210px; flex-direction: column; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.mini-form input { height: 34px; }
.empty-inline { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 38px 18px; border-top: 1px solid #edf0f4; color: #68768e; font-size: 12px; }
.empty-inline span { color: #98a3b4; font-size: 11px; }
.permission-form { width: min(620px,100%); }
.permission-form > h2 { margin-bottom: 5px; }
.check-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #edf0f4; }
.check-row input { accent-color: var(--blue); }
.check-row span { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }.check-row small { color: #8995a8; font-size: 10px; }
code { color: #5a6c9b; font-size: 10px; word-break: break-all; }
.login-shell { width: 100%; padding: 0; }
.login-layout { display: grid; min-height: calc(100vh - 56px); grid-template-columns: minmax(0,1.03fr) minmax(400px,.97fr); }
.login-intro { position: relative; display: flex; min-height: 670px; flex-direction: column; justify-content: center; overflow: hidden; padding: 60px clamp(32px,9vw,140px); color: white; background: #17294b; }
.login-intro::before { position: absolute; inset: 0; content: ""; opacity: .4; background: radial-gradient(circle at 84% 25%,rgba(85,124,218,.5),transparent 35%), radial-gradient(circle at 12% 86%,rgba(54,99,186,.4),transparent 34%); }
.login-intro > *:not(.decor-orbit) { position: relative; z-index: 1; }
.brand-large { margin-bottom: 82px; color: white; font-size: 23px; }
.login-intro .eyebrow { margin-bottom: 18px; color: #8da6e3; }
.login-intro h1 { margin-bottom: 19px; font-size: clamp(36px,4.7vw,57px); letter-spacing: -.055em; line-height: 1.26; }
.login-intro h1 span { color: #a9c0ff; }
.intro-copy { max-width: 410px; margin: 0; color: #b7c2d8; font-size: 14px; line-height: 1.9; }
.intro-note { display: flex; align-items: center; gap: 10px; margin-top: 46px; color: #d2dbee; font-size: 11px; letter-spacing: .04em; }
.decor-orbit { position: absolute; width: 450px; height: 450px; border: 1px solid rgba(188,208,255,.13); border-radius: 50%; }
.orbit-one { right: -190px; bottom: -220px; }.orbit-two { right: -98px; bottom: -128px; width: 270px; height: 270px; }
.login-card-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px; background: #f8f9fb; }
.login-card { width: min(416px,100%); padding: 37px 36px 30px; border: 1px solid #e9edf3; border-radius: 17px; background: white; box-shadow: var(--shadow); }
.card-kicker { margin-bottom: 8px; color: #6d82b9; font-size: 11px; font-weight: 700; }
.login-card h2 { margin-bottom: 7px; font-size: 24px; letter-spacing: -.04em; }
.login-card > .muted { margin-bottom: 25px; font-size: 12px; }
.login-card .form-stack { gap: 9px; }
.login-card .form-stack > label { margin-top: 3px; font-size: 11px; }
.login-card input { height: 45px; padding: 0 12px; border-color: #dfe5ee; font-size: 13px; }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 48px; }
.password-toggle { position: absolute; top: 0; right: 0; display: grid; width: 44px; height: 45px; place-items: center; border: 0; color: #8794a9; background: transparent; }
.password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.login-footnote { display: flex; align-items: center; gap: 7px; margin: 23px 0 0; color: #8793a6; font-size: 10px; }
.lock-mark { color: #7891ce; font-size: 9px; }
.login-caption { margin-top: 20px; color: #929daf; font-size: 10px; }.login-caption span { padding: 0 4px; color: #c1c8d4; }
.alert + .form-stack { margin-top: 16px; }
@media (max-width: 1000px) {
  .topbar { gap: 18px; padding: 0 24px; }
  .identity-chip { padding-left: 12px; }.role-pill { display: none; }
  .stats-grid, .admin-shortcuts { grid-template-columns: repeat(2,1fr); }
  .create-user-form { grid-template-columns: repeat(2,1fr); }
  .create-submit { align-self: end; }
  .login-layout { grid-template-columns: minmax(0,.9fr) minmax(380px,1.1fr); }
  .login-intro { padding: 50px 42px; }
}
@media (max-width: 700px) {
  .topbar { height: auto; min-height: 66px; flex-wrap: wrap; gap: 10px; padding: 12px 18px; }
  .brand-small { font-size: 16px; }.brand-small img { width: 30px; height: 30px; }
  .topnav { order: 3; width: 100%; justify-content: space-between; gap: 12px; margin: 0; padding-top: 8px; border-top: 1px solid #f0f2f6; font-size: 11px; }
  .identity-chip { margin-left: auto; padding-left: 0; border: 0; }.identity-name { max-width: 80px; }
  .page-shell { width: calc(100% - 32px); padding: 35px 0 45px; }
  .home-shell { width: calc(100% - 32px); padding: 35px 0 45px; }
  .site-footer { width: calc(100% - 32px); font-size: 10px; }
  .welcome-row, .page-heading-row { align-items: flex-start; flex-direction: column; gap: 13px; }
  .welcome-meta { align-self: flex-start; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .search-box { width: 100%; }
  .tool-group { padding: 18px 15px; }
  .tool-group-heading { align-items: flex-start; }
  .tool-group-note { display: none; }
  .tool-group-title { gap: 10px; }
  .tool-group-icon { width: 39px; height: 39px; }
  .tool-group-title h3 { font-size: 17px; }
  .tool-grid { gap: 10px; }
  .empty-state p { font-size: 11px; }
  .help-strip { align-items: flex-start; flex-wrap: wrap; padding: 14px; }
  .help-strip div { flex: 1; }.help-strip > a { margin: 0 0 0 36px; }
  .stats-grid { gap: 9px; }.stat-card { min-height: 117px; padding: 14px; }.stat-card strong { font-size: 27px; }
  .admin-shortcuts { gap: 8px; }.shortcut-card { gap: 8px; padding: 11px; }.shortcut-icon { width: 29px; height: 29px; }
  .admin-tables, .account-grid { grid-template-columns: 1fr; }
  .surface-card { padding: 18px; }.table-card { padding: 18px 0 0; }
  .table-heading { align-items: flex-start; flex-direction: column; padding: 0 16px 14px; }
  .search-small { width: 100%; }
  .create-user-form { grid-template-columns: 1fr; }
  .profile-list div { font-size: 11px; }
  .login-layout { display: flex; min-height: calc(100vh - 56px); flex-direction: column; }
  .login-intro { min-height: auto; padding: 28px 25px 25px; }
  .brand-large { margin-bottom: 26px; font-size: 19px; }.brand-large img { width: 42px; height: 42px; }
  .login-intro .eyebrow { margin-bottom: 10px; }
  .login-intro h1 { margin-bottom: 10px; font-size: 32px; }
  .intro-copy { max-width: 100%; font-size: 12px; }.intro-note { margin-top: 20px; }
  .decor-orbit { width: 240px; height: 240px; right: -120px; bottom: -150px; }
  .orbit-two { display: none; }
  .login-card-wrap { flex: 1; padding: 30px 18px 20px; }
  .login-card { padding: 27px 22px 24px; }.login-card h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.paper-tool-layout { display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); gap: 18px; align-items: start; }
.paper-upload-card, .paper-status-card { padding: 24px; min-width: 0; }
.paper-card-title { display: flex; align-items: center; gap: 14px; margin-bottom: 23px; }
.paper-card-title h2, .paper-status-heading h2 { margin: 0 0 5px; }
.paper-card-title .muted { margin: 0; font-size: 12px; }
.paper-doc-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #4168d9; background: #edf2ff; font-size: 10px; font-weight: 800; }
.paper-upload-form { display: flex; flex-direction: column; gap: 15px; }
.paper-file-field { display: flex; flex-direction: column; gap: 8px; padding: 17px; border: 1px dashed #b9c8eb; border-radius: 10px; color: #45536c; background: #fafbff; font-size: 12px; font-weight: 650; }
.paper-file-field input { width: 100%; padding: 9px; border: 1px solid #dce3ed; border-radius: 7px; background: white; font-size: 11px; }
.paper-file-field small { overflow-wrap: anywhere; color: #8490a4; font-size: 10px; font-weight: 500; }
.paper-privacy-note { display: flex; flex-direction: column; gap: 5px; margin-top: 18px; padding: 12px 14px; border-radius: 9px; color: #536784; background: #f0f5fb; font-size: 11px; line-height: 1.6; }
.paper-privacy-note span { color: #71809b; }
.paper-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.paper-status-heading .eyebrow { margin-bottom: 7px; }
.novelty-cache-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -4px 0 14px; }
.novelty-cache-controls .muted { font-size: 11px; }
.paper-status-card > .muted { min-height: 42px; margin-bottom: 15px; font-size: 12px; }
.paper-progress-wrap { display: flex; align-items: center; gap: 10px; margin: 12px 0 18px; }
.paper-progress-track { height: 7px; flex: 1; overflow: hidden; border-radius: 99px; background: #e8edf5; }
.paper-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #4168d9; transition: width .2s ease; }
.paper-progress-wrap small { min-width: 35px; color: #71809b; text-align: right; font-size: 10px; }
.paper-task-actions, .paper-downloads { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.paper-result { margin-top: 18px; padding: 14px; border: 1px solid #e5eaf1; border-radius: 9px; background: #fbfcfe; }
.paper-result-title { margin: 0 0 9px; font-size: 12px; }
.paper-notice-list { display: grid; gap: 6px; margin: 0; padding-left: 19px; color: #68768e; font-size: 11px; line-height: 1.6; }
.paper-notice-error { color: #9a3f4b; }
.novelty-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.8fr); gap: 18px; align-items: start; }
.novelty-form-card, .novelty-status-card { min-width: 0; padding: 24px; }
.novelty-upload-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.novelty-upload-section { min-width: 0; padding: 17px; border: 1px solid #e5eaf1; border-radius: 12px; background: #fff; }
.novelty-upload-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.novelty-upload-heading h2 { margin: 0 0 4px; font-size: 15px; }
.novelty-upload-heading p { margin: 0; font-size: 11px; line-height: 1.55; }
.novelty-dropzone { display: flex; min-height: 148px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 15px; border: 1px dashed #b9c8eb; border-radius: 10px; color: #45536c; background: #fafbff; text-align: center; cursor: pointer; }
.novelty-dropzone:hover, .novelty-dropzone.is-dragover { border-color: #4168d9; background: #f1f5ff; }
.novelty-dropzone strong { font-size: 12px; }
.novelty-dropzone .muted { font-size: 10px; }
.novelty-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.novelty-upload-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: #4168d9; background: #edf2ff; font-size: 18px; font-weight: 700; }
.novelty-file-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 34px; padding-top: 8px; }
.novelty-file-row span { overflow-wrap: anywhere; font-size: 10px; }
#reference-file-name { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.novelty-ai-disclosure { margin-top: 17px; padding: 15px; border: 1px solid #eadfca; border-radius: 10px; color: #6d5c3f; background: #fffaf0; font-size: 11px; line-height: 1.65; }
.novelty-ai-disclosure > strong { display: block; margin-bottom: 5px; color: #594726; font-size: 12px; }
.novelty-ai-disclosure p { margin: 0 0 8px; }
.novelty-provider-warning { color: #9a3f4b; font-weight: 650; }
.novelty-consent { display: flex; align-items: flex-start; gap: 8px; color: #594726; cursor: pointer; }
.novelty-consent input { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--blue); }
.novelty-submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.novelty-submit-row .muted { font-size: 11px; }
.novelty-task-list { display: grid; gap: 10px; }
.novelty-task-item { display: grid; gap: 7px; padding: 13px; border: 1px solid #e5eaf1; border-radius: 10px; background: #fbfcfe; }
.novelty-task-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.novelty-task-header strong { font-size: 12px; }
.novelty-task-item p { margin: 0; font-size: 11px; line-height: 1.55; }
.novelty-task-item small { color: #8490a4; font-size: 10px; }
.novelty-task-item .button { justify-self: start; }
.empty-filter { width: 100%; margin: 20px 0; text-align: center; }
.external-create-card { margin-bottom: 17px; }
.external-create-card h2 { margin-bottom: 18px; font-size: 16px; }
.external-tool-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; align-items: end; }
.external-tool-form .checkbox-field { display: flex; min-height: 39px; align-items: center; gap: 8px; color: #596780; font-size: 11px; }
.external-tool-form .checkbox-field input { width: 15px; height: 15px; accent-color: var(--blue); }
.admin-tool-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.button-filter-active { color: #fff; background: var(--blue); }
.admin-tool-table { min-width: 1040px; }
.admin-tool-table td { vertical-align: top; white-space: normal; }
.admin-tool-table td:nth-child(3) { max-width: 260px; }
.admin-tool-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.admin-tool-actions form { margin: 0; }
.external-edit-form { position: static; width: min(260px,75vw); margin: 6px 0; }
.external-edit-form label { display: flex; flex-direction: column; gap: 4px; color: #596780; font-size: 10px; }
.external-edit-form input:not([type="checkbox"]) { width: 100%; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(65,104,217,.42); outline-offset: 3px; }
@media (max-width: 760px) {
  .external-tool-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-tool-filters { width: 100%; }
}
@media (max-width: 480px) {
  .external-tool-form { grid-template-columns: minmax(0,1fr); }
  .tool-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .paper-tool-layout { grid-template-columns: minmax(0,1fr); }
  .paper-upload-card, .paper-status-card { padding: 18px; }
  .novelty-layout { grid-template-columns: minmax(0,1fr); }
  .novelty-form-card, .novelty-status-card { padding: 18px; }
  .page-heading-row { align-items: flex-start; }
  .paper-downloads > a { flex: 1 1 100%; }
}
@media (max-width: 560px) {
  .novelty-upload-grid { grid-template-columns: minmax(0,1fr); }
  .novelty-dropzone { min-height: 130px; }
  .novelty-submit-row { align-items: stretch; }
  .novelty-submit-row > .button { width: 100%; }
}
