body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f4f4f4;
    overscroll-behavior-x: none;
}

[hidden] {
    display: none !important;
}

main {
    max-width: 1080px;
    margin: 40px auto;
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    direction: ltr;
}

h1 {
    margin-top: 0;
}

.loginScreen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.loginCard {
    width: min(380px, 100%);
    background: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.loginField {
    display: grid;
    gap: 6px;
    margin-top: 16px;
    color: #555;
    font-size: 14px;
}

.loginField input {
    font-size: 20px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
}

.loginError {
    margin-top: 14px;
    color: #a40000;
    font-size: 14px;
}

.loginButton {
    width: 100%;
    margin-top: 20px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.langButton {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d0d0d0;
    background: white;
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 12px;
}

.label {
    font-size: 14px;
    color: #555;
}

.value,
.subvalueMain {
    font-size: 32px;
    margin-top: 8px;
    line-height: 1.2;
}

.subvalue {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.subvalueMain {
    color: #000;
    margin-top: 0;
}

.subvalueSide {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    line-height: 1.2;
    color: #555;
    position: relative;
}

.infoButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #cfcfcf;
    border-radius: 999px;
    background: white;
    color: #555;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.infoPopup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(320px, 80vw);
    background: #fff7cc;
    border: 1px solid #e6d98a;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    z-index: 10;
    font-size: 13px;
    line-height: 1.4;
    color: #5b5200;
}

.infoPopupTitle {
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.infoPopupText {
    margin: 0 0 8px;
}

.infoTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.infoTable th,
.infoTable td {
    text-align: center;
    padding: 4px 6px;
    border-bottom: 1px solid rgba(91, 82, 0, 0.18);
}

.infoTable th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

[dir="rtl"] .label,
[dir="rtl"] h1 {
    text-align: right;
}

[dir="rtl"] .langButton {
    direction: rtl;
}

[dir="rtl"] .infoPopup {
    text-align: right;
}

.chartSection {
    margin-bottom: 24px;
}

.chartFrame {
    position: relative;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    overflow: hidden;
}

.chartTitle {
    color: #202020;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
}

.chartSection > .label {
    text-align: center;
}

.chartNavButton {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
}

.chartNavButton:disabled {
    opacity: 0.28;
    cursor: default;
}

#productivityChart {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 360px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    overscroll-behavior: contain;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.chartPreviewCanvas {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 640px) {
    main {
        margin: 12px;
        padding: 16px;
    }

    .chartFrame {
        grid-template-columns: 34px 1fr 34px;
        gap: 6px;
    }

    .chartTitle {
        font-size: 18px;
        margin-top: 8px;
    }

    .chartNavButton {
        width: 34px;
        height: 34px;
        font-size: 24px;
    }

    #productivityChart {
        height: 300px;
    }
}

button {
    font-size: 22px;
    padding: 18px 36px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: #ddd;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
