:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #fff;
  --text: #192337;
  --muted: #748097;
  --border: #e4e9f1;
  --accent: #5168d8;
  --accent-dark: #3e53bd;
  --green: #23876e;
  --danger: #b42318;
  --shadow: 0 8px 28px rgba(28, 43, 76, .06);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.site-header { height: 70px; padding: 0 max(24px, calc((100vw - 1200px) / 2)); display: flex; justify-content: space-between; align-items: center; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -.025em; }
.brand-mark { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: var(--accent); color: white; font-size: .76rem; font-weight: 800; letter-spacing: -.04em; }
.header-note, .admin-badge { color: var(--muted); font-size: .69rem; font-weight: 750; letter-spacing: .1em; }
.worker-main { width: min(940px, 100%); margin: 0 auto; padding: 38px 24px 24px; }
.page-intro { margin: 0 0 24px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: .69rem; font-weight: 800; letter-spacing: .13em; }
h1 { margin: 0; font-size: clamp(1.7rem, 3.5vw, 2.2rem); letter-spacing: -.045em; line-height: 1.16; }
.page-intro > p:last-child, .admin-intro p:last-child { max-width: 650px; margin: 10px 0 0; color: var(--muted); font-size: .92rem; }
.form-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); }
.form-section { padding: 24px 26px 26px; border-bottom: 1px solid var(--border); }
.section-heading { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 20px; }
.section-number { flex: 0 0 auto; display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #eef0ff; color: var(--accent); font-size: .73rem; font-weight: 800; }
.section-heading h2, .panel-toolbar h2 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.section-heading p, .panel-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 15px; color: #4e5a70; font-size: .79rem; font-weight: 650; }
.field-grid .field { margin: 0; }
.field-wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .filter-row select, .search-wrap input { width: 100%; min-width: 0; border: 1px solid #dfe5ee; border-radius: 8px; background: #fff; color: var(--text); outline: none; }
.field input, .field select { height: 42px; padding: 0 11px; }
.field textarea { padding: 9px 11px; resize: vertical; }
.field input::placeholder, .search-wrap input::placeholder, .field textarea::placeholder { color: #9aa4b4; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-row select:focus, .search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(81, 104, 216, .12); outline: none; }
.required { color: #c24e42; }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.picker { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.picker legend { width: 100%; padding: 0 0 8px; color: #4e5a70; font-size: .79rem; font-weight: 700; }
.selection-count { float: right; color: var(--accent); font-size: .71rem; font-weight: 650; }
.picker-search input { width: 100%; height: 36px; margin-bottom: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; font-size: .78rem; outline: none; }
.option-list { height: 228px; overflow-y: auto; overscroll-behavior: contain; border-radius: 6px; }
.option-item { display: flex; gap: 9px; align-items: flex-start; padding: 7px 5px; border-bottom: 1px solid #f0f2f6; color: #39465d; font-size: .74rem; line-height: 1.35; cursor: pointer; }
.option-item:hover { background: #f7f8ff; }
.option-item input { flex: 0 0 auto; width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--accent); }
.option-empty, .option-hint { padding: 12px 6px; color: var(--muted); font-size: .75rem; }
.option-hint { margin: 0; text-align: center; }
.target-grid { max-width: 630px; }
.grade-note { display: flex; gap: 7px; align-items: flex-start; max-width: 680px; margin: 16px 0 0; color: var(--muted); font-size: .75rem; }
.grade-note span { color: var(--accent); }
.form-footer { display: flex; min-height: 70px; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 26px; }
.form-message { margin: 0; color: var(--muted); font-size: .8rem; }
.form-message.error, .error { color: var(--danger); }
.button { display: inline-flex; min-height: 40px; justify-content: center; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: .81rem; font-weight: 700; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .6; cursor: wait; }
.button-primary { border-color: var(--accent); background: var(--accent); color: white; }
.button-primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.button-secondary { background: var(--surface); color: var(--text); }
.button-secondary:hover { border-color: #bdc8da; background: #fafbfe; }
.button-danger { border-color: #f0c7c3; background: #fff; color: var(--danger); }
.button-danger:hover { background: #fff5f4; }
.success-panel { margin-top: 20px; padding: 44px 20px; border: 1px solid #cfe7df; border-radius: 14px; background: #f3fbf7; text-align: center; }
.success-mark { display: grid; width: 48px; height: 48px; margin: 0 auto 15px; place-items: center; border-radius: 50%; background: #d9f1e7; color: var(--green); font-size: 1.4rem; font-weight: 800; }
.success-panel h2 { margin: 0; font-size: 1.25rem; }
.success-panel p { margin: 7px 0 16px; color: var(--muted); font-size: .85rem; }
.success-panel .reference { font-size: .72rem; }
.worker-footer { display: flex; justify-content: space-between; gap: 12px; margin: 16px 2px 0; color: var(--muted); font-size: .7rem; }
.worker-footer a { color: var(--muted); }
.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; }

.admin-header-right { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .76rem; }
.admin-badge { padding: 5px 8px; border-radius: 6px; background: #eef0ff; color: var(--accent); font-size: .61rem; }
.admin-main { width: min(1320px, 100%); margin: 0 auto; padding: 34px 26px 60px; }
.admin-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.admin-intro p:last-child { margin-top: 7px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { display: flex; min-height: 86px; justify-content: space-between; align-items: center; padding: 16px 18px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.stat-label { display: block; color: var(--muted); font-size: .75rem; font-weight: 650; }
.stat-value { display: block; margin-top: 2px; font-size: 1.5rem; line-height: 1.15; font-weight: 760; letter-spacing: -.04em; }
.stat-icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 11px; background: #eef0ff; color: var(--accent); font-size: 1.05rem; }
.stat-card:nth-child(2) .stat-icon { background: #eaf7f2; color: var(--green); }
.stat-card:nth-child(3) .stat-icon { background: #fff4e8; color: #b76b1e; }
.analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.analysis-card { min-width: 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.analysis-card h2 { margin: 0; font-size: .85rem; letter-spacing: -.015em; }
.analysis-card > p { margin: 3px 0 15px; color: var(--muted); font-size: .68rem; }
.bar-row { margin: 11px 0; }
.bar-labels { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: .7rem; }
.bar-name { overflow: hidden; color: #4a5870; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { flex: 0 0 auto; color: var(--text); font-weight: 700; }
.bar-track { height: 6px; overflow: hidden; border-radius: 99px; background: #eff1f6; }
.bar-fill { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.grade-fill-c { background: #e4a654; } .grade-fill-b { background: #7195df; } .grade-fill-a { background: #53a67e; } .grade-fill-none { background: #b9c1cf; }
.target-fill { background: var(--green); }
.analysis-empty { margin: 18px 0 8px; color: var(--muted); font-size: .75rem; }
.toolbar-actions { display: flex; gap: 8px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); }
.tab { display: flex; min-height: 43px; align-items: center; gap: 7px; padding: 0 3px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .82rem; font-weight: 650; }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.tab span { display: grid; min-width: 20px; height: 19px; place-items: center; padding: 0 5px; border-radius: 10px; background: #f0f2f6; color: var(--muted); font-size: .65rem; }
.admin-message { min-height: 18px; margin: 8px 0; color: var(--muted); font-size: .75rem; }
.admin-message.error { color: var(--danger); }
.admin-panel { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.panel-toolbar { display: flex; min-height: 74px; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 18px; }
.filter-row { display: flex; gap: 9px; padding: 0 18px 14px; }
.search-wrap { position: relative; flex: 1; min-width: 170px; }
.search-wrap input { height: 38px; padding: 0 11px; font-size: .77rem; }
.filter-row select { width: auto; min-width: 130px; height: 38px; padding: 0 9px; font-size: .75rem; }
.table-wrap { width: 100%; overflow: auto; border-top: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .75rem; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #edf0f5; white-space: nowrap; }
.data-table th { position: sticky; top: 0; z-index: 1; background: #fafbfe; color: var(--muted); font-size: .66rem; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.data-table td { color: #46536a; }
.data-table tbody tr:hover { background: #fafbff; }
.cell-strong { display: block; color: var(--text); font-weight: 700; }
.cell-secondary { display: block; margin-top: 2px; color: var(--muted); font-size: .68rem; }
.grade-pill, .status-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 99px; font-size: .67rem; font-weight: 700; }
.grade-a { background: #e9f7ef; color: #18764f; }
.grade-b { background: #eaf1ff; color: #3f62b6; }
.grade-c { background: #fff4e6; color: #a15a16; }
.grade-none { background: #f0f2f6; color: #778198; }
.directory-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 99px; font-size: .67rem; font-weight: 700; }
.directory-active { background: #e9f7ef; color: #18764f; }
.directory-inactive { background: #f0f2f6; color: #778198; }
.status-pending { background: #fff4e6; color: #a15a16; }
.status-reviewed { background: #eaf1ff; color: #3f62b6; }
.status-approved { background: #e9f7ef; color: #18764f; }
.status-rejected { background: #fff0ef; color: #b42318; }
.row-action { min-height: 30px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 7px; background: white; color: var(--text); font-size: .7rem; font-weight: 650; }
.row-action:hover { border-color: var(--accent); color: var(--accent); }
.table-empty { padding: 34px 18px; color: var(--muted); text-align: center; font-size: .8rem; }
.access-message { width: min(500px, calc(100% - 32px)); margin: 12vh auto 0; padding: 38px 26px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.access-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 16px; place-items: center; border-radius: 14px; background: #eef0ff; color: var(--accent); font-size: 1.3rem; }
.access-message h1 { font-size: 1.45rem; }
.access-message > p:not(.eyebrow) { margin: 9px 0 20px; color: var(--muted); font-size: .85rem; }

dialog { width: min(690px, calc(100% - 24px)); max-height: 90vh; overflow-y: auto; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(14, 25, 50, .2); }
dialog::backdrop { background: rgba(22, 32, 54, .4); backdrop-filter: blur(2px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.dialog-heading h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; }
.dialog-close { border: 0; font-size: 1.4rem; }
.dialog-grid { margin-bottom: 16px; }
.field-hint { color: var(--muted); font-size: .68rem; font-weight: 500; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.dialog-spacer { flex: 1; }
.check-field { display: flex; align-items: center; gap: 8px; margin: 0 0 15px; color: #4e5a70; font-size: .79rem; font-weight: 650; }
.check-field input { width: 16px; height: 16px; accent-color: var(--accent); }

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .site-header { height: 62px; padding-right: 16px; padding-left: 16px; }
  .header-note { font-size: .58rem; }
  .worker-main { padding: 28px 14px 20px; }
  .form-section { padding: 20px 16px; }
  .form-footer { align-items: flex-start; flex-direction: column; padding: 14px 16px 17px; }
  .form-footer .button { width: 100%; }
  .picker-grid { grid-template-columns: 1fr; }
  .option-list { height: 190px; }
  .admin-main { padding: 25px 14px 40px; }
  .admin-intro { align-items: flex-start; }
  .analysis-grid { grid-template-columns: 1fr; }
  .filter-row { flex-wrap: wrap; padding-right: 12px; padding-left: 12px; }
  .filter-row .search-wrap { flex-basis: 100%; }
  .filter-row select { flex: 1; min-width: 105px; }
  .panel-toolbar { padding-right: 12px; padding-left: 12px; }
}
@media (max-width: 480px) {
  .brand { gap: 7px; font-size: .86rem; }
  .brand-mark { width: 31px; height: 31px; }
  .header-note { display: none; }
  .worker-main { padding-right: 10px; padding-left: 10px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .admin-intro { flex-direction: column; }
  .admin-header-right { gap: 6px; font-size: .68rem; }
  .admin-stats { gap: 7px; }
  .stat-card { min-height: 74px; padding: 10px; }
  .stat-icon { display: none; }
  .stat-label { font-size: .65rem; }
  .stat-value { font-size: 1.3rem; }
  .tabs { gap: 13px; }
  .tab { font-size: .75rem; }
  .panel-toolbar { align-items: flex-start; }
  .panel-toolbar .button { min-height: 35px; padding: 7px 9px; font-size: .73rem; }
  .toolbar-actions { flex-direction: column; }
  dialog { padding: 18px; }
  .dialog-grid { grid-template-columns: 1fr; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .dialog-spacer { flex-basis: 100%; }
  .worker-footer { flex-direction: column; }
}
