/* Keep tables readable instead of shrinking ten columns into a phone width. */
.monthly-report-table { overflow-x: auto !important; max-width: 100%; }
#monthly-attendance-table { min-width: 900px !important; font-size: 14px !important; }
#monthly-attendance-table th, #monthly-attendance-table td { font-size: 14px !important; white-space: nowrap; }
.modal-content { max-height: calc(100dvh - 2rem) !important; overflow-y: auto !important; overscroll-behavior: contain; }
:focus-visible { outline: 3px solid #111827; outline-offset: 3px; }
.calendar-panel { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.calendar-panel .calendar-container { position: static; height: auto; max-height: none; overflow: visible; }
.calendar-panel .calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-panel .calendar-day { min-width: 0; min-height: 0; overflow: hidden; }
.calendar-day .holiday-name, .calendar-day .holiday-content { width: 100%; min-width: 0; }
.calendar-day .holiday-name, .calendar-day .holiday-content > div { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.calendar-day .holiday-content { max-height: 28px; overflow: hidden; }
.calendar-container .calendar-controls { flex-wrap: wrap; gap: 10px; align-items: center; }
.calendar-container .calendar-controls > div { flex-wrap: wrap; max-width: 100%; }
.calendar-container .month-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.calendar-container .calendar-controls .btn { padding: 8px 10px !important; font-size: 12px !important; white-space: nowrap; }
.calendar-container .monthly-summary-card { width: 100%; min-width: 0; margin-top: 14px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--border-color); background: transparent; }
.calendar-container .monthly-summary-card h3 { font-size: 12px; margin-bottom: 8px; padding-bottom: 0; border: 0; }
.calendar-container .monthly-summary { padding: 0; }
.calendar-container .progress-bar-container { margin-bottom: 6px; }
.calendar-container .progress-bar { height: 8px; margin-bottom: 8px; }
.calendar-container .progress-fill { padding: 0; min-width: 0; }
.calendar-container .progress-marker { position: absolute; top: 0; height: 100%; width: 1px; background: #6b7280; pointer-events: none; }
.calendar-container .progress-labels { display: block; position: relative; height: 14px; font-size: 10px; }
.calendar-container .progress-label { position: absolute; left: 0; top: 0; white-space: nowrap; }
.calendar-container .progress-label:before { content: none; }
.calendar-container .summary-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.calendar-container .stat-item { padding: 4px 0; background: transparent; border-radius: 0; text-align: left; }
.calendar-container .stat-label { font-size: 10px; margin-bottom: 2px; }
.calendar-container .stat-value { font-size: 14px; }
.calendar-panel .progress-container { height: auto; }
.status-row { grid-template-columns: minmax(0, 1fr); }
#monthly-summary-status { color: #4b5563; font-size: 13px; }
.clock-control { min-width: 0; }
.clock-section .clock { font-size: clamp(2.5rem, 9vw, 6rem); }
.clock-control .btn { width: 100%; }
.clock-stamps { margin-top: 8px; font-size: 11px; color: #6b7280; }
.stamp-line { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; line-height: 1.8; }
.stamp-line time { color: #111827; font-weight: 600; font-variant-numeric: tabular-nums; }
.stamp-pair + .stamp-pair { margin-top: 6px; padding-top: 6px; border-top: 1px solid #e5e7eb; }
.older-stamps { margin-top: 4px; }
.older-stamps summary { cursor: pointer; font-size: 10px; }
.older-stamps-list { max-height: 132px; overflow-y: auto; margin-top: 4px; }
.day-off-detail { text-align: center; line-height: 1.8; }
.active-break-counter { align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 4px 0 10px; padding: 8px 12px; color: #92400e; background: #fef3c7; border-radius: 8px; font-size: 12px; }
.active-break-counter strong { color: #b45309; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.active-break-counter.is-outing { background: #e0f2fe; color: #075985; }
.active-break-counter.is-outing strong { color: #0369a1; }
.counter-start { font-size: 11px; }
.daily-work-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.daily-work-totals { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #6b7280; font-size: 12px; }
.daily-work-totals strong { color: #111827; font-variant-numeric: tabular-nums; }
#daily-work-date:empty { display: none; }
.clock-section .edit-today { padding: 8px 10px; font-size: 12px; background: #f39c12; color: white; }
.clock-section .clock-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.clock-section .clock-controls .btn { padding: 12px 6px; font-size: 14px; min-width: 0; white-space: nowrap; }
.clock-controls .btn-outing { background: #0891b2; color: white; }
.clock-controls .btn:disabled { opacity: 1 !important; color: #545965 !important; background: #dfe2e7 !important; }
.work-mode-control { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; }
.work-mode-control select { width: auto; padding: 6px 10px; font-size: 13px; border: 1px solid #d1d5db; background: white; border-radius: 6px; }
button:disabled { opacity: 1; color: #545965 !important; background: #dfe2e7 !important; cursor: not-allowed; }
.mobile-monthly-list { display: none; }
@media (min-width: 1024px) {
    .container { align-items: stretch; }
    .left-panel, .calendar-panel { align-self: stretch; }
    .left-panel > .clock-section { flex: 1; justify-content: flex-start; }
    .calendar-panel > .calendar-container { flex: 1; }
    .clock-section .clock-controls { margin-bottom: 20px; }
    .clock-section .daily-work-footer { margin-top: auto; }
}
@media (min-width: 769px) and (max-width: 1023px) {
    .container { grid-template-columns: minmax(0, 1fr); }
    .clock-section .daily-work-footer { margin-top: 20px; }
}
@media (max-width: 768px) {
    .calendar-panel { width: 100%; max-width: 100%; }
    .calendar-panel .calendar-day { aspect-ratio: auto; height: 60px; min-height: 60px; max-height: 60px; }
    .clock, #current-time { font-size: clamp(2.5rem, 10vw, 4rem) !important; }
    .calendar-controls > div { flex-wrap: wrap; }
    .modal-content { margin: 1rem auto !important; }
    #monthly-list .monthly-report-table { display: none; }
    .mobile-monthly-list { display: grid; margin-top: 16px; border-top: 1px solid var(--border-color); }
    .monthly-day { min-width: 0; border-bottom: 1px solid var(--border-color); }
    .monthly-day > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 10px; align-items: center; gap: 8px; min-height: 48px; padding: 10px 2px; font-size: 12px; list-style: none; cursor: pointer; }
    .monthly-day > summary::-webkit-details-marker { display: none; }
    .monthly-day > summary::after { content: '⌄'; color: #6b7280; text-align: center; }
    .monthly-day[open] > summary::after { transform: rotate(180deg); }
    .monthly-day-times { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .monthly-day-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; padding: 8px 2px 12px; font-size: 12px; }
    .monthly-day-details > div { min-width: 0; overflow-wrap: anywhere; }
    .monthly-day-label { display: block; margin-bottom: 4px; color: #6b7280; font-size: 10px; }
    .monthly-day-details > div:nth-child(5), .monthly-day-details > div:nth-child(6) { grid-column: span 2; }
    .monthly-day-action { grid-column: 1 / -1; text-align: right; }
    .monthly-day-action .btn { min-height: 40px; padding: 8px 16px; font-size: 12px; }
}
@media (max-width: 480px) {
    .calendar-container .progress-labels { height: 26px; }
    .calendar-container #minashi-hours-label { top: 12px; }
    .calendar-container .summary-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .clock-section .clock-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .clock-section .clock-controls .btn { font-size: 12px; }
}

.clock, #clock { font-variant-numeric: tabular-nums; }
