:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --border: #2d3a4d;
    --text: #e8eef5;
    --muted: #8b9cb3;
    --accent: #3d9cf5;
    --accent-dim: #2b7bc4;
    --danger: #f05d5e;
    --radius: 10px;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a5f 0%, var(--bg) 55%);
    color: var(--text);
    line-height: 1.5;
    padding: 2rem 1.25rem;
}
main {
    max-width: 520px;
    margin: 0 auto;
}
.header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}
h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}
.btn-create {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #0a0e14;
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.1s ease;
}
.btn-create:hover:not(:disabled) {
    background: #5aadff;
}
.btn-create:active:not(:disabled) {
    transform: scale(0.96);
}
.btn-create:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.timer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.timer-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    background: rgba(0, 0, 0, 0.15);
}
.timer-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}
.timer-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}
.timer-item-sub {
    font-size: 0.8rem;
    color: var(--muted);
}
.timer-item-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--border);
    color: var(--muted);
}
.timer-item-status.running {
    background: rgba(61, 156, 245, 0.2);
    color: var(--accent);
}
.timer-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.timer-item-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}
label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
}
select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.elapsed {
    font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
    font-size: 1.65rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.elapsed.idle {
    color: var(--muted);
}
input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: text;
}
input[type="text"]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
input[type="text"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
input[type="text"]:invalid {
    border-color: var(--danger);
}
button {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
button:active:not(:disabled) {
    transform: scale(0.98);
}
button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.btn-start {
    background: var(--accent);
    color: #0a0e14;
}
.btn-start:hover:not(:disabled) {
    background: #5aadff;
}
.btn-stop {
    background: var(--danger);
    color: #fff;
}
.btn-stop:hover:not(:disabled) {
    background: #ff7a7b;
}
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
    color: var(--text);
    border-color: var(--muted);
}
.msg {
    font-size: 0.875rem;
    color: var(--muted);
    min-height: 1.25rem;
    margin-top: 1rem;
}
.msg.error {
    color: #ff9d9e;
}
.timer-list > li.empty-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    padding: 1.5rem 0.5rem;
    margin: 0;
    border: none;
    background: transparent;
}
dialog.modal {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    padding: 0;
    max-width: min(420px, calc(100vw - 2rem));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
dialog.modal::backdrop {
    background: rgba(8, 12, 18, 0.72);
}
.modal-inner {
    padding: 1.5rem;
}
.modal-inner h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    font-weight: 600;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.25rem;
}
.modal-actions button {
    margin: 0;
}