:root {
    --bg: var(--tg-theme-bg-color, #ffffff);
    --text: var(--tg-theme-text-color, #000000);
    --hint: var(--tg-theme-hint-color, #8e8e93);
    --button: var(--tg-theme-button-color, #2481cc);
    --button-text: var(--tg-theme-button-text-color, #ffffff);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1 {
    margin: 0 0 16px;
    font-size: 22px;
}

h2 {
    margin: 24px 0 8px;
    font-size: 17px;
}

.hidden {
    display: none !important;
}

.muted, small {
    color: var(--hint);
}

.period {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.period h1 {
    margin: 0;
}

.arrow {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--secondary-bg);
    color: var(--text);
    font-size: 24px;
}

.arrow.invisible {
    visibility: hidden;
}

.total {
    margin: 16px 0;
    text-align: center;
}

#total-vnd {
    font-size: 28px;
    font-weight: 700;
}

#total-alt {
    display: block;
    margin-top: 4px;
}

.chart {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    border-radius: 50%;
}

.chart::after {
    content: "";
    position: absolute;
    inset: 25%;
    border-radius: 50%;
    background: var(--bg);
}

.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--secondary-bg);
}

.dot {
    flex: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.info {
    flex: 1;
    min-width: 0;
}

.info small, .sum small {
    display: block;
    font-size: 12px;
}

.sum {
    text-align: right;
    white-space: nowrap;
}

.delete {
    border: none;
    background: none;
    font-size: 18px;
}

.actions {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0 0;
    background: var(--bg);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--button);
    color: var(--button-text);
    font-size: 16px;
    font-weight: 600;
}

.btn.secondary {
    background: var(--secondary-bg);
    color: var(--text);
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--hint);
    font-size: 14px;
}

input {
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--secondary-bg);
    color: var(--text);
    font-size: 16px;
}

.chips, .colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 12px;
    border: 2px solid var(--color, var(--hint));
    border-radius: 18px;
    background: none;
    color: var(--text);
    font-size: 14px;
}

.chip.active {
    background: var(--color);
    color: #ffffff;
}

.color {
    width: 36px;
    height: 36px;
    border: 3px solid transparent;
    border-radius: 50%;
}

.color.active {
    border-color: var(--text);
}
