.tacho-screen { display: grid; gap: 20px; max-width: 1220px; margin: 0 auto; }
.tacho-screen .screen-head { margin: 0; }
.tacho-screen h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.tacho-screen .panel { min-width: 0; padding: 26px; }
.tacho-file-panel,.tacho-upload { scroll-margin-top: 24px; }
.tacho-remote .tacho-panel-head { margin-bottom: 16px; }
.tacho-remote .tacho-panel-head button { flex-shrink: 0; min-height: 42px; }
.tacho-remote-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.tacho-remote-filter { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.tacho-remote-filter select { min-height: 38px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 30px 8px 12px; color: var(--text); background: var(--surface); }
.tacho-remote-list { list-style: none; padding: 0 4px 0 0; margin: 20px 0 0; max-height: 480px; overflow-y: auto; overscroll-behavior: contain; }
.tacho-remote-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,.75fr) auto; gap: 20px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.tacho-remote-name,.tacho-remote-meta { display: grid; gap: 7px; min-width: 0; }
.tacho-remote-name strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.tacho-remote-name > span,.tacho-remote-meta small { color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.tacho-remote-status { justify-self: start; color: var(--muted); font-size: 11px; font-weight: 600; }
.tacho-remote-status.is-ready { color: var(--teal); }
.tacho-remote-status.is-warning { color: #94651d; }
.tacho-remote-row button { min-height: 38px; font-size: 12px; }
.tacho-remote button:disabled,.tacho-remote select:disabled { opacity: .55; cursor: default; }
.tacho-remote-more { display: flex; justify-content: center; padding-top: 18px; border-top: 1px solid var(--line); }
.tacho-remote-hint { margin-top: 16px; }
.tacho-remote-empty { margin: 20px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.tacho-remote .tacho-message { margin-top: 18px; }
.tacho-upload { display: flex; align-items: center; gap: 22px; border: 1px dashed var(--line-strong); background: linear-gradient(115deg,var(--surface),#edf6f4); min-height: 180px; transition: border-color .15s,box-shadow .15s; }
.tacho-upload.is-dragging { border-color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.tacho-upload-icon { flex-shrink: 0; width: 64px; height: 64px; display: grid; place-items: center; color: var(--teal); border: 1px solid #cae4df; border-radius: 18px; background: var(--teal-weak); font-size: 37px; font-weight: 400; }
.tacho-upload-copy { min-width: 0; flex: 1; }
.tacho-upload-copy h2 { overflow-wrap: anywhere; }
.tacho-upload-copy p,.tacho-panel-head p { margin: 8px 0 11px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.tacho-upload-actions { flex-shrink: 0; display: grid; justify-items: center; gap: 10px; }
.tacho-upload-actions > span { color: var(--muted); font-size: 11px; }
.tacho-upload-actions button { min-width: 150px; min-height: 42px; }
.tacho-status { font-size: 12px; color: var(--muted); }
.tacho-status.is-ready { color: var(--teal); }
.tacho-status.is-ready::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--teal); }
.tacho-intro { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; padding: 10px 8px 12px; }
.tacho-intro-number { font-size: 11px; font-weight: 700; color: var(--teal); }
.tacho-intro h3 { font-size: 15px; margin: 12px 0 7px; }
.tacho-intro p,.tacho-copy { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 0; }
.tacho-panel-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 22px; }
.tacho-kicker { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.tacho-identity-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 26px; }
.tacho-identity-grid > div { display: grid; gap: 8px; align-content: start; min-width: 0; }
.tacho-identity-grid span { color: var(--muted); font-size: 11px; }
.tacho-identity-grid strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.tacho-details { margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 12px; }
.tacho-details summary { cursor: pointer; color: var(--muted); }
.tacho-details dl { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 12px; margin: 18px 0 0; }
.tacho-details dt { color: var(--muted); }
.tacho-details dd { margin: 0; overflow-wrap: anywhere; }
.tacho-hash { font-family: ui-monospace,monospace; font-size: 11px; }
.tacho-signature { margin: 22px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.tacho-day { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.tacho-day select { border: 1px solid var(--line-strong); border-radius: 6px; min-height: 38px; padding: 8px 30px 8px 12px; color: var(--text); background: var(--surface); }
.tacho-totals { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; padding-bottom: 25px; }
.tacho-totals.has-unknown { grid-template-columns: repeat(5,minmax(0,1fr)); }
.tacho-totals > div { display: grid; gap: 9px; }
.tacho-totals span { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.tacho-totals strong { font-size: 21px; font-weight: 600; letter-spacing: -.035em; }
.tacho-mode { display: inline-flex; gap: 8px; align-items: center; }
.tacho-totals i,.tacho-mode i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.tacho-drive { background: #267c70; }
.tacho-work { background: #d69939; }
.tacho-available { background: #8271b4; }
.tacho-rest { background: #8bb8c9; }
.tacho-unknown { background: #bec6ca; }
.tacho-timeline { position: relative; height: 34px; border-radius: 4px; overflow: hidden; background: repeating-linear-gradient(135deg,#eef1f2 0,#eef1f2 4px,#e0e6e8 4px,#e0e6e8 5px); }
.tacho-timeline > span { position: absolute; height: 100%; top: 0; border-right: 1px solid rgba(255,255,255,.35); }
.tacho-hours { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin: 8px 0 25px; font-variant-numeric: tabular-nums; }
.tacho-table-scroll { overflow-x: auto; max-height: 500px; }
.tacho-table { width: 100%; min-width: 0; border-collapse: collapse; text-align: left; font-size: 12px; font-variant-numeric: tabular-nums; }
.tacho-table th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tacho-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tacho-table th:first-child,.tacho-table td:first-child { padding-left: 0; }
.tacho-table tbody tr:last-child td { border-bottom: 0; }
.tacho-table small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.tacho-activity .tacho-table { table-layout: fixed; }
.tacho-activity .tacho-table th,.tacho-activity .tacho-table td { padding-left: 8px; padding-right: 8px; white-space: normal; overflow-wrap: break-word; }
.tacho-activity .tacho-table th:first-child,.tacho-activity .tacho-table td:first-child { padding-left: 0; }
.tacho-activity .tacho-table th:nth-child(1),.tacho-activity .tacho-table th:nth-child(2) { width: 17%; }
.tacho-activity .tacho-table th:nth-child(3) { width: 42%; }
.tacho-activity .tacho-table th:nth-child(4) { width: 24%; }
.tacho-message { padding: 16px 20px; border: 1px solid #eed8b4; border-radius: var(--radius); background: #fff8eb; color: #76511b; font-size: 12px; line-height: 1.7; }
.tacho-message p { margin: 0; }
.tacho-message p + p { margin-top: 6px; }
.tacho-message-error { color: var(--red); background: var(--red-weak); border-color: #ebc9c6; }
.tacho-empty-records p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.tacho-footnote { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; }
.tacho-analysis { scroll-margin-top: 24px; }
.tacho-analysis > .tacho-copy { margin-top: 12px; }
.tacho-analysis-trial { flex-shrink: 0; color: #76511b; background: #fff8eb; border: 1px solid #eed8b4; border-radius: 20px; padding: 7px 11px; font-size: 11px; }
.tacho-analysis-controls { display: grid; grid-template-columns: minmax(150px,.65fr) minmax(0,2fr); gap: 24px; align-items: start; }
.tacho-analysis-month { display: grid; gap: 9px; font-size: 12px; color: var(--muted); }
.tacho-analysis-month input { min-height: 40px; min-width: 0; width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; color: var(--text); background: var(--surface); font: inherit; }
.tacho-analysis-options { display: grid; gap: 14px; padding-top: 2px; }
.tacho-analysis-options label { display: flex; gap: 10px; align-items: start; font-size: 12px; line-height: 1.6; cursor: pointer; }
.tacho-analysis-options input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--teal); }
.tacho-analysis-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.tacho-analysis-actions button { min-height: 40px; }
.tacho-analysis button:disabled,.tacho-analysis input:disabled { opacity: .55; cursor: default; }
.tacho-analysis-notice { margin: 17px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.tacho-analysis > .tacho-message,.tacho-analysis-result > .tacho-message { margin: 18px 0; }
.tacho-analysis-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; margin-top: 24px; }
.tacho-analysis-tabs button { border: 0; border-radius: 5px; padding: 10px 13px; min-height: 38px; color: var(--muted); background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
.tacho-analysis-tabs button[aria-pressed="true"] { color: var(--teal); background: var(--surface); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.tacho-analysis-result { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 23px; }
.tacho-analysis-result h3 { margin: 0 0 10px; font-size: 16px; letter-spacing: -.02em; }
.tacho-analysis-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; margin-top: 21px; }
.tacho-analysis-metrics > div { display: grid; gap: 9px; }
.tacho-analysis-metrics span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.tacho-analysis-metrics strong { font-size: 21px; font-weight: 600; letter-spacing: -.03em; }
.tacho-analysis-rule-total { margin: 18px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.tacho-analysis-note,.tacho-analysis-table-key { margin: 17px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.tacho-analysis-table-key { margin: 22px 0 12px; }
.tacho-analysis-reference-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.tacho-analysis-match { flex-shrink: 0; color: #76511b; font-size: 11px; line-height: 1.6; padding: 7px 10px; border-radius: 6px; background: #fff8eb; }
.tacho-analysis-match.is-complete { color: var(--teal); background: var(--teal-weak); }
.tacho-analysis-basis { margin: 16px 0 18px; padding: 12px 15px; border-left: 3px solid var(--teal); background: var(--teal-weak); color: var(--muted); font-size: 12px; line-height: 1.7; }
.tacho-analysis-summary { min-width: 410px; }
.tacho-analysis-summary th:not(:first-child),.tacho-analysis-summary td:not(:first-child) { text-align: right; }
.tacho-analysis-table-scroll { max-height: 650px; }
.tacho-analysis-table { min-width: 650px; }
.tacho-analysis-table th,.tacho-analysis-table td { padding-left: 11px; padding-right: 11px; }
.tacho-analysis-table td { vertical-align: middle; }
.tacho-analysis-pair { white-space: nowrap; font-weight: 600; }
.tacho-analysis-pair > span { color: var(--muted); font-weight: 400; }
.tacho-analysis-period { color: var(--muted); font-size: 11px; line-height: 1.7; }
.tacho-analysis-row-status { display: block; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.tacho-analysis-row-status.is-matched { color: var(--teal); }
.tacho-analysis-row-status.is-review,.tacho-analysis-warning { color: #94651d; }
.tacho-analysis-changes-button { border: 0; border-bottom: 1px dotted var(--teal); color: var(--teal); padding: 3px 0; background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.tacho-analysis-muted { color: var(--muted); font-size: 10px; }
.tacho-analysis-change-row > td { white-space: normal; padding: 0 0 18px; }
.tacho-analysis-changes { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 16px; }
.tacho-analysis-changes h4 { font-size: 12px; margin: 0 0 6px; }
.tacho-analysis-changes p { margin: 0 0 13px; font-size: 11px; color: var(--muted); }
.tacho-analysis-changes ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tacho-analysis-changes li { display: grid; grid-template-columns: minmax(150px,.9fr) minmax(0,1.5fr) auto; gap: 14px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.tacho-analysis-changes strong { font-weight: 500; color: var(--text); }
.tacho-analysis-limitations { color: var(--muted); margin: 16px 0 0; padding-left: 18px; line-height: 1.7; }
.tacho-analysis-limitations li + li { margin-top: 7px; }
@media (max-width: 900px) {
  .tacho-screen .panel { padding: 20px; }
  .tacho-upload-icon { display: none; }
  .tacho-identity-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tacho-totals strong { font-size: 18px; }
  .tacho-remote-row { grid-template-columns: minmax(0,1fr) auto; gap: 12px 20px; }
  .tacho-remote-meta { grid-column: 1; }
  .tacho-remote-row button { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 600px) {
  .tacho-upload,.tacho-panel-head { flex-direction: column; gap: 18px; align-items: stretch; }
  .tacho-upload-actions { align-items: center; justify-items: stretch; }
  .tacho-upload-actions > span { text-align: center; }
  .tacho-intro { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .tacho-intro > div { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
  .tacho-intro h3 { display: inline; margin-left: 10px; }
  .tacho-intro p { margin: 8px 0 0 27px; }
  .tacho-identity-grid,.tacho-totals,.tacho-totals.has-unknown { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
  .tacho-day { justify-content: space-between; }
  .tacho-day select { flex: 1; }
  .tacho-remote-filter { width: 100%; justify-content: space-between; }
  .tacho-remote-filter select { flex: 1; min-width: 0; }
  .tacho-remote-row { grid-template-columns: minmax(0,1fr); }
  .tacho-remote-row button { grid-column: 1; grid-row: auto; justify-self: start; }
  .tacho-analysis-controls { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .tacho-analysis-actions { flex-direction: column; }
  .tacho-analysis-trial { align-self: start; }
  .tacho-analysis-tabs { display: flex; }
  .tacho-analysis-tabs button { flex: 1; }
  .tacho-analysis-metrics { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .tacho-analysis-metrics > div { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .tacho-analysis-metrics strong { font-size: 18px; }
  .tacho-analysis-reference-head { flex-direction: column; }
  .tacho-analysis-changes li { grid-template-columns: minmax(0,1fr); gap: 3px; }
}

/* Durable originals */
.tacho-saved-search { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 180px; font-size: 12px; }
.tacho-saved-search input { min-height: 40px; padding: 8px 10px; border: 1px solid #9aaba5; border-radius: 6px; background: #f4f7f3; width: 100%; box-sizing: border-box; }
.tacho-saved-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.tacho-saved-row .tacho-remote-name strong { overflow-wrap: anywhere; }
.tacho-saved-notice { border-color: #91b39e; background: #eaf4eb; }

/* Driver history, preliminary checks and the draft timesheet. */
.tacho-reports { scroll-margin-top: 24px; min-width: 0; }
.tacho-report-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 16px 24px; }
.tacho-report-toolbar .tacho-analysis-month { flex: 0 1 190px; }
.tacho-reports > .tacho-message { margin-top: 18px; }
.tacho-report-settings > .tacho-copy { margin-top: 16px; }
.tacho-report-settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 20px 0; }
.tacho-report-settings-grid label,.tacho-report-edit-row label { display: grid; gap: 8px; min-width: 0; font-size: 12px; color: var(--muted); }
.tacho-report-settings-grid select,.tacho-report-settings-grid input,.tacho-report-edit-row select,.tacho-report-edit-row input { display: block; width: 100%; box-sizing: border-box; min-width: 0; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; background: var(--surface); color: var(--text); font: inherit; }
.tacho-report-settings small { font-size: 10px; line-height: 1.6; color: var(--muted); }
.tacho-report-confirm,.tacho-report-selection label { display: flex; align-items: start; gap: 10px; font-size: 12px; line-height: 1.7; }
.tacho-report-confirm { margin: 24px 0 0; }
.tacho-report-confirm input,.tacho-report-selection input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--teal); }
.tacho-report-settings .tacho-analysis-actions { margin: 18px 0 12px; }
.tacho-report-settings .tacho-message { margin-top: 16px; }
.tacho-report-selection { display: grid; gap: 13px; max-height: 300px; overflow-y: auto; margin-top: 18px; }
.tacho-report-selection span { overflow-wrap: anywhere; min-width: 0; }
.tacho-report-selection small { display: block; font-size: 10px; color: var(--muted); }
.tacho-report-edit-list { display: grid; gap: 16px; margin: 20px 0; }
.tacho-report-edit-row { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.tacho-report-edit-row label { flex: 1 1 110px; }
.tacho-report-edit-row button { min-height: 40px; }
.tacho-report-coverage { display: grid; gap: 9px; margin-top: 25px; padding: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
.tacho-report-coverage > strong { font-size: 14px; }
.tacho-report-coverage > span { color: var(--muted); font-size: 12px; }
.tacho-report-source-list,.tacho-report-findings,.tacho-report-rules { padding: 0; list-style: none; }
.tacho-report-source-list li { display: grid; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.tacho-report-source-list span,.tacho-report-source-list small { color: var(--muted); }
.tacho-report-findings { display: grid; gap: 16px; margin: 25px 0; }
.tacho-report-findings > li { border: 1px solid #eed8b4; border-radius: 8px; padding: 18px; min-width: 0; }
.tacho-report-finding-head { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 10px; }
.tacho-report-finding-head h4 { margin: 0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.tacho-report-finding-head > span { color: #76511b; font-size: 11px; line-height: 1.7; }
.tacho-report-findings p { font-size: 12px; line-height: 1.7; margin: 10px 0; }
.tacho-report-findings dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.tacho-report-findings dt,.tacho-report-findings small { color: var(--muted); font-size: 10px; line-height: 1.7; }
.tacho-report-findings dd { margin: 5px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.tacho-report-rules li { display: grid; grid-template-columns: minmax(0,1fr) minmax(110px,.8fr); gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
.tacho-report-rules span,.tacho-report-rules p { color: var(--muted); }
.tacho-report-rules p { grid-column: 1 / -1; margin: 0; }
.tacho-report-empty { margin-top: 22px; }
.tacho-report-legal { font-size: 11px; line-height: 1.8; margin: 20px 0 0; }
.tacho-report-legal a { color: var(--teal); }
.tacho-report-totals { margin-bottom: 24px; }
.tacho-report-timesheet { min-width: 1000px; }
.tacho-report-timesheet-scroll { max-height: 650px; }
.tacho-report-row-notes { width: 230px; white-space: normal; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.tacho-report-row-notes summary { color: var(--teal); cursor: pointer; }
.tacho-report-row-notes p { margin: 8px 0; }
.tacho-report-row-notes .tacho-analysis-limitations { margin-top: 10px; }
.tacho-reports button:disabled,.tacho-reports input:disabled,.tacho-reports select:disabled { opacity: .55; cursor: default; }
@media (max-width: 600px) {
  .tacho-report-settings-grid { grid-template-columns: minmax(0,1fr); }
  .tacho-report-toolbar { align-items: stretch; flex-direction: column; }
  .tacho-report-toolbar .tacho-analysis-month { flex: 1; }
  .tacho-report-rules li { grid-template-columns: minmax(0,1fr); }
  .tacho-report-findings dl { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .tacho-report-findings dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .tacho-report-findings dd { margin: 0; }
}
