/* Confirmed A hierarchy; scoped to the existing internal time surfaces. */
body.package1-ui-active :is(#time, #time-history) {
  --time-accent: var(--kms-color-primary);
  --time-meta: var(--kms-color-text-secondary-strong);
  font-size: 16px;
  line-height: 24px;
}
body.package1-ui-active :is(#time, #time-history).active { gap: 16px; }
/* Keep the heading accessible; the global topbar already names this page. */
body.package1-ui-active #time > .sheet-title .kms-page-heading > h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
body.package1-ui-active :is(#time, #time-history) > .sheet-title { flex-wrap: wrap; gap: 8px 16px; }
body.package1-ui-active #time-history > .sheet-title h2 {
  font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: normal;
}
body.package1-ui-active :is(#time, #time-history) .time-area-tabs {
  gap: 8px; padding: 0; border: 0; background: transparent;
}
body.package1-ui-active :is(#time, #time-history) .time-area-tabs > button {
  min-height: 48px; font-size: 16px; line-height: 24px; font-weight: 500;
  background: var(--kms-color-surface); border: 1px solid var(--kms-color-border);
}
body.package1-ui-active :is(#time, #time-history) .time-area-tabs > button.active {
  color: var(--kms-color-on-primary); background: var(--time-accent);
  border-color: var(--time-accent); box-shadow: none;
}
body.package1-ui-active :is(#time, #time-history) .time-source-tabs > button {
  min-height: 48px; white-space: normal;
}
body.package1-ui-active :is(#time, #time-history) .time-source-tabs > button.active {
  color: var(--time-accent); background: var(--kms-color-information-soft-bg);
  box-shadow: inset 0 -3px var(--time-accent);
}
body.package1-ui-active :is(#time, #time-history) .time-source-tabs strong { font-size: 16px; line-height: 24px; }
body.package1-ui-active :is(#time, #time-history) .time-source-tabs small { font-size: 14px; line-height: 20px; }
body.package1-ui-active #time .time-clock-card {
  padding: 16px; gap: 16px 24px; border-top-width: 1px;
  border-radius: 12px; box-shadow: inset 4px 0 var(--time-accent); align-items: start;
}
body.package1-ui-active #time .time-clock-status { align-items: flex-start; text-align: left; }
body.package1-ui-active #time .time-live-timer {
  font-size: 56px; line-height: 64px; font-weight: 600; letter-spacing: -.035em;
}
body.package1-ui-active #time #timeClockStatus {
  font-size: 14px; line-height: 20px; border-radius: 6px; font-weight: 500;
  color: var(--time-accent); background: var(--kms-color-information-soft-bg);
}
body.package1-ui-active #time [data-clock-state="running"] #timeClockStatus {
  color: var(--kms-color-on-primary); background: var(--kms-color-success-text);
}
body.package1-ui-active #time [data-clock-state="paused"] #timeClockStatus {
  color: var(--kms-color-text); background: var(--kms-color-warning-soft);
}
body.package1-ui-active #time :is(.time-form, .time-clock-actions) { gap: 8px; }
body.package1-ui-active #time :is(.time-work-context, .time-note-details) > summary {
  min-height: 48px; font-size: 16px; line-height: 24px; color: var(--kms-color-text);
}
body.package1-ui-active #time #timeWorkContext > summary > strong { font-weight: 500; }
body.package1-ui-active #time #timeWorkContext > summary > small {
  display: block; margin: 4px 0 0 20px; color: var(--time-meta);
  font-size: 14px; line-height: 20px; font-weight: 400; white-space: normal; overflow-wrap: anywhere;
}
body.package1-ui-active #time :is(.time-work-context, .time-note-details) > summary::marker { color: var(--time-accent); }
body.package1-ui-active #time :is(.time-clock-primary, .time-clock-actions > button, .time-history-link) {
  min-height: 48px; font-size: 16px; line-height: 24px; border-radius: 8px;
}
body.package1-ui-active #time .time-clock-primary:not(.is-active),
body.package1-ui-active #time-history #timeForgottenEntryForm > button[type="submit"] {
  color: var(--kms-color-on-primary); background: var(--time-accent); border-color: var(--time-accent);
}
body.package1-ui-active #time :is(.time-day-panel, .time-today-panel, .time-team-today),
body.package1-ui-active #time-history :is(.time-filter-panel, .time-month-summary, .time-entry-card, .time-forgotten-entry) {
  padding: 16px; border-radius: 12px;
}
body.package1-ui-active #time :is(.time-day-panel, .time-today-panel, .time-team-today) h3 {
  font-size: 20px; line-height: 28px; font-weight: 600;
}
body.package1-ui-active #time :is(.time-today-facts, .time-team-today-summary) { gap: 16px; }
body.package1-ui-active #time :is(.time-today-facts, .time-team-today-summary) strong,
body.package1-ui-active #time-history .time-month-summary strong {
  font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: normal;
}
body.package1-ui-active :is(#time, #time-history) :is(.page-subtitle, .title-note),
body.package1-ui-active #time :is(.time-clock-eyebrow, #timeClockMeta, .time-timer-caption, .time-location-status, .time-day-balance-head, .time-today-facts span, .time-team-today-summary span, .time-operation-facts small, .time-operation-facts b, .time-current-operation > span, .submit-save-status),
body.package1-ui-active #time-history :is(.time-filter-state, .time-filter-count, .time-month-summary span, .time-entry-card span:not(.status), .time-entry-location span) {
  font-size: 14px; line-height: 20px; color: var(--time-meta);
}
body.package1-ui-active #time-history .time-entry-card strong { font-size: 16px; line-height: 24px; }
body.package1-ui-active #time .time-form label,
body.package1-ui-active #time-history :is(.time-filter-panel, .time-forgotten-entry, .time-correction-request, .time-correction-review, .time-correction) label {
  min-width: 0; font-size: 14px; line-height: 20px; color: var(--time-meta);
}
body.package1-ui-active #time .time-form :is(input:not([type="hidden"]), select, textarea),
body.package1-ui-active #time-history :is(.time-filter-panel, .time-forgotten-entry, .time-correction-request, .time-correction-review, .time-correction) :is(input:not([type="hidden"]), select, textarea, button),
body.package1-ui-active #time-history :is(.time-history-actions, .sheet-title) button,
body.package1-ui-active #time-history #timeLoadMore {
  min-width: 0; max-width: 100%; min-height: 48px; font-size: 16px; line-height: 24px;
}
body.package1-ui-active #time-history :is(.time-advanced-filters, .time-entry-details, .time-correction-request, .time-correction) > summary {
  min-height: 48px; font-size: 16px; line-height: 24px; white-space: normal;
}
body.package1-ui-active #time-history :is(.time-forgotten-entry, .time-correction-request, .time-correction-review) {
  background: var(--kms-color-surface); box-shadow: inset 4px 0 var(--time-accent);
}
body.package1-ui-active #time-history :is(.time-correction-fields, .time-correction form, .time-correction-request form) {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
body.package1-ui-active #time-history :is(.time-correction-fields, .time-correction form, .time-correction-request form) label:has(textarea) { grid-column: 1 / -1; }
body.package1-ui-active #time-history .time-correction-review > strong { color: var(--time-accent); }
body.package1-ui-active :is(#time, #time-history) .time-account-management summary strong { font-size: 16px; line-height: 24px; }
body.package1-ui-active :is(#time, #time-history) .time-account-management summary small,
body.package1-ui-active :is(#time, #time-history) .time-account-management:not([open]) .time-account-management-action {
  font-size: 14px; line-height: 20px;
}
@media (max-width: 650px) {
  body.package1-ui-active #time .time-clock-card { grid-template-columns: minmax(0, 1fr); }
  body.package1-ui-active #time .time-live-timer { font-size: 48px; line-height: 56px; }
  body.package1-ui-active :is(#time, #time-history) .time-area-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.package1-ui-active #time-history .time-correction-fields .required-text { display: block; }
}
@media (max-width: 360px) {
  body.package1-ui-active #time-history :is(.time-correction-fields, .time-correction form, .time-correction-request form) { grid-template-columns: minmax(0, 1fr); }
}
/* Match A typography without inheriting the legacy heavy control weights. */
body.package1-ui-active :is(#time, #time-history) .time-source-tabs { margin-bottom: 0; gap: 8px; }
body.package1-ui-active :is(#time, #time-history) .time-source-tabs strong { font-weight: 500; }
body.package1-ui-active :is(#time, #time-history) .time-source-tabs small { font-weight: 400; }
body.package1-ui-active #time .time-form :is(input, select, textarea),
body.package1-ui-active #time-history :is(.time-filter-panel, .time-forgotten-entry, .time-correction-request, .time-correction-review, .time-correction) :is(input, select, textarea) { font-weight: 400; }
body.package1-ui-active #time .time-form label,
body.package1-ui-active #time-history :is(.time-filter-panel, .time-forgotten-entry, .time-correction-request, .time-correction-review, .time-correction) label { font-weight: 400; }
body.package1-ui-active #time .time-form button,
body.package1-ui-active #time-history :is(.time-history-actions, .sheet-title, .time-forgotten-entry, .time-correction-request, .time-correction-review, .time-correction) button { font-weight: 500; box-shadow: none; }
body.package1-ui-active #time-history .time-forgotten-entry h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
@media (max-width: 650px) {
  body.package1-ui-active #time-history .time-correction-fields label:has(select) { grid-column: 1 / -1; }
}
/* Native date controls need a full row on narrow phones to keep the date visible. */
@media (max-width: 420px) {
  body.package1-ui-active #time-history :is(.time-correction-fields, .time-correction form, .time-correction-request form) { grid-template-columns: minmax(0, 1fr); }
}

/* Stempeluhr, Tageslinie und bestätigter Verwaltungsbericht. */
body.package1-ui-active #time .time-booking-feedback {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  grid-column: 1 / -1; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--kms-color-border); border-radius: 8px;
  background: var(--kms-color-information-soft-bg);
}
body.package1-ui-active #time .time-booking-feedback[hidden],
body.package1-ui-active #time .time-pending-event[hidden] { display: none; }
body.package1-ui-active #time .time-booking-feedback[data-tone="warning"] { background: var(--kms-color-warning-soft); }
body.package1-ui-active #time .time-booking-feedback[data-tone="error"] { background: var(--kms-color-problem-soft); }
body.package1-ui-active #time .time-booking-feedback[data-tone="success"] { background: var(--kms-color-success-soft); }
body.package1-ui-active #time .time-booking-feedback > div { flex: 1 1 190px; min-width: 0; overflow-wrap: anywhere; }
body.package1-ui-active #time .time-booking-feedback p { margin: 2px 0 0; color: var(--time-meta); }
body.package1-ui-active #time .time-booking-feedback button { min-height: 48px; }
body.package1-ui-active #time .time-clock-card :is(.time-clock-primary, .time-clock-secondary, #timeSwitchButton):disabled {
  opacity: .52; cursor: not-allowed;
}
body.package1-ui-active #time .time-offline-status { grid-column: 1 / -1; margin: 0; }
body.package1-ui-active #time .time-clock-card > .time-clock-status { grid-column: 1; grid-row: 1; }
body.package1-ui-active #time .time-clock-card > .time-form { grid-column: 2; grid-row: 1; }
body.package1-ui-active #time .time-clock-card:has(.time-booking-feedback:not([hidden])) > .time-form { grid-row: 3; grid-column: 1 / -1; }
body.package1-ui-active #time .time-clock-card:has(.time-booking-feedback:not([hidden])) > .time-booking-feedback { grid-row: 2; }
body.package1-ui-active #time .time-timeline-heading { margin: 16px 0 8px; color: var(--time-meta); font-size: 14px; font-weight: 600; }
body.package1-ui-active #time .time-timeline { margin: 0; padding: 0; list-style: none; }
body.package1-ui-active #time :is(.time-timeline li, .time-pending-event) {
  position: relative; display: grid; align-items: start; grid-template-columns: 3rem minmax(0, 1fr);
  gap: 10px; padding: 6px 0 6px 20px; min-height: 36px; overflow-wrap: anywhere;
}
body.package1-ui-active #time :is(.time-timeline li, .time-pending-event)::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 4px; width: 2px; background: var(--kms-color-border);
}
body.package1-ui-active #time :is(.time-timeline li, .time-pending-event)::after {
  content: ""; position: absolute; top: 13px; inset-inline-start: 0; width: 10px; height: 10px;
  border-radius: 50%; background: var(--time-accent);
}
body.package1-ui-active #time .time-timeline li:first-child::before { top: 13px; }
body.package1-ui-active #time .time-pending-event::before { bottom: auto; height: 13px; }
body.package1-ui-active #time .time-day-panel .time-pending-event::after {
  box-sizing: border-box; border: 2px solid var(--kms-color-text-secondary-strong); background: var(--kms-color-surface);
}
body.package1-ui-active #time .time-pending-event {
  background: var(--kms-color-warning-soft); border-radius: 8px; padding-inline-end: 8px;
}
body.package1-ui-active #time :is(.time-timeline, .time-pending-event) :is(time, small) { color: var(--time-meta); font-size: 13px; }
body.package1-ui-active #time :is(.time-timeline, .time-pending-event) small { display: block; }
body.package1-ui-active #time .time-day-balance-track.is-chronological { gap: 3px; background: transparent; }
body.package1-ui-active #time .time-day-balance-track.is-chronological > span { flex-basis: 0; border-radius: 4px; }
body.package1-ui-active #time .time-day-balance-track > span[data-segment="pause"] { background: var(--kms-color-warning); }
body.package1-ui-active #time .time-day-balance-track > span[data-segment="gap"] { background: var(--kms-color-border); }
body.package1-ui-active #time .time-timeline-range { display: flex; justify-content: space-between; margin-top: 4px; color: var(--time-meta); font-size: 13px; }
body.package1-ui-active #time .time-day-panel > .time-history-link { margin-top: 8px; }
body.package1-ui-active #time-history.time-compact-report #timeTeamSummary { display: block; padding: 16px; }
body.package1-ui-active #time-history.time-compact-report #timeTeamSummary.hidden { display: none; }
body.package1-ui-active #time-history .time-report-register { border-collapse: collapse; width: 100%; table-layout: fixed; }
body.package1-ui-active #time-history .time-report-register :is(td, th) {
  padding: 9px 6px; border-bottom: 1px solid var(--kms-color-border); text-align: start; vertical-align: top;
  text-transform: none; letter-spacing: normal;
  overflow-wrap: anywhere;
}
body.package1-ui-active #time-history .time-report-register :is(small, thead th) { color: var(--time-meta); font-size: 13px; }
body.package1-ui-active #time-history .time-report-register small { display: block; margin-top: 2px; font-weight: 400; }
body.package1-ui-active #time-history .time-report-register th:first-child { width: 36%; }
body.package1-ui-active #time-history .time-report-register th:nth-child(2) { width: 26%; }
body.package1-ui-active #time-history .time-report-register .status { white-space: normal; }
@media (max-width: 900px) {
  body.package1-ui-active #time .time-clock-card { grid-template-columns: minmax(0, 1fr); }
  body.package1-ui-active #time .time-clock-card > .time-form { grid-column: 1; grid-row: auto; }
  body.package1-ui-active #time .time-clock-card > .time-booking-feedback { grid-row: 2; }
}
@media (max-width: 650px) {
  body.package1-ui-active #time .time-clock-actions > .time-clock-primary { flex-basis: 100%; }
  body.package1-ui-active #time .time-today-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (min-width: 1024px) {
  body.package1-ui-active #time-history.time-compact-report .time-area-tabs > button { border: 0; border-radius: 0; }
  body.package1-ui-active #time-history.time-compact-report .time-area-tabs > button.active {
    color: var(--time-accent); background: transparent; box-shadow: inset 0 -3px var(--time-accent);
  }
  body.package1-ui-active #time-history.time-compact-report > :is(.time-filter-panel, #timeTeamSummary) { order: 0; }
  body.package1-ui-active #time-history.time-compact-report > :is(#timeMonthSummary, .time-history-actions, #timeEntryList, #timeLoadMore, .time-account-management) { order: 1; }
}

body.package1-ui-active #time-history.time-employee-report > :is(.time-filter-panel, #timeEntryList, #timeLoadMore) { order: 0; }
body.package1-ui-active #time-history.time-employee-report > :is(#timeMonthSummary, .time-history-actions, .time-account-management) { order: 1; }
body.package1-ui-active #time-history.time-employee-report #timeEntryList > h3 { margin: 0; }
.time-account-stamps table { width: 100%; table-layout: fixed; }
.time-account-stamps :is(td, th) { overflow-wrap: anywhere; white-space: normal; }
.time-account-stamps td small { display: block; }

body.package1-ui-active #time-history .time-employee-totals { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0; }
body.package1-ui-active #time-history .time-employee-totals :is(h3, h4, h5, p, ul) { margin: 0; }
body.package1-ui-active #time-history .time-employee-totals :is(h4, h5, summary, li) {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; overflow-wrap: anywhere;
}
body.package1-ui-active #time-history .time-employee-totals :is(h4, h5, summary, ul, .time-report-day > p) { padding: 8px 12px; }
body.package1-ui-active #time-history .time-employee-totals :is(h5, details) { border-top: 1px solid var(--kms-color-border); }
body.package1-ui-active #time-history .time-employee-totals summary { cursor: pointer; }
body.package1-ui-active #time-history .time-employee-totals summary .time-report-caret::before { content: "▸ "; }
body.package1-ui-active #time-history .time-employee-totals details[open] > summary .time-report-caret::before { content: "▾ "; }
body.package1-ui-active #time-history .time-employee-totals ul { list-style: none; }
body.package1-ui-active #time-history .time-employee-totals b { white-space: nowrap; font-variant-numeric: tabular-nums; }

body.package1-ui-active #time-history .time-report-period-total { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
body.package1-ui-active #time-history .time-employee-totals .time-report-day > summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start;
}
body.package1-ui-active #time-history .time-report-day > summary small { display: block; }
body.package1-ui-active #time-history .time-report-day > summary b { white-space: normal; }
body.package1-ui-active #time-history .time-report-day-bookings { display: grid; gap: 8px; padding: 0 8px 8px; }
body.package1-ui-active #time-history .time-report-day-bookings .time-entry-work { grid-column: 1 / -1; }

@media (max-width: 670px) {
  body.package1-ui-active #time-history .time-employee-totals .time-report-day > summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.package1-ui-active #time-history .time-report-day-total { grid-area: 1 / 2; }
}
