:root {
  color-scheme: light;
  color: var(--ink);
  background: var(--canvas);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  --ink: #1e293b;
  --canvas: #f3f5f9;
  --accent: #2855ac;
  --strong: #1a3157;
  --muted: #526077;
  --border: #dbe2ec;
  --panel: #fff;
  --menu: #34445c;
  --soft: #e8effc;
  --input: #fbfcff;
  --input-border: #bac7d9;
  --action: #2855ac;
  --action-hover: #1a3157;
  --action-ink: #fff;
  --body-copy: #455570;
  --draft: #f0f4fb;
  --bot-ink: #234b93;
  --web: #eaf0f9;
  --web-ink: #30507b;
  --infra: #f7efdf;
  --infra-ink: #714a12;
  --focus: #426ac7;
  --error-ink: #9a2b30;
  --error-surface: #fff2f1;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #bac5d6;
  --canvas: #111722;
  --accent: #a9c6ff;
  --strong: #c5cfdc;
  --muted: #b2bfd4;
  --border: #344155;
  --panel: #1a2332;
  --menu: #bdc8d8;
  --soft: #263b5b;
  --input: #151e2c;
  --input-border: #546580;
  --action: #a9c6ff;
  --action-hover: #c7daff;
  --action-ink: #172842;
  --body-copy: #b7c3d3;
  --draft: #172131;
  --bot-ink: #bed3ff;
  --web: #243951;
  --web-ink: #c1d9fc;
  --infra: #443726;
  --infra-ink: #f4d8a1;
  --focus: #a9c6ff;
  --error-ink: #ffc1c1;
  --error-surface: #422b2e;
}

:root[data-theme="cashmere"] {
  color-scheme: dark;
  --canvas: #201914;
  --panel: #30251e;
  --ink: #d1c0ae;
  --strong: #ddcbb5;
  --muted: #bca997;
  --accent: #d9ae82;
  --border: #534235;
  --menu: #cfbda9;
  --soft: #493629;
  --input: #271e18;
  --input-border: #91775f;
  --action: #c29a75;
  --action-hover: #d2ab86;
  --action-ink: #2c2019;
  --body-copy: #c6b4a2;
  --draft: #291f19;
  --bot-ink: #e0bf9e;
  --web: #30382c;
  --web-ink: #c0cfb5;
  --infra: #453322;
  --infra-ink: #e4bd8d;
  --focus: #dbac7a;
  --error-ink: #edb8ab;
  --error-surface: #442e28;
}
:root[data-theme="cashmere"] :is(.intro h1, .auth-card h1) {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.035em;
}
:root[data-theme="cashmere"] :is(.auth-card, .job) {
  box-shadow: 0 2px 8px rgb(73 49 26 / 5%);
}

/* Text palettes leave category badges and action colors independent. */
:root[data-tone="neutral"] { --tone: #464b53; }
:root[data-tone="warm"] { --tone: #584a3f; }
:root:is([data-theme="dark"], [data-theme="cashmere"])[data-tone="neutral"] { --tone: #b8b8b8; }
:root:is([data-theme="dark"], [data-theme="cashmere"])[data-tone="warm"] { --tone: #c4b6a6; }
:root:is([data-tone="neutral"], [data-tone="warm"]) {
  --ink: var(--tone);
  --strong: var(--tone);
  --menu: var(--tone);
  --body-copy: var(--tone);
  --muted: var(--tone);
}
.appearance:not([hidden]) { display: grid; gap: 4px; margin-bottom: 10px; font-size: .82rem; }
.appearance select {
  font: inherit;
  background: var(--panel);
  color: var(--strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); }
button, input { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--strong); font-weight: 750; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--action); color: var(--action-ink); }

.sign-out { padding: 5px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--strong); font-size: .82rem; white-space: nowrap; }
.sign-out:hover { background: var(--soft); }

main { padding-block: 42px 64px; }
.intro { margin-bottom: 30px; }
.intro h1 { margin: 0 0 8px; color: var(--strong); font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.1; letter-spacing: -.045em; }
.intro p { margin: 0; color: var(--muted); }
.workspace { display: grid; gap: 24px; grid-template-columns: minmax(215px, 245px) minmax(0, 1fr); align-items: start; }
aside, .search, .job, .empty { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
aside { padding: 15px 10px 10px; }
aside h2 { margin: 0 9px 10px; font-size: .83rem; color: var(--muted); }
aside nav { display: grid; gap: 4px; }
aside a { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px; border-radius: 7px; text-decoration: none; font-size: .86rem; color: var(--menu); }
aside a span { font-variant-numeric: tabular-nums; color: var(--muted); }
aside a:hover, aside a.active { background: var(--soft); color: var(--strong); }
aside a.active { font-weight: 700; }

.search { padding: 15px 18px 18px; }
.search label { display: block; font-size: .88rem; font-weight: 650; margin-bottom: 6px; }
.search-row { display: flex; gap: 8px; }
.search input[type=search] { min-width: 0; flex: 1; padding: 9px 12px; border: 1px solid var(--input-border); border-radius: 8px; color: var(--ink); background: var(--input); }
.search button, .copy, .login-form button { border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 650; background: var(--action); color: var(--action-ink); }
.search button:hover, .copy:hover, .login-form button:hover { background: var(--action-hover); }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 19px 0 10px; }
.results-head h2 { font-size: .93rem; margin: 0; font-weight: 650; }
.results-head h2 span { font-variant-numeric: tabular-nums; margin-left: 5px; color: var(--muted); }
.reset { font-size: .86rem; }
.jobs { display: grid; gap: 12px; }
.job { padding: 18px; min-width: 0; }
.job-meta, .job-title { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.job-meta { color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.pill { padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--bot-ink); font-weight: 650; }
.pill.web { background: var(--web); color: var(--web-ink); }
.pill.infra { background: var(--infra); color: var(--infra-ink); }
.job-title { margin-top: 10px; }
.job-title :is(h1, h2, h3) { font-size: 1.2rem; margin: 0; overflow-wrap: anywhere; }
.job-title a { color: var(--strong); text-decoration: none; }
.job-title a:hover { text-decoration: underline; }
.budget { font-size: .92rem; font-weight: 700; }
.excerpt { margin: 11px 0 0; color: var(--body-copy); font-size: .9rem; overflow-wrap: anywhere; }
.job-actions { display: grid; gap: 8px; margin-top: 14px; font-size: .87rem; }
.outbound { width: fit-content; font-weight: 650; text-underline-offset: 3px; }
summary { width: fit-content; color: var(--accent); font-weight: 650; }
.draft { background: var(--draft); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 8px; }
.draft p { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy { padding: 5px 10px; font-size: .84rem; }
.copy-status { margin-left: 8px; color: var(--muted); }
.empty { padding: 26px 20px; }
.empty h3 { margin: 0 0 6px; font-size: 1.08rem; }
.empty p { margin: 0; color: var(--muted); }

.auth-layout { display: grid; place-items: start center; padding: clamp(36px, 10vh, 120px) 14px 42px; }
.auth-card { width: min(100%, 430px); padding: clamp(20px, 5vw, 34px); border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.auth-card h1 { margin: 0 0 22px; color: var(--strong); font-size: 1.85rem; letter-spacing: -.035em; line-height: 1.2; }
.login-form { display: grid; gap: 16px; }
.login-field { display: grid; gap: 5px; min-width: 0; }
.login-field label { color: var(--strong); font-size: .9rem; font-weight: 650; }
.login-field input { width: 100%; padding: 10px 12px; border: 1px solid var(--input-border); border-radius: 8px; color: var(--ink); background: var(--input); }
.login-form button { margin-top: 4px; }
.login-error { margin: 0; padding: 9px 12px; border-radius: 8px; color: var(--error-ink); background: var(--error-surface); font-size: .88rem; }

@media (max-width: 680px) {
  .wrap { width: calc(100% - 28px); }
  .topbar-inner { min-height: 58px; flex-wrap: wrap; padding-block: 8px; }
  .brand-icon { flex: none; }
  main { padding-block: 26px 42px; }
  .intro { margin-bottom: 18px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  aside nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  aside a { overflow-wrap: anywhere; }
  .job { padding: 14px; }
}

@media (max-width: 365px) {
  aside nav { grid-template-columns: 1fr; }
}
.card-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.profile-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--input-border);
  color: var(--strong);
  background: linear-gradient(145deg, var(--panel), var(--soft));
}
.profile-button:hover { border-color: var(--accent); }
:root[data-theme="cashmere"] .profile-button {
  background: linear-gradient(145deg, #684a34, #392a20);
  border-color: #a6815f;
  color: #e8cdae;
}
#profile-menu {
  position: fixed;
  inset: 64px max(14px, calc((100vw - 1160px) / 2)) auto auto;
  margin: 6px 0 0;
  width: min(15rem, 90vw);
  max-height: min(70vh, 26rem);
  overflow-wrap: anywhere;
  padding: 12px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
}
@supports (position-area: bottom span-left) {
  #profile-menu {
    inset: auto;
    position-area: bottom span-left;
    justify-self: end;
    position-try-fallbacks: flip-block;
  }
}
#profile-menu strong { display: block; margin-bottom: 8px; }
.mail-setting { margin-block: 10px; }
.mail-setting button[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); }
.mail-body { white-space: pre-wrap; }
.mail-pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.mail-pagination > * {
  display: grid;
  min-width: 36px;
  min-height: 36px;
  padding: 4px 8px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
}
.mail-pagination a { background: var(--panel); border-color: var(--border); }
.mail-pagination a:hover, .mail-pagination .active { background: var(--soft); border-color: var(--accent); }
.mail-pagination .active { color: var(--strong); font-weight: 700; }
