/* OS One look (see os-one-design-kit): tokens and components copied from
   admin/admin.css, dark by default, light via html[data-theme="light"].
   The accent comes from /theme.css (THEME_COLOR). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; src: url("/assets/fonts/inter-400.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; src: url("/assets/fonts/inter-500.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; src: url("/assets/fonts/inter-600.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; src: url("/assets/fonts/inter-700.ttf") format("truetype"); font-display: swap; }

:root {
    --bg: #0f0f0f;
    --surface: #232528;
    --surface2: #18191a;
    --text: #eef2ee;
    --muted: #a3aea6;
    --line: #3f4541;
    --accent: #76b728;
    --danger: #c54852;
    --input: #151719;
    --on-accent: #121612;
    --shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
    --icon-btn-bg: #232528;
    --badge-bg: #2f3330;
    --badge-text: #a3aea6;
    --scroll-track: #1c2321;
    --scroll-thumb: color-mix(in srgb, var(--accent) 68%, #ffffff);
    --scroll-thumb-hover: color-mix(in srgb, var(--accent) 72%, #000000);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3aea6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
html[data-theme="light"] {
    --bg: #eef0f2;
    --surface: #fff;
    --surface2: #f6f7f8;
    --text: #101214;
    --muted: #5c6368;
    --line: #c3c9cf;
    --input: #fff;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    --icon-btn-bg: #f1f3f5;
    --badge-bg: #e2e5e8;
    --badge-text: #4f575d;
    --scroll-track: #e2e5e8;
    --scroll-thumb: color-mix(in srgb, var(--accent) 62%, #ffffff);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6368' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 0.4rem; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px Inter, system-ui, sans-serif;
    min-height: 100vh;
}
.main { max-width: 998px; margin: auto; padding: 16px 24px 40px; }

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 16px;
    min-height: 46px;
    margin-bottom: 20px;
}
.brand-link { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-link img { width: 32px; height: 32px; border-radius: 9px; object-fit: contain; }
.topbar-status { flex-shrink: 1; min-width: 0; overflow: hidden; }
.status { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.welcome-name { color: var(--muted); font-weight: 700; letter-spacing: 0.01em; }
.badge { background: var(--badge-bg); color: var(--badge-text); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok {
    background: color-mix(in srgb, var(--accent) 22%, var(--surface));
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.badge.offline {
    background: color-mix(in srgb, var(--danger) 24%, var(--surface));
    color: #ffb4b8;
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
}
html[data-theme="light"] .badge.offline { color: #9b1c28; }
.tabs { display: flex; gap: 4px; flex: 1; justify-content: center; }
.tab {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tab svg { width: 17px; height: 17px; pointer-events: none; }
.tab.active,
.tab:hover {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    color: var(--text);
}
.tabs-dropdown { display: none; position: relative; }
.tabs-dropdown-toggle {
    width: auto;
    min-width: 120px;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    cursor: pointer;
}
.tabs-dropdown-toggle:hover {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.tabs-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 4px;
}
.tabs-dropdown.open .tabs-dropdown-menu { display: block; }
.tabs-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 14px;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.tabs-dropdown-item:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.tabs-dropdown-item.active { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.tabs-dropdown-item svg,
.tabs-dropdown-current-icon svg { width: 17px; height: 17px; flex-shrink: 0; }
.tabs-dropdown-current-icon,
.tabs-dropdown-chevron { display: inline-flex; flex-shrink: 0; align-items: center; }
.tabs-dropdown-chevron { margin-left: auto; width: 16px; height: 16px; transition: transform 0.2s; }
.tabs-dropdown.open .tabs-dropdown-chevron { transform: rotate(180deg); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }
.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--icon-btn-bg);
    color: var(--muted);
    font: 700 16px Inter, system-ui, sans-serif;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform 0.12s, background 0.15s;
    cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.lang { font-size: 12px; letter-spacing: 0.02em; }
.icon-btn:hover {
    background: color-mix(in srgb, var(--accent) 18%, var(--icon-btn-bg));
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
    transform: translateY(-1px);
}
.auth-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--icon-btn-bg);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    opacity: 0.75;
}
.auth-icon-btn:hover {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    transform: translateY(-1px);
}
.auth-icon-btn.logout:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: color-mix(in srgb, #ef4444 10%, transparent);
}
.theme-switcher {
    width: 48px;
    height: 26px;
    border-radius: 13px;
    background: var(--bg);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: none;
    padding: 0;
    flex-shrink: 0;
    transition: box-shadow 0.15s ease;
}
.theme-icon { position: absolute; width: 20px; height: 20px; top: 3px; transition: transform 0.3s, opacity 0.3s; }
.moon-icon { left: 3px; opacity: 1; color: #f1c40f; }
.sun-icon { left: 3px; opacity: 0; transform: translateX(100%); color: #f39c12; }
.theme-switcher.light .moon-icon { opacity: 0; transform: translateX(100%); }
.theme-switcher.light .sun-icon { opacity: 1; left: auto; right: 3px; transform: translateX(0); }
.theme-switcher:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--muted) 55%, transparent); }

/* ── Panels, cards, forms (Admin) ───────────────────────────────────── */
.panel { animation: fade 0.15s ease; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.section-head h1 { margin: 0; font-size: 25px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(300px, 0.82fr) minmax(430px, 1.18fr); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.card h2 { font-size: 17px; margin: 0 0 15px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin-bottom: 0; }
.card-head .search-input-wrap { flex: 0 0 210px; }
.create-card { padding-top: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.search-input-wrap { position: relative; display: block; width: 210px; }
.list-search-input { height: 32px; margin: 0; max-width: none; padding: 5px 32px; font-size: 12px; border-radius: 8px; }
.search-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    width: 15px;
    height: 15px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}
.search-clear-btn {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0;
    font-size: 14px;
    line-height: 1;
}
.search-clear-btn:hover { border: 0; color: var(--text); }
label { display: block; color: var(--muted); font-weight: 600; margin: 0 0 13px; }
input,
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--input);
    color: var(--text);
    font: inherit;
    outline: none;
}
select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 13px 13px;
}
input:focus,
select:focus,
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input.mono,
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; }
small { display: block; color: var(--muted); margin: -7px 0 12px; }
button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 13px;
    background: var(--surface2);
    color: var(--text);
    font: 600 13px Inter, system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
}
button svg,
.button svg { pointer-events: none; }
button:hover,
.button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
button:disabled:hover { border-color: var(--line); }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 7px 9px;
    background: var(--surface2);
}
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.list-main { min-width: 0; flex: 1; }
.list-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-title .badge { display: inline-block; margin-left: 8px; font-size: 11px; line-height: 15px; vertical-align: middle; }
.list-sub { color: var(--muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.symbol-action-btn {
    min-width: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface2));
    color: var(--text);
    transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}
.symbol-action-btn svg,
.icon-action-btn svg { width: 16px; height: 16px; }
.symbol-action-btn:hover {
    background: color-mix(in srgb, var(--accent) 18%, var(--surface2));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
    transform: translateY(-1px);
}
.symbol-action-btn.danger {
    background: color-mix(in srgb, #c53030 58%, var(--surface2));
    color: #fff8f8;
    border-color: color-mix(in srgb, #ff6b6b 50%, #400);
}
.symbol-action-btn.danger:hover {
    background: color-mix(in srgb, #e04545 52%, var(--surface2));
    border-color: color-mix(in srgb, #ffb3b3 45%, #300);
}
.icon-action-btn { width: 38px; min-width: 38px; height: 38px; padding: 0; border-radius: 8px; }
.icon-action-btn svg { width: 17px; height: 17px; }
.icon-action-btn svg.fa-floppy-disk { width: 15px; height: 15px; }
.icon-action-btn:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent); transform: translateY(-1px); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--line);
    font-size: 12px;
    white-space: nowrap;
}
.notice {
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border-radius: 10px;
    margin-bottom: 14px;
}
.notice.error { border-left-color: var(--danger); }
.muted { color: var(--muted); }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin: -6px 0 13px; line-height: 1.35; }
.form-row { display: flex; gap: 10px; align-items: flex-end; }
.form-row > label { flex: 1; min-width: 0; margin-bottom: 0; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.form-actions .spacer { flex: 1; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.sort-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); }
.sort-switch button {
    height: 26px;
    gap: 4px;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: 600 12px Inter, system-ui, sans-serif;
}
.sort-switch button:hover { color: var(--text); }
.sort-switch button.active,
.sort-switch button.active:hover { background: var(--accent); color: var(--on-accent); }
kbd,
code {
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--surface2);
    border: 1px solid var(--line);
    font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── Dialogs ───────────────────────────────────────────────────────── */
dialog {
    border: 0;
    padding: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    max-width: min(520px, calc(100vw - 30px));
    width: 100%;
    overflow: visible;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.dialog-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    position: relative;
    max-height: calc(100svh - 40px);
    overflow: auto;
}
.dialog-card.fit { overflow: visible; }
.dialog-card h2 { margin: 0 0 16px; padding-right: 30px; }
.dialog-close { position: absolute; right: 10px; top: 10px; border-radius: 50%; padding: 3px 9px; font-size: 18px; line-height: 1.2; }
.brand-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.brand-heading img { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; }
.brand-heading h2,
.brand-heading p { margin: 0; padding: 0; }
.brand-heading p { color: var(--muted); margin-top: 4px; }
.secret-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secret-row .mono { overflow-wrap: anywhere; user-select: all; }
.download-link { color: var(--text); font-weight: 700; text-decoration: underline 2px var(--accent); text-underline-offset: 3px; }
.app-url { display: block; font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.info-grid { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; align-items: center; }
.info-grid .mono { overflow-wrap: anywhere; }

/* ── Searchable dropdown (combo) ────────────────────────────────────── */
.combo { position: relative; min-width: 180px; }
.combo input { margin: 0; height: 34px; padding: 5px 30px 5px 32px; }
.combo .search-icon { left: 10px; }
.combo-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    transform: translateY(-50%);
}
.combo-toggle:hover { color: var(--text); border: 0; }
.combo-toggle svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
.combo.open .combo-toggle svg { transform: rotate(180deg); }
.combo-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.combo-item {
    justify-content: flex-start;
    border: 0;
    border-radius: 7px;
    background: transparent;
    min-height: 32px;
    padding: 5px 9px;
    font-weight: 600;
    text-align: left;
    width: 100%;
}
.combo-item:hover,
.combo-item.active { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 0; }
.combo-empty { padding: 8px 10px; font-size: 12px; color: var(--muted); }

/* ── Date picker (Admin "when" picker, date only) ─────────────────── */
.when-field { position: relative; }
.when-picker {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    width: 260px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45);
    color: var(--text);
    font-weight: 500;
}
.when-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; font-weight: 600; }
.when-head button,
.when-days button { padding: 0; border-color: transparent; background: transparent; color: var(--text); font-weight: 500; }
.when-head button { width: 30px; height: 30px; font-size: 18px; }
.when-week,
.when-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.when-week { color: var(--muted); font-size: 11px; margin: 0 0 2px; }
.when-days button { height: 32px; border-radius: 8px; font-size: 13px; }
.when-days button.out { color: var(--muted); opacity: 0.55; }
.when-days button.today { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.when-days button.picked { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); font-weight: 700; }
.when-days button:hover { border-color: var(--accent); }

/* ── Time sheets (me + admin) ───────────────────────────────────────── */
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav .month-label { min-width: 150px; text-align: center; font-weight: 700; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat-label { color: var(--muted); font-weight: 600; font-size: 12px; }
.stat-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.days { display: flex; flex-direction: column; gap: 10px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 12px; }
.day.today { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.day-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.day-title { font-weight: 700; flex: 1; min-width: 0; }
.day-title .muted { font-weight: 600; margin-left: 6px; }
.day-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.span { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.span .dash { color: var(--muted); margin: 0 6px; }
.glyph { display: inline-flex; vertical-align: -3px; width: 16px; height: 16px; margin-left: 6px; }
.glyph svg { width: 16px; height: 16px; }
.glyph.warn { color: var(--danger); }
.glyph.edit { color: var(--muted); }
.glyph.live { color: var(--accent); }
.glyph.dim { color: var(--muted); }
.field-label { color: var(--muted); font-weight: 600; }
.times-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 12px; }
.times-bar #times-user { flex: 0 1 260px; }
.times-total { flex: 1; text-align: right; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.summary-row .list-sub { white-space: normal; }

/* ── Terminal ───────────────────────────────────────────────────────── */
.terminal { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 2vh; }
.clock { text-align: center; }
.clock-time { font-size: clamp(60px, 13vw, 124px); font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.clock-date { color: var(--muted); font-size: clamp(16px, 2.4vw, 22px); font-weight: 600; margin-top: 12px; }
.punch {
    width: min(600px, 100%);
    min-height: 170px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 14px;
}
.punch-icon { width: 76px; height: 76px; flex-shrink: 0; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.punch-icon svg { width: 100%; height: 100%; }
.punch-body { min-width: 0; flex: 1; }
.punch-name { font-size: clamp(22px, 4vw, 32px); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punch-action { font-size: 18px; font-weight: 700; margin-top: 6px; }
.punch-meta { color: var(--muted); font-size: 16px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.punch.idle .punch-name,
.punch.waiting .punch-name { color: var(--muted); font-size: clamp(20px, 3.4vw, 26px); white-space: normal; }
.punch.waiting .punch-name { color: var(--text); }
.punch.in { border-left-color: var(--accent); }
.punch.in .punch-icon,
.punch.in .punch-action { color: var(--accent); }
.punch.out { border-left-color: var(--muted); }
.punch.unknown,
.punch.error { border-left-color: var(--danger); }
.punch.unknown .punch-icon,
.punch.unknown .punch-action,
.punch.error .punch-action { color: var(--danger); }
.punch.waiting { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); border-left-color: var(--accent); }
.punch.waiting .punch-icon { color: var(--accent); animation: breathe 1.6s ease-in-out infinite; }
.punch.flash { animation: punch-flash 1.8s ease; }
.terminal-actions { display: flex; gap: 10px; }
.big-btn { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; gap: 10px; }
.big-btn svg { width: 20px; height: 20px; }
.recent { width: min(600px, 100%); }
.recent .list-row { background: var(--surface); }
.recent .glyph { margin: 0 4px 0 0; }
.countdown { font-variant-numeric: tabular-nums; }

/* ── Sign-in card (home/signed-out.html) ────────────────────────────── */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px 32px; width: min(360px, 100%); text-align: center; }
.signin-card img { width: 44px; height: 44px; margin-bottom: 10px; }
.signin-card h1 { margin: 0 0 18px; font-size: 20px; }
.signin-card input { margin: 0 0 12px; text-align: center; }
.signin-card .primary { width: 100%; padding: 10px 14px; font-size: 14px; }
.signin-card .notice { text-align: left; }
.signin-card .back { display: inline-block; margin-top: 16px; color: var(--muted); font-size: 13px; text-decoration: none; }
.signin-card .back:hover { color: var(--text); }

html[data-theme="light"] .topbar,
html[data-theme="light"] .card,
html[data-theme="light"] .day,
html[data-theme="light"] .stat,
html[data-theme="light"] .punch,
html[data-theme="light"] .signin-card { box-shadow: 0 1px 3px rgba(16, 18, 20, 0.13); }
html[data-theme="light"] .list-row,
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea { border-color: #bcc3ca; }
html[data-theme="light"] .symbol-action-btn { background: var(--surface2); box-shadow: none; }
html[data-theme="light"] .symbol-action-btn:hover {
    background: color-mix(in srgb, var(--accent) 22%, var(--surface2));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
html[data-theme="light"] .symbol-action-btn.danger { background: color-mix(in srgb, #c53030 58%, #e9ebee); }

@keyframes fade { from { opacity: 0.3; transform: translateY(3px); } }
/* Needs attention: move something large, once, for ~2 s, on page load only. */
.attention { animation: attention 2s ease 1; }
@keyframes attention {
    0%, 100% { transform: none; }
    10%, 30%, 50% { transform: translateX(-6px); border-color: var(--danger); }
    20%, 40%, 60% { transform: translateX(6px); border-color: var(--danger); }
}
@keyframes breathe { 50% { transform: scale(0.9); opacity: 0.7; } }
@keyframes punch-flash {
    0% { transform: scale(0.96); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
    25% { transform: scale(1.02); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 25%, transparent); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 850px) {
    .grid.two { grid-template-columns: 1fr; }
    .main { padding: 10px; }
    .card { padding: 15px; }
}
@media (max-width: 650px) {
    .tabs ~ .topbar-status,
    .has-tabs .topbar-status { display: none; }
    .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .stat-value { font-size: 18px; }
}
@media (max-width: 600px) {
    .tabs { display: none; }
    .tabs-dropdown { display: block; flex: 1; min-width: 0; }
    .tabs-dropdown-toggle { min-width: 0; max-width: 100%; }
    #dropdown-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .card-head { flex-wrap: wrap; }
    .card-head .search-input-wrap { flex: 1 1 100%; width: 100%; }
    .punch { padding: 18px; gap: 16px; min-height: 140px; }
    .punch-icon { width: 56px; height: 56px; }
}
@media (max-width: 500px) {
    .topbar-status { display: none; }
    .topbar { gap: 8px; padding: 10px 12px; }
    .topbar-actions { gap: 8px; }
    .has-tabs #info { display: none; }
    .month-nav .month-label { min-width: 0; }
}
