:root {
  color-scheme: light;
  --ink: #141518;
  --ink-soft: #667085;
  --paper: #ffffff;
  --paper-deep: #f6f7f9;
  --surface: #ffffff;
  --line: #eceef1;
  --line-strong: #dfe3e8;
  --accent: #ffd400;
  --accent-ink: #765d00;
  --accent-pale: #fff8cc;
  --brown: #141518;
  --brown-2: #23262b;
  --modify: #9a7200;
  --analyze: #6b7280;
  --operate: #167b68;
  --context: #596579;
  --shadow: 0 14px 40px rgb(20 21 24 / 8%);
  --sans: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: var(--sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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;
}

.mobile-summary,
.mobile-category-control,
.mobile-result-copy {
  display: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 14px clamp(24px, 4vw, 58px);
  color: #fffaf2;
  background: var(--brown);
  border-bottom: 1px solid #514336;
}

.brand-block h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.4vw, 38px);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.brand-block p {
  margin: 3px 0 0;
  color: #d9ccbd;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-switcher {
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  gap: 26px;
}

.view-tab {
  position: relative;
  min-width: 92px;
  min-height: 50px;
  padding: 0 6px 13px;
  color: #d9ccbd;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 17px;
}

.view-tab::after {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  height: 2px;
  content: "";
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0.4);
  transition: 160ms ease;
}

.view-tab:hover,
.view-tab.is-active {
  color: #fffaf2;
}

.view-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  color: #f8f1e8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}

.header-action:hover {
  background: rgb(255 255 255 / 7%);
  border-color: rgb(255 255 255 / 15%);
}

.header-action span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 18px;
}

.header-action b {
  font-weight: 400;
}

.app-view[hidden] {
  display: none;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 96px;
  padding: 20px clamp(24px, 4vw, 58px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.summary-stat + .summary-stat {
  border-left: 1px solid var(--line);
}

.summary-stat strong {
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(31px, 3vw, 43px);
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1;
}

.summary-stat span {
  margin-top: 6px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
}

.archive-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 218px;
  max-width: 1600px;
  margin: 0 auto;
}

.archive-main {
  min-width: 0;
  padding: 0 clamp(18px, 2vw, 32px) 64px;
  border-right: 1px solid var(--line);
}

.filter-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.95fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--line-strong);
  backdrop-filter: blur(14px);
}

.search-field {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.search-field > span {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
  transform: rotate(-12deg);
}

.search-field input {
  min-width: 0;
  flex: 1;
  padding: 0 9px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-field kbd {
  color: #8c8175;
  font-family: var(--sans);
  font-size: 11px;
}

.category-filter {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
}

.filter-chip {
  min-height: 38px;
  padding: 0 15px;
  background: var(--surface);
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip + .filter-chip {
  border-left: 1px solid var(--line);
}

.filter-chip:hover {
  background: var(--paper-deep);
}

.filter-chip.is-active {
  color: #fffaf2;
  background: var(--brown-2);
}

.project-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.project-filter > span {
  font-weight: 600;
}

.project-filter label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.project-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.project-filter i {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

.project-filter input:checked + i {
  background: var(--accent);
  border-color: var(--accent);
}

.project-filter input:checked + i::after {
  content: "✓";
  color: white;
  font-size: 12px;
  font-style: normal;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.result-toolbar p {
  margin: 0;
  color: var(--ink-soft);
}

.result-toolbar p strong {
  color: var(--ink);
}

.result-toolbar button,
.audit-block button {
  padding: 7px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.result-toolbar button:hover,
.audit-block button:hover {
  color: var(--accent);
}

.column-head {
  display: grid;
  grid-template-columns: 90px 82px 120px 116px minmax(280px, 1fr) minmax(150px, 0.5fr);
  align-items: center;
  min-height: 38px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  border-bottom: 1px solid var(--line-strong);
}

.day-group {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  border-bottom: 1px solid var(--line-strong);
  scroll-margin-top: 88px;
}

.day-label {
  position: relative;
  padding: 16px 12px 16px 6px;
  border-right: 1px solid var(--line);
}

.day-label strong {
  display: block;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.day-label span {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-family: var(--serif);
}

.day-label small {
  display: block;
  margin-top: 11px;
  color: #8e8378;
  font-size: 11px;
}

.day-records {
  min-width: 0;
}

.instruction-record {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.instruction-record:last-child {
  border-bottom: 0;
}

.instruction-record::before {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: -5px;
  width: 9px;
  height: 9px;
  content: "";
  background: #b7aa99;
  border: 2px solid var(--paper);
  border-radius: 50%;
}

.record-row {
  display: grid;
  grid-template-columns: 82px 120px 116px minmax(280px, 1fr) minmax(150px, 0.5fr) 30px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 5px 0 5px 18px;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.record-time {
  font-family: var(--serif);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.record-project {
  overflow: hidden;
  padding-right: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-tag {
  justify-self: start;
  padding: 2px 7px;
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag-color) 70%, transparent);
  border-radius: 3px;
  font-family: var(--serif);
  font-size: 12px;
  white-space: nowrap;
}

.category-modify {
  --tag-color: var(--modify);
}

.category-analyze {
  --tag-color: var(--analyze);
}

.category-operate {
  --tag-color: var(--operate);
}

.category-context {
  --tag-color: var(--context);
}

.record-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding-right: 18px;
}

.record-title strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-overtime-status {
  flex: 0 0 auto;
  padding: 1px 6px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.record-context {
  overflow: hidden;
  padding-right: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-chevron {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  transition: transform 160ms ease;
}

.row-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.instruction-record.is-open .row-chevron {
  transform: rotate(90deg);
}

.record-detail {
  margin: 0 14px 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 22px rgb(58 47 37 / 5%);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 24px;
  padding: 10px 14px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.detail-meta b {
  color: var(--ink);
  font-weight: 600;
}

.instruction-segment {
  padding: 14px;
}

.instruction-segment + .instruction-segment {
  border-top: 1px solid var(--line);
}

.segment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.segment-head strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.segment-head button,
.favorite-toggle {
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.segment-head button:hover,
.favorite-toggle:hover {
  color: var(--accent);
}

.segment-location {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin: 0 0 10px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 12px;
}

.segment-location span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.segment-location b {
  color: var(--ink);
}

.instruction-text {
  margin: 0;
  color: #302820;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.attachments {
  padding: 10px 14px;
  color: var(--ink-soft);
  background: #fbf5ef;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.record-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  color: #84796e;
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.favorite-toggle.is-favorite {
  color: var(--accent);
}

mark {
  color: inherit;
  background: #ffe09d;
  border-radius: 2px;
}

.empty-state {
  padding: 88px 24px;
  text-align: center;
}

.empty-state strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.empty-state p {
  color: var(--ink-soft);
}

.coverage-rail {
  min-width: 0;
  padding: 24px 18px 50px;
  background: #f8f6f1;
}

.coverage-sticky {
  position: sticky;
  top: 22px;
}

.coverage-rail h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}

.rail-subtitle {
  margin: 5px 0 14px;
  color: var(--ink-soft);
  font-family: var(--serif);
}

.day-index {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 6px;
}

.day-jump {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 29px;
  padding: 0 6px;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.day-jump:hover,
.day-jump.is-active {
  color: var(--accent);
  background: var(--accent-pale);
  border-left-color: var(--accent);
}

.day-jump span:last-child {
  font-size: 11px;
}

.audit-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}

.audit-block dl {
  margin: 12px 0;
}

.audit-block dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  color: var(--ink-soft);
}

.audit-block dt,
.audit-block dd {
  margin: 0;
}

.audit-block dd {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.audit-block button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line-strong);
}

.archive-dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.archive-dialog::backdrop {
  background: rgb(44 36 29 / 42%);
}

.archive-dialog header,
.archive-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--paper-deep);
}

.archive-dialog header {
  border-bottom: 1px solid var(--line);
}

.archive-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.archive-dialog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.archive-dialog header button {
  width: 34px;
  height: 34px;
  background: transparent;
  border: 0;
  font-size: 24px;
  cursor: pointer;
}

.archive-dialog footer button {
  min-width: 90px;
  min-height: 38px;
  color: white;
  background: var(--brown);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.dialog-copy {
  max-height: 65vh;
  padding: 18px;
  overflow: auto;
}

.dialog-copy p,
.dialog-copy ul {
  margin: 0 0 12px;
}

.dialog-copy code {
  padding: 1px 4px;
  color: var(--accent);
  background: var(--accent-pale);
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 11px 15px;
  color: #fffaf2;
  background: var(--brown);
  border: 1px solid #6d5d4e;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.overtime-view {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(24px, 3vw, 48px) 72px;
}

.overtime-controls {
  display: flex;
  align-items: flex-end;
  gap: 30px;
  min-height: 70px;
  padding: 13px 0 14px;
  border-bottom: 1px solid var(--line-strong);
}

.overtime-select-control {
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.overtime-select-control select {
  min-width: 190px;
  height: 38px;
  padding: 0 36px 0 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
}

.overtime-select-control select:disabled {
  opacity: 1;
}

.overtime-projects {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 320px;
  min-height: 38px;
  padding: 0;
  border: 0;
}

.overtime-projects legend {
  float: left;
  margin-right: 20px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 38px;
}

.overtime-projects label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.overtime-projects input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.overtime-projects i {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

.overtime-projects input:checked + i {
  background: var(--accent);
  border-color: var(--accent);
}

.overtime-projects input:checked + i::after {
  color: white;
  content: "✓";
  font-size: 12px;
  font-style: normal;
}

.overtime-mobile-project {
  display: none;
}

.overtime-summary {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  min-height: 134px;
  border-bottom: 1px solid var(--line-strong);
}

.overtime-summary section {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 20px clamp(24px, 3vw, 48px);
}

.overtime-summary section + section::before {
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 0;
  width: 1px;
  content: "";
  background: var(--line);
}

.overtime-summary span {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
}

.overtime-summary strong {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: clamp(27px, 2.6vw, 42px);
  font-weight: 500;
  line-height: 1.05;
  white-space: nowrap;
}

.overtime-primary-stat strong {
  color: var(--accent);
}

.overtime-primary-stat small {
  margin-top: 7px;
  color: #8a7e71;
  font-size: 12px;
}

.overtime-primary-stat small b {
  color: var(--ink-soft);
}

.overtime-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  border-bottom: 1px solid var(--line-strong);
}

.daily-panel,
.weekday-panel {
  min-width: 0;
  padding: 20px 22px 24px;
}

.weekday-panel {
  border-left: 1px solid var(--line-strong);
}

.section-heading,
.sessions-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2,
.sessions-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.section-heading p,
.sessions-heading p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 10px;
  height: 7px;
  background: #c9c1b6;
  border: 1px solid #a69c90;
  border-radius: 1px;
}

.chart-legend .legend-weekend {
  background: var(--accent);
  border-color: var(--accent);
}

.daily-chart {
  position: relative;
  margin-top: 12px;
}

.daily-chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.daily-bar-chart {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
  overflow: visible;
}

.line-chart-grid line {
  stroke: var(--line);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.line-chart-grid text,
.line-chart-axis-title,
.line-chart-date {
  fill: #8a7e71;
  font-family: var(--sans);
  font-size: 10px;
}

.line-chart-date.is-weekend {
  fill: var(--accent);
  font-weight: 600;
}

.daily-bar-column {
  cursor: default;
  outline: none;
}

.daily-bar-column .bar-focus {
  fill: var(--accent-pale);
  opacity: 0;
  transition: opacity 140ms ease;
}

.daily-bar-column .bar-core {
  fill: #a9a096;
  transition: opacity 140ms ease;
}

.daily-bar-column.is-weekend .bar-core {
  fill: var(--accent);
}

.daily-bar-column .bar-value {
  fill: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
}

.daily-bar-column.is-weekend .bar-value {
  fill: var(--accent);
}

.daily-bar-column:hover .bar-focus,
.daily-bar-column:focus .bar-focus {
  opacity: 0.72;
}

.daily-bar-column:hover .bar-core,
.daily-bar-column:focus .bar-core {
  opacity: 0.82;
}

.chart-scroll-hint {
  display: none;
}

.weekday-bar-track {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  background: var(--paper-deep);
}

.weekday-bar-track i {
  display: block;
  width: var(--bar-size);
  height: 100%;
  background: #c9c1b6;
}

.weekday-bar-row.is-weekend .weekday-bar-track i {
  background: var(--accent);
}

.weekday-chart {
  margin-top: 19px;
}

.weekday-bar-row {
  display: grid;
  grid-template-columns: 30px minmax(50px, 1fr) 76px 34px;
  align-items: center;
  gap: 10px;
  min-height: 35px;
  font-family: var(--serif);
}

.weekday-bar-row strong,
.weekday-bar-row small {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
}

.sessions-panel {
  padding-top: 22px;
}

.sessions-heading {
  align-items: baseline;
  padding: 0 2px 14px;
}

.sessions-heading > strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.session-column-head,
.session-row {
  display: grid;
  grid-template-columns: 180px 220px 170px 100px minmax(140px, 1fr) 32px;
  align-items: center;
}

.session-column-head {
  min-height: 36px;
  padding: 0 14px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 12px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.overtime-session {
  border-bottom: 1px solid var(--line);
}

.overtime-session.is-excluded {
  background: var(--paper-deep);
  border-left: 3px solid var(--line-strong);
}

.overtime-session.is-excluded .session-row {
  padding-left: 11px;
}

.overtime-session.is-excluded .session-duration {
  justify-self: start;
  padding: 2px 7px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
}

.session-row {
  width: 100%;
  min-height: 48px;
  padding: 5px 14px;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.session-row:hover {
  background: rgb(207 77 24 / 3.5%);
}

.session-date,
.session-time,
.session-duration {
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
}

.session-duration {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.session-count,
.session-project {
  color: var(--ink-soft);
  font-size: 12px;
}

.overtime-session.is-open .row-chevron {
  transform: rotate(90deg);
}

.session-detail {
  margin: 0 14px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.session-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.session-detail ol {
  max-height: 320px;
  margin: 0;
  padding: 4px 12px 4px 40px;
  overflow: auto;
}

.session-detail li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 110px;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.session-detail li:last-child {
  border-bottom: 0;
}

.session-detail time {
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
}

.session-detail li span {
  overflow-wrap: anywhere;
}

.session-detail li small {
  color: var(--ink-soft);
  text-align: right;
}

.load-more {
  display: block;
  min-width: 210px;
  min-height: 42px;
  margin: 22px auto 0;
  padding: 0 20px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  cursor: pointer;
}

.load-more:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.overtime-method {
  display: flex;
  gap: 18px;
  margin-top: 32px;
  padding-top: 16px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line-strong);
  font-size: 12px;
}

.overtime-method strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
}

.overtime-method p {
  margin: 0;
}

.chart-empty {
  grid-column: 1 / -1;
  padding: 45px 0;
  color: var(--ink-soft);
  text-align: center;
}

@media (max-width: 1240px) {
  .session-column-head,
  .session-row {
    grid-template-columns: 160px 190px 150px 88px minmax(120px, 1fr) 30px;
  }

  .filter-bar {
    grid-template-columns: minmax(260px, 1fr) auto;
  }

  .project-filter {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .column-head {
    grid-template-columns: 80px 74px 105px 106px minmax(240px, 1fr) minmax(130px, 0.45fr);
  }

  .day-group {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .record-row {
    grid-template-columns: 74px 105px 106px minmax(240px, 1fr) minmax(130px, 0.45fr) 28px;
  }
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
  }

  .header-action {
    padding: 0 7px;
    font-size: 0;
  }

  .header-action span {
    font-size: 18px;
  }

  .view-switcher {
    gap: 8px;
  }

  .view-tab {
    min-width: 80px;
    font-size: 15px;
  }

  .archive-shell {
    display: block;
  }

  .archive-main {
    border-right: 0;
  }

  .coverage-rail {
    padding: 20px;
    border-top: 1px solid var(--line-strong);
  }

  .coverage-sticky {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .audit-block {
    margin-top: 0;
    padding: 0 0 0 24px;
    border-top: 0;
    border-left: 1px solid var(--line-strong);
  }

  .overtime-controls {
    flex-wrap: wrap;
    gap: 12px 24px;
  }

  .overtime-summary {
    grid-template-columns: 1.15fr repeat(3, 1fr);
  }

  .overtime-summary section {
    padding-right: 20px;
    padding-left: 20px;
  }

  .overtime-analytics {
    grid-template-columns: minmax(0, 1fr) 310px;
  }

  .session-column-head,
  .session-row {
    grid-template-columns: 150px 175px 135px 75px minmax(110px, 1fr) 28px;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 60px;
    padding: 10px 16px;
    align-items: center;
  }

  .brand-block h1 {
    font-size: 20px;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .view-switcher {
    position: absolute;
    top: 60px;
    right: 16px;
    left: 16px;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 54px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
  }

  .view-tab {
    min-width: 0;
    min-height: 52px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    font-size: 17px;
  }

  .view-tab + .view-tab {
    border-left: 1px solid var(--line-strong);
  }

  .view-tab::after {
    display: none;
  }

  .view-tab:hover,
  .view-tab.is-active {
    color: #fffaf2;
    background: var(--accent);
  }

  .brand-block p {
    display: none;
  }

  .header-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .header-action {
    width: 36px;
    min-height: 36px;
    padding: 0;
  }

  #export-button {
    display: none;
  }

  .app-view {
    padding-top: 69px;
  }

  .summary-strip {
    display: none;
  }

  .mobile-summary {
    display: block;
    margin: 0;
    padding: 15px 16px 13px;
    color: var(--ink);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.4;
  }

  .mobile-summary strong {
    color: var(--accent);
    font-size: 22px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .mobile-summary span {
    color: var(--ink-soft);
  }

  .archive-main {
    padding: 0 16px 40px;
  }

  .overtime-view {
    padding-right: 16px;
    padding-bottom: 44px;
    padding-left: 16px;
  }

  .overtime-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    padding: 14px 0 16px;
  }

  .overtime-select-control {
    min-width: 0;
  }

  .overtime-select-control > span {
    display: none;
  }

  .overtime-select-control select {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 26px 0 9px;
    font-size: 12px;
  }

  .overtime-projects {
    display: none;
  }

  .overtime-mobile-project {
    display: grid;
    grid-column: 2;
    grid-row: 1;
  }

  .overtime-month-control {
    grid-column: 1;
    grid-row: 1;
  }

  .overtime-category-control {
    grid-column: 3;
    grid-row: 1;
  }

  .overtime-summary {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
    padding-bottom: 12px;
  }

  .overtime-summary section {
    padding: 17px 12px;
    text-align: center;
  }

  .overtime-summary section + section::before {
    top: 18px;
    bottom: 18px;
  }

  .overtime-primary-stat {
    grid-column: 1 / -1;
    min-height: 190px;
    border-bottom: 1px solid var(--line);
  }

  .overtime-summary .overtime-primary-stat::before {
    display: none;
  }

  .overtime-summary span {
    font-size: 16px;
  }

  .overtime-summary strong {
    font-size: clamp(27px, 9vw, 42px);
    white-space: normal;
  }

  .overtime-primary-stat strong {
    margin-top: 13px;
    font-size: clamp(42px, 14vw, 60px);
  }

  .overtime-primary-stat small {
    margin-top: 13px;
    font-size: 13px;
  }

  .overtime-desktop-only {
    display: none !important;
  }

  .overtime-analytics {
    display: block;
  }

  .daily-panel,
  .weekday-panel {
    padding: 24px 0;
  }

  .weekday-panel {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .section-heading h2,
  .sessions-heading h2 {
    font-size: 21px;
  }

  .section-heading p {
    display: none;
  }

  .chart-legend {
    gap: 10px;
    font-size: 10px;
  }

  .daily-chart {
    margin-top: 10px;
    margin-right: -16px;
    margin-left: -16px;
  }

  .daily-chart-scroll {
    padding: 0 16px 8px;
    scroll-padding-left: 16px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .daily-bar-chart {
    width: var(--chart-mobile-width);
    min-width: var(--chart-mobile-width);
  }

  .chart-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 1px 16px 0;
    color: var(--ink-soft);
    font-size: 11px;
  }

  .chart-scroll-hint span {
    color: var(--accent);
    font-size: 15px;
  }

  .weekday-panel {
    display: none;
  }

  .sessions-panel {
    padding-top: 24px;
  }

  .sessions-heading {
    align-items: flex-end;
    padding-bottom: 9px;
  }

  .sessions-heading p {
    display: none;
  }

  .session-column-head {
    display: none;
  }

  .session-row {
    grid-template-columns: 72px minmax(100px, 1fr) minmax(72px, auto) 22px;
    grid-template-areas:
      "date time duration chevron"
      "date count project chevron";
    gap: 2px 10px;
    min-height: 76px;
    padding: 10px 4px;
  }

  .session-date {
    grid-area: date;
    line-height: 1.4;
  }

  .session-time {
    grid-area: time;
    font-size: 14px;
  }

  .session-duration {
    grid-area: duration;
    text-align: right;
  }

  .session-count {
    grid-area: count;
  }

  .session-project {
    grid-area: project;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .session-row .row-chevron {
    grid-area: chevron;
  }

  .session-detail {
    margin: 0 0 12px;
  }

  .session-detail-summary {
    display: grid;
    gap: 3px;
  }

  .session-detail ol {
    padding-left: 34px;
  }

  .session-detail li {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
  }

  .session-detail li small {
    grid-column: 2;
    text-align: left;
  }

  .load-more {
    width: 100%;
    min-height: 48px;
  }

  .overtime-method {
    display: block;
    margin-top: 26px;
  }

  .overtime-method p {
    margin-top: 5px;
  }

  .filter-bar {
    position: static;
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    grid-template-areas:
      "search search"
      "category projects";
    gap: 10px 8px;
    padding: 14px 0 12px;
    background: var(--paper);
    backdrop-filter: none;
  }

  .search-field {
    grid-area: search;
    height: 48px;
    padding: 0 13px;
    border-radius: 3px;
  }

  .search-field > span {
    font-size: 23px;
  }

  .search-field input {
    padding-left: 8px;
    font-size: 14px;
  }

  .search-field kbd {
    display: none;
  }

  .category-filter {
    display: none;
  }

  .mobile-category-control {
    position: relative;
    grid-area: category;
    display: flex;
    align-items: center;
    min-width: 0;
    height: 42px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 3px;
  }

  .mobile-category-control select {
    width: 100%;
    height: 100%;
    padding: 0 30px 0 12px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: inherit;
    outline: 0;
    appearance: none;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
  }

  .mobile-category-control svg {
    position: absolute;
    right: 10px;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
    pointer-events: none;
  }

  .project-filter {
    grid-area: projects;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 6px;
    justify-content: stretch;
    min-width: 0;
  }

  .project-filter > span {
    display: none;
  }

  .project-filter label {
    min-width: 0;
    height: 42px;
    padding: 0 8px;
    gap: 5px;
    justify-content: center;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-size: 13px;
    white-space: nowrap;
  }

  .project-filter i {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
  }

  .desktop-result-copy,
  .result-toolbar > div,
  .column-head {
    display: none;
  }

  .mobile-result-copy {
    display: inline;
  }

  .result-toolbar {
    min-height: 40px;
    padding: 0 2px;
  }

  .result-toolbar p {
    font-size: 13px;
  }

  .day-group {
    display: block;
    scroll-margin-top: 0;
  }

  .day-label {
    position: sticky;
    z-index: 6;
    top: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-height: 48px;
    padding: 11px 2px 9px;
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    backdrop-filter: blur(10px);
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .day-label strong,
  .day-label span,
  .day-label small {
    display: inline;
    margin: 0;
  }

  .day-label strong {
    font-size: 21px;
    letter-spacing: 0.02em;
  }

  .day-label span,
  .day-label small {
    color: var(--ink-soft);
    font-family: var(--sans);
    font-size: 12px;
  }

  .day-label small::before {
    margin-right: 8px;
    content: "·";
  }

  .instruction-record::before {
    display: none;
  }

  .record-row {
    position: relative;
    grid-template-columns: auto auto minmax(0, 1fr) 22px;
    grid-template-areas:
      "time project category arrow"
      "title title title arrow";
    gap: 8px 10px;
    min-height: 0;
    padding: 14px 2px 16px;
  }

  .record-time {
    grid-area: time;
    color: var(--ink-soft);
    font-family: var(--sans);
    font-size: 12px;
  }

  .record-project {
    grid-area: project;
    padding: 0;
    overflow: visible;
    font-size: 12px;
    font-weight: 600;
    text-overflow: clip;
    white-space: nowrap;
  }

  .category-tag {
    grid-area: category;
    align-self: center;
    padding: 1px 6px;
    font-family: var(--sans);
    font-size: 11px;
  }

  .record-title {
    grid-area: title;
    display: block;
    padding: 0;
  }

  .record-overtime-status {
    display: inline-block;
    margin-top: 5px;
    vertical-align: top;
  }

  .record-title strong {
    overflow: visible;
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.62;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .record-context {
    display: none;
  }

  .row-chevron {
    grid-area: arrow;
    align-self: center;
    width: 22px;
    height: 32px;
    color: var(--ink-soft);
  }

  .record-detail {
    margin: 0;
    background: var(--surface);
    border: 0;
    border-top: 1px solid var(--line);
    box-shadow: none;
  }

  .detail-meta {
    display: none;
  }

  .instruction-segment {
    padding: 18px 8px 20px;
  }

  .segment-head {
    margin-bottom: 12px;
  }

  .segment-head strong {
    font-size: 17px;
  }

  .segment-head button {
    min-height: 38px;
    padding: 0 4px;
    color: var(--accent);
    font-size: 13px;
  }

  .segment-location {
    display: block;
    grid-template-columns: 1fr;
    margin: 0 0 14px;
    padding: 10px 0;
    background: transparent;
    border-top: 1px dashed var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }

  .segment-location:not(.has-target),
  .location-page {
    display: none;
  }

  .instruction-text {
    font-size: 16px;
    line-height: 1.75;
  }

  .record-footer {
    align-items: center;
    justify-content: flex-start;
    min-height: 52px;
    padding: 6px 8px;
    background: var(--surface);
  }

  .record-footer > span {
    display: none;
  }

  .favorite-toggle {
    min-height: 40px;
    padding: 0 4px;
    color: var(--accent);
    font-size: 14px;
  }

  .attachments {
    padding: 12px 8px;
    font-size: 13px;
  }

  .coverage-rail {
    display: none;
  }

  .archive-dialog {
    width: calc(100vw - 24px);
  }

  .toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Natural-day rows for merged work sessions that cross midnight. */
.overtime-session.is-split-session .session-row {
  box-shadow: inset 3px 0 0 var(--accent);
}

.overtime-session.is-split-session .session-detail {
  border-left: 3px solid var(--accent);
}

.session-detail li {
  grid-template-columns: 104px minmax(0, 1fr) 128px;
}

.session-detail time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4f5865;
  font-family: var(--sans);
  font-size: 11px;
  white-space: nowrap;
}

.instruction-date {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 6px;
  color: #515a67;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 720;
}

.session-detail li.is-cross-day-instruction {
  background: linear-gradient(90deg, rgb(255 212 0 / 8%), transparent 42%);
}

.is-cross-day-instruction .instruction-date {
  color: #655100;
  background: var(--accent-pale);
  border-color: #efd75f;
}

.session-detail li small em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  color: #655100;
  background: var(--accent-pale);
  border: 1px solid #efd75f;
  border-radius: 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 720;
  white-space: nowrap;
}

.sessions-heading > strong {
  max-width: 340px;
  text-align: right;
}

@media (max-width: 760px) {
  .sessions-heading > strong {
    max-width: 210px;
    line-height: 1.45;
  }

  .session-detail ol {
    padding-right: 10px;
    padding-left: 32px;
  }

  .session-detail li {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 5px 10px;
  }

  .session-detail time {
    grid-row: 1 / span 2;
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 4px;
    padding-top: 1px;
  }

  .session-detail li small {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .sessions-heading {
    align-items: flex-start;
  }

  .sessions-heading > strong {
    max-width: 150px;
    font-size: 10px;
  }

  .session-detail li {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .instruction-date,
  .session-detail li small em {
    padding-right: 5px;
    padding-left: 5px;
    font-size: 9px;
  }
}

/* 2026-07 清爽黄黑视觉系统 */
[hidden] {
  display: none !important;
}

body {
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
strong,
button,
input,
select,
time {
  font-family: var(--sans);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(255 212 0 / 42%);
  outline-offset: 2px;
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  min-height: 72px;
  padding: 10px clamp(24px, 3vw, 48px);
  color: var(--ink);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand-block {
  justify-self: start;
}

.brand-block h1 {
  color: var(--ink);
  font-size: clamp(21px, 1.7vw, 27px);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.brand-block p {
  display: none;
}

.view-switcher {
  align-self: center;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  justify-self: center;
  padding: 4px;
  background: var(--paper-deep);
  border-radius: 12px;
}

.view-tab {
  min-width: 132px;
  min-height: 42px;
  padding: 0 22px;
  color: #5f6672;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.view-tab::after {
  display: none;
}

.view-tab:hover {
  color: var(--ink);
  background: #fff;
}

.view-tab.is-active,
.view-tab.is-active:hover {
  color: #171500;
  background: var(--accent);
  box-shadow: 0 5px 14px rgb(200 160 0 / 18%);
}

.header-actions {
  justify-self: end;
  gap: 8px;
}

.header-action {
  min-height: 40px;
  padding: 0 12px;
  color: #343840;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.header-action:hover {
  color: var(--ink);
  background: var(--paper-deep);
  border-color: #cfd4db;
}

.header-action span {
  width: 18px;
  height: 18px;
  font-size: inherit;
}

.header-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.header-action b {
  font-weight: 650;
}

.toast {
  color: #171500;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-weight: 650;
}

.summary-strip {
  gap: 12px;
  padding: 22px clamp(24px, 3vw, 48px);
  background: #fff;
  border-bottom: 0;
}

.summary-stat {
  min-height: 112px;
  padding: 20px;
  background: var(--paper-deep);
  border: 0;
  border-radius: 14px;
}

.summary-stat + .summary-stat {
  border-left: 0;
}

.summary-stat strong {
  color: var(--ink);
  font-weight: 750;
}

.archive-shell {
  background: #fff;
  border-top: 0;
}

.archive-main {
  border-right-color: var(--line);
}

.filter-bar {
  background: rgb(255 255 255 / 94%);
  border-bottom-color: var(--line);
}

.category-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--paper-deep);
  border: 0;
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
  display: none;
}

.search-field,
.mobile-category-control,
.project-filter label {
  background: var(--paper-deep);
  border-color: transparent;
  border-radius: 10px;
}

.search-field:focus-within {
  background: #fff;
  border-color: #d5dae1;
  box-shadow: 0 0 0 3px rgb(255 212 0 / 20%);
}

.filter-chip {
  min-height: 34px;
  padding: 0 12px;
  background: transparent;
  border-color: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
}

.filter-chip + .filter-chip {
  border-left: 0;
}

.filter-chip:hover,
.filter-chip.is-active {
  color: #171500;
  background: var(--accent);
  border-color: var(--accent);
}

.project-filter input:checked + i,
.overtime-projects input:checked + i {
  color: #171500;
  background: var(--accent);
  border-color: var(--accent);
}

.project-filter input:checked + i::after,
.overtime-projects input:checked + i::after {
  width: 5px;
  height: 9px;
  content: "";
  color: #171500;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

.project-filter i {
  display: grid;
  flex: 0 0 18px;
  place-items: center;
  width: 18px;
  height: 18px;
  line-height: 0;
  border-radius: 4px;
}

.result-toolbar {
  border-bottom-color: var(--line);
}

.column-head {
  color: var(--ink-soft);
  background: var(--paper-deep);
  border-bottom: 0;
}

.day-label {
  background: #fff;
  border-right-color: var(--line);
  border-bottom-color: var(--line);
}

.day-label strong,
.coverage-rail h2,
.audit-block h2 {
  font-weight: 720;
}

.instruction-record::before {
  background: var(--accent);
  border-color: #fff;
}

.instruction-record,
.overtime-session {
  border-bottom-color: var(--line);
}

.category-tag,
.record-overtime-status {
  border-radius: 7px;
}

.category-tag {
  --tag-color: #59616d;
  color: #59616d;
  background: #f1f3f5;
  border-color: transparent;
}

.category-tag.category-modify {
  color: #5d4b00;
  background: var(--accent-pale);
  border-color: #f0d95f;
}

.record-overtime-status {
  color: #5e4b00;
  background: var(--accent-pale);
  border-color: #f0d95f;
}

.record-detail,
.session-detail {
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgb(20 21 24 / 5%);
}

.coverage-rail {
  background: #fff;
}

.audit-block,
.overtime-method {
  border-color: var(--line);
}

.overtime-view {
  max-width: 1540px;
  padding: 0 clamp(24px, 3vw, 48px) 72px;
}

.overtime-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  margin-top: 20px;
  padding: 0;
  border-bottom: 0;
}

.overtime-projects {
  display: none;
}

.overtime-mobile-project {
  display: grid;
  grid-column: 2;
  grid-row: 1;
}

.overtime-month-control {
  grid-column: 1;
  grid-row: 1;
}

.overtime-category-control {
  grid-column: 3;
  grid-row: 1;
}

.overtime-select-control {
  gap: 0;
}

.overtime-select-control > span {
  display: none;
}

.overtime-select-control select {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 42px 0 16px;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 620;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.overtime-select-control select:hover {
  background: #f1f3f5;
}

.overtime-select-control select:focus {
  background: #fff;
  border-color: #d5dae1;
  box-shadow: 0 0 0 3px rgb(255 212 0 / 20%);
}

.overtime-summary {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 12px;
  min-height: 0;
  margin-top: 16px;
  padding: 16px;
  background: var(--paper-deep);
  border: 0;
  border-radius: 16px;
}

.overtime-summary section {
  min-height: 126px;
  padding: 22px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgb(20 21 24 / 4%);
}

.overtime-summary section + section::before {
  display: none;
}

.overtime-summary span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.overtime-summary strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(28px, 2.5vw, 40px);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.overtime-primary-stat strong {
  color: var(--ink);
  font-size: clamp(36px, 3.2vw, 50px);
}

.overtime-primary-stat small {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

.overtime-primary-stat small b {
  color: var(--ink);
  font-weight: 700;
}

#overtime-excluded-count {
  color: var(--accent-ink);
}

.overtime-desktop-only {
  display: none !important;
}

.overtime-analytics {
  display: block;
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgb(20 21 24 / 4%);
  overflow: hidden;
}

.daily-panel {
  padding: 22px 24px 18px;
}

.weekday-panel {
  display: none;
}

.section-heading,
.sessions-heading {
  align-items: center;
}

.section-heading h2,
.sessions-heading h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.section-heading p,
.sessions-heading p {
  color: var(--ink-soft);
  font-size: 12px;
}

.chart-legend {
  color: var(--ink-soft);
  font-size: 12px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  background: #4b515b;
  border: 0;
  border-radius: 3px;
}

.chart-legend .legend-weekend {
  background: var(--accent);
  border: 0;
}

.daily-chart-scroll {
  scrollbar-color: #cfd4da transparent;
}

.daily-bar-chart {
  height: 410px;
}

.line-chart-grid line {
  stroke: #e8ebef;
  stroke-dasharray: none;
}

.line-chart-grid text,
.line-chart-axis-title,
.line-chart-date {
  fill: #7a828e;
}

.line-chart-date.is-weekend,
.daily-bar-column.is-weekend .bar-value {
  fill: var(--accent-ink);
}

.daily-time-column {
  cursor: default;
  outline: none;
}

.daily-time-column .time-track {
  fill: #f1f3f5;
  transition: fill 140ms ease;
}

.daily-time-column .time-segment {
  fill: #4b515b;
  transition: opacity 140ms ease;
}

.daily-time-column.is-weekend .time-segment {
  fill: var(--accent);
}

.daily-time-column:hover .time-track,
.daily-time-column:focus .time-track {
  fill: var(--accent-pale);
}

.daily-time-column:hover .time-segment,
.daily-time-column:focus .time-segment {
  opacity: 0.78;
}

.daily-total {
  fill: #343840;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
}

.daily-total.is-weekend {
  fill: var(--accent-ink);
}

.daily-bar-column .bar-focus {
  fill: var(--accent-pale);
}

.daily-bar-column .bar-core {
  fill: #4b515b;
}

.daily-bar-column.is-weekend .bar-core {
  fill: var(--accent);
}

.daily-bar-column .bar-value {
  fill: #343840;
}

.chart-scroll-hint {
  color: var(--ink-soft);
}

.chart-scroll-hint span {
  color: var(--accent-ink);
}

.sessions-panel {
  margin-top: 20px;
  padding-top: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgb(20 21 24 / 4%);
  overflow: hidden;
}

.sessions-heading {
  min-height: 78px;
  padding: 16px 20px;
}

.sessions-heading > strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 620;
}

.session-column-head,
.session-row {
  grid-template-columns: 1.15fr 1.5fr 0.8fr 0.7fr 1fr 0.7fr 44px;
}

.session-row .row-chevron {
  justify-self: center;
}

.session-column-head {
  min-height: 42px;
  padding: 0 16px;
  color: #737b87;
  background: var(--paper-deep);
  border: 0;
  font-size: 11px;
  font-weight: 650;
}

.session-row {
  min-height: 62px;
  padding: 8px 16px;
  transition: background-color 140ms ease;
}

.session-date,
.session-time,
.session-duration {
  color: var(--ink);
  font-size: 13px;
  font-weight: 570;
}

.session-duration {
  color: var(--accent-ink);
  font-weight: 720;
}

.session-count,
.session-project {
  color: var(--ink-soft);
  font-size: 12px;
}

.session-status {
  justify-self: start;
  min-width: 0;
  padding: 4px 8px;
  color: #5d4b00;
  background: var(--accent-pale);
  border: 1px solid #f0d95f;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.2;
  white-space: nowrap;
}

.session-status:empty {
  visibility: hidden;
}

.overtime-session.is-excluded {
  background: #fafbfc;
  border-left: 0;
}

.overtime-session.is-excluded .session-row {
  padding-left: 16px;
}

.overtime-session.is-excluded .session-duration {
  justify-self: start;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: 13px;
}

.row-chevron {
  width: 34px;
  height: 34px;
  color: #555d68;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.row-chevron svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.session-detail {
  margin: 0 16px 16px;
  background: #fff;
}

.session-detail-summary {
  background: var(--paper-deep);
  border-bottom-color: var(--line);
}

.load-more {
  min-height: 44px;
  margin-bottom: 20px;
  color: var(--ink);
  background: var(--paper-deep);
  border: 0;
  border-radius: 10px;
  font-weight: 650;
}

.load-more:hover {
  color: #171500;
  background: var(--accent);
}

.archive-load-more {
  margin-top: 16px;
}

.overtime-method {
  margin-top: 20px;
  padding: 16px 18px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 0;
  border-radius: 12px;
}

.overtime-method strong {
  color: var(--ink);
  font-weight: 700;
}

.archive-dialog form {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgb(20 21 24 / 18%);
}

.archive-dialog header,
.archive-dialog footer {
  background: var(--paper-deep);
  border-color: var(--line);
}

.archive-dialog footer button {
  color: #171500;
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  font-weight: 700;
}

@media (max-width: 1240px) {
  .site-header {
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  }

  .session-column-head,
  .session-row {
    grid-template-columns: 1.15fr 1.5fr 0.8fr 0.7fr 1fr 0.7fr 44px;
  }
}

@media (max-width: 980px) {
  .site-header {
    align-items: center;
    grid-template-columns: minmax(180px, 1fr) auto minmax(96px, 1fr);
  }

  .view-tab {
    min-width: 108px;
  }

  .header-action {
    width: 40px;
    padding: 0;
    font-size: 0;
  }

  .header-action span {
    width: 20px;
    height: 20px;
  }

  .overtime-summary {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .session-column-head,
  .session-row {
    grid-template-columns: 1.15fr 1.5fr 0.8fr 0.7fr 1fr 0.7fr 44px;
  }
}

@media (max-width: 760px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 44px 48px;
    gap: 12px 0;
    min-height: 0;
    padding: 10px 16px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  .brand-block {
    z-index: 1;
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    pointer-events: none;
  }

  .brand-block h1 {
    font-size: clamp(18px, 5.2vw, 21px);
    font-weight: 760;
    letter-spacing: -0.025em;
  }

  .header-actions {
    z-index: 2;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .header-action {
    width: 40px;
    min-height: 40px;
    color: var(--ink);
    background: var(--paper-deep);
    border: 0;
    border-radius: 11px;
  }

  #export-button {
    display: none;
  }

  .view-switcher {
    position: static;
    z-index: auto;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 48px;
    padding: 0;
    gap: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .view-tab {
    min-width: 0;
    min-height: 48px;
    padding: 0 10px;
    color: #4d5561;
    background: var(--paper-deep);
    border: 0;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 680;
  }

  .view-tab + .view-tab {
    border-left: 0;
  }

  .view-tab:hover {
    color: var(--ink);
    background: #eef1f4;
  }

  .view-tab.is-active,
  .view-tab.is-active:hover {
    color: #171500;
    background: var(--accent);
  }

  .app-view {
    padding-top: 0;
  }

  .overtime-view {
    padding: 0 16px 44px;
  }

  .overtime-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
    padding: 0;
  }

  .overtime-select-control select {
    height: 48px;
    padding: 0 25px 0 10px;
    background: var(--paper-deep);
    border: 0;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 650;
  }

  .overtime-summary {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
  }

  .overtime-summary section {
    min-height: 112px;
    padding: 16px;
    text-align: left;
    border-radius: 11px;
  }

  .overtime-primary-stat {
    grid-column: 1 / -1;
    min-height: 154px;
    border-bottom: 0;
  }

  .overtime-summary span {
    font-size: 13px;
  }

  .overtime-summary strong {
    margin-top: 8px;
    font-size: clamp(25px, 7.4vw, 32px);
    white-space: nowrap;
  }

  .overtime-primary-stat strong {
    margin-top: 13px;
    font-size: clamp(38px, 12vw, 50px);
  }

  .overtime-secondary-stat strong {
    max-width: 100%;
    font-size: clamp(20px, 6.2vw, 28px);
    letter-spacing: -0.055em;
  }

  .overtime-primary-stat small {
    margin-top: 12px;
    font-size: 12px;
  }

  .overtime-analytics {
    margin-top: 12px;
    border-radius: 14px;
  }

  .daily-panel {
    padding: 18px;
  }

  .section-heading h2,
  .sessions-heading h2 {
    font-size: 18px;
  }

  .chart-legend {
    gap: 10px;
    font-size: 10px;
  }

  .daily-chart {
    margin: 10px -18px 0;
  }

  .daily-chart-scroll {
    padding: 0 18px 8px;
    scroll-padding-left: 18px;
  }

  .chart-scroll-hint {
    margin-right: 14px;
    margin-left: 14px;
  }

  .sessions-panel {
    margin-top: 12px;
    border-radius: 14px;
  }

  .sessions-heading {
    min-height: 68px;
    padding: 14px 16px;
  }

  .sessions-heading > strong {
    font-size: 11px;
  }

  .session-row {
    grid-template-columns: 70px minmax(0, 1fr) minmax(68px, auto) 38px;
    grid-template-areas:
      "date time duration chevron"
      "count project status chevron";
    gap: 4px 8px;
    min-height: 76px;
    padding: 10px 12px;
  }

  .session-date {
    grid-area: date;
    align-self: end;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.25;
  }

  .session-time {
    grid-area: time;
    align-self: end;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .session-duration {
    grid-area: duration;
    align-self: end;
    justify-self: end;
    font-size: 12px;
    text-align: right;
  }

  .session-count {
    grid-area: count;
    align-self: start;
    font-size: 11px;
  }

  .session-project {
    grid-area: project;
    align-self: start;
    overflow: hidden;
    font-size: 11px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .session-status {
    grid-area: status;
    align-self: start;
    justify-self: end;
    padding: 3px 6px;
    font-size: 10px;
  }

  .session-row .row-chevron {
    grid-area: chevron;
    align-self: center;
    justify-self: center;
    width: 34px;
    height: 34px;
  }

  .overtime-session.is-excluded .session-row {
    padding-left: 12px;
  }

  .overtime-session.is-excluded .session-duration {
    justify-self: end;
    font-size: 12px;
  }

  .session-detail {
    margin: 0 12px 12px;
  }

  .load-more {
    width: calc(100% - 24px);
  }

  .overtime-method {
    display: block;
    margin-top: 12px;
    padding: 14px;
  }

  .filter-bar {
    background: #fff;
  }

  .category-filter {
    display: none;
  }

  .mobile-summary {
    color: var(--ink);
    background: #fff;
    border-bottom-color: var(--line);
  }

  .mobile-summary strong {
    color: var(--accent-ink);
    font-weight: 750;
  }

  .day-label {
    background: rgb(255 255 255 / 96%);
    border-bottom-color: var(--line);
  }

  .record-row {
    grid-template-columns: auto auto minmax(0, 1fr) 40px;
    padding-right: 8px;
    padding-left: 8px;
    border-radius: 0;
  }

  .record-row .row-chevron {
    grid-area: arrow;
    align-self: center;
    justify-self: center;
    width: 34px;
    height: 34px;
  }

  .project-filter label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
  }

  .record-title strong {
    font-size: 15px;
    font-weight: 600;
  }

  .row-chevron {
    color: #555d68;
  }
}

@media (max-width: 390px) {
  .site-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand-block h1 {
    font-size: 18px;
  }

  .overtime-view {
    padding-right: 12px;
    padding-left: 12px;
  }

  .overtime-controls {
    gap: 6px;
  }

  .overtime-select-control select {
    padding-right: 20px;
    padding-left: 8px;
    font-size: 11px;
  }

  .overtime-summary {
    padding: 10px;
  }

  .overtime-summary section {
    padding: 14px;
  }

  .session-row {
    grid-template-columns: 66px minmax(0, 1fr) minmax(62px, auto) 36px;
    column-gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

/* Theme-aligned select menus and precise mobile action alignment. */
.header-action {
  justify-content: center;
}

.header-action svg {
  display: block;
}

.overtime-controls {
  position: relative;
  z-index: 20;
  overflow: visible;
}

.overtime-select-control {
  position: relative;
}

.overtime-select-control .custom-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.custom-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px 0 16px;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.custom-select-button:hover:not(:disabled) {
  background: #f1f3f5;
}

.custom-select-button:focus-visible,
.overtime-select-control.is-open .custom-select-button {
  background: #fff;
  border-color: #d5dae1;
  box-shadow: 0 0 0 3px rgb(255 212 0 / 22%);
  outline: none;
}

.custom-select-button:disabled {
  color: var(--ink);
  cursor: default;
  opacity: 1;
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-chevron {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-left: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transition: transform 150ms ease;
}

.overtime-select-control.is-open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-button:disabled .custom-select-chevron {
  opacity: 0.58;
}

.custom-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  min-width: max-content;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 46px rgb(20 21 24 / 16%);
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  color: #343840;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  color: var(--ink);
  background: var(--paper-deep);
  outline: none;
}

.custom-select-option.is-selected {
  color: #332a00;
  background: var(--accent-pale);
}

.custom-select-option i {
  width: 18px;
  color: #8a7000;
  font-style: normal;
  text-align: center;
  opacity: 0;
}

.custom-select-option.is-selected i {
  opacity: 1;
}

@media (max-width: 980px) {
  .header-action {
    gap: 0;
  }
}

@media (max-width: 760px) {
  .custom-select-button {
    height: 48px;
    padding: 0 12px 0 10px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 650;
  }

  .custom-select-chevron {
    flex-basis: 14px;
    width: 14px;
    height: 14px;
    margin-left: 6px;
  }

  .custom-select-menu {
    top: calc(100% + 6px);
    min-width: 100%;
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 14px 36px rgb(20 21 24 / 18%);
  }

  .custom-select-option {
    gap: 8px;
    min-height: 38px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  .custom-select-button {
    padding-right: 10px;
    padding-left: 8px;
    font-size: 11px;
  }
}

/* Compact visual explanation of centered instruction intervals. */
.timing-explainer {
  margin-top: 16px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 34px rgb(20 21 24 / 4%);
}

.timing-explainer-heading {
  display: block;
}

.timing-explainer-heading > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 14px;
}

.timing-explainer-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.timing-explainer-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.timing-explainer-grid {
  margin-top: 10px;
}

.interval-example {
  --timing-label-column: 72px;
  --timing-track-gap: 10px;
  margin: 0;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid #e7eaee;
}

.interval-example figcaption {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.interval-demo {
  margin-top: 6px;
}

.interval-overlap-label,
.interval-row,
.interval-axis {
  display: grid;
  grid-template-columns: var(--timing-label-column) minmax(0, 1fr);
  gap: var(--timing-track-gap);
}

.interval-overlap-label {
  align-items: end;
  min-height: 21px;
  margin-bottom: 3px;
}

.interval-overlap-label > div {
  position: relative;
  height: 21px;
}

.interval-overlap-label b {
  position: absolute;
  bottom: 0;
  left: 23.077%;
  display: grid;
  width: 53.846%;
  min-width: 96px;
  min-height: 18px;
  place-items: center;
  color: #665100;
  background: transparent;
  border: 0;
  border-top: 1px solid #d6af00;
  border-right: 1px solid #d6af00;
  border-left: 1px solid #d6af00;
  border-radius: 5px 5px 0 0;
  font-size: 9px;
  font-weight: 760;
  transform: translateX(-1px);
  white-space: nowrap;
}

.interval-row {
  align-items: center;
  min-height: 44px;
}

.interval-row + .interval-row {
  margin-top: 4px;
}

.interval-row-merged {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #e7eaee;
}

.interval-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.interval-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  min-height: 22px;
  padding: 0;
  color: #3f4650;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 740;
  white-space: nowrap;
}

.interval-row-merged .interval-label span {
  color: #5a4800;
  background: #fff8cf;
  border-color: #efd75f;
}

.interval-track {
  position: relative;
  height: 30px;
  overflow: hidden;
  background: #e3e7eb;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgb(65 72 82 / 5%);
}

.interval-bar {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  display: block;
  width: 76.923%;
  color: #4c3d00;
  background: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
}

.interval-bar-first {
  left: 0;
}

.interval-bar-second {
  left: 23.077%;
}

.instruction-point {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #24282f;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgb(20 21 24 / 28%);
  transform: translate(-50%, -50%);
}

.interval-bar-merged {
  left: 0;
  width: 100%;
}

.merged-duration {
  display: grid;
  height: 100%;
  place-items: center;
  color: #584700;
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
}

.interval-axis {
  margin-top: 5px;
}

.interval-axis > div {
  position: relative;
  height: 13px;
  color: #7b8491;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.interval-axis i {
  position: absolute;
  font-style: normal;
  transform: translateX(-50%);
}

.interval-axis i:nth-child(1) {
  left: 0;
  transform: none;
}

.interval-axis i:nth-child(2) {
  left: 38.462%;
}

.interval-axis i:nth-child(3) {
  left: 61.538%;
}

.interval-axis i:nth-child(4) {
  right: 0;
  transform: none;
}

@media (max-width: 760px) {
  .timing-explainer {
    margin-top: 12px;
    padding: 16px 14px;
    border-radius: 14px;
  }

  .timing-explainer-heading > div {
    display: block;
  }

  .timing-explainer-heading h2 {
    margin: 0;
    font-size: 18px;
  }

  .timing-explainer-heading p {
    margin-top: 3px;
    max-width: none;
    font-size: 12px;
  }

  .timing-explainer-grid {
    margin-top: 10px;
  }

}

@media (max-width: 420px) {
  .interval-example {
    --timing-label-column: 62px;
    --timing-track-gap: 8px;
  }

  .timing-explainer-heading p {
    max-width: 28ch;
  }

  .interval-overlap-label,
  .interval-row,
  .interval-axis {
    grid-template-columns: var(--timing-label-column) minmax(0, 1fr);
    gap: var(--timing-track-gap);
  }

  .interval-overlap-label b {
    min-width: 84px;
    font-size: 8px;
  }
}

/* Final chart label sizing after the theme and responsive overrides above. */
.daily-bar-chart {
  height: 428px;
}

.line-chart-weekday {
  fill: #8a929d;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
}

.line-chart-weekday.is-weekend {
  fill: var(--accent-ink);
  font-weight: 720;
}

/* Time semantics: dark office hours, yellow overtime on every day. */
.chart-legend .legend-office {
  background: #4b515b;
  border: 0;
}

.chart-legend .legend-overtime {
  background: var(--accent);
  border: 0;
}

.daily-time-column .office-hours {
  fill: #4b515b;
}

.daily-time-column .time-segment,
.daily-time-column.is-weekend .time-segment {
  fill: var(--accent);
}

.daily-time-column:hover .office-hours,
.daily-time-column:focus .office-hours {
  fill: #373d46;
}

.daily-total,
.daily-total.is-weekend {
  fill: var(--accent-ink);
}

.weekday-bar-track i,
.weekday-bar-row.is-weekend .weekday-bar-track i {
  background: var(--accent);
}

/* Rich instruction details for daily chart segments. */
.daily-time-column .time-segment {
  cursor: help;
  outline: none;
}

.daily-time-column .time-segment.is-tooltip-active,
.daily-time-column .time-segment:focus {
  filter: drop-shadow(0 0 4px rgb(255 212 0 / 70%));
  stroke: #fff;
  stroke-width: 1.5px;
}

.daily-chart-tooltip {
  position: fixed;
  z-index: 120;
  width: min(430px, calc(100vw - 24px));
  max-height: min(480px, 74vh);
  overflow: auto;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
  box-shadow: 0 22px 60px rgb(20 21 24 / 22%);
  overscroll-behavior: contain;
}

.daily-chart-tooltip > header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 12px;
  background: rgb(255 255 255 / 96%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.daily-chart-tooltip > header > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.daily-chart-tooltip header strong {
  font-size: 15px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.daily-chart-tooltip header span {
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.daily-chart-tooltip header button {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: -5px;
  margin-right: -5px;
  padding: 0;
  color: #59616d;
  background: var(--paper-deep);
  border: 0;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.daily-chart-tooltip header button:hover {
  color: var(--ink);
  background: var(--accent-pale);
}

.chart-tooltip-count {
  margin: 12px 14px 2px;
  color: #6b7480;
  font-size: 11px;
  font-weight: 680;
}

.daily-chart-tooltip ol {
  margin: 0;
  padding: 4px 14px 14px;
  list-style: none;
}

.daily-chart-tooltip li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.daily-chart-tooltip li:last-child {
  border-bottom: 0;
}

.daily-chart-tooltip li > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-chart-tooltip time {
  color: #4f5865;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.daily-chart-tooltip li small {
  color: #7a838f;
  font-size: 10px;
  text-align: right;
}

.daily-chart-tooltip li p {
  margin-top: 6px;
  color: #252a31;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .daily-chart-tooltip {
    top: auto !important;
    right: 12px;
    bottom: 12px;
    left: 12px !important;
    width: auto;
    max-height: 62vh;
    border-radius: 12px;
  }

  .daily-chart-tooltip > header {
    padding: 12px;
  }

  .daily-chart-tooltip ol {
    padding-right: 12px;
    padding-left: 12px;
  }

  .daily-chart-tooltip li > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .daily-chart-tooltip li small {
    text-align: left;
  }
}

/* Expanded session details use the page scroll only; highlight the chevron, not the row. */
.session-row:hover,
.session-row:focus-visible,
.overtime-session.is-open .session-row {
  background: transparent;
  outline: none;
}

.record-row:hover,
.record-row:focus-visible,
.instruction-record.is-open .record-row {
  background: transparent;
  outline: none;
}

.record-row:hover .row-chevron,
.record-row:focus-visible .row-chevron {
  color: #4f4000;
  background: var(--accent-pale);
  border-color: #e7cc49;
}

.record-row:focus-visible .row-chevron {
  box-shadow: 0 0 0 3px rgb(255 212 0 / 24%);
}

.instruction-record.is-open .row-chevron {
  color: #332a00;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
  transform: rotate(90deg);
}

.session-row:hover .row-chevron,
.session-row:focus-visible .row-chevron {
  color: #4f4000;
  background: var(--accent-pale);
  border-color: #e7cc49;
}

.session-row:focus-visible .row-chevron {
  box-shadow: 0 0 0 3px rgb(255 212 0 / 24%);
}

.overtime-session.is-open .row-chevron {
  color: #332a00;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
  transform: rotate(90deg);
}

.session-detail,
.overtime-session.is-split-session .session-detail {
  margin: 0 16px 14px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.session-detail-summary {
  gap: 5px 24px;
  padding: 9px 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.session-detail ol {
  max-height: none;
  margin: 0;
  padding: 2px 0 2px 30px;
  overflow: visible;
}

.session-detail li {
  padding-top: 9px;
  padding-bottom: 9px;
}

@media (max-width: 760px) {
  .session-detail,
  .overtime-session.is-split-session .session-detail {
    margin-right: 12px;
    margin-left: 12px;
  }

  .session-detail ol {
    padding-right: 0;
    padding-left: 28px;
  }
}

/* Desktop archive columns share the exact record grid; compact date labels avoid empty group space. */
@media (min-width: 981px) {
  .column-head {
    grid-template-columns: 108px 82px 120px 116px minmax(280px, 1fr) minmax(150px, 0.5fr) 30px;
  }

  .day-label {
    padding: 12px 12px 12px 6px;
  }

  .day-label span {
    margin-top: 3px;
  }

  .day-label small {
    margin-top: 5px;
  }
}

@media (min-width: 981px) and (max-width: 1240px) {
  .column-head {
    grid-template-columns: 98px 74px 105px 106px minmax(240px, 1fr) minmax(130px, 0.45fr) 28px;
  }
}
