/* The Benefits page. Layout only: colours and type come from the shared tokens, the frame from the HR page. */
.benefits-page h3 { margin: 26px 0 10px; }
.benefits-page .panel h3 { margin-top: 0; }
.benefits-controls .new-record { margin-top: 0; }
.benefits-card { margin: 16px 0; }
.benefits-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.benefits-head h4 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.benefits-summary { white-space: pre-line; overflow-wrap: anywhere; }
.benefits-window { padding: 16px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.benefits-window:last-child { border-bottom: 0; padding-bottom: 0; }
.benefits-levels { width: 100%; border-collapse: collapse; margin: 12px 0 4px; border: 0; background: none; }
.benefits-levels th, .benefits-levels td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.benefits-levels th { font-size: 12px; font-weight: 500; color: var(--muted); }
.benefits-open { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; }
.benefits-open > div { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.benefits-open small { color: var(--muted); }
.benefits-problem { padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); overflow-wrap: anywhere; }
.benefits-problem ul { margin: 6px 0 0; padding-left: 20px; }
.benefits-history summary { cursor: pointer; padding: 8px 0; color: var(--muted); }
.benefits-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.benefits-level { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.benefits-level label { min-width: 0; }
.benefits-level input { width: 100%; min-width: 0; }
.benefits-request { padding: 16px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.benefits-request:last-child { border-bottom: 0; padding-bottom: 0; }
.benefits-request p { margin: 6px 0; }
.benefits-docs { display: block; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .benefits-level { grid-template-columns: minmax(0, 1fr); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .benefits-open button { width: 100%; }
  .benefits-controls .new-record { width: 100%; }
}
/* Benefits files: the lines a file holds, wide enough to scroll on a small screen. */
.benefits-file-table { overflow-x: auto; margin: 8px 0; }
.benefits-file-table table { border-collapse: collapse; width: 100%; font-size: 0.9em; }
.benefits-file-table th, .benefits-file-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }

/* CL-36: compact Benefits, file reviews and their dialogs at phone widths. */
@media (max-width: 600px) {
  .benefits-page { padding: 12px; min-width: 0; overflow-wrap: anywhere; }
  .benefits-page .page-head { margin-bottom: 12px; }
  .benefits-page .page-head h2 { margin-bottom: 6px; }
  .benefits-page .panel { padding: 12px; margin: 12px 0; min-width: 0; }
  .benefits-page .benefits-controls { gap: 8px; margin: 12px 0; }
  .benefits-page .benefits-controls > * { min-width: 0; max-width: 100%; }
  .benefits-page :is(p,small,.small,.badge,.metric span,th,td,label) { font-size: 14px; }
  .benefits-page .page-head > p { font-size: 14px; }
  .benefits-page :is(button,.btn,summary) { min-height: 44px; min-width: 44px; max-width: 100%; white-space: normal; }
  .benefits-page :is(button,.btn) { font-size: 14px; overflow-wrap: anywhere; }
  .benefits-page :is(select,input) { min-height: 44px; max-width: 100%; font-size: 16px; }
  .benefits-page :is(.benefits-table,.benefits-file-table) { overflow-x: auto; max-width: 100%; }
  .benefits-page .benefits-levels td:not(:first-child) { white-space: nowrap; overflow-wrap: normal; }
  .benefits-page .benefits-levels th { min-width: 7em; }
  .benefits-page .benefits-docs a { display: inline-block; min-height: 44px; padding-block: 10px; }
  body[data-view="benefits"] .dialog { font-size: 14px; overflow-wrap: anywhere; }
  body[data-view="benefits"] .dialog :is(p,small,.small,label,legend) { font-size: 14px; }
  body[data-view="benefits"] .dialog :is(button,label.check) { min-height: 44px; max-width: 100%; white-space: normal; }
  body[data-view="benefits"] .dialog button { min-width: 44px; font-size: 14px; }
  body[data-view="benefits"] .dialog :is(input:not([type=checkbox]),select,textarea) { min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px; }
  body[data-view="benefits"] .dialog input[type=checkbox] { flex-shrink: 0; }
  body[data-view="benefits"] .dialog .benefits-level { grid-template-columns: minmax(0,1fr); }
  body[data-view="benefits"] .toast { font-size: 14px; overflow-wrap: anywhere; }
}
