@layer reset, base, layout, components, responsive;
@layer reset {
  * { box-sizing: border-box; }
  body, h1, h2, h3, p { margin: 0; }
  button, input, select, textarea { font: inherit; }
  button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
  button { cursor: pointer; }
  svg { display: block; }
}
@layer base {
  :root { --ink: #202522; --muted: #626a66; --line: #dddfd9; --paper: #fff; --canvas: #f6f6f3; --accent: #215a45; --soft: #eaf0e9; --blue: #245fc7; --warning: #805b10; --danger: #a0352c; --sidebar: 236px; }
  html { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); background: var(--canvas); font-size: 14px; }
  body { min-width: 0; line-height: 1.5; }
  h1, h2, h3 { font-weight: 550; line-height: 1.15; letter-spacing: -.045em; }
  h1 { font-size: clamp(30px, 3vw, 46px); }
  h2 { font-size: 24px; } h3 { font-size: 18px; letter-spacing: -.025em; }
  a { color: var(--accent); text-underline-offset: 3px; }
  button, input, select, textarea, summary { outline-offset: 4px; }
  :focus-visible { outline: 3px solid var(--blue); }
  button:disabled { opacity: .55; cursor: not-allowed; }
  small, .small { font-size: 12px; }
  .muted { color: var(--muted); } .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .icon { width: 18px; height: 18px; flex: 0 0 auto; }
  .skip { position: fixed; top: -100px; left: 16px; padding: 12px; background: white; z-index: 100; }
  .skip:focus { top: 12px; }
  .boot { min-height: 90vh; display: grid; align-content: center; justify-content: center; gap: 20px; }
  .wordmark { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 650; letter-spacing: -.04em; }
  .dot { width: 7px; height: 7px; border-radius: 50%; background: #4b7556; display: inline-block; }
  .number { font-variant-numeric: tabular-nums; }
}
@layer layout {
  .sidebar { width: var(--sidebar); position: fixed; inset: 0 auto 0 0; padding: 30px 18px 18px; background: #eeefe9; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 10; }
  .brand { padding: 0 9px 29px; }
  .brand .small { color: var(--muted); margin-top: 5px; font-size: 11px; letter-spacing: .04em; }
  .project-switch { display: flex; gap: 10px; align-items: center; width: 100%; padding: 12px 10px; background: #f9f9f6; border: 1px solid #d9ddd3; border-radius: 9px; text-align: left; margin-bottom: 32px; }
  .project-switch .initial { display: grid; place-items: center; width: 30px; height: 30px; background: #e0e7da; border-radius: 7px; font-weight: 600; flex-shrink: 0; }
  .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .project-switch .text { flex: 1; min-width: 0; }
  .nav-label { padding-left: 12px; margin-bottom: 10px; }
  .nav { display: grid; gap: 4px; }
  .nav button { border: 0; background: transparent; display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-radius: 7px; color: #555e57; text-align: left; min-height: 43px; }
  .nav button:hover { background: #e5e8df; }
  .nav button.active { background: #dde5d8; color: #274d33; font-weight: 600; }
  .nav .count { margin-left: auto; font-size: 11px; }
  .sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 18px 10px 0; color: var(--muted); }
  .sidebar-footer button { margin-bottom: 16px; }
  .local-state { display: flex; align-items: center; gap: 8px; font-size: 11px; }
  .shell { margin-left: var(--sidebar); }
  .topbar { min-height: 76px; padding: 0 42px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #f9f9f6; }
  .breadcrumb { color: var(--muted); display: flex; align-items: center; gap: 11px; font-size: 12px; }
  .breadcrumb strong { color: var(--ink); font-weight: 500; }
  .topbar-actions { display: flex; align-items: center; gap: 15px; }
  main.workspace { padding: 40px 42px 72px; max-width: 1480px; margin: 0 auto; }
  .page-heading { display: flex; align-items: flex-end; gap: 20px; justify-content: space-between; margin-bottom: 32px; }
  .page-heading .eyebrow { margin-bottom: 10px; }
  .page-heading p { margin-top: 12px; max-width: 660px; color: var(--muted); }
  .heading-actions { display: flex; gap: 9px; flex-wrap: wrap; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 30px; align-items: start; }
  .section { margin-top: 34px; }
  .section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
  .section-title h2 { font-size: 19px; letter-spacing: -.025em; }
  .toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
  .toolbar input { max-width: 340px; background: #fff; }
  .toolbar select { width: auto; max-width: 270px; margin-left: auto; }
  .stack { display: grid; gap: 18px; }
  .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .spread { justify-content: space-between; }
  .library { max-width: 1140px; margin: auto; padding: 36px 40px 70px; }
  .library-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 74px; }
  .library-intro { max-width: 720px; margin: 0 0 50px; }
  .library-intro h1 { font-size: clamp(40px, 5vw, 66px); font-weight: 500; line-height: 1.05; letter-spacing: -.055em; }
  .library-intro h1 span { color: #7a8579; }
  .library-intro p { font-size: 17px; color: var(--muted); max-width: 620px; margin-top: 23px; }
  .product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 20px; }
  .product-tile { text-align: left; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); transition: border-color .15s, transform .15s; min-height: 216px; display: flex; flex-direction: column; gap: 16px; }
  .product-tile:hover { border-color: #849a85; transform: translateY(-2px); }
  .product-tile h2 { font-size: 24px; } .product-tile footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
  .principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; border-top: 1px solid var(--line); padding-top: 28px; margin-top: 64px; }
  .principles h3 { margin: 14px 0 8px; } .principles p { color: var(--muted); font-size: 13px; }
}
@layer components {
  .btn { border: 1px solid var(--line); border-radius: 7px; padding: 10px 16px; min-height: 42px; color: var(--ink); background: white; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; font-weight: 500; font-size: 13px; line-height: 1.35; }
  .btn:hover { background: #f0f3ee; border-color: #b8c4b7; }
  .btn.primary { color: white; background: var(--accent); border-color: var(--accent); }
  .btn.primary:hover { background: #184833; }
  .btn.dark { color: white; background: #262e29; border-color: #262e29; }
  .btn.ghost { background: transparent; border-color: transparent; }
  .btn.compact { min-height: 34px; padding: 6px 10px; font-size: 12px; }
  .btn.icon-only { padding: 10px; }
  .text-btn { color: var(--accent); background: none; border: none; padding: 6px 0; font-size: 13px; font-weight: 500; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
  .text-btn:hover { text-decoration-color: currentColor; }
  .badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: .025em; border-radius: 4px; padding: 4px 7px; font-weight: 600; background: #eef0ed; color: #566156; white-space: nowrap; }
  .badge.green { color: #2c6440; background: #e9f2e7; } .badge.amber { color: #805b10; background: #f9f0dc; } .badge.blue { color: #345e94; background: #eaf0f9; }
  .next-action { background: #e8eee2; border: 1px solid #dbe3d3; border-radius: 12px; padding: 30px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
  .next-action h2 { font-size: 27px; margin: 14px 0 12px; max-width: 660px; }
  .next-action p { color: #556551; max-width: 620px; }
  .next-mark { width: 62px; height: 62px; border-radius: 50%; border: 1px solid #acbea3; display: grid; place-items: center; color: #59774c; margin-left: auto; }
  .next-mark .icon { width: 27px; height: 27px; }
  .next-action .actions { margin-top: 23px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
  .metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 32px 0; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
  .metric { padding-left: 25px; border-left: 1px solid var(--line); }
  .metric:first-child { padding-left: 0; border: 0; } .metric .value { font-size: 31px; letter-spacing: -.05em; font-weight: 500; }
  .metric p { color: var(--muted); font-size: 12px; margin-top: 4px; }
  .panel { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 24px; }
  .panel > p { color: var(--muted); margin-top: 10px; }
  .line-item { border-bottom: 1px solid var(--line); padding: 18px 0; display: flex; align-items: flex-start; gap: 15px; }
  .line-item:first-child { padding-top: 0; } .line-item:last-child { border: 0; }
  .line-item .body { min-width: 0; flex: 1; } .line-item h3 { font-size: 15px; letter-spacing: -.015em; line-height: 1.4; }
  .line-item p { font-size: 13px; color: var(--muted); margin-top: 5px; }
  .item-index { font-size: 11px; color: #777f72; padding-top: 3px; width: 22px; flex-shrink: 0; }
  .empty { border: 1px dashed #cfd4c9; border-radius: 10px; padding: 35px 26px; text-align: center; }
  .empty h3 { margin: 12px 0 8px; } .empty p { color: var(--muted); max-width: 460px; margin: 0 auto 18px; }
  .empty .icon { margin: auto; color: #75896e; width: 25px; height: 25px; }
  .record { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
  .record .record-meta { margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .record h3 { font-size: 20px; margin-bottom: 13px; }
  .record blockquote { margin: 16px 0; padding: 1px 0 1px 17px; border-left: 2px solid #b7c8af; color: #414f40; white-space: pre-wrap; overflow-wrap: anywhere; }
  .record-footer { margin-top: 22px; padding-top: 15px; border-top: 1px solid #edefe9; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  .record details { margin-top: 15px; } summary { cursor: pointer; font-size: 13px; color: var(--accent); padding: 6px 0; }
  .source-link { font-size: 12px; overflow-wrap: anywhere; }
  .notice { padding: 16px 18px; background: #eef1e9; border-radius: 7px; font-size: 13px; color: #485847; line-height: 1.6; }
  .notice.amber { background: #faf2df; color: #75561d; } .notice.blue { background: #edf2f8; color: #405b7c; }
  .notice p + p { margin-top: 10px; }
  .error { color: var(--danger); background: #fbefed; padding: 12px 15px; border-radius: 6px; font-size: 13px; }
  .error:empty { display: none; }
  .field { display: grid; gap: 7px; margin-bottom: 20px; }
  .field label, fieldset legend { font-size: 13px; font-weight: 600; }
  .field .help { font-size: 12px; color: var(--muted); line-height: 1.6; }
  input, textarea, select { width: 100%; padding: 11px 13px; background: #fcfcfa; border: 1px solid #cdd2c8; border-radius: 6px; color: var(--ink); min-width: 0; }
  input::placeholder, textarea::placeholder { color: #7b8278; }
  textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
  input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
  fieldset { border: 0; padding: 0; margin: 0 0 20px; } fieldset legend { padding: 0 0 10px; }
  .check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; padding: 8px 0; cursor: pointer; }
  .check input { margin-top: 3px; }
  .checks { max-height: 230px; overflow: auto; border: 1px solid var(--line); padding: 8px 14px; border-radius: 6px; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
  dialog { width: min(690px, calc(100vw - 32px)); max-height: calc(100dvh - 50px); border: 1px solid #d6dbd0; border-radius: 14px; box-shadow: 0 24px 100px #16230f30; padding: 0; color: var(--ink); }
  dialog::backdrop { background: #151d185e; backdrop-filter: blur(4px); }
  .dialog-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; padding: 28px 30px 20px; }
  .dialog-head h2 { font-size: 25px; margin-top: 5px; }
  .dialog-content { padding: 0 30px 28px; } .dialog-content > p { margin-bottom: 20px; color: var(--muted); }
  #toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 20px; border-radius: 8px; background: #253c2c; color: #fff; box-shadow: 0 5px 25px #1b301530; z-index: 100; max-width: calc(100vw - 32px); font-size: 13px; pointer-events: none; }
  #toast:empty { display: none; }
  .step-rail { display: flex; gap: 7px; margin-bottom: 24px; } .step-rail span { height: 3px; border-radius: 3px; flex: 1; background: #e6e9e1; } .step-rail span.done { background: #56794c; }
  .choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 15px 0 26px; }
  .choice-grid label { padding: 18px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; display: grid; gap: 8px; }
  .choice-grid label:has(input:checked) { border-color: var(--accent); background: #eef3e9; }
  .choice-grid .icon { margin: 8px 0; }
  .journey { border-left: 1px solid #c6d1be; margin: 18px 0 10px 9px; padding: 0 0 0 24px; }
  .journey div { position: relative; margin-bottom: 27px; }
  .journey div::before { content: ''; width: 9px; height: 9px; background: #98af8b; border: 3px solid var(--canvas); border-radius: 50%; position: absolute; left: -32px; top: 4px; box-sizing: content-box; }
  .journey strong { font-size: 13px; font-weight: 550; } .journey p { font-size: 12px; color: var(--muted); margin-top: 4px; }
  .interview-shell { max-width: 1040px; padding: 27px 32px 70px; margin: auto; }
  .interview-top { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .interview-layout { display: grid; grid-template-columns: minmax(0, 650px) 210px; gap: 60px; margin: 48px 0; }
  .interview-main h1 { font-size: clamp(28px, 3.1vw, 39px); line-height: 1.2; margin: 19px 0; letter-spacing: -.04em; }
  .interview-main .guidance { color: var(--muted); line-height: 1.7; margin: 0 0 25px; font-size: 15px; }
  .interview-main textarea { background: #fff; min-height: 220px; font-size: 16px; padding: 20px; border-radius: 9px; }
  .interview-aside { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 9px; }
  .interview-aside h3 { font-size: 14px; margin: 14px 0 8px; }
  .interview-aside p { color: var(--muted); font-size: 12px; line-height: 1.7; }
  .answer-list { margin: 25px 0; } .answer-list .record { margin-bottom: 16px; }
  .save-note { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
  .answer-controls { margin: 18px 0 25px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
  .approval-list { padding-left: 20px; color: #75561d; font-size: 12px; margin: 12px 0 0; }
  .audit-row { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 12px; }
  .blank-art { display: grid; grid-template-columns: repeat(3, 46px); gap: 10px; margin-bottom: 25px; }
  .blank-art span { height: 54px; background: #e6ecdf; border: 1px solid #cfd9c5; border-radius: 5px; }
  .blank-art span:nth-child(2) { transform: translateY(9px); background: #f1f3eb; } .blank-art span:nth-child(3) { background: #d8e4cc; }
  .loading { color: var(--muted); padding: 40px; text-align: center; }
  .scenario { padding: 23px; background: #e8eee2; border: 1px solid #dbe3d3; border-radius: 9px; margin: 20px 0; }
  .scenario p { margin-top: 10px; font-size: 16px; line-height: 1.6; }
  .question-sources { margin: 10px 0 24px; }
  .answer-choices { display: grid; gap: 9px; margin: 12px 0 22px; }
  .answer-choices button { background: #fff; border: 1px solid var(--line); border-radius: 8px; text-align: left; display: flex; align-items: center; gap: 14px; padding: 14px; color: var(--ink); line-height: 1.5; }
  .answer-choices button:hover, .answer-choices button:focus { background: #eef3e9; border-color: #92a685; }
  .answer-choices button span { display: grid; place-items: center; width: 28px; height: 28px; background: #eef1e9; border: 1px solid var(--line); border-radius: 5px; flex-shrink: 0; font-size: 12px; }
  code { background: #eaf0e7; padding: 2px 5px; border-radius: 4px; overflow-wrap: anywhere; }
}
@layer responsive {
  @media (min-width: 1600px) { main.workspace { padding-top: 55px; } }
  @media (max-width: 1100px) { :root { --sidebar: 204px; } .sidebar { padding: 25px 12px 18px; } .topbar { padding: 0 28px; } main.workspace { padding: 32px 28px 64px; } .two-col { grid-template-columns: 1fr; } .next-action h2 { font-size: 25px; } .interview-layout { gap: 30px; } }
  @media (max-width: 760px) {
    .sidebar { position: static; width: 100%; padding: 17px 18px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { padding: 0 0 16px; } .brand .small, .nav-label, .sidebar-footer { display: none; }
    .project-switch { margin: 0 0 12px; padding: 8px; } .nav { display: flex; overflow: auto; gap: 5px; padding-bottom: 5px; }
    .nav button { white-space: nowrap; padding: 9px 12px; min-height: 41px; } .nav .count, .nav .icon { display: none; }
    .shell { margin: 0; } .topbar { min-height: 60px; padding: 10px 20px; } .topbar .save-note { display: none; }
    main.workspace { padding: 28px 20px 50px; } .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 25px; }
    .next-action { padding: 24px; display: block; } .next-mark { display: none; }
    .metrics { grid-template-columns: 1fr 1fr; gap: 23px; } .metric:nth-child(3) { border: 0; padding-left: 0; }
    .toolbar { flex-wrap: wrap; } .toolbar input, .toolbar select { max-width: none; width: 100%; margin: 0; }
    .library { padding: 25px 22px 45px; } .library-header { margin-bottom: 48px; gap: 15px; } .library-header .badge { display: none; }
    .principles { grid-template-columns: 1fr; gap: 25px; } .form-grid { grid-template-columns: 1fr; }
    .dialog-head { padding: 23px 22px 18px; } .dialog-content { padding: 0 22px 24px; }
    .interview-shell { padding: 20px 22px 45px; } .interview-layout { grid-template-columns: 1fr; margin-top: 30px; gap: 20px; }
    .interview-aside { border: 0; margin: 0; padding: 0; } .interview-aside .journey { display: none; }
    .interview-top .badge { display: none; } .answer-controls { align-items: flex-start; flex-direction: column; }
    .record { padding: 20px; } .record-footer { align-items: flex-start; }
    .choice-grid { gap: 7px; } .choice-grid label { padding: 14px 9px; font-size: 12px; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
}
