.death-timer-container {
    max-width: 1344px;
    margin: 0 auto;
    padding: 2rem;
}
.death-timer-container h1 {
    font-size: 2.2rem;
    margin-bottom: 0.4rem;
}
.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* ── Form ── */
.dt-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 600px;
}
.dt-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.dt-row label {
    font-weight: 600;
    min-width: 140px;
}
.dt-row input[type="number"],
.dt-row input[type="text"],
.dt-row select {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}
.dt-row input[type="number"] {
    width: 90px;
}
.dt-row input[type="text"] {
    flex: 1;
    min-width: 180px;
}
.dt-row select {
    flex: 1;
    min-width: 220px;
}
.dt-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ── Blood pressure slider ── */
.dt-bp-row {
    flex-direction: column;
    align-items: stretch;
}
.dt-bp-slider-group {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}
.dt-bp-slider-col {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}
.dt-bp-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.dt-bp-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.dt-bp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c0392b;
    cursor: pointer;
    border: 2px solid var(--bg-primary);
}
.dt-bp-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c0392b;
    cursor: pointer;
    border: 2px solid var(--bg-primary);
}
.dt-bp-value {
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #c0392b;
    text-align: center;
}
#dt-bp-category.bp-normal { color: #27ae60; }
#dt-bp-category.bp-elevated { color: #f39c12; }
#dt-bp-category.bp-stage1 { color: #e67e22; }
#dt-bp-category.bp-stage2 { color: #c0392b; }
#dt-bp-category.bp-crisis { color: #8b0000; }

/* ── Buttons ── */
.dt-btn {
    align-self: flex-start;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: #c0392b;
    color: #fff;
    margin-top: 0.5rem;
    transition: background 0.15s;
}
.dt-btn:hover {
    background: #922b21;
}
.dt-btn-sm {
    padding: 0.38rem 0.8rem;
    font-size: 0.88rem;
    margin-top: 0;
    align-self: unset;
    flex-shrink: 0;
}
.dt-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    margin-top: 0;
}
.dt-btn-secondary:hover {
    background: var(--bg-hover);
}
.dt-bottom-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ── Two-column layout ── */
.dt-result-layout {
    display: grid;
    grid-template-columns: 62% 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 0.5rem;
}
@media (max-width: 680px) {
    .dt-result-layout {
        grid-template-columns: 1fr;
    }
    .dt-sidebar {
        position: static;
        max-height: 320px;
    }
}

/* ── Big number + featured nav ── */
.dt-result-top {
    text-align: center;
    padding: 1.4rem 1rem 1rem;
    border: 2px solid var(--border-primary);
    border-radius: 10px;
    background: var(--bg-secondary);
    margin-bottom: 1.2rem;
}
.dt-you-can {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.dt-featured-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.dt-nav-btn {
    background: none;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.2rem 0.55rem;
    font-size: 0.85rem;
    transition:
        background 0.12s,
        color 0.12s;
    flex-shrink: 0;
    line-height: 1.4;
}
.dt-nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dt-activity-label {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.7rem;
}
.dt-count-box {
    margin: 0 auto 0.7rem;
}
.dt-count {
    font-family: "Courier New", "Consolas", monospace;
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: bold;
    color: #c0392b;
    display: block;
    white-space: nowrap;
    letter-spacing: -0.02em;
}
.dt-more-times {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.dt-context {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}
.dt-heartbeat {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    letter-spacing: 0.01em;
}

/* ── Viz controls ── */
.dt-viz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.dt-tabs {
    display: flex;
    gap: 0.4rem;
}
.dt-tab {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.92rem;
    cursor: pointer;
    font-weight: 600;
    transition:
        background 0.12s,
        color 0.12s;
}
.dt-tab-active {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}
.dt-tab:not(.dt-tab-active):hover {
    background: var(--bg-hover);
}
.dt-log-btn {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.88rem;
    cursor: pointer;
    font-weight: 600;
    min-width: 8rem;
    text-align: center;
}
.dt-log-btn:hover {
    background: var(--bg-hover);
}
.dt-log-btn-active {
    background: #c0392b !important;
    color: #fff !important;
    border-color: #c0392b !important;
}

/* ── Chart ── */
.dt-panel {
    margin-bottom: 1rem;
}
.dt-panel-empty {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.5rem;
    display: none;
}
.dt-panel-empty.visible {
    display: block;
}
.dt-chart-wrap {
    position: relative;
    width: 100%;
}

/* ── Multi-waffle ── */
.dt-multi-waffle {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.dt-waffle-card {
    border: 1px solid var(--border-primary);
    border-top: 3px solid; /* color set inline */
    border-radius: 6px;
    padding: 0.65rem 0.75rem;
    background: var(--bg-secondary);
}
.dt-waffle-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dt-waffle-card-grid {
    display: grid;
    grid-template-columns: repeat(20, 10px);
    gap: 2px;
    margin-bottom: 0.4rem;
    overflow: hidden;
}
/* Per-card color for filled squares via CSS variable on the grid */
.dt-waffle-card-grid .dt-waffle-sq.filled {
    background-color: var(--sq-color, #c0392b);
}
.dt-waffle-sq {
    width: 10px;
    height: 10px;
    border-radius: 1px;
    transition: background-color 0.3s ease;
}
.dt-waffle-sq.filled {
    background-color: #c0392b;
} /* default; overridden per-card */
.dt-waffle-sq.empty {
    background-color: var(--bg-tertiary);
}
.dt-waffle-card-label {
    font-size: 0.74rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ── Sidebar ── */
.dt-sidebar {
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-secondary);
    position: sticky;
    top: 1rem;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dt-sidebar-header {
    padding: 0.65rem 0.9rem;
    font-weight: 700;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.dt-sidebar-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.35rem;
}

.dt-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition:
        background-color 0.12s,
        border-color 0.12s;
    user-select: none;
}
.dt-sidebar-item:hover {
    background: var(--bg-hover);
}

.dt-sidebar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
    transition: background-color 0.12s;
}
.dt-sidebar-name {
    flex: 1;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.dt-sidebar-count {
    font-family: "Courier New", monospace;
    font-size: 0.74rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 4.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
/* Featured indicator: small triangle shown next to active+featured item */
.dt-feat-star {
    font-size: 0.65rem;
    flex-shrink: 0;
    opacity: 0.8;
}
.dt-sidebar-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
}
.dt-sidebar-remove:hover {
    color: #c0392b;
}

/* ── Sidebar custom form ── */
.dt-sidebar-custom {
    border-top: 1px solid var(--border-primary);
    padding: 0.6rem 0.7rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.dt-sidebar-custom-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dt-sidebar-custom input[type="text"],
.dt-sidebar-custom input[type="number"] {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
}
.dt-sb-dur-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.dt-sb-dur-row input {
    flex: 1;
    min-width: 0;
}
.dt-sb-dur-row select {
    padding: 0.35rem 0.3rem;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* ── Dead ── */
#dt-dead {
    text-align: center;
    padding: 2rem;
    border: 2px dashed #c0392b;
    border-radius: 10px;
    font-size: 1.2rem;
    line-height: 2;
}
