:root {
    --bg: #ffffff;
    --text: #0d0d0d;
    --input-bg: #ffffff;
    --border: #e5e7eb;
    --box-bg: #f7f7f8;
    --divider: #e5e7eb;
    --button: #114634;
    --button-active: #247156;
}

.dark {
    --bg: #000000;
    --text: #ffffff;
    --input-bg: #1c1c1e;
    --border: #2c2c2e;
    --box-bg: #1c1c1e;
    --divider: #2c2c2e;
    --button: #114634;
    --button-active: #247156;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.app {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 6px 26px calc(16px + env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    margin-top: 4px;
    margin-bottom: 6px;
}

.logo {
    width: 240px;
    max-width: 70%;
    filter: invert(1);
}

.dark .logo {
    filter: none;
}

.theme-btn {
    width: 42px;
    height: 42px;

    border-radius: 50%;
    background: var(--box-bg);
    border: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
    outline: none;
    box-shadow: none;
}

.theme-btn:focus,
.theme-btn:focus-visible,
.theme-btn:active {
    outline: none;
    box-shadow: none;
    transform: none;
}

.theme-btn:active {
    transform: scale(0.95);
    box-shadow:
        0 0 0 2px rgba(10, 132, 255, 0.25),
        0 0 12px rgba(10, 132, 255, 0.5);
}

.theme-btn img {
    width: 20px;
    height: 20px;
}

#screen1,
#screen2 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
}

label {
    display: block;
    margin-top: 18px;
    font-size: 18px;
    text-transform: uppercase;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 16px;
    margin-top: 8px;
    border-radius: 12px;
    font-size: 24px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    text-align: center;
    box-sizing: border-box;
}

input:focus {
    outline: none;
}

button {
    width: 100%;
    padding: 16px;

    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    background: var(--button);
    color: white;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

button:active {
    background: var(--button-active);
    transform: scale(0.99);
}

.bottom-button {
    margin-top: 12px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.top-values {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.top-box {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    background: var(--box-bg);
    border: 1px solid var(--border);
    text-align: center;
}

.top-label {
    font-size: 14px;
    opacity: 0.7;
    text-transform: uppercase;
}

.top-value {
    font-size: 36px;
    font-weight: 700;
}

.top-value-big {
    font-size: 56px;
    font-weight: 700;
}

.divider {
    height: 2px;
    margin: 20px 0;
    background: var(--divider);
}

input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.dark input.error {
    border-color: #ff4d4d;
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.15);
}