.timings-view { padding: 22px; }
.timings-view [hidden] { display: none !important; }
.timings-overview h3 { margin: 0; font-size: 16px; }
.timings-overview .timings-library-controls { margin-bottom: 20px; }
.timings-overview .timings-library-table-wrap { max-height: none; }
.timings-copy-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.timings-copy-toolbar .add-tour-button { width: auto; margin-left: auto; }
.timings-copy-toolbar > span { font-size: 13px; color: #64748b; }
.timings-view .timings-select-label { flex-direction: row; align-items: center; gap: 9px; cursor: pointer; }
.timings-view .timings-select-label input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; padding: 0; accent-color: #030c94; }
.timings-selection-column { width: 38px; }
.timings-heading, .timings-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.timings-heading { margin-bottom: 22px; flex-wrap: wrap; }
.timings-heading h2, .timings-section-heading h3 { margin: 0; }
.timings-heading p { margin: 5px 0 0; color: #7a8593; font-size: 14px; }
.timings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.timings-actions .add-tour-button { width: auto; }
.timings-view button:disabled { opacity: .55; cursor: default; }
.timings-controls, .timings-fields, .timings-trip-fields { display: grid; gap: 16px; }
.timings-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.timings-version-field { min-width: 0; }
.timings-version-field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.timings-version-field > .timings-help { margin: 7px 0 0; }
.timings-version-picker { position: relative; min-width: 0; }
.timings-version-picker > summary { display: flex; align-items: center; gap: 10px; min-height: 37px; padding: 9px 10px; border: 1px solid #ded6ca; border-radius: 8px; background: #faf8f4; font-size: 14px; cursor: pointer; list-style: none; }
.timings-version-picker > summary::-webkit-details-marker { display: none; }
.timings-version-picker > summary::after { content: ""; width: 6px; height: 6px; margin: -3px 3px 0 auto; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); flex-shrink: 0; }
.timings-version-picker > summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timings-version-picker > summary:focus-visible { outline: 2px solid #030c94; outline-offset: 2px; }
.timings-version-picker[inert] { opacity: .55; }
.timings-version-picker > fieldset { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: min(60dvh, 430px); overflow-y: auto; margin: 0; padding: 12px; min-width: 0; border: 1px solid #ded6ca; border-radius: 10px; background: white; box-shadow: 0 8px 24px #0002; }
.timings-version-picker h4 { margin: 14px 0 7px; color: #64748b; font-size: 12px; }
.timings-view .timings-version-option { display: flex; flex-direction: row; align-items: center; gap: 9px; padding: 7px 5px; font-weight: 400; cursor: pointer; border-radius: 5px; }
.timings-version-option:hover { background: #f4f1eb; }
.timings-view .timings-version-option input { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; padding: 0; accent-color: #030c94; }
.timings-version-search { margin-bottom: 10px; }
.timings-version-footer { display: flex; justify-content: end; padding-top: 12px; }
.timings-fields { grid-template-columns: 2fr 1fr 1fr; }
.timings-trip-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.timings-trip-fields { margin-top: 16px; }
.timings-view label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 700; min-width: 0; }
.timings-view input, .timings-view select, .timings-view textarea { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid #ded6ca; border-radius: 8px; padding: 9px 10px; background: #faf8f4; color: #1f2937; font: 14px Arial, sans-serif; }
.timings-view textarea { resize: vertical; line-height: 1.45; }
.timings-view input:focus-visible, .timings-view select:focus-visible, .timings-view textarea:focus-visible, .timings-row-action:focus-visible { outline: 2px solid #030c94; outline-offset: 2px; }
.timings-editor { margin: 0; padding: 0; border: 0; min-width: 0; }
.timings-editor:disabled { opacity: .55; }
.timings-message { min-height: 1.4em; font-size: 14px; margin: 14px 0 6px; color: #39724b; }
.timings-message.is-error { color: #b42318; }
.timings-source, .timings-help { font-size: 13px; color: #64748b; line-height: 1.5; }
.timings-source { margin: 0 0 20px; }
.timings-source:empty { display: none; }
.timings-library { width: min(1080px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid #e5dfd5; border-radius: 16px; background: white; color: #1f2937; }
.timings-library[open] { display: flex; flex-direction: column; }
.timings-library::backdrop { background: rgba(31, 45, 61, .4); }
.timings-library .modal-header, .timings-library .modal-actions { flex-shrink: 0; }
.timings-library .modal-header h2 { margin: 0; font-size: 19px; }
.timings-library .modal-actions { margin: 0; padding: 14px 22px; }
.timings-library-body { padding: 0 22px 20px; overflow: auto; min-height: 0; }
.timings-library-controls { display: flex; align-items: end; gap: 12px; margin-top: 14px; }
.timings-library-controls label { flex: 1; }
.timings-library-controls button { white-space: nowrap; }
.timings-library-table-wrap { position: relative; overflow: auto; max-height: min(50dvh, 420px); }
.timings-library-table { width: 100%; min-width: 660px; border-collapse: collapse; font-size: 13px; }
.timings-library-table th { position: sticky; top: 0; background: #f0ece4; z-index: 1; }
.timings-library-table th, .timings-library-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #e5dfd5; overflow-wrap: anywhere; }
.timings-library-table td { background: white; }
.timings-library-table tr.is-current td { background: #f0f2ff; }
.timings-library-table small { display: block; margin-top: 4px; color: #64748b; }
.timings-library-actions { white-space: nowrap; }
.timings-library-actions button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 9px; vertical-align: middle; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.timings-library-actions button + button { margin-left: 6px; }
.timings-library-actions button:focus-visible { outline: 2px solid #030c94; outline-offset: 2px; }
.timings-library-actions button:disabled { transform: none; box-shadow: none; }
.timings-library-actions svg { display: block; width: 20px; height: 20px; }
.timings-library-empty { color: #64748b; }
.timings-delete-dialog { width: min(520px, calc(100vw - 32px)); }
.timings-delete-details { margin: 18px 0; }
.timings-delete-details > div { display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 12px; padding: 5px 0; }
.timings-delete-details dt { color: #64748b; }
.timings-delete-details dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.timings-confirm-delete-button { padding: 10px 18px; border: 0; border-radius: 8px; background: #b42318; color: white; font: inherit; font-size: 14px; cursor: pointer; }
.timings-confirm-delete-button:hover { background: #912018; }
.timings-section-heading { margin: 22px 0 10px; }
.timings-start-variants { margin-top: 24px; padding: 16px; border: 1px solid #ded6ca; border-radius: 10px; background: #faf8f4; }
.timings-start-variants h3 { margin: 0; font-size: 16px; }
.timings-start-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.timings-start-controls label { flex: 1 1 150px; }
.timings-start-controls label:has(#timing-new-start), #timing-variant-time-label { flex: 0 1 160px; }
.timings-start-controls button { white-space: nowrap; }
.timings-start-variants .is-error, .timings-start-error { color: #b42318; }
.timings-section-heading h3, .timings-preview-heading { font-size: 16px; }
.timings-section-heading button { font-size: 13px; white-space: nowrap; }
.timings-description-label { margin-top: 20px; }
.timings-notes-field { margin-top: 16px; }
.timings-closing-notes-fields { display: grid; grid-template-columns: minmax(0, 1fr) 140px; align-items: start; gap: 16px; margin-top: 20px; }
.timings-table-wrap { position: relative; overflow-x: auto; }
.timings-contact-editor, .timings-step-editor { width: 100%; border-collapse: collapse; font-size: 13px; }
.timings-contact-editor { min-width: 560px; }
.timings-step-editor { min-width: 900px; table-layout: fixed; }
.timings-contact-editor th, .timings-step-editor th { background: #f4f1eb; padding: 9px; text-align: left; }
.timings-contact-editor td, .timings-step-editor td { padding: 3px 5px; vertical-align: top; border-bottom: 1px solid #eee8df; }
.timings-step-editor th:first-child { width: 80px; }
.timings-step-editor th:nth-child(2) { width: 34%; }
.timings-step-editor th:nth-last-child(2) { width: 148px; }
.timings-step-editor th:last-child { width: 100px; }
.timings-step-time { font-variant-numeric: tabular-nums; line-height: 1.5; }
.timings-ferry-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.timings-ferry-tools p { flex: 1 1 250px; margin: 0; }
.timings-ferry-tools a { color: #030c94; font-size: 12px; }
.timings-ferry-tools .is-error, .timings-ferry-status.is-error { color: #b42318; }
.timings-view .timings-ferry-toggle { flex-direction: row; align-items: center; gap: 6px; margin-top: 8px; color: #64748b; font-size: 11px; font-weight: 400; }
.timings-view .timings-ferry-toggle input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: #030c94; }
.timings-ferry-status { font-size: 12px; color: #64748b; }
.timings-ferry-times { font-variant-numeric: tabular-nums; }
.timings-ferry-selected { color: #c00000; font-weight: 700; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.timings-ferry-print-note { margin-bottom: 3px; }
.timings-row-action { border: 0; background: transparent; color: #475569; padding: 6px; font-size: 18px; cursor: pointer; }
.timings-row-action:hover { color: #030c94; background: #f4f1eb; border-radius: 5px; }
.timings-row-actions { white-space: nowrap; }
.timings-total { font-size: 14px; font-weight: 700; text-align: right; }
.timings-preview-heading { margin: 30px 0 14px; }
.timings-preview-wrap { overflow-x: auto; padding: 12px; background: #eeece8; border-radius: 8px; }
.timings-preview { position: relative; box-sizing: border-box; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 12mm; background: white; box-shadow: 0 1px 6px #0002; color: #111827; font-family: Arial, sans-serif; font-size: 10pt; line-height: 1.2; }
.timings-sheet-header { display: flex; align-items: center; gap: 24px; margin-bottom: 10px; }
.timings-sheet-logo { width: 40mm; max-width: 30%; height: auto; }
.timings-sheet-header > div { flex: 1; }
.timings-sheet-header h2 { text-align: center; font-size: 16pt; margin: 0; overflow-wrap: anywhere; }
.timings-sheet-code { display: none; }
.timings-sheet-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 9px; }
.timings-sheet-meta > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; padding: 2px 4px; }
.timings-sheet-meta dt { font-weight: 400; }
.timings-sheet-meta dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.timings-sheet-meta .timings-meeting-notes { grid-column: 1 / -1; font-weight: 700; color: #000; white-space: pre-line; margin-bottom: 3px; }
.timings-sheet-meta .timings-sheet-tour { grid-column: span 2; }
.timings-report-time { background: #fff68f; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.timings-preview section { margin-bottom: 9px; }
.timings-preview h3 { margin: 0 0 3px; font-size: 10pt; }
.timings-preview table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.timings-preview th, .timings-preview td { padding: 2px 4px; border: 1px solid #b5b5b5; text-align: left; vertical-align: top; overflow-wrap: anywhere; white-space: pre-line; }
.timings-preview th { background: #e7e7e7; font-weight: 700; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.timings-sheet-description { white-space: pre-line; margin: 0 0 4px; line-height: 1.18; orphans: 2; widows: 2; }
.timings-sheet-contacts th, .timings-sheet-contacts td { border: 0; background: transparent; padding: 1px 4px; }
.timings-sheet-client { margin-top: 9px; }
.timings-closing-notes { margin: 9px 0; font-weight: 700; text-align: center; color: #000; white-space: pre-line; overflow-wrap: anywhere; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.timings-closing-notes.is-red { color: #c00000; }
.timings-sheet-image { margin: 9px 0; break-inside: avoid; }
.timings-sheet-image img { display: block; width: 85%; max-height: 90mm; margin-inline: auto; object-fit: contain; }
.timings-preview .timings-sheet-schedule { width: calc(100% - 2px); border: 1px solid #b5b5b5; }
.timings-sheet-schedule tbody { break-inside: avoid; }
.timings-sheet-schedule th:first-child, .timings-sheet-schedule th:last-child,
.timings-sheet-schedule td:first-child, .timings-sheet-schedule td:last-child { white-space: nowrap; }
.timings-tour-controls { display: flex; align-items: end; gap: 12px; margin-top: 20px; }
.timings-tour-controls > label { flex: 1; }
.timings-tour-controls > button { white-space: nowrap; }
.timings-tour-controls > label:has(option[value=""]:checked) { color: #b42318; }
#timing-tour:has(option[value=""]:checked) { color: #b42318; border-color: #d92d20; background: #fff1f2; }
#timing-tour option { color: #1f2937; background: #faf8f4; }
#timing-tour option[value=""] { color: #b42318; }
.timings-duration-input { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.timings-duration-input label { font-size: 11px; gap: 4px; }
.timings-duration-input input { padding: 8px 6px; }
.timings-merge-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.timings-merge-toolbar > span { color: #64748b; font-size: 12px; }
.timings-merge-toolbar button { font-size: 12px; }
.timings-cell-select { flex-direction: row !important; align-items: center; gap: 5px !important; margin-bottom: 5px; font-size: 11px !important; font-weight: 400 !important; color: #64748b; }
.timings-cell-select input { width: 15px; height: 15px; margin: 0; accent-color: #030c94; }
.timings-merge-cell.is-selected { background: #eef0ff; outline: 2px solid #030c94; outline-offset: -2px; }
.timings-merge-cell textarea { height: 100%; }
.timings-image-preview img { display: block; max-width: 100%; max-height: 200px; margin-top: 14px; object-fit: contain; }
.timings-view input[readonly] { color: #475569; background: #f1f5f9; }
.timings-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1000px) {
  .timings-fields, .timings-trip-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .timings-view { padding: 16px; }
  .timings-controls, .timings-fields, .timings-trip-fields { grid-template-columns: minmax(0, 1fr); }
  .timings-closing-notes-fields { grid-template-columns: minmax(0, 1fr); }
  .timings-actions { width: 100%; }
  .timings-actions button { flex: 1; padding: 9px; }
}
@media print {
  @page timings-sheet { size: A4 portrait; margin: 12mm; }
  .timings-library { display: none !important; }
  body.timings-print > :not(#app-content),
  body.timings-print #app-content > :not(.app-panel),
  body.timings-print .app-panel > :not(#timings-view),
  body.timings-print .timings-heading,
  body.timings-print .timings-overview,
  body.timings-print .timings-controls,
  body.timings-print .timings-library,
  body.timings-print .timings-message,
  body.timings-print .timings-source,
  body.timings-print .timings-editor,
  body.timings-print .timings-preview-heading { display: none !important; }
  body.timings-print .timings-sheet-code { display: none !important; }
  body.timings-print #timings-view { display: block !important; margin: 0 !important; padding: 0 !important; width: 100% !important; }
  body.timings-print .timings-preview-wrap { overflow: visible; padding: 0; background: transparent; border-radius: 0; }
  body.timings-print .timings-preview { page: timings-sheet; width: 100%; min-height: 0; margin: 0; padding: 0; border: 0; font-size: 10pt; }
  body.timings-print .timings-sheet-header { break-inside: avoid; }
  body.timings-print .timings-sheet-header h2 { font-size: 16pt; }
  body.timings-print .timings-sheet-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); break-inside: avoid; }
  body.timings-print .timings-sheet-meta .timings-sheet-tour { grid-column: span 2; }
  body.timings-print .timings-preview thead { display: table-header-group; }
  body.timings-print .timings-preview tr { break-inside: avoid; }
  body.timings-print .timings-preview h3 { break-after: avoid; }
  body.timings-print .timings-sheet-image img { max-height: 90mm; }
}
