:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202c35;
  background: #f5f6f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: #155277; text-underline-offset: 0.18em; }
a:hover { color: #0a3855; }
::selection { color: #fff; background: #155277; }
:focus-visible { outline: 3px solid #b4582e; outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header { background: #fff; border-bottom: 1px solid #dce2e4; }
.header-inner { max-width: 1040px; min-height: 72px; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: #1c303d; text-decoration: none; font-size: 2rem; font-weight: 750; letter-spacing: -0.05em; line-height: 1; }
.top-nav { display: flex; align-items: center; gap: 24px; height: 100%; margin-right: auto; }
.top-nav a { color: #4b5e68; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.top-nav a:hover { color: #154e70; }
.top-nav a[aria-current="page"] { color: #1c303d; text-decoration: underline; text-decoration-color: #b4582e; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.session-tools { display: flex; align-items: center; gap: 24px; font-size: 0.88rem; }
.session-tools span { color: #4b5e68; }

.page { max-width: 1040px; margin: 0 auto; padding: 54px 32px 96px; }
.page-intro { max-width: 720px; margin-bottom: 38px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: 2.4rem; line-height: 1.16; letter-spacing: -0.035em; }
.page-intro p { max-width: 62ch; margin-bottom: 0; color: #52636c; line-height: 1.6; }
h2 { margin-bottom: 24px; font-size: 1.12rem; line-height: 1.3; letter-spacing: -0.012em; }

.access-state { max-width: 640px; padding: 30px 32px; background: #fff; border: 1px solid #dce2e4; border-radius: 12px; line-height: 1.55; }
.access-state h2 { margin-bottom: 10px; }
.access-state p { color: #52636c; margin-bottom: 24px; }
.work-area { max-width: 760px; }
#job-form { background: #fff; border: 1px solid #dce2e4; border-radius: 14px; overflow: hidden; }
.form-section { padding: 32px 36px; border-bottom: 1px solid #e6eaeb; }
.field-grid, .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.field { min-width: 0; }
label { display: block; margin-bottom: 9px; font-size: 0.91rem; font-weight: 650; }
.required, .optional { margin-left: 5px; color: #61717a; font-size: 0.73rem; font-weight: 500; }
input:not([type="file"]), select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: #202c35; background: #fff; border: 1px solid #aab8bf; border-radius: 7px; }
textarea { display: block; resize: vertical; min-height: 108px; line-height: 1.5; }
input[type="file"] { width: 100%; padding: 14px; border: 1px dashed #8fa1aa; border-radius: 8px; background: #f8faf9; cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 14px; padding: 8px 12px; border: 1px solid #9daeb6; border-radius: 6px; color: #233a48; background: #fff; cursor: pointer; }
input:hover, select:hover, textarea:hover { border-color: #567887; }
input:disabled, select:disabled, textarea:disabled { color: #5e6b72; background: #f3f5f5; cursor: not-allowed; }
.field-help { margin: 8px 0 0; color: #566670; font-size: 0.79rem; line-height: 1.5; }
.file-list { list-style: none; margin: 14px 0 0; padding: 0; }
.file-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #e6eaeb; font-size: 0.87rem; overflow-wrap: anywhere; }
.file-list li:last-child { border-bottom: 0; }
.file-size { color: #61717a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.search-settings { border-bottom: 1px solid #e6eaeb; }
.search-settings summary { padding: 26px 36px; font-weight: 650; cursor: pointer; }
.search-settings summary span { display: block; margin: 6px 0 0 20px; color: #566670; font-size: 0.79rem; font-weight: 400; }
.search-settings[open] summary { border-bottom: 1px solid #e6eaeb; }
.settings-grid { padding: 28px 36px 32px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 36px; }
.form-actions p { max-width: 340px; margin: 0; color: #566670; font-size: 0.82rem; line-height: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border-radius: 7px; border: 1px solid transparent; font-weight: 650; font-size: 0.88rem; text-decoration: none; cursor: pointer; transition: background-color 180ms ease-out, border-color 180ms ease-out; }
.button-primary { color: #fff; background: #154e70; }
.button-primary:hover { color: #fff; background: #0b3955; }
.button-primary:disabled { color: #f4f7f8; background: #7d939f; cursor: wait; }
.button-secondary { color: #17455f; background: #fff; border-color: #8da3af; }
.button-secondary:hover { background: #edf3f5; }
.submission-state { margin-top: 24px; padding: 28px 32px; background: #fff; border: 1px solid #dce2e4; border-radius: 12px; }
.submission-state[data-kind="error"] { border-color: #d8a5a7; }
.submission-state[data-kind="success"] { border-color: #91b8a2; }
.submission-state h2 { margin-bottom: 9px; }
.submission-state p { color: #52636c; line-height: 1.55; }
.submission-state dl { margin: 22px 0; border-top: 1px solid #e6eaeb; }
.submission-state dl div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid #e6eaeb; }
.submission-state dt { color: #566670; }
.submission-state dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.submission-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 8px 16px; padding-top: 14px; padding-bottom: 14px; }
  .top-nav { order: 3; width: 100%; height: auto; margin-top: 8px; gap: 20px; }
}

@media (max-width: 650px) {
  .header-inner { padding: 0 20px; min-height: 64px; }
  .session-tools { gap: 12px; }
  .session-tools span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page { padding: 38px 20px 64px; }
  h1 { font-size: 2rem; }
  .page-intro { margin-bottom: 28px; }
  .form-section { padding: 25px 22px; }
  .field-grid, .settings-grid { grid-template-columns: 1fr; gap: 22px; }
  .search-settings summary { padding: 22px; }
  .settings-grid { padding: 24px 22px; }
  .form-actions { align-items: stretch; flex-direction: column; padding: 24px 22px; gap: 18px; }
  .form-actions .button { width: 100%; }
  .submission-state, .access-state { padding: 24px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
