:root {
    --gap: 0.75rem;
    --space: 0.5rem;
    --header-offset: 3.2rem;
    --footer-offset: 3.6rem;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font: inherit;
    color: inherit;
}
body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-main-background);
    color: var(--color-main-text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}
.app {
    width: 100%;
    max-width: 420px;
    height: 100vh;
    margin: 0 auto;
    padding: var(--header-offset) 1.25rem var(--footer-offset);
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}
.app > header,
.app > footer {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: min(100vw, 420px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-header-background);
    z-index: 3;
}
.app > header {
    top: 0;
    padding: 0.35rem 1.25rem;
}
.brand {
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.85rem;
}
.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
button {
    border: none;
    background: var(--color-button-primary-bg);
    color: var(--color-button-primary-text);
    padding: 0.6rem 1.05rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
button.secondary {
    background: var(--color-button-secondary-bg);
    border: 1px solid var(--color-button-secondary-border);
    color: var(--color-button-secondary-text);
}
button.ghost {
    background: var(--color-button-ghost-bg);
    color: var(--color-button-ghost-text);
}
button.icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--color-button-secondary-border);
    background: var(--color-button-secondary-bg);
    color: var(--color-button-secondary-text);
}
.theme-switch {
    position: relative;
    padding: 0.5rem;
}
.theme-switch .icon {
    display: none;
    width: 1.25rem;
    height: 1.25rem;
}
.theme-switch img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
body.theme-dark .theme-switch .icon-light-mode {
    display: block;
}
body.theme-light .theme-switch .icon-dark-mode {
    display: block;
    filter: brightness(0) saturate(100%);
}

@media (min-width: 768px) {
    .app {
        max-width: 600px;
    }
    .app > header,
    .app > footer {
        width: min(100vw, 600px);
    }
}

.burger {
    position: relative;
    border: 1px solid var(--color-button-secondary-border);
    background: var(--color-button-secondary-bg);
    color: var(--color-button-secondary-text);
}
.burger span,
.burger span::before,
.burger span::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1.2rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}
.burger span {
    top: 50%;
    transform: translate(-50%, -50%);
}
.burger span::before {
    top: -6px;
}
.burger span::after {
    top: 6px;
}
nav.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 75vw;
    max-width: 320px;
    padding: 1.5rem;
    background: var(--color-drawer-background);
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2;
}
body.menu-open nav.drawer {
    transform: translateX(0);
}
nav.drawer a {
    text-decoration: none;
    color: var(--color-main-text);
    font-weight: 500;
}
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    overflow-y: auto;
    padding-bottom: var(--gap);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
main::-webkit-scrollbar {
    display: none;
}
.app > main > section {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0;
}
.app > main > section > * {
    min-width: 0;
}
.card {
    background: var(--color-card-background);
    border-radius: 22px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: var(--space);
    border: 1px solid var(--color-border);
}
.hero {
    background: var(--color-primary-element);
    color: var(--color-button-primary-text);
    border: none;
}
.subtitle {
    color: var(--color-muted-text);
    font-size: 0.88rem;
    line-height: 1.4;
}
.tray {
    display: flex;
    gap: 0.55rem;
}
.search {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--color-card-background);
    border-radius: 999px;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
}
.search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--color-main-text);
    font-size: 0.95rem;
}
.search input::placeholder {
    color: var(--color-muted-text);
}
.grid {
    display: grid;
    gap: 0.5rem;
}
.grid.trio {
    grid-template-columns: repeat(3, 1fr);
}
.stat {
    text-align: center;
}
.stat .value {
    font-size: 1.2rem;
    font-weight: 600;
}
.stat .label {
    color: var(--color-muted-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.media {
    min-height: 140px;
    border-radius: 18px;
    background: var(--color-primary-element-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-media-text);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--color-muted-text);
}
.list li {
    list-style: none;
    display: flex;
    justify-content: space-between;
}
.app > footer {
    bottom: 0;
    padding: 0.6rem 1.25rem;
    gap: 0.5rem;
    border-radius: 0;
    border-top: 1px solid var(--color-border);
}
.card-head {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.card-head h1 {
    font-size: 1.1rem;
}
.section-head {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-inline: 0.25rem;
}
.section-head h1 {
    font-size: 1.2rem;
}
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.4rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.table-wrapper::-webkit-scrollbar {
    display: none;
}
.timesheet {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 100%;
}
.timesheet th,
.timesheet td {
    padding: 0.35rem 0.4rem;
    border-top: 1px solid var(--color-border);
}
.timesheet thead th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    color: var(--color-muted-text);
    border-top: none;
}
.timesheet tbody tr:nth-child(even) {
    background: var(--color-table-stripe);
}
.timesheet td {
    color: var(--color-main-text);
    vertical-align: top;
}
.timesheet td:nth-child(-n+6),
.timesheet th:nth-child(-n+6) {
    white-space: nowrap;
    text-align: center;
}
.timesheet th:nth-child(7) {
    text-align: left;
    white-space: nowrap;
    word-break: keep-all;
}
.timesheet td:nth-child(7) {
    text-align: left;
    white-space: normal;
    word-break: break-word;
}
