body {
    padding: 0 calc(20px * var(--space-scale)) calc(60px * var(--space-scale)) calc(20px * var(--space-scale));
}

#site-header {
    margin: 0 calc(-20px * var(--space-scale));
}

.container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(12px * var(--radius-scale));
    padding: calc(30px * var(--space-scale));
    margin: 0 auto calc(24px * var(--space-scale)) auto;
}

#container {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: calc(20px * var(--space-scale));
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: calc(10px * var(--space-scale));
    align-items: center;
}

.controls-row span {
    color: var(--text-muted);
}

h1 {
    color: var(--text);
    font-size: 2.2em;
    margin: 0 0 calc(10px * var(--space-scale)) 0;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    color: var(--accent-bright);
    font-size: 1.2em;
    margin: 0;
}

h3,
h5 {
    color: var(--text);
}

p {
    color: var(--text-muted);
}

input,
select,
button {
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: calc(8px * var(--radius-scale));
    padding: calc(10px * var(--space-scale));
    font-size: 1rem;
    font-family: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

input:focus,
select:focus,
button:focus {
    outline: none;
    border-color: var(--accent-bright);
}

input[type="date"],
input[type="time"] {
    color: var(--text);
    color-scheme: dark;
}

button {
    font-weight: 600;
    padding: calc(10px * var(--space-scale)) calc(18px * var(--space-scale));
    font-size: 0.95rem;
    background: linear-gradient(180deg, var(--accent-bright), var(--accent));
    color: var(--text-strong);
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(var(--accent-bright-rgb), 0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: calc(10px * var(--space-scale));
    border: 1px solid var(--border);
    border-radius: calc(8px * var(--radius-scale));
    overflow: hidden;
}

th,
td {
    padding: calc(12px * var(--space-scale));
    text-align: left;
    border: 1px solid var(--border);
    color: var(--text);
}

th {
    background: var(--surface-alt);
    color: var(--text);
    font-weight: 600;
}

td {
    background: var(--surface);
}

td input[type="text"] {
    width: 85%;
    padding: calc(8px * var(--space-scale));
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: calc(6px * var(--radius-scale));
    margin-bottom: calc(5px * var(--space-scale));
    font-family: var(--font-mono);
}

td input[type="text"]:focus {
    color: var(--text);
    border-color: var(--accent-bright);
}

td button {
    padding: calc(8px * var(--space-scale)) calc(14px * var(--space-scale));
    font-size: 0.85rem;
}

.note {
    font-size: 0.95em;
    color: var(--text-muted);
    font-style: italic;
}

section {
    margin-bottom: calc(30px * var(--space-scale));
}

#code {
    font-family: monospace;
    background: var(--bg);
    color: var(--text);
    padding: calc(10px * var(--space-scale));
    border-radius: calc(6px * var(--radius-scale));
    border: 1px solid var(--border);
}

i,
.fa-solid,
.fa-regular {
    color: var(--accent-bright);
    transition: color 0.2s ease;
}

button i,
button .fa-solid,
button .fa-regular {
    color: var(--text-strong);
    margin-right: calc(6px * var(--space-scale));
}

#notifPopup {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: calc(100% - 40px);
    box-sizing: border-box;
    word-wrap: break-word;
    background: var(--surface-alt);
    color: var(--text);
    padding: calc(15px * var(--space-scale)) calc(20px * var(--space-scale));
    border-radius: calc(8px * var(--radius-scale));
    border: 1px solid var(--accent-bright);
    display: none;
    z-index: 1000;
    transition: opacity 0.5s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

@media (max-width: 600px) {
    .container {
        padding: calc(18px * var(--space-scale));
    }

    h1 {
        font-size: 1.7em;
    }

    h2 {
        font-size: 1.1em;
    }

    input,
    select,
    button {
        width: 100%;
        padding: calc(10px * var(--space-scale));
        font-size: 1rem;
    }

    #container {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: calc(6px * var(--space-scale));
    }

    .use-current-time {
        margin-top: calc(10px * var(--space-scale));
        width: 100%;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    table {
        border: none;
        border-radius: 0;
    }

    thead {
        display: none;
    }

    tbody tr {
        margin-bottom: calc(14px * var(--space-scale));
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: calc(8px * var(--radius-scale));
        overflow: hidden;
    }

    tbody tr:last-child {
        margin-bottom: 0;
    }

    td {
        border: none;
        border-bottom: 1px solid var(--border);
        padding: calc(10px * var(--space-scale)) calc(12px * var(--space-scale));
    }

    tbody tr td:last-child {
        border-bottom: none;
    }

    tbody tr td:first-child {
        background: var(--surface-alt);
        font-weight: 600;
    }

    td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75em;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        margin-bottom: calc(6px * var(--space-scale));
    }

    td input[type="text"] {
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }

    td button {
        width: 100%;
    }
}
