/*
 * WORKDAYS: the tool's own components, styled in the site's design language (7 Oct 2026, on the UltraCompress Pro
 * template, after PaletteSnape). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk, buttons, theme toggle,
 * focus rings) and /libs/shared-nav.css (the site's header and footer). This file holds only what the tool itself
 * needs: the toolbar with the status pill and the six pill tabs, the cards, the forms and chips, the result boxes
 * with their stat tiles and tables, the calendar, the holiday, saved and history lists, the work week rows, the
 * toggles, the confirmation window, the toasts, the print layout and the information sections. Light is the default;
 * dark applies when <html> has no data-theme.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --working: #166534; --working-bg: rgba(22, 163, 74, 0.12);
    --weekend: #475569; --weekend-bg: rgba(100, 116, 139, 0.14);
    --holiday: #b91c1c; --holiday-bg: rgba(220, 38, 38, 0.12);
    --half: #92400e; --half-bg: rgba(217, 119, 6, 0.14);
    --range: rgba(139, 92, 246, 0.16);
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --working: #4ade80; --working-bg: rgba(74, 222, 128, 0.16);
    --weekend: #94a3b8; --weekend-bg: rgba(148, 163, 184, 0.16);
    --holiday: #f87171; --holiday-bg: rgba(248, 113, 113, 0.18);
    --half: #fbbf24; --half-bg: rgba(251, 191, 36, 0.18);
    --range: rgba(167, 139, 250, 0.22);
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- Tools back link above the header, as on every other tool ----- */
body { padding-top: 0; }
.back-bar { height: 48px; display: flex; align-items: center; padding: 0 var(--zdu-gutter, 24px); }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: calc(90px + var(--bar-offset, 48px)); }
@media (max-width: 768px) { .theme-toggle { top: calc(75px + var(--bar-offset, 48px)); } }
.hidden-input { display: none; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.btn-icon.btn-sm { width: 38px; height: 38px; padding: 0; }
.btn-icon.btn-sm svg { width: 17px; height: 17px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-stack--top { margin-top: 14px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 220px; max-width: 100%; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view[hidden] { display: none; }
.shell-hint { margin-top: 14px; }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }

/* ----- Cards ----- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.card-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card--wide { grid-column: span 2; }
.card-grid--three .card, .card-grid--two .card { grid-column: auto; }
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; margin-bottom: 0; }
.view > .card { margin-bottom: 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { margin: 0; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-note { font-size: 0.8125rem; color: var(--text-3); }
.card-body { padding: 16px 20px 20px; flex: 1; }
.sub-title { font-size: 0.95rem; font-weight: 700; margin: 18px 0 8px; color: var(--text-strong); }
.form-hint { font-size: 0.78rem; color: var(--text-3); margin: 10px 0 0; line-height: 1.5; }

/* ----- Forms ----- */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.form-row--tight { grid-template-columns: minmax(0, 1fr) 130px; }
.form-group { margin-bottom: 14px; min-width: 0; }
.form-row .form-group { margin-bottom: 0; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-strong); }
.form-input { width: 100%; min-width: 0; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.form-input::placeholder { color: var(--placeholder); }
input[type="date"].form-input { color-scheme: light; }
:root:not([data-theme="light"]) input[type="date"].form-input { color-scheme: dark; }
select.form-input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
select.form-input option { color: #0a0a14; background: #fff; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .form-input { flex: 1; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { padding: 7px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.choice-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.choice-btn--sm { padding: 7px 13px; font-size: 0.8rem; }
.choice-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.choice-btn[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.choice-btn:disabled { cursor: default; opacity: 0.7; }
.choice-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid transparent; background: transparent; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); background: var(--surface); }
.icon-btn.is-danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Results ----- */
.result-box { margin-top: 18px; padding: 18px 20px 20px; border-radius: 14px; background: var(--tint-brand); border: 1px solid var(--tint-brand-border); }
.result-box[hidden] { display: none; }
.result-main { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 16px; }
.result-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.result-value { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 3rem; font-weight: 700; line-height: 1.1; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.result-value--date { font-size: 2rem; }
.result-span { font-size: 0.85rem; color: var(--text-2); margin-top: 4px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-tiles--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-tile { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 12px; padding: 12px 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--brand); }
.stat-tile.working { border-top-color: var(--working); } .stat-tile.weekend { border-top-color: var(--weekend); } .stat-tile.holiday { border-top-color: var(--holiday); } .stat-tile.half { border-top-color: var(--half); }
.stat-num { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: 0.72rem; color: var(--text-3); line-height: 1.3; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--surface-border); color: var(--text); white-space: nowrap; }
.data-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 600; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.total td { font-weight: 700; color: var(--text-strong); }
.data-table .num-strong { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; background: var(--brand); }
.dot.working { background: var(--working); } .dot.weekend { background: var(--weekend); } .dot.holiday { background: var(--holiday); } .dot.half { background: var(--half); } .dot.range { background: var(--range); border: 1px solid var(--brand); }

/* ----- Calendar ----- */
.month-nav, .year-nav { display: flex; align-items: center; gap: 8px; }
.year-nav { justify-content: center; margin-bottom: 10px; }
.month-label { font-weight: 700; font-size: 0.9rem; color: var(--text-strong); min-width: 130px; text-align: center; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 4px; }
.cal-weekdays span { text-align: center; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-day { aspect-ratio: 1; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; position: relative; transition: transform 0.15s ease, border-color 0.15s ease; }
.cal-day.is-empty { background: transparent; cursor: default; }
.cal-day.working { background: var(--working-bg); color: var(--working); }
.cal-day.weekend { background: var(--weekend-bg); color: var(--weekend); }
.cal-day.holiday { background: var(--holiday-bg); color: var(--holiday); }
.cal-day.half { background: var(--half-bg); color: var(--half); }
.cal-day.in-range { box-shadow: inset 0 0 0 2px var(--range); }
.cal-day.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--ring); }
.cal-day.today::after { content: ''; position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: currentColor; }
.cal-day:not(.is-empty):hover { transform: translateY(-1px); border-color: var(--brand); }
.cal-day:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.legend-item { font-size: 0.75rem; color: var(--text-2); display: inline-flex; align-items: center; }
.legend-item .dot { margin-right: 6px; }

/* ----- Lists: holidays, saved configurations, history ----- */
.holiday-list { display: flex; flex-direction: column; gap: 6px; }
.holiday-list--columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.holiday-list--scroll { max-height: 300px; overflow-y: auto; padding-right: 2px; }
.holiday-list--top { margin-top: 14px; }
.holiday-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.holiday-item.is-off { opacity: 0.7; }
.holiday-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.holiday-name { font-weight: 600; font-size: 0.875rem; color: var(--text-strong); }
.holiday-date { font-size: 0.75rem; color: var(--text-3); }
.holiday-source { font-size: 0.7rem; color: var(--text-3); border: 1px solid var(--chip-border); border-radius: 9999px; padding: 2px 8px; white-space: nowrap; }
.list-empty { color: var(--text-3); font-size: 0.875rem; margin: 0; padding: 10px 0; line-height: 1.5; }
.rule-list { margin: 0; padding-left: 18px; }
.rule-list li { margin-bottom: 10px; color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }
.rule-list li:last-child { margin-bottom: 0; }
.rule-list strong { color: var(--text-strong); }
.saved-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.saved-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 12px; background: var(--surface-2); }
.saved-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.saved-name { font-weight: 600; font-size: 0.88rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-meta { font-size: 0.72rem; color: var(--text-3); }
.saved-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.history-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.history-type { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--link); }
.history-details { font-size: 0.85rem; color: var(--text-strong); }
.history-time { font-size: 0.72rem; color: var(--text-3); }
.history-result { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 0.9rem; color: var(--text-strong); white-space: nowrap; text-align: right; }

/* ----- Batch rows ----- */
.batch-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.batch-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 10px; align-items: end; }
.batch-row .form-group { margin-bottom: 0; }
.batch-row .icon-btn { margin-bottom: 5px; }

/* ----- Work week rows and toggles ----- */
.week-rows { display: flex; flex-direction: column; gap: 6px; }
.week-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.week-row label { font-size: 0.9rem; font-weight: 600; color: var(--text-strong); }
.week-row .form-input { width: 130px; padding: 7px 32px 7px 12px; font-size: 0.85rem; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--surface-border); }
.switch-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-label { font-weight: 600; font-size: 0.9rem; color: var(--text-strong); }
.switch-hint { font-size: 0.75rem; color: var(--text-3); }
.toggle { position: relative; width: 46px; height: 26px; flex-shrink: 0; border-radius: 9999px; border: 0; padding: 0; background: var(--chip-border); cursor: pointer; transition: background 0.2s ease; }
.toggle .toggle-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s ease; }
.toggle[aria-checked="true"] { background: var(--gradient-brand); }
.toggle[aria-checked="true"] .toggle-knob { transform: translateX(20px); }
.toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Windows ----- */
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 20px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); width: 100%; max-width: 520px; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; transform: translateY(12px); transition: transform 0.25s ease; }
.modal--narrow { max-width: 420px; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { margin: 0; font-size: 1.15rem; }
.modal-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s ease, color 0.2s ease; }
.modal-close:hover { border-color: var(--brand); color: var(--link); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-message { margin: 0; color: var(--text); }

/* ----- Toasts ----- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.toast { background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 400px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast-icon { font-size: 0.95rem; font-weight: 700; line-height: 1; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.12); flex-shrink: 0; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left-color: #4ade80; } .toast.error { border-left-color: #f87171; } .toast.warning { border-left-color: #fbbf24; } .toast.info { border-left-color: #38bdf8; }
.toast.leaving { opacity: 0; transform: translateX(40px); }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

/* ----- Tablets ----- */
@media (max-width: 1023px) {
    .card-grid, .card-grid--two { grid-template-columns: 1fr; }
    .card--wide { grid-column: auto; }
    .holiday-list--columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-section .info-grid { grid-template-columns: repeat(2, 1fr); }
    .info-three { grid-template-columns: 1fr; }
}

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .status-pill { flex: 1; min-width: 0; }
    .view-tabs { width: 100%; flex-wrap: wrap; border-radius: 18px; }
    .view-tab { flex: 1 1 30%; padding: 8px 4px; font-size: 0.76rem; text-align: center; }
    .card-grid, .card-grid--two { gap: 14px; margin-bottom: 14px; }
    .view > .card { margin-bottom: 14px; }
    .card-header { padding-left: 16px; padding-right: 16px; }
    .card-body { padding: 14px 16px 16px; }
    .form-row, .form-row--tight { grid-template-columns: 1fr; }
    .stat-tiles, .stat-tiles--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .result-value { font-size: 2.5rem; }
    .result-value--date { font-size: 1.6rem; }
    .holiday-list--columns { grid-template-columns: 1fr; }
    .batch-row { grid-template-columns: minmax(0, 1fr) 32px; }
    .batch-row .form-group:first-child { grid-column: 1 / -1; }
    .batch-row .icon-btn { grid-column: 2; grid-row: 3; }
    .batch-row .form-group:nth-child(2) { grid-column: 1; grid-row: 2; }
    .batch-row .form-group:nth-child(3) { grid-column: 1; grid-row: 3; }
    .week-row .form-input { width: 120px; }
    .month-label { min-width: 0; }
    .modal-overlay { padding: 8px; }
    .modal-body, .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }
    .toast-container { bottom: 16px; right: 16px; left: 16px; align-items: flex-end; }
    .toast { min-width: 0; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}

/* ----- Print: the open tab only ----- */
@media print {
    .back-bar, body > header, .theme-toggle, .app-hero, .app-toolbar, .shell-hint, .info-section, .site-footer, .toast-container, .modal-overlay, .btn, .chip-row, .choice-row, .form-hint, #zdu-cookie-banner { display: none !important; }
    .container.app-container { max-width: none; padding: 0; margin: 0; }
    .card { box-shadow: none; break-inside: avoid; }
    .card-grid, .card-grid--two { grid-template-columns: 1fr; }
    .result-value { color: #000; background: none; -webkit-text-fill-color: #000; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .modal, .toast, .chip, .choice-btn, .cal-day, .toggle, .toggle .toggle-knob { transition: none; animation: none; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026) */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) { min-height: 44px; }
    div.card-body > p.form-hint,
    main td,
    section#app-shell.app-shell > p.form-hint.shell-hint { font-size: 1rem; }
    main .data-table td:first-child { white-space: normal; } /* labels wrap so the numbers stay in view at 16 px */
    main button#nextMonth, main button#prevMonth { min-width: 44px; }
}
