:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1d252c;
    --muted: #66717d;
    --line: #d8dde3;
    --brand: #c8002d;
    --brand-dark: #970021;
    --ok: #168a55;
    --warn: #c97910;
    --danger: #c83232;
    --focus: #237b9f;
    font-family: Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    min-height: 44px;
}

.app-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 18px 14px 96px;
}

.login-view {
    min-height: 100vh;
    display: grid;
    align-content: center;
    gap: 22px;
}

.brand-block {
    display: grid;
    gap: 8px;
}

.brand-logo {
    width: 58px;
    height: 58px;
    display: block;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(29, 37, 44, 0.18);
}

h1,
h2,
p {
    margin: 0;
}

.brand-block h1,
.topbar h1 {
    font-size: 28px;
    line-height: 1.1;
}

.brand-block p,
.form-message,
.metric small,
.eyebrow {
    color: var(--muted);
}

.panel,
.time-form,
.recent-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

label,
fieldset {
    display: grid;
    gap: 7px;
    margin: 0 0 14px;
}

label span,
legend {
    font-size: 13px;
    font-weight: 700;
    color: #34424f;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--text);
    padding: 10px 11px;
}

textarea {
    resize: vertical;
    min-height: 78px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    outline: 3px solid rgba(35, 123, 159, 0.22);
    border-color: var(--focus);
}

.primary-button,
.ghost-button,
.quick-hours button,
.segmented span {
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
}

.primary-button {
    width: 100%;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    padding: 12px 14px;
}

.primary-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.ghost-button {
    width: auto;
    background: #fff;
    border-color: var(--line);
    color: var(--text);
    font-weight: 700;
    padding: 9px 12px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 0 14px;
}

.eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.metric {
    min-height: 92px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 5px solid var(--focus);
    border-radius: 8px;
    padding: 12px;
    display: grid;
    align-content: center;
    gap: 3px;
}

.metric span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 800;
    text-transform: uppercase;
}

.metric strong {
    font-size: 27px;
    line-height: 1;
}

.metric.is-ok {
    border-left-color: var(--ok);
}

.metric.is-warn {
    border-left-color: var(--warn);
}

.metric.is-danger {
    border-left-color: var(--danger);
}

.quick-hours {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.quick-hours button {
    background: #edf2f6;
    color: var(--text);
    font-weight: 800;
    border-color: #d5dde4;
}

.quick-hours button.is-active {
    background: #1d252c;
    color: #fff;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.segmented label {
    margin: 0;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: grid;
    place-items: center;
    min-height: 44px;
    border-color: var(--line);
    background: #fff;
    text-align: center;
    padding: 8px;
}

.segmented input:checked + span {
    background: #1d252c;
    color: #fff;
    border-color: #1d252c;
}

.sticky-save {
    position: sticky;
    bottom: 12px;
    box-shadow: 0 10px 28px rgba(29, 37, 44, 0.2);
}

.form-message {
    min-height: 22px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
}

.form-message.is-error {
    color: var(--danger);
}

.form-message.is-ok {
    color: var(--ok);
}

.instance-picker {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.instance-picker button {
    text-align: left;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.recent-section {
    margin-top: 14px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

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

.recent-list {
    display: grid;
    gap: 8px;
}

.recent-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fbfcfd;
}

.recent-item header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.recent-item strong {
    font-size: 14px;
}

.recent-item p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

@media (max-width: 420px) {
    .app-shell {
        padding-inline: 10px;
    }

    .status-grid,
    .segmented {
        grid-template-columns: 1fr;
    }

    .quick-hours {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
/* Mobile overflow guards */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.app-shell,
.panel,
.time-form,
.recent-section,
.metric,
.recent-item,
label,
fieldset,
.topbar > div,
.section-heading,
.recent-item header {
    min-width: 0;
}

fieldset {
    min-inline-size: 0;
    border: 0;
    padding: 0;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.status-grid,
.segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topbar h1,
.eyebrow,
.recent-item strong,
.recent-item p,
.metric strong,
.metric small {
    overflow-wrap: anywhere;
}

.recent-item header > * {
    min-width: 0;
}
@media (max-width: 420px) {
    .status-grid,
    .segmented {
        grid-template-columns: 1fr;
    }

    .topbar,
    .section-heading,
    .recent-item header {
        align-items: stretch;
        flex-wrap: wrap;
    }
}
.powered-by {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.powered-by img {
    width: 28px;
    height: auto;
    display: block;
}

.powered-by strong {
    color: #34424f;
    font-size: 11px;
}
.recent-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.delete-time-button {
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid rgba(200, 50, 50, 0.35);
    border-radius: 8px;
    background: #fff;
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
}

.delete-time-button:active {
    background: rgba(200, 50, 50, 0.08);
}
.install-link {
    width: fit-content;
    min-height: 36px;
    margin-top: 2px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.install-action {
    color: var(--brand);
}

.install-help {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: end center;
    padding: 16px;
    background: rgba(29, 37, 44, 0.28);
}

.install-help[hidden] {
    display: none;
}

.install-card {
    width: min(100%, 420px);
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 14px;
    box-shadow: 0 18px 42px rgba(29, 37, 44, 0.24);
}

.install-card strong {
    display: block;
    margin-bottom: 6px;
}

.install-card p {
    margin-bottom: 12px;
    color: var(--muted);
    line-height: 1.35;
}