/* Overtime 2, printout details, tax calculation and the printed timesheet.
   Shared by every calculator page; matches the page's own colors. */

/* ── Settings: rate, Overtime 1, Overtime 2 ── */
.settings-bar.wh-set { display: block !important; padding: 4px 14px !important; }
.wh-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; }
.wh-row + .wh-row { border-top: 1px solid #d6d6d6; }
.wh-lab { font-size: 14px; color: #222; min-width: 86px; }
.wh-mut { color: #555; font-size: 14px; }
.wh-head { display: flex; align-items: center; gap: 8px; }
.wh-rest { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wh-rest input[type="number"] { background: #fff; border: 1px solid #1b4180; border-radius: 2px; padding: 5px 8px; font-size: 14px; }
.wh-mult { display: inline-flex; border: 1px solid #1b4180; border-radius: 2px; overflow: hidden; }
.wh-mult button { border: 0; padding: 5px 9px; font: 700 12.5px Arial, Helvetica, sans-serif; background: #fff; color: #1b4180; cursor: pointer; }
.wh-mult button + button { border-left: 1px solid #1b4180; }
.wh-mult button.on { background: #1b4180; color: #fff; }
.wh-mult button:focus-visible { outline: 2px solid #4e7a2c; outline-offset: 1px; }
.total-label.ot2-color { color: #9A3412; }

/* ── Panels (details, tax) ── */
.wh-panel { border: 1px solid #bbb; background: #fff; margin-bottom: 12px; }
.wh-panel.tax { margin: 14px 0 0; }
.wh-ph { width: 100%; background: #eee; border: 0; padding: 10px 14px; display: flex; align-items: center; gap: 10px; text-align: left;
  font: 700 14.5px Arial, Helvetica, sans-serif; color: #113263; cursor: pointer; }
.wh-panel.open .wh-ph { border-bottom: 1px solid #bbb; }
.wh-ph small { font-weight: 400; color: #555; font-size: 12.5px; }
.wh-ph .chev { margin-left: auto; color: #406595; transition: transform .15s; }
.wh-panel.open .wh-ph .chev { transform: rotate(180deg); }
.wh-body { display: none; }
.wh-panel.open .wh-body { display: block; }
.wh-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 14px; padding: 12px 14px; }
.wh-f label { display: block; font-size: 12.5px; color: #444; margin-bottom: 3px; }
.wh-f input, .wh-f select { width: 100%; background: #fff; border: 1px solid #1b4180; border-radius: 2px; padding: 6px 8px; font-size: 14px; font-family: inherit; color: #222; min-height: 32px; }
.wh-f.full { grid-column: 1 / -1; }
.wh-f input:focus, .wh-f select:focus { outline: none; border-color: #4e7a2c; box-shadow: 0 0 0 2px rgba(78,122,44,.2); }
.wh-hint { padding: 0 14px 10px; font-size: 12px; color: #64748B; line-height: 1.45; }
.day-label .wh-date { display: block; font-size: 11px; color: #64748B; font-weight: 400; }

/* Tax panel header holds a switch instead of a chevron. */
.wh-taxhead { display: flex; align-items: center; gap: 10px; background: #eee; padding: 10px 14px; }
.wh-panel.open .wh-taxhead { border-bottom: 1px solid #bbb; }
.wh-taxhead .t { font: 700 14.5px Arial, Helvetica, sans-serif; color: #113263; }
.wh-taxhead small { color: #555; font-size: 12.5px; }
.wh-taxhead .toggle-switch { margin-left: auto; flex: none; }
.wh-off { padding: 10px 14px; font-size: 13px; color: #555; }
.wh-panel.open .wh-off { display: none; }
.wh-more { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid #E5E7EB; border-bottom: 1px solid #E5E7EB;
  padding: 9px 14px; font: 13.5px Arial, Helvetica, sans-serif; color: #1a52a8; cursor: pointer; }
.wh-moregrid { display: none; }
.wh-moregrid.open { display: grid; }
.wh-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #222; }
.wh-check input { width: 18px; height: 18px; min-height: 0; }
.wh-res { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.wh-res td { padding: 8px 14px; border-bottom: 1px solid #E5E7EB; }
.wh-res td.v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-res td.m { color: #B91C1C; }
.wh-res small { color: #64748B; font-size: 12px; }
.wh-res tr.net td { background: #EEF6E6; font-weight: 700; font-size: 17px; color: #3f6623; border-bottom: none; }
.wh-res tr.net small { color: #3f6623; font-weight: 400; }
.wh-note { padding: 10px 14px; font-size: 12.5px; color: #44526A; line-height: 1.45; border-top: 1px solid #E5E7EB; }
.wh-note b { color: #113263; }
.wh-warn { padding: 10px 14px; font-size: 13px; color: #92400E; background: #FFFBEB; border-top: 1px solid #FDE68A; }
.wh-src { padding: 0 14px 10px; font-size: 11.5px; color: #64748B; line-height: 1.45; }

@media (max-width: 600px) {
  .wh-grid { grid-template-columns: 1fr 1fr; }
  .wh-row.ot { display: block; }
  .wh-rest { margin-top: 6px; }
  .wh-lab { min-width: 0; }
  .wh-ph, .wh-taxhead { flex-wrap: wrap; row-gap: 2px; }
  .wh-ph small, .wh-taxhead small { order: 3; flex-basis: 100%; }
}

/* ── Printed timesheet ── */
#whPrint { display: none; }
@media print {
  /* No fixed paper size: the printer's own paper (Letter or A4) is used. */
  @page { margin: 0.5in 0.55in; }
  body > *:not(#whPrint) { display: none !important; }
  body { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  #whPrint { display: block !important; font-family: Arial, Helvetica, sans-serif; color: #1E2838; font-size: 10pt;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#whPrint .p-top { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid #113263; padding-bottom: 8px; }
#whPrint h1 { font-size: 22pt; color: #113263; margin: 0; letter-spacing: -.3px; }
#whPrint .p-wk { font-size: 10.5pt; color: #44526A; margin-top: 3px; }
#whPrint .p-r { text-align: right; font-size: 8.5pt; color: #64748B; line-height: 1.5; }
#whPrint .p-who { display: flex; margin-top: 12px; border: 1px solid #CBD5E1; }
#whPrint .p-who div { flex: 1; padding: 6px 9px; border-left: 1px solid #CBD5E1; }
#whPrint .p-who div:first-child { border-left: 0; }
#whPrint .p-who small { display: block; font-size: 7pt; text-transform: uppercase; letter-spacing: .5px; color: #64748B; margin-bottom: 2px; }
#whPrint .p-who b { font-size: 10.5pt; }
#whPrint table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#whPrint .p-t { margin-top: 14px; }
#whPrint .p-t th { background: #113263; color: #fff; font-size: 7.5pt; text-transform: uppercase; letter-spacing: .4px; padding: 6px 7px; text-align: right; }
#whPrint .p-t td { padding: 6px 7px; border-bottom: 1px solid #E2E8F0; text-align: right; }
#whPrint .p-t th.l, #whPrint .p-t td.l { text-align: left; }
#whPrint .p-t tr:nth-child(even) td { background: #F6F8FB; }
#whPrint .p-t td.d { font-weight: 700; color: #113263; }
#whPrint .p-t td.o1 { color: #B45309; } #whPrint .p-t td.o2 { color: #9A3412; } #whPrint .p-t td.z { color: #CBD5E1; }
#whPrint .p-t tr.tot td { background: #EEF2F7; font-weight: 700; border-top: 2px solid #113263; border-bottom: none; }
#whPrint .p-small { font-size: 7.5pt; color: #64748B; margin-top: 5px; }
#whPrint .p-two { display: flex; gap: 14px; margin-top: 16px; align-items: flex-start; }
#whPrint .p-box { flex: 1; border: 1px solid #CBD5E1; break-inside: avoid; }
#whPrint .p-box h3 { margin: 0; background: #406595; color: #fff; font-size: 8pt; text-transform: uppercase; letter-spacing: .5px; padding: 5px 9px; }
#whPrint .p-box h3 span { text-transform: none; letter-spacing: 0; font-weight: 400; }
#whPrint .p-box td { padding: 5px 9px; border-bottom: 1px solid #E2E8F0; text-align: right; }
#whPrint .p-box td:first-child { text-align: left; }
#whPrint .p-box td.m { color: #B91C1C; }
#whPrint .p-box small { color: #64748B; font-size: 7.5pt; }
#whPrint .p-box tr.big td { font-size: 12pt; font-weight: 700; color: #3f6623; background: #EEF6E6; border-bottom: none; }
#whPrint .p-notes { margin-top: 14px; border: 1px solid #CBD5E1; padding: 7px 9px; font-size: 9.5pt; break-inside: avoid; }
#whPrint .p-notes small { display: block; font-size: 7pt; text-transform: uppercase; letter-spacing: .5px; color: #64748B; margin-bottom: 2px; }
#whPrint .p-sig { display: flex; gap: 34px; margin-top: 34px; break-inside: avoid; }
#whPrint .p-sig div { flex: 1; border-top: 1px solid #1E2838; padding-top: 4px; font-size: 8pt; color: #64748B; display: flex; justify-content: space-between; }
#whPrint .p-foot { margin-top: 22px; border-top: 1px solid #E2E8F0; padding-top: 6px; display: flex; justify-content: space-between; font-size: 7.5pt; color: #94A3B8; }
#whPrint .p-foot b { color: #113263; }

/* State form questions (built from each state's own withholding form). */
#wh_stateQs { border-top: 1px dashed #d6d6d6; padding-top: 10px; margin-top: -2px; }
.wh-sqhead { font-size: 12.5px; font-weight: 700; color: #113263; text-transform: uppercase; letter-spacing: .4px; }
.wh-qhint { font-size: 11.5px; color: #64748B; margin-top: 3px; line-height: 1.35; }

/* Tax results: sections, disclaimer, overtime after tax. */
.wh-res tr.sec td { background: #F4F7FA; font-size: 11.5px; font-weight: 700; color: #44526A; text-transform: uppercase; letter-spacing: .4px; padding: 6px 14px; }
.wh-res tr.sub td { font-weight: 700; }
.wh-disclaimer { margin: 10px 14px 0; padding: 9px 12px; background: #F1F5F9; border-left: 3px solid #406595; font-size: 12.5px; color: #334155; line-height: 1.45; }
.wh-disclaimer b { color: #113263; }
.wh-otbox { margin: 12px 14px; border: 1px solid #F5D0A9; background: #FFF7ED; border-radius: 4px; padding: 10px 12px; }
.wh-otbox .t { font-weight: 700; color: #9A3412; font-size: 14px; margin-bottom: 6px; }
.wh-otbox table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.wh-otbox td { padding: 3px 0; }
.wh-otbox td + td { text-align: right; white-space: nowrap; }
.wh-otbox td.m { color: #B91C1C; }
.wh-otbox small { color: #64748B; font-size: 12px; }
.wh-otbox tr.k td { font-weight: 700; color: #3f6623; }
.wh-otbox p { font-size: 12px; color: #44526A; margin: 6px 0 0; line-height: 1.45; }
#whPrint .p-box td.est { font-size: 7pt; color: #64748B; text-align: left; border-bottom: none; }


/* ── Fixes after the Nov 24 test ── */
/* A time or limit the calculator cannot use. */
.time-input.invalid, .wh-rest input.invalid { outline: 2px solid #B91C1C; outline-offset: 1px; border-radius: 2px; }
.wh-inline-warn { flex-basis: 100%; font-size: 12.5px; color: #B91C1C; }

/* Keyboard users can see which switch they are on. */
.toggle-switch input:focus-visible + .toggle-track { outline: 2px solid #113263; outline-offset: 2px; }
.ampm-pill:focus-visible, .del-btn:focus-visible, .wh-ph:focus-visible, .wh-more:focus-visible { outline: 2px solid #113263; outline-offset: 1px; }

/* "You worked over 40 hours" hint under the totals. */
.wh-othint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; background: #FFFBEB; border-top: 1px solid #FDE68A; font-size: 13.5px; color: #78350F; line-height: 1.4; }
.wh-othint span { flex: 1 1 260px; }
.wh-btn { border: 0; border-radius: 3px; background: #4e7a2c; color: #fff; font: 700 13px Arial, Helvetica, sans-serif; padding: 7px 12px; cursor: pointer; }
.wh-btn:hover { background: #3f6623; }
.wh-linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: #1a52a8; text-decoration: underline; cursor: pointer; }

/* Small phones: keep "/hr" on the same line as its box. */
@supports not (zoom: 1) {
@media (max-width: 380px) {
  #hourlyRate, #otRate, #ot2Rate { width: calc(7ch + 18px) !important; }
  .wh-set select { padding-left: 4px !important; padding-right: 2px !important; }
  .wh-rest input[type="number"] { padding-left: 6px; padding-right: 4px; }
  .wh-rest { gap: 4px; }
  #otThreshold, #ot2Threshold { width: 46px !important; }
  .wh-rest .wh-mut { font-size: 13px; }
}
}

/* Phones: the feedback button sits at the end of the page instead of
   floating over the numbers. */
@media (max-width: 600px) {
  .feedback-fab { position: static !important; display: block !important; width: calc(100% - 28px); max-width: 340px; margin: 0 auto 28px; padding: 11px 14px !important; opacity: 1 !important; font-size: 0; text-align: center; }
  .feedback-fab::before { content: '\2709  Feedback / Report Issue' !important; font-size: 14px !important; }
}

/* Printed timesheet: header on every page, weekly subtotals, summary and
   signatures kept together, tighter rows on long sheets. */
#whPrint { padding-right: 1px; }
#whPrint .p-who, #whPrint .p-box, #whPrint .p-notes { box-sizing: border-box; }
#whPrint .p-t thead { display: table-header-group; }
#whPrint .p-t tr { break-inside: avoid; }
#whPrint .p-t tr.wk td { background: #F1F5F9 !important; font-weight: 700; color: #113263; border-bottom: 1px solid #94A3B8; }
#whPrint .p-sum { break-inside: avoid; }
#whPrint .p-sum .p-two:first-child { margin-top: 16px; }
#whPrint.dense .p-t td { padding: 4px 7px; }
#whPrint.dense .p-t th { padding: 5px 7px; }
#whPrint.dense .p-who { margin-top: 9px; }
#whPrint.dense .p-t { margin-top: 10px; }
#whPrint.dense .p-two { margin-top: 10px; }
#whPrint.dense .p-notes { margin-top: 10px; }
#whPrint.dense .p-sig { margin-top: 26px; }
#whPrint.dense .p-foot { margin-top: 14px; }

/* ── Phones (24 Nov): one layout that shrinks in proportion ── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
.wh-f, .wh-grid > * { min-width: 0; }
/* iPhone date boxes like to grow wider than their column. */
.wh-f input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
/* The "two jobs" tick box sits beside its words. */
.wh-f label.wh-check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 0; line-height: 1.35; }
.wh-f label.wh-check input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; }

/* Text in boxes is 16px on touch screens (smaller text makes iPhones zoom
   the page in when a box is tapped). */
@media (pointer: coarse), (max-width: 600px) {
  input[type="text"], input[type="number"], input[type="email"], input[type="date"], input:not([type]), select, textarea { font-size: 16px !important; }
  .time-input { width: 54px; padding: 4px 2px; }
  .wh-f input, .wh-f select { min-height: 38px; }
}

/* The phone layout, drawn for a 390px-wide screen. AM/PM sits beside the
   time. Every column has fixed room so nothing is clipped. */
@media (max-width: 600px) {
  .col-headers, .entry-row { grid-template-columns: 44px 1fr 1fr 50px 62px 26px; padding-left: 6px; padding-right: 6px; }
  .time-cell { flex-direction: row; align-items: center; padding: 0; gap: 3px; }
  .time-input { width: 54px; }
  .ampm-pill { width: auto; min-width: 28px; font-size: 11px; padding: 5px 4px; }
  .break-cell { padding: 0 2px; }
  .break-input { padding: 4px 1px; }
  .hours-cell { font-size: 13px; padding: 0 1px; }
  .hrs-dec { font-size: 10px; }
  .day-label { font-size: 13px; overflow: visible; text-overflow: clip; padding-right: 0; }
  .day-label .wh-date { font-size: 10.5px; white-space: nowrap; }
  .del-btn { width: 26px; height: 30px; }
  .col-headers span { font-size: 10.5px; letter-spacing: 0; }
  /* Tax lines: the small grey note goes on its own line. */
  .wh-res td { padding-left: 12px; padding-right: 12px; }
  .wh-res td small, .wh-otbox td small { display: block; margin-top: 1px; }
  .wh-res tr.net td { font-size: 16px; }
}
/* Question boxes go one per line so long choices show in full. */
@media (max-width: 480px) {
  .wh-grid, .wh-moregrid.open { grid-template-columns: 1fr; }
}

/* Narrower than 390px: the whole calculator shrinks in proportion, so a
   small phone shows exactly the same layout, just smaller. */
@supports (zoom: 1) {
  :root { --wh-z: 1; }
  @media (max-width: 389px) { :root { --wh-z: 0.9733; } }
  @media (max-width: 379px) { :root { --wh-z: 0.9465; } }
  @media (max-width: 369px) { :root { --wh-z: 0.9198; } }
  @media (max-width: 359px) { :root { --wh-z: 0.8930; } }
  @media (max-width: 349px) { :root { --wh-z: 0.8663; } }
  @media (max-width: 339px) { :root { --wh-z: 0.8396; } }
  @media (max-width: 329px) { :root { --wh-z: 0.8128; } }
  @media (max-width: 319px) { :root { --wh-z: 0.7861; } }
  @media (max-width: 309px) { :root { --wh-z: 0.7594; } }
  @media (max-width: 299px) { :root { --wh-z: 0.7326; } }
  @media (max-width: 289px) { :root { --wh-z: 0.7059; } }
  @media (max-width: 279px) { :root { --wh-z: 0.6791; } }
  @media (max-width: 269px) { :root { --wh-z: 0.6524; } }
  @media (max-width: 259px) { :root { --wh-z: 0.6257; } }
  @media (max-width: 249px) { :root { --wh-z: 0.5989; } }
  @media (max-width: 389px) {
    .calc-bar, .settings-bar, .wh-panel, .card, .actions, .app-banner, .modal { zoom: var(--wh-z); }
  }
}

/* Old browsers without "zoom": slimmer columns instead, and on very narrow
   screens AM/PM goes under the time. */
@supports not (zoom: 1) {
  @media (max-width: 389px) {
    .col-headers, .entry-row { grid-template-columns: 40px 1fr 1fr 44px 56px 22px; padding-left: 5px; padding-right: 5px; }
    .time-cell { gap: 2px; padding: 0 2px; }
    .time-input { flex: 1 1 0; width: auto; min-width: 46px; max-width: 56px; }
    .ampm-pill { min-width: 24px; font-size: 10.5px; padding: 5px 2px; }
    .day-label .wh-date { font-size: 10px; }
    .del-btn { width: 22px; height: 28px; }
    .wh-set .wh-row:first-child { flex-wrap: nowrap; }
    .wh-set .wh-row:first-child #hourlyRate { flex: 1 1 60px; min-width: 56px; width: auto !important; max-width: 110px; padding-left: 6px; padding-right: 6px; }
    .wh-set .wh-row:first-child #currencySelect { flex: none; }
    .wh-set .wh-row:first-child .wh-lab, .wh-set .wh-row:first-child .wh-mut { flex: none; }
  }
  @media (max-width: 359px) {
    .container { padding-left: 6px; padding-right: 6px; }
    .col-headers, .entry-row { grid-template-columns: 36px 1fr 1fr 40px 50px 20px; padding-left: 4px; padding-right: 4px; }
    .time-cell { padding: 0 1px; }
    .time-input { padding-left: 1px; padding-right: 1px; }
    .ampm-pill { min-width: 22px; font-size: 10px; }
    .break-cell { padding: 0 1px; }
    .day-label { font-size: 12.5px; }
    .hours-cell { font-size: 12px; }
    .hrs-dec { font-size: 9.5px; }
    .del-btn { width: 20px; }
    .col-headers span { font-size: 9.5px; }
  }
  @media (max-width: 300px) {
    .col-headers, .entry-row { grid-template-columns: 38px 1fr 1fr 42px 50px 20px; padding-left: 4px; padding-right: 4px; }
    .time-cell { flex-direction: column; align-items: stretch; gap: 2px; padding: 0 1px; }
    .time-input, .ampm-pill { flex: none; width: 100%; max-width: none; }
    .ampm-pill { padding: 4px 2px; }
    .hours-cell { font-size: 11.5px; }
    .hrs-dec { font-size: 9px; }
    #hourlyRate, #otRate, #ot2Rate { width: calc(6ch + 16px) !important; }
    .total-hrs.grand { font-size: 17px; }
    .wh-set .wh-row:first-child { flex-wrap: wrap; }
    .wh-set .wh-row:first-child .wh-lab { flex-basis: 100%; }
    .wh-rest > span.wh-mut:nth-of-type(3) { display: none; }
    .total-row { padding-left: 8px; padding-right: 8px; }
    .total-hrs small { display: none; }
    .total-label { font-size: 12px; }
    .total-right { gap: 6px; }
  }
}

/* 12 hr / 24 hr switch at the end of the hourly rate row. */
.wh-clock { display: inline-flex; margin-left: auto; border: 1px solid #1b4180; border-radius: 2px; overflow: hidden; flex: none; }
.wh-clock button { border: 0; padding: 5px 9px; font: 700 12.5px Arial, Helvetica, sans-serif; background: #fff; color: #1b4180; cursor: pointer; white-space: nowrap; }
.wh-clock button + button { border-left: 1px solid #1b4180; }
.wh-clock button[aria-pressed="true"] { background: #1b4180; color: #fff; }
.wh-clock button:focus-visible { outline: 2px solid #4e7a2c; outline-offset: 1px; }
.wh-timehint { border-top: 1px solid #FCA5A5; background: #FEF2F2; color: #7F1D1D; }
/* 24 hr: no AM/PM buttons. */
.clock24 .ampm-pill { display: none !important; }
@media print { .wh-clock { display: none !important; } }

/* Details for the printout sits just above Print / Save PDF. */
#wh_detailsPanel { margin: 14px 0 12px; }

/* The currency box keeps one width whichever of the 153 currencies is picked. */
#currencySelect { width: 7.2em; max-width: 7.2em; text-overflow: ellipsis; }
