:root {
  color-scheme: light;
  --paper: #fff;
  --sidebar: #f8f8f8;
  --ink: #202123;
  --muted: #77787d;
  --quiet: #94959a;
  --line: #e9e9ec;
  --soft: #f5f5f6;
  --accent: #212121;
  --sidebar-width: 248px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, a { touch-action: manipulation; }
button { transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease; }
button:disabled { cursor: wait; opacity: .5; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #757575; outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.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; }

/* A quiet navigation rail keeps attention on the writing space. */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar-width); padding: 26px 14px 16px; background: var(--sidebar); display: flex; flex-direction: column; border-right: 1px solid #f1f1f2; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: inline-block; flex: 0 0 auto; position: relative; width: 38px; height: 46px; overflow: hidden; }
.brand-mark img { position: absolute; width: 76px; height: 76px; max-width: none; left: -19px; top: -7px; mix-blend-mode: multiply; }
.brand-wordmark { font-size: 22px; font-weight: 650; line-height: 1.2; letter-spacing: -.6px; }
nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 13px; color: #595a5e; border: 0; border-radius: 9px; text-align: left; background: transparent; font-size: 13px; white-space: nowrap; }
.nav-item:hover { background: #ededee; }
.nav-item.active { background: #eaeaec; color: #202123; font-weight: 550; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 5px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); text-align: center; }
.sidebar-bottom { margin-top: auto; padding-top: 48px; }

main { margin-left: var(--sidebar-width); min-height: 100dvh; }
#breadcrumb { color: #62636a; font-size: 13px; font-weight: 500; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: #77787d; padding: 0; }
.icon-button:hover { background: var(--soft); color: var(--ink); }
.view { margin: 0 auto; padding: 0 40px 28px; }
.page-heading h1 { font-size: 30px; font-weight: 600; line-height: 1.45; letter-spacing: -.9px; }
.page-heading p { color: var(--muted); font-size: 13px; line-height: 1.85; margin-top: 12px; }
.loading { padding: 100px 24px; text-align: center; color: var(--muted); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: #65666c; padding: 6px 0; font-size: 12px; font-weight: 400; }
.text-button:hover { color: var(--ink); }
.text-button .icon { width: 16px; height: 16px; }

/* One composer, one primary action. */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
#generate-form { padding: 23px 25px 20px; }
label { display: block; font-size: 12px; font-weight: 500; margin: 20px 0 8px; }
input, textarea { width: 100%; background: var(--paper); border: 1px solid #dfe0e4; border-radius: 10px; color: var(--ink); padding: 11px 13px; font-size: 13px; line-height: 1.8; }
input::placeholder, textarea::placeholder { color: #a0a0a7; opacity: 1; }
input:focus, textarea:focus { outline: none; border-color: #a4a5ae; box-shadow: 0 0 0 3px #20212305; }
textarea { resize: vertical; }
#job-title { border: 0; border-radius: 0; padding: 4px 0 11px; font-size: 14px; font-weight: 500; box-shadow: none; background: transparent; }
#job-title::placeholder { font-weight: 400; }
#jd-text { display: block; border: 0; background: transparent; box-shadow: none; border-radius: 0; padding: 6px 0; height: 208px; min-height: 150px; max-height: 460px; font-size: 14px; line-height: 1.95; resize: vertical; }
#jd-text::placeholder { color: #96969f; }
.field-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #9999a1; font-size: 10px; margin-top: 10px; }
.field-footer span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 39px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.primary-button { background: var(--accent); color: #fff; }
.primary-button:hover { background: #3b3b3d; }
.primary-button .icon { width: 16px; height: 16px; }
.generate-button { min-height: 40px; border-radius: 10px; gap: 15px; padding: 10px 15px 10px 18px; font-size: 12px; }
.generate-button .icon { width: 18px; height: 18px; }
.secondary-button { background: #fff; border-color: #e3e3e7; color: #5f6066; }
.secondary-button:hover { background: var(--soft); border-color: #d4d4da; }
.secondary-button .icon { width: 15px; height: 15px; }
.danger-button { background: #c24343; color: #fff; }
.danger-button:hover { background: #a63838; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.card-heading > div { display: flex; align-items: center; gap: 9px; }
.card-heading h2 { font-size: 14px; font-weight: 550; }
.small-muted { color: var(--quiet); font-size: 11px; white-space: nowrap; }
.output-card:has(#output-empty:not([hidden])) > .card-heading,
.output-card:has(#output-empty:not([hidden])) > .output-bottom,
.output-card:has(#output-busy:not([hidden])) > .card-heading,
.output-busy { display: flex; justify-content: center; gap: 15px; padding: 10px 12px 20px; }
.output-busy h3 { font-size: 13px; font-weight: 500; }
.output-busy p { margin-top: 5px; font-size: 11px; color: var(--muted); }
.spinner { display: inline-block; width: 21px; height: 21px; margin-top: 2px; border: 2px solid #e9e9ed; border-top-color: #6f7079; border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#greeting-text { border: 0; box-shadow: none; background: #fafafa; border-radius: 11px; min-height: 192px; max-height: 520px; padding: 14px 16px; font-size: 14px; line-height: 2; }
#greeting-text:focus { box-shadow: 0 0 0 1px #dedee3; }
.output-bottom { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 10px; color: var(--quiet); margin-top: 16px; padding-top: 13px; border-top: 1px solid #f0f0f2; }
.output-bottom .icon { width: 13px; height: 13px; }

/* The archive and settings share the same restrained visual language. */
.secondary-view { max-width: 1120px; padding-top: 43px; }
.secondary-view .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 35px; }
.eyebrow { color: var(--quiet); font-size: 11px; margin-bottom: 10px; }
.secondary-view .page-heading h1 { font-size: 28px; }
.secondary-view .page-heading p { margin-top: 9px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; gap: 32px; }
.profile-card { padding: 25px; }
.optional { color: var(--quiet); font-size: 10px; font-weight: 400; margin-left: 7px; }
.upload-zone { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 24px 15px; border: 1px dashed #d8d8df; border-radius: 12px; background: #fcfcfd; color: #51525a; }
.upload-zone:hover { background: #f6f6f8; border-color: #a6a7af; }
.upload-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 9px; border: 1px solid #e9e9ed; border-radius: 10px; background: #fff; }
.upload-icon .icon { width: 18px; height: 18px; }
.upload-zone strong { font-size: 12px; font-weight: 500; }
.upload-zone > span:last-child { margin-top: 5px; color: var(--quiet); font-size: 10px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#profile-text { min-height: 290px; line-height: 1.9; }
.profile-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 21px; padding-top: 19px; }
#profile-save-state { font-size: 11px; color: var(--quiet); }
.profile-tips { padding-top: 22px; }
.tip-icon { width: 25px; height: 25px; color: #878890; margin-bottom: 19px; }
.profile-tips h3 { font-size: 18px; font-weight: 500; line-height: 1.8; letter-spacing: -.4px; }
.profile-tips > p { margin-top: 16px; font-size: 12px; color: #92929a; line-height: 1.95; }
.tip-item { display: flex; align-items: baseline; gap: 13px; margin-top: 24px; }
.tip-item > span { font-size: 10px; color: #b0b0b7; }
.tip-item p { font-size: 11px; color: #85858e; line-height: 1.9; }
.history-total { font-size: 12px; color: var(--muted); }
.history-empty { text-align: center; padding: 65px 24px; }
.history-empty-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; margin-bottom: 20px; border-radius: 14px; background: var(--soft); color: #93949d; }
.history-empty-icon .icon { width: 23px; height: 23px; }
.history-empty h3 { font-size: 16px; font-weight: 500; }
.history-empty p { margin: 12px 0 23px; color: var(--muted); font-size: 12px; }
.history-list { display: grid; gap: 18px; }
.history-card { padding: 23px 25px 15px; }
.history-card-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.record-title { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.record-time { display: block; font-size: 10px; color: var(--quiet); margin-top: 6px; }
.record-delete { width: 28px; height: 28px; flex-shrink: 0; }
.record-delete .icon { width: 16px; height: 16px; }
.record-greeting { min-height: 155px; line-height: 1.95; background: #fafafa; border-color: #f2f2f4; }
.history-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
details { border-top: 1px solid var(--line); }
summary { padding: 12px 0 0; cursor: pointer; font-size: 11px; color: var(--quiet); }
.record-jd { padding: 14px 0 3px; font-size: 12px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { width: min(470px, calc(100% - 32px)); max-height: calc(100dvh - 40px); border: 1px solid #e7e7ec; border-radius: 20px; padding: 29px; color: var(--ink); background: #fff; box-shadow: 0 24px 90px #00000024; }
dialog::backdrop { background: #18191d40; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-heading .eyebrow { margin-bottom: 6px; }
dialog h2 { font-size: 21px; font-weight: 550; letter-spacing: -.4px; }
.dialog-description { margin: 15px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.field-help { display: flex; align-items: flex-start; gap: 8px; margin: 17px 0 25px; color: #96969f; font-size: 11px; line-height: 1.85; }
.field-help .icon { width: 14px; height: 14px; margin-top: 3px; }
.full-width { width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 28px; }
.inline-error { padding: 10px 12px; margin: 12px 0; border-radius: 9px; background: #fff4f4; color: #b54343; font-size: 12px; }
.toast { position: fixed; z-index: 50; bottom: 28px; left: calc(50% + var(--sidebar-width) / 2); transform: translateX(-50%); padding: 12px 19px; max-width: min(480px, calc(100% - 32px)); border: 1px solid #e8e8ed; border-radius: 12px; background: #fff; color: #55565d; font-size: 12px; box-shadow: 0 7px 35px #20212312; overflow-wrap: anywhere; }
.toast.error { color: #ad4242; border-color: #f0d8d8; }
.sidebar-collapsed { --sidebar-width: 0px; }
.sidebar-collapsed .sidebar { display: none; }

@media (min-width: 1600px) {
  #jd-text { height: 238px; }
}
@media (max-width: 1150px) {
  :root { --sidebar-width: 220px; }
  .view { padding-left: 30px; padding-right: 30px; }
  .profile-layout { grid-template-columns: minmax(0, 1fr); }
  .profile-tips { display: none; }
}
@media (max-width: 800px) {
  :root { --sidebar-width: 190px; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .brand { gap: 9px; }
  .brand-wordmark { font-size: 20px; }
  .view { padding-left: 22px; padding-right: 22px; }
  #generate-form { padding: 20px; }
  .generate-button { padding: 10px 12px; gap: 9px; font-size: 11px; }
}
@media (max-width: 640px) {
  :root { --sidebar-width: 0px; }
  .sidebar, .sidebar-collapsed .sidebar { position: relative; inset: auto; display: block; width: 100%; padding: 15px 16px 10px; border-right: 0; border-bottom: 1px solid #eeeef1; background: #fafafa; }
  .brand-mark { width: 27px; height: 34px; }
  .brand-mark img { width: 56px; height: 56px; left: -14px; top: -5px; }
  .brand { gap: 10px; }
  .brand-wordmark { font-size: 19px; }
  nav { display: flex; gap: 5px; }
  .sidebar-bottom { display: none; }
  .nav-item { flex: 1; justify-content: center; min-height: 38px; padding: 8px 7px; gap: 6px; font-size: 11px; border-radius: 8px; }
  .nav-item .icon { width: 16px; height: 16px; }
  .nav-count { min-width: auto; font-size: 9px; padding: 0; margin-left: 0; }
  main { margin-left: 0; min-height: calc(100dvh - 112px); }
  #breadcrumb { font-size: 10px; color: #9999a1; font-weight: 400; }
  #toggle-sidebar { display: none; }
  .view { padding: 0 18px 24px; }
  #generate-form { padding: 17px 17px 15px; }
  #job-title { font-size: 13px; }
  #jd-text { height: 190px; min-height: 155px; font-size: 13px; }
  .field-footer { font-size: 9px; gap: 5px; }
  .generate-button { padding: 9px 12px; min-height: 37px; gap: 9px; font-size: 11px; }
  .card-heading h2 { font-size: 13px; }
  .output-bottom { font-size: 9px; }
  .secondary-view { padding-top: 23px; }
  .secondary-view .page-heading { margin-bottom: 24px; }
  .secondary-view .page-heading h1 { font-size: 25px; }
  .secondary-view .page-heading p { font-size: 11px; }
  .eyebrow { font-size: 10px; }
  .profile-card { padding: 18px; border-radius: 15px; }
  .two-fields { grid-template-columns: 1fr; gap: 0; }
  .profile-actions { align-items: flex-start; flex-direction: column; }
  #save-profile { width: 100%; }
  label { font-size: 11px; }
  .optional { font-size: 9px; margin-left: 5px; }
  .history-card { padding: 18px 17px 12px; border-radius: 15px; }
  .history-total { font-size: 10px; }
  .history-empty { padding: 45px 18px; }
  .history-empty p { font-size: 11px; }
  dialog { padding: 23px; border-radius: 17px; }
  .toast { bottom: 18px; font-size: 11px; width: max-content; }
}
@media (max-width: 370px) {
  .view { padding-left: 12px; padding-right: 12px; }
  .generate-button { padding: 9px 10px; gap: 6px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
