:root {
    color-scheme: light;
    --bg: #f3f6fa;
    --panel: #ffffff;
    --text: #10203a;
    --muted: #64748b;
    --line: #dfe6ef;
    --line-strong: #cbd5e1;
    --primary: #002eff;
    --primary-dark: #001fc4;
    --primary-soft: #eef1ff;
    --green: #159957;
    --yellow: #d49000;
    --red: #d33c4a;
    --gray: #7a8798;
    --shadow: 0 16px 44px rgba(22, 39, 66, .09);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--text); background: linear-gradient(180deg, #edf2f8 0, var(--bg) 320px); }
a { color: inherit; }
button, input, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(0, 46, 255, .18); outline-offset: 2px; }

.platform-header {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(20px, 4vw, 64px);
    border-bottom: 1px solid rgba(216, 225, 236, .9);
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(16px);
}

.brand { display: flex; min-width: 0; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: #fff; background: var(--primary); font-weight: 900; letter-spacing: -.04em; box-shadow: 0 8px 22px rgba(0, 46, 255, .24); }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 18px; white-space: nowrap; }
.brand-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.inline-form { display: inline; margin: 0; }

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 18px rgba(0, 46, 255, .17); }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 8px 20px rgba(0, 46, 255, .22); }
.button-secondary { border-color: var(--line); color: var(--text); background: #fff; }
.button-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: 0 6px 16px rgba(16, 32, 58, .08); }
.button-danger { border-color: #f3c7cd; color: #a81f30; background: #fff7f8; }
.button-danger:hover:not(:disabled) { border-color: #dc8792; color: #8e1626; background: #ffecee; }
.button:disabled { cursor: not-allowed; opacity: .55; }

.notifications-menu { position: relative; }
.notifications-menu > summary { list-style: none; }
.notifications-menu > summary::-webkit-details-marker { display: none; }
.notifications-trigger { min-width: 146px; }
.notifications-count {
    display: inline-grid;
    min-width: 23px;
    height: 23px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    color: #fff;
    background: var(--primary);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}
.notifications-menu[open] > .notifications-trigger { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.notifications-popover {
    position: absolute;
    z-index: 80;
    top: calc(100% + 10px);
    right: 0;
    width: min(420px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(16, 32, 58, .2);
}
.notifications-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #edf1f6; }
.notifications-list { max-height: 360px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.notifications-list li { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 11px; padding: 13px 18px; border-bottom: 1px solid #edf1f6; }
.notifications-list li:last-child { border-bottom: 0; }
.notification-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--primary); }
.notifications-list p { margin: 0; font-size: 13px; line-height: 1.42; }
.notifications-list time { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.notifications-empty { margin: 0; padding: 20px 18px; color: var(--muted); font-size: 14px; }
.notifications-footer { display: block; padding: 13px 18px; border-top: 1px solid #edf1f6; color: var(--primary); font-size: 13px; font-weight: 850; text-align: center; text-decoration: none; transition: color .15s ease, background .15s ease; }
.notifications-footer:hover { color: var(--primary-dark); background: var(--primary-soft); }

.breadcrumb-bar { border-bottom: 1px solid rgba(216, 225, 236, .9); background: rgba(255, 255, 255, .72); }
.breadcrumb-list { display: flex; width: min(1240px, calc(100% - 32px)); min-height: 38px; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 auto; padding: 7px 0; color: var(--muted); font-size: 12px; list-style: none; }
.breadcrumb-list li { display: inline-flex; align-items: center; gap: 7px; }
.breadcrumb-list li:not(:last-child)::after { color: #a0aec0; content: "›"; }
.breadcrumb-list a { color: var(--primary); font-weight: 750; text-decoration: none; }
.breadcrumb-list a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.breadcrumb-list [aria-current="page"] span { color: var(--text); font-weight: 750; }

.shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 64px; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-intro-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.eyebrow { margin: 0 0 7px; color: var(--primary); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.035em; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); }
.intro-copy { margin: 10px 0 0; color: var(--muted); font-size: 17px; }
.version-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.72); font-size: 13px; font-weight: 800; white-space: nowrap; }

.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.module-card { display: flex; min-height: 350px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.module-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 28px 20px; border-bottom: 1px solid #edf1f6; }
.module-icon { display: grid; width: 50px; height: 50px; place-items: center; margin-bottom: 15px; border-radius: 15px; color: var(--primary); background: var(--primary-soft); font-size: 24px; font-weight: 900; }
.status-pill { display: inline-flex; min-height: 34px; align-items: center; gap: 8px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 900; white-space: nowrap; }
.status-pill::before, .status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.status-green { color: var(--green); background: #eaf8f0; }
.status-yellow { color: #9b6700; background: #fff4d6; }
.status-red { color: var(--red); background: #fff0f2; }
.status-gray { color: var(--gray); background: #eef1f5; }
.status-dot.status-green { background: var(--green); }
.status-dot.status-yellow { background: var(--yellow); }
.status-dot.status-red { background: var(--red); }
.status-dot.status-gray { background: var(--gray); }
.module-body { display: flex; flex: 1; flex-direction: column; padding: 22px 28px 26px; }
.summary-number { margin: 0 0 18px; font-size: 28px; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.timer-live-value.is-overtime { color: var(--red); }
.status-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.status-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; min-height: 34px; align-items: center; gap: 10px; }
.status-row strong { font-size: 14px; }
.status-row small { color: var(--muted); text-align: right; }
.module-footer { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin-top: auto; padding-top: 22px; }
.module-footer .button { width: 100%; }

.panel { margin-top: 24px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.panel-no-top { margin-top: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.event-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.event-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #edf1f6; }
.event-item:first-child { border-top: 0; }
.event-item p { margin: 0; }
.event-meta { color: var(--muted); font-size: 13px; }

.player-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.player-card { display: flex; min-width: 0; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.player-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.player-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 18px 0 2px; overflow: hidden; border: 1px solid #e7ebf1; border-radius: 12px; background: #050607; }
.player-preview img, .player-preview video { display: block; width: 100%; height: 100%; object-fit: contain; background: #050607; }
.player-preview video { pointer-events: none; }
.player-preview-placeholder { display: grid; width: 100%; height: 100%; place-items: center; padding: 20px; color: #94a3b8; background: #f7f9fc; font-size: 13px; text-align: center; }
.player-preview-label { position: absolute; right: 8px; bottom: 8px; padding: 5px 8px; border-radius: 7px; color: #fff; background: rgba(8, 13, 24, .78); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.player-current-name { min-height: 38px; margin: 10px 0 0; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.player-meta { display: grid; gap: 8px; margin: 15px 0 18px; color: var(--muted); font-size: 14px; }
.player-meta div { min-width: 0; }
.player-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: auto; }
.player-actions .button { width: 100%; min-width: 0; padding-right: 10px; padding-left: 10px; font-size: 13px; white-space: nowrap; }

.timer-overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 22px; }
.timer-control-panel { overflow: hidden; }
.timer-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.timer-overview-clock {
    display: grid;
    min-height: clamp(190px, 24vw, 290px);
    place-items: center;
    padding: clamp(30px, 4vw, 52px) 24px;
    overflow: hidden;
    border-radius: 16px;
    color: #fff;
    background: var(--primary);
    font-size: clamp(58px, 8.4vw, 118px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    font-kerning: none;
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-variant-numeric: tabular-nums lining-nums;
    white-space: nowrap;
}
.timer-overview-clock .fixed-text { display: inline-flex; align-items: baseline; justify-content: center; gap: .025em; white-space: nowrap; }
.timer-overview-clock .fixed-char { display: inline-flex; flex: 0 0 auto; align-items: baseline; justify-content: center; line-height: inherit; text-align: center; }
.timer-overview-clock .fixed-char.is-digit { width: .68em; }
.timer-overview-clock .fixed-char.is-separator { width: .42em; }
.timer-overview-clock .fixed-char.is-minus { width: .54em; margin-right: .02em; }
.timer-overview-clock .fixed-char.is-other { width: .54em; }
.timer-overview-clock.is-overtime { background: var(--red); }
.timer-overview-subline { min-height: 28px; margin: 14px 2px 22px; color: var(--muted); font-size: 16px; font-weight: 750; }
.timer-button-grid { display: grid; gap: 10px; }
.timer-adjust-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.timer-transport-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.timer-action-button { min-height: 62px; padding: 8px; border: 0; border-radius: 12px; cursor: pointer; color: var(--text); background: #eef1f5; font-size: 20px; font-weight: 900; transition: color .15s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease; }
.timer-action-button:hover:not(:disabled) { box-shadow: inset 0 0 0 2px rgba(16, 32, 58, .10), 0 6px 16px rgba(16, 32, 58, .08); }
.timer-action-button.plus:hover:not(:disabled) { background: var(--primary-dark); }
.timer-action-button.minus:hover:not(:disabled) { color: var(--primary-dark); background: #e3e8ff; }
.timer-action-button.start:hover:not(:disabled) { background: #0d8148; }
.timer-action-button.pause:hover:not(:disabled) { background: #dce3eb; }
.timer-action-button.reset:hover:not(:disabled) { background: #ffe9aa; }
.timer-action-button.plus { color: #fff; background: var(--primary); }
.timer-action-button.minus { color: var(--primary); background: var(--primary-soft); }
.timer-action-button.start { color: #fff; background: var(--green); }
.timer-action-button.pause { background: #e8edf3; }
.timer-action-button.reset { background: #fff4d6; }
.timer-action-button:disabled { cursor: wait; opacity: .55; }
.timer-quick-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid #edf1f6; }
.timer-quick-section .eyebrow { margin-bottom: 12px; }
.timer-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.timer-quick-grid .button { min-height: 50px; }
.timer-side-list { display: grid; gap: 12px; margin: 0; }
.timer-side-list > div { padding-bottom: 12px; border-bottom: 1px solid #edf1f6; }
.timer-side-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.timer-side-list dt { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.timer-side-list dd { margin: 0; font-weight: 850; }
.timer-links { display: grid; gap: 10px; margin-top: 22px; }
.timer-error { color: var(--red); }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(20,38,68,.16); }
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { font-size: 32px; }
.form-grid { display: grid; gap: 16px; margin-top: 24px; }
.field { display: grid; gap: 7px; }
.field label, .field > span:first-child { font-size: 14px; font-weight: 800; }
.field input, .field select { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #cfd9e6; border-radius: 11px; color: var(--text); background: #fff; }
.field input:focus, .field select:focus { border-color: var(--primary); outline: 3px solid rgba(0,46,255,.11); }
.alert { margin: 18px 0 0; padding: 13px 15px; border-radius: 11px; font-size: 14px; font-weight: 700; }
.alert-error { color: #982435; background: #fff0f2; }
.alert-success { color: #0b7740; background: #eaf8f0; }
.alert-warning { color: #845800; background: #fff4d6; }
.auth-note { margin: 20px 0 0; font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid #e9eef5; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
td { font-size: 14px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.user-actions input[type="password"] { min-width: 150px; min-height: 40px; padding: 0 10px; border: 1px solid #cfd9e6; border-radius: 9px; }
.split-grid { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); gap: 22px; }
.definition-list { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 10px 18px; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; font-weight: 750; }


.storage-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
    align-items: center;
    gap: clamp(30px, 6vw, 84px);
}
.storage-definition-list { max-width: 620px; }
.storage-note { max-width: 700px; margin: 24px 0 0; line-height: 1.55; }
.storage-note strong { color: var(--text); }
.storage-chart { display: grid; justify-items: center; gap: 13px; padding: 4px 0; text-align: center; }
.storage-chart > p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; }
.storage-donut {
    position: relative;
    display: grid;
    width: clamp(176px, 18vw, 218px);
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    background: var(--panel);
    box-shadow: 0 14px 34px rgba(16, 32, 58, .10);
}
.storage-donut-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.storage-donut-track,
.storage-donut-progress { fill: none; stroke-width: 14; }
.storage-donut-track { stroke: #e5ebf3; }
.storage-donut-progress { stroke: var(--primary); stroke-linecap: butt; }
.storage-donut-content { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; }
.storage-donut-content strong { font-size: clamp(27px, 3vw, 38px); font-weight: 900; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.storage-donut-content span { color: var(--muted); font-size: 13px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }

.install-steps { counter-reset: install; display: grid; gap: 14px; margin: 24px 0; padding: 0; list-style: none; }
.install-steps li { position: relative; padding: 16px 18px 16px 54px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.install-steps li::before { counter-increment: install; position: absolute; top: 14px; left: 15px; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-weight: 900; content: counter(install); }
.check-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.check-item { display: flex; align-items: flex-start; gap: 9px; }
.check-symbol { font-weight: 900; }
.check-ok { color: var(--green); }
.check-bad { color: var(--red); }
.check-list-spaced { margin-top: 20px; }
.log-filter { align-items: end; margin-bottom: 20px; }
.log-filter .field { min-width: 220px; }
.log-details summary { cursor: pointer; font-weight: 700; }
.log-details pre { max-width: 34rem; max-height: 18rem; margin: .65rem 0 0; padding: .75rem; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #f7f8fa; font: .78rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1050px) {
    .player-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .timer-overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .module-grid, .split-grid { grid-template-columns: 1fr; }
    .timer-adjust-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 720px) {
    .platform-header { position: static; align-items: flex-start; flex-direction: column; padding: 16px 18px; }
    .header-actions { width: 100%; }
    .header-actions > .button, .header-actions > .inline-form, .header-actions > .inline-form .button, .notifications-menu { flex: 1 1 auto; }
    .header-actions > .inline-form .button, .notifications-trigger { width: 100%; }
    .notifications-popover { right: auto; left: 0; }
    .breadcrumb-list, .shell { width: min(100% - 20px, 1240px); }
    .shell { padding-top: 24px; }
    .page-intro { align-items: flex-start; flex-direction: column; }
    .page-intro-actions { width: 100%; justify-content: flex-start; }
    .module-grid, .player-grid { grid-template-columns: 1fr; }
    .storage-overview { grid-template-columns: 1fr; }
    .storage-chart { margin-top: 8px; }
    .module-card-head, .module-body, .panel { padding-left: 20px; padding-right: 20px; }
    .event-item { grid-template-columns: 10px minmax(0,1fr); }
    .event-item time { grid-column: 2; }
    .auth-card { padding: 26px 22px; }
    .timer-quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .timer-overview-clock { min-height: 170px; padding: 28px 12px; font-size: clamp(48px, 13vw, 86px); }
}


@media (max-width: 480px) {
    .brand-copy span { white-space: normal; }
    .player-actions .button { padding-right: 7px; padding-left: 7px; font-size: 12px; }
    .status-row { grid-template-columns: 10px minmax(0,1fr); }
    .status-row small { grid-column: 2; text-align: left; }
    .timer-adjust-grid, .timer-transport-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .timer-transport-grid .timer-action-button:last-child { grid-column: 1 / -1; }
    .timer-quick-grid { grid-template-columns: 1fr; }
}
