:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #233449;
  background: #f4f6fa;
  --accent: #235b65;
  --border: #dbe2eb;
  --muted: #5e6d80;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: #163f47; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; border: 1px solid transparent; border-radius: 8px;
  padding: .55rem 1rem; background: var(--accent); color: #fff;
  font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.4;
}
button:hover, .button:hover { background: #194650; color: #fff; }
.secondary, button[type=button], button[name=action][value=restore],
button[name=action][value=archive] {
  background: #fff; color: #34465d; border-color: #c9d3df;
}
.secondary:hover, button[type=button]:hover { background: #edf2f7; color: #233449; }
.danger, button[name=action][value=reject] {
  background: #fff; color: #a12e38; border-color: #e3bcc0;
}
.danger:hover, button[name=action][value=reject]:hover { background: #fff0f1; color: #8c2430; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid #b96b18; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { color: #1d2e43; line-height: 1.25; letter-spacing: -.025em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin: 0 0 .6rem; }
h2 { font-size: 1.3rem; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; margin-top: 2rem; }
p { margin: .65rem 0 1.1rem; }
small, .muted { color: var(--muted); }
.workspace { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--border); padding: 2rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: .7rem; color: #203b48; font-size: 1.25rem; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); color: #fff; border-radius: 10px; }
.nav-label { margin: 2.25rem .75rem .65rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.main-nav { display: grid; gap: .35rem; }
.main-nav a { padding: .7rem .8rem; border-radius: 8px; color: #526177; text-decoration: none; font-weight: 550; }
.main-nav a:hover { background: #f3f6f9; }
.main-nav a[aria-current] { background: #e8f1f1; color: #1c515c; box-shadow: inset 3px 0 var(--accent); }
.sidebar-note { margin: auto .75rem 0; padding-top: 2rem; font-size: .85rem; color: var(--muted); }
.workspace-body { min-width: 0; }
.topbar { min-height: 104px; padding: 1rem 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #ffffffcc; border-bottom: 1px solid var(--border); }
.profile-switcher label { margin: 0 0 .2rem; font-size: .8rem; color: var(--muted); }
.profile-switcher .actions { margin: 0; flex-wrap: nowrap; }
.profile-switcher select { width: min(300px, 100%); }
.account { position: relative; flex-shrink: 0; }
.account summary { font-weight: 650; padding: .5rem; border-radius: 6px; }
.account summary .muted { font-weight: 400; font-size: .85rem; margin-left: .4rem; }
.account-menu { position: absolute; z-index: 5; right: 0; top: 100%; width: 230px; padding: 1rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px #24374f18; display: grid; gap: .8rem; }
main { max-width: 1320px; padding: 2.5rem; margin: 0 auto; min-width: 0; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem; }
.page-header p { color: var(--muted); max-width: 680px; margin-bottom: 0; }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .65rem; }
.card, fieldset, .job-card {
  min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem; margin: 1.25rem 0; box-shadow: 0 2px 4px #24374f03;
}
fieldset fieldset { box-shadow: none; padding: 1rem; }
legend { font-size: 1.1rem; font-weight: 700; color: #283e54; padding: 0 .4rem; }
label { display: block; margin: 1rem 0 .4rem; font-weight: 550; }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
  display: block; width: 100%; max-width: 100%; min-width: 0; margin-top: .35rem;
  padding: .65rem .75rem; color: #233449; background: #fff;
  border: 1px solid #bcc8d6; border-radius: 7px;
}
input[type=checkbox] { width: 18px; height: 18px; margin: 0 .45rem 0 0; accent-color: var(--accent); vertical-align: middle; }
select {
  appearance: none; min-height: 44px; padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, #526177 50%), linear-gradient(135deg, #526177 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input[type=file] { padding: .5rem; }
textarea { min-height: 60vh; font: .9rem/1.6 ui-monospace, monospace; resize: vertical; }
textarea.terms { min-height: 6rem; font: inherit; }
label .muted { display: block; font-weight: 400; font-size: .9rem; margin-top: .4rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin: .9rem 0; }
.save-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1.25rem 0; }
.settings-nav { display: flex; flex-wrap: wrap; gap: .4rem .7rem; padding: .8rem; margin-bottom: 1.5rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.settings-nav a { padding: .4rem .55rem; color: #4c5f73; border-radius: 6px; text-decoration: none; font-size: .9rem; }
.settings-nav a:hover, .settings-nav a[aria-current] { background: #e8f1f1; color: #1c515c; }
#google-sheets form + form { display: flex; flex-wrap: wrap; gap: .65rem; border-top: 1px solid var(--border); padding-top: 1.5rem; margin-top: 1.5rem; }
#google-sheets button[value=probe], #google-sheets button[value=dry-run] { background: #fff; color: #34465d; border-color: #c9d3df; }
[id] { scroll-margin-top: 1.5rem; }
.form-feedback { scroll-margin-top: 2rem; }
:target.card, :target fieldset:first-child { border-color: #65939b; }
.message, .error { padding: 1rem 1.25rem; margin: 1.25rem 0; border-radius: 9px; overflow-wrap: anywhere; }
.message { border: 1px solid #a9d3bd; background: #eef8f2; color: #24553b; }
.error { border: 1px solid #e2b7bd; background: #fff2f3; color: #972c38; white-space: pre-wrap; }
[aria-invalid=true] { border-color: #b63848 !important; }
.badge, .score { display: inline-block; padding: .2rem .65rem; border-radius: 6px; background: #edf2f7; color: #43566d; font-size: .82rem; font-weight: 650; }
.score { background: #e6f2ed; color: #276047; white-space: nowrap; }
.filter-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 1rem; align-items: end; }
.filter-grid label { margin: 0; }
.filter-grid button { margin-bottom: 0; }
.job-card { margin: 1rem 0; }
.job-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.job-heading h3 { margin: .3rem 0; font-size: 1.2rem; }
.job-company { margin: 0; font-weight: 650; color: var(--muted); font-size: .9rem; }
.job-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0 1rem; color: var(--muted); }
.job-footer { border-top: 1px solid #e9edf2; margin-top: 1.1rem; padding-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.job-footer .actions { margin: 0; }
.job-applied { display: flex; align-items: center; gap: .6rem; }
.job-applied .applied-badge { background: #e6f2ed; color: #276047; }
summary { cursor: pointer; min-height: 32px; }
details.card > summary { font-size: 1.1rem; font-weight: 650; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
th { font-size: .8rem; color: var(--muted); background: #f8fafc; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; margin: 1.25rem 0 2rem; }
.table-scroll table { min-width: 620px; }
.empty-state { padding: 2rem; border: 1px dashed #b9c9d7; background: #f9fbfd; border-radius: 12px; text-align: center; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
code.secret { display: block; padding: 1rem; font-size: 1.1rem; overflow-wrap: anywhere; }
.user-management { min-width: 18rem; max-width: 30rem; }
.user-management details { margin-top: 1rem; }
.user-management summary { cursor: pointer; font-weight: 650; }
.user-danger { border-top: 1px solid #e5c1c5; padding-top: 1rem; }
.user-danger summary { color: #8c2430; }
.auth { max-width: 490px; padding: 3rem 1rem; margin: auto; }
.auth .brand { margin-bottom: 3rem; }
.auth main { padding: 0; }
.auth .card { padding: 2rem; }
.auth button[type=submit] { width: 100%; margin-top: 1rem; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 10; padding: .75rem; background: #fff; }
.skip-link:focus { top: 1rem; }
.loading-status { display: flex; align-items: center; gap: .8rem; padding: 1rem; margin: 1rem 0; background: #edf4f6; border-radius: 8px; }
.spinner { width: 22px; height: 22px; flex-shrink: 0; border: 3px solid #c3d9dd; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (min-width: 1100px) {
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; align-items: start; }
}
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 195px minmax(0, 1fr); }
  main { padding: 1.75rem; }
  .topbar { padding: 1rem 1.75rem; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; padding: 1rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand { margin-bottom: .8rem; }
  .nav-label, .sidebar-note { display: none; }
  .main-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
  .main-nav a { font-size: .85rem; padding: .6rem; }
  .main-nav[aria-label=Administration] { margin-top: .3rem; }
  .topbar { padding: 1rem; align-items: flex-start; flex-wrap: wrap; }
  .profile-switcher { min-width: 0; flex: 1 1 220px; }
  .profile-switcher select { width: 100%; }
  .profile-switcher .actions { align-items: end; }
  .account { margin-left: auto; }
  main { padding: 1.5rem 1rem 3rem; }
  .card, fieldset, .job-card { padding: 1.1rem; }
  .filter-grid { grid-template-columns: 1fr; }
  .job-heading { flex-wrap: wrap; }
  .settings-nav { gap: .25rem; padding: .5rem; }
  .job-footer > form, .job-footer > form > button, .job-footer > .job-documents,
  .job-applied, .job-applied > form, .job-applied button { width: 100%; }
}
.job-documents { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; min-width: 0; }
.job-documents .loading-status { margin: 0; padding: .45rem .7rem; }
.job-documents .error { margin: 0; }
.generate-form { margin: 0; }
.generate-form button { display: inline-flex; align-items: center; gap: .45rem; }
.package-picker { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.package-picker select { max-width: 19rem; }
.package-picker button, .package-picker .button { min-height: 34px; display: inline-flex; align-items: center; }
.spinner.small { width: 14px; height: 14px; border-width: 2px; }
