.fw {
  min-width: 0;
  color: var(--ink);
  --fw-warning: #805018;
  --fw-error: #a0392c;
}
.fw, .fw input, .fw select, .fw textarea { letter-spacing: 0; }
.fw [hidden] { display: none !important; }
.fw h1 { font-size: 24px; }
.fw h2 { font-size: 17px; }
.fw h3 { margin: 22px 0 12px; font-size: 14px; }
.fw p { max-width: 75ch; }
.fw .page-head { gap: 16px; margin-bottom: 20px; }
.fw .page-head .actions { flex-shrink: 0; }
.fw .page-head h1:focus { outline: none; }
.fw-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 22px; }
.fw-tabs [role=tab] { min-height: 44px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 16px; color: #526171; background: transparent; }
.fw-tabs [role=tab]:hover { background: var(--surface); color: var(--ink); }
.fw-tabs [aria-selected=true] { border-bottom-color: var(--blue); color: var(--blue); font-weight: 600; }
.fw-tabs [role=tab]:focus-visible { outline-offset: -3px; }
.fw-subtabs { margin-top: -8px; margin-bottom: 18px; }
.fw-subtabs [role=tab] { padding: 8px 12px; font-size: 13px; }
.fw-rule-group { min-width: 0; margin: 0 0 24px; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); }
.fw-rule-group legend { padding: 0 12px 0 0; color: var(--ink); font-size: 16px; font-weight: 600; }
.fw-rule-group .fw-note { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.fw-rule-group .fw-formula { margin: 10px 0 0; padding-bottom: 0; }
.fw-rules-workspace { min-width: 0; container-type: inline-size; }
.fw-rules-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 28px; align-items: start; }
.fw-rules-main, .fw-rule-chat { min-width: 0; }
.fw-rules-main .fw-filter { margin-top: 0; }
.fw-rule-chat { padding-top: 22px; border-top: 1px solid var(--line); }
.fw-rule-chat .toolbar { gap: 12px; margin-bottom: 8px; }
.fw-rule-chat [data-chat-status] { margin: 12px 0; color: #3d5069; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.fw-chat-messages { max-height: 520px; min-height: 80px; overflow: auto; overscroll-behavior: contain; margin: 14px 0 18px; padding: 0 12px 0 0; border-block: 1px solid var(--line); scrollbar-gutter: stable; }
.fw-chat-messages:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.fw-chat-message { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fw-chat-message:last-child { border-bottom: 0; }
.fw-chat-message header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; }
.fw-chat-message header strong { font-size: 13px; }
.fw-chat-message header > span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fw-chat-message p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; }
.fw-chat-proposal { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.fw-chat-proposal > span { min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.fw-rule-chat form { display: grid; gap: 14px; }
.fw-rule-chat .fw-check, .fw-rule-chat .fw-help, .fw-rule-chat .form-footer, .fw-rule-chat .fw-form-error { margin: 0; }
.fw-rule-chat .fw-help { overflow-wrap: anywhere; }
.fw-rule-chat .fw-check { min-height: 44px; align-items: flex-start; }
.fw-rule-chat .form-footer { padding-top: 0; border: 0; }
.fw-selection-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 18px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fw-selection-bar .fw-check { min-height: 44px; align-items: center; margin: 0; }
.fw-selection-bar .fw-check input { margin: 0; }
.fw-selection-bar [role=status] { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.fw-defaults { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.fw-defaults p { margin: 0; color: #3d5069; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.fw button span { min-width: 0; overflow-wrap: anywhere; }
@container (min-width: 1180px) {
  .fw-rules-layout { grid-template-columns: minmax(0,1fr) minmax(350px,0.48fr); gap: 24px; }
  .fw-rule-chat { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 24px; }
}
.fw-section { min-width: 0; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.fw-section:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.fw-section > h2 { margin-bottom: 16px; }
.fw-section > h2 + .fw-meta { margin-top: 0; }
.fw-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 22px; max-width: 1000px; }
.fw-full { grid-column: 1 / -1; }
.fw form { min-width: 0; }
.fw textarea { width: 100%; min-width: 0; min-height: 76px; padding: 9px 10px; border: 1px solid #b9c5d2; border-radius: 4px; color: var(--ink); background: var(--white); font: inherit; line-height: 1.6; resize: vertical; caret-color: var(--blue); }
.fw textarea:hover { border-color: #899bae; }
.fw textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.fw input, .fw textarea, .fw select { scroll-margin-block: 28px; }
.fw input[type=radio] { width: 18px; height: 18px; min-height: 0; margin: 0; flex-shrink: 0; accent-color: var(--blue); }
.fw-check { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 0; color: var(--ink); max-width: 85ch; }
.fw-check input { margin-top: 2px; }
.fw-choice { display: flex; flex-wrap: wrap; gap: 14px 24px; margin: 0; padding: 0; border: 0; }
.fw-choice legend { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.fw-choice label { display: flex; align-items: center; gap: 8px; color: var(--ink); min-height: 40px; }
.fw-filter, .fw-upload { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.fw-filter label { flex: 1 1 145px; }
.fw-filter label:has(input[type=search]) { flex: 2 1 220px; }
.fw-filter .fw-form-error, .fw-upload .fw-form-error { width: 100%; }
.fw-upload > label { flex: 1 1 280px; }
.fw-upload input[type=file] { padding: 6px; }
.fw-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px 26px; margin: 18px 0 22px; }
.fw-meta > div { min-width: 0; }
.fw-meta dt { color: var(--muted); font-size: 12px; line-height: 1.5; }
.fw-meta dd { margin: 5px 0 0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.fw-number { font-variant-numeric: tabular-nums; font-family: var(--sans); white-space: normal; overflow-wrap: anywhere; }
.fw-total-separator { color: var(--muted); }
.fw-emphasis { font-weight: 600; }
.fw-block { display: block; margin-top: 5px; }
.fw-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.fw-unknown { color: #606b78; font-weight: 400; }
.fw-note { margin: 16px 0; padding: 12px 0; border-block: 1px solid var(--line); color: #3d5069; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.fw-note.warning { color: var(--fw-warning); }
.fw-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.fw-calculation { min-height: 70px; margin: 20px 0; padding: 15px 0; border-block: 1px solid var(--line); color: #3d5069; font-size: 13px; }
.fw-calculation .fw-meta { margin: 0; }
.fw-formula { padding: 14px 0; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; color: #34465e; }
.fw-status { display: inline-flex; align-items: center; max-width: 100%; padding: 2px 7px; border-radius: 3px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.fw-status.neutral { color: #526171; background: #edf0f4; }
.fw-status.info { color: #214bb1; background: #eef3fe; }
.fw-status.warning { color: #805018; background: #fff4dc; }
.fw-status.success { color: #116a70; background: #e8f4f3; }
.fw-error { margin: 18px 0; padding: 16px; border: 1px solid #edc4bb; border-radius: 4px; color: var(--fw-error); background: #fff8f6; overflow-wrap: anywhere; }
.fw-error p { margin: 8px 0 12px; }
.fw-error h1, .fw-error h2 { color: var(--fw-error); font-size: 17px; }
.fw-form-error { margin-top: 12px; color: var(--fw-error); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.fw-form-error:empty { display: none; }
.fw-error:focus-visible, .fw-form-error:focus-visible { outline: 2px solid var(--fw-error); outline-offset: 3px; }
.fw-empty { padding: 26px 0; border-top: 1px solid var(--line); }
.fw-empty h2 { color: var(--muted); font-size: 15px; }
.fw-empty p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.fw .fw-table-wrap { max-height: 680px; overscroll-behavior: contain; }
.fw table { min-width: 820px; }
.fw table th { position: sticky; top: 0; z-index: 1; }
.fw th, .fw td { padding: 11px 12px; }
.fw td { font-family: var(--sans); font-variant-numeric: tabular-nums; vertical-align: top; }
.fw td .fw-cell-value { min-width: 0; max-width: 330px; overflow-wrap: anywhere; }
.fw td .fw-cell-value > button { margin: 4px 4px 0 0; }
.fw td:has(.fw-number) .fw-cell-value { text-align: right; }
.fw th { white-space: normal; min-width: 90px; }
.fw-cell-label { display: none; }
.fw-action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.fw-details { margin: 0; padding: 14px 0 18px; border-bottom: 1px solid var(--line); }
.fw-details summary { display: list-item; cursor: pointer; padding: 9px 0; min-height: 44px; color: #34465e; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.fw-details summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.fw-findings { margin: 0; padding-left: 22px; }
.fw-findings li { padding: 8px 0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.fw-employee-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; padding: 0; margin: 0; border: 0; }
.fw-employee-choice { display: flex; gap: 12px; align-items: flex-start; min-height: 75px; padding: 15px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.fw-employee-choice input { margin-top: 3px; }
.fw-employee-choice > span { min-width: 0; overflow-wrap: anywhere; }
.fw-loading { display: grid; gap: 18px; min-height: 250px; padding-block: 20px; color: var(--muted); font-size: 13px; }
.fw-loading > div { height: 32px; border-radius: 3px; background: #edf1f6; }
.fw-loading > div:nth-last-child(2) { width: 85%; }
.fw-loading > div:last-child { width: 65%; }
.fw-modal { width: 820px; }
.fw-modal .modal-head h2 { font-size: 19px; }
.fw-modal .fw-meta { margin-top: 4px; }
.fw-modal .fw-scroll-table { min-width: 580px; }
.fw-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.fw ::selection { background: #dde7fd; color: var(--ink); }
.fw * { scrollbar-color: #aab7c6 var(--surface); scrollbar-width: thin; }
@media (max-width: 1050px) {
  .fw .page-head { align-items: flex-start; }
  .fw .page-head .actions { flex-shrink: 1; }
}
@media (max-width: 760px) {
  .fw h1 { font-size: 22px; }
  .fw .page-head { flex-wrap: wrap; }
  .fw .page-head .actions { width: 100%; }
  .fw-tabs { gap: 0; }
  .fw-tabs [role=tab] { flex: 1 1 auto; padding-inline: 10px; }
  .fw-form-grid, .fw-meta, .fw-employee-list { grid-template-columns: minmax(0,1fr); }
  .fw-form-grid { gap: 16px; }
  .fw-meta { gap: 14px; }
  .fw-filter > label { flex-basis: calc(50% - 6px); }
  .fw-filter > label:has(input[type=search]) { flex-basis: 100%; }
  .fw-section { margin-top: 24px; padding-top: 20px; }
  .fw .form-footer { justify-content: flex-start; }
  .fw button { min-height: 44px; }
  .fw .icon { width: 44px; height: 44px; flex-basis: 44px; }
  .fw .fw-responsive { display: block; min-width: 0; width: 100%; }
  .fw-responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .fw .fw-responsive tbody { display: block; width: 100%; }
  .fw .fw-responsive tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .fw .fw-responsive tr:last-child { border-bottom: 0; }
  .fw .fw-responsive td { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 12px; width: 100%; border: 0; padding: 6px 0; white-space: normal; font-size: 13px; }
  .fw-responsive .fw-cell-label { display: block; color: var(--muted); font-size: 12px; line-height: 1.7; }
  .fw .fw-responsive td .fw-cell-value { max-width: none; }
  .fw-responsive .fw-number { white-space: normal; }
  .fw .fw-scroll-table { min-width: 700px; }
  .fw .fw-scroll-table th { white-space: normal; }
  .fw .pager { font-family: var(--sans); }
  .fw-choice { display: grid; gap: 4px; }
  .fw-action-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .fw-action-row button { padding-inline: 9px; }
  .fw-modal { padding: 20px 16px; }
}
@media (max-width: 380px) {
  .fw-filter > label { flex-basis: 100%; }
  .fw .fw-responsive td { grid-template-columns: 85px minmax(0,1fr); gap: 9px; }
  .fw-action-row { grid-template-columns: minmax(0,1fr); }
  .fw .form-footer > button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .fw button, .fw input, .fw textarea, .fw select { transition: none; }
}
