:root {
    --ui-bg: #f3f3ef;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f8f8f5;
    --ui-line: #d8d8d0;
    --ui-line-strong: #bfc1ba;
    --ui-ink: #111111;
    --ui-muted: #5f615b;
    --ui-blue: #e8eefb;
    --ui-blue-strong: #1f4ed8;
    --ui-green: #e8f2eb;
    --ui-red: #b42318;
    --ui-lime: #efff78;
    --ui-cyan: #cfefff;
    --ui-pink: #ffd8ea;
    --ui-gold: #ffe7a7;
    --ui-radius: 20px;
    --ui-radius-sm: 14px;
    --ui-shadow: 0 8px 24px rgba(17, 17, 17, 0.04);
    --ui-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body.app-shell {
    margin: 0;
    min-height: 100vh;
    background: var(--ui-bg);
    color: var(--ui-ink);
    font-family: var(--ui-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.app-shell a {
    color: inherit;
    text-decoration: none;
}

body.app-shell ::selection {
    background: rgba(31, 78, 216, 0.12);
}

body.page-index .container,
body.page-guide .page,
body.page-vat .page,
body.page-calendar .page {
    width: min(1180px, calc(100vw - 40px));
    margin: 0 auto;
}

body.page-index .container {
    padding: 0 0 48px;
}

body.page-index .header {
    position: relative;
    padding: 68px 0 40px;
    margin-bottom: 34px;
    background: #eef2ec;
    border-bottom: none;
    border-radius: 0 0 36px 36px;
    overflow: visible;
    box-shadow: 0 18px 44px rgba(17, 17, 17, 0.08);
    color: var(--ui-ink);
    isolation: isolate;
}

body.page-index .header::before,
body.page-index .header::after {
    content: none;
    position: absolute;
    border-radius: 999px;
    filter: blur(10px);
    opacity: 0.9;
    z-index: 0;
    animation: heroBlobDrift 10s ease-in-out infinite;
}

body.page-index .header::before {
    width: 260px;
    height: 260px;
    top: -90px;
    right: -40px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0) 72%);
}

body.page-index .header::after {
    width: 320px;
    height: 320px;
    left: -80px;
    bottom: -150px;
    background: radial-gradient(circle, rgba(255, 231, 167, 0.76) 0%, rgba(255, 231, 167, 0) 74%);
    animation-delay: -4s;
}

body.page-index .header-inner {
    width: min(1180px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 0;
}

body.page-index .header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-right: 96px;
    position: relative;
    z-index: 1;
}

body.page-index .header-copy {
    max-width: 820px;
}

body.page-index .header h1,
body.page-guide .hero h1,
body.page-vat .hero h1,
body.page-calendar .hero h1,
body.page-vat .result-card h2,
body.page-vat .section-heading h2 {
    margin: 0;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.92;
}

body.page-index .header h1 {
    display: inline-block;
    color: var(--ui-ink);
    font-size: clamp(2.2rem, 5vw, 4rem);
    letter-spacing: -0.06em;
    line-height: 0.92;
    text-transform: uppercase;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.52),
        0 0 18px rgba(255, 255, 255, 0.2),
        0 0 34px rgba(239, 255, 120, 0.18);
    animation: heroTitleIn 0.72s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.page-index .header h1::after {
    content: none;
}

body.page-index .header-subtitle {
    margin: 22px 0 0;
    max-width: 760px;
    padding: 18px 20px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    font-size: clamp(1.08rem, 2.2vw, 1.34rem);
    line-height: 1.62;
    color: rgba(17, 17, 17, 0.78);
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.05);
    animation: heroCardIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.page-index .menu-toggle,
body.page-guide .menu-toggle,
body.page-vat .menu-toggle,
body.page-calendar .menu-toggle {
    position: fixed;
    top: max(14px, env(safe-area-inset-top, 0px) + 14px);
    right: max(14px, env(safe-area-inset-right, 0px) + 14px);
    z-index: 9999;
    width: 62px;
    height: 62px;
    min-width: 62px;
    min-height: 62px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 22px;
    background: rgba(17, 17, 17, 0.92);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(17, 17, 17, 0.18);
    backdrop-filter: blur(14px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    animation: menuDockFloat 3.4s ease-in-out infinite;
}

body.page-index .menu-toggle:hover,
body.page-guide .menu-toggle:hover,
body.page-vat .menu-toggle:hover,
body.page-calendar .menu-toggle:hover {
    transform: translateY(-2px) scale(1.02);
    background: #000000;
    box-shadow: 0 22px 42px rgba(17, 17, 17, 0.22);
}

body.page-index .menu-toggle-box,
body.page-guide .menu-toggle-box,
body.page-vat .menu-toggle-box,
body.page-calendar .menu-toggle-box {
    position: relative;
    width: 24px;
    height: 18px;
    display: block;
}

body.page-index .menu-toggle-line,
body.page-guide .menu-toggle-line,
body.page-vat .menu-toggle-line,
body.page-calendar .menu-toggle-line {
    position: absolute;
    left: 0;
    width: 24px;
    height: 2.5px;
    border-radius: 999px;
    background: #ffffff;
    transform-origin: center;
    transition: transform 0.28s ease, opacity 0.2s ease, top 0.28s ease, background 0.28s ease;
}

body.page-index .menu-toggle-line:nth-child(1),
body.page-guide .menu-toggle-line:nth-child(1),
body.page-vat .menu-toggle-line:nth-child(1),
body.page-calendar .menu-toggle-line:nth-child(1) {
    top: 0;
}

body.page-index .menu-toggle-line:nth-child(2),
body.page-guide .menu-toggle-line:nth-child(2),
body.page-vat .menu-toggle-line:nth-child(2),
body.page-calendar .menu-toggle-line:nth-child(2) {
    top: 7.5px;
}

body.page-index .menu-toggle-line:nth-child(3),
body.page-guide .menu-toggle-line:nth-child(3),
body.page-vat .menu-toggle-line:nth-child(3),
body.page-calendar .menu-toggle-line:nth-child(3) {
    top: 15px;
}

body.page-index .menu-toggle.is-active,
body.page-guide .menu-toggle.is-active,
body.page-vat .menu-toggle.is-active,
body.page-calendar .menu-toggle.is-active {
    background: #ffffff;
    border-color: rgba(17, 17, 17, 0.12);
}

body.page-index .menu-toggle.is-active .menu-toggle-line,
body.page-guide .menu-toggle.is-active .menu-toggle-line,
body.page-vat .menu-toggle.is-active .menu-toggle-line,
body.page-calendar .menu-toggle.is-active .menu-toggle-line {
    background: #111111;
}

body.page-index .menu-toggle.is-active .menu-toggle-line:nth-child(1),
body.page-guide .menu-toggle.is-active .menu-toggle-line:nth-child(1),
body.page-vat .menu-toggle.is-active .menu-toggle-line:nth-child(1),
body.page-calendar .menu-toggle.is-active .menu-toggle-line:nth-child(1) {
    top: 7.5px;
    transform: rotate(45deg);
}

body.page-index .menu-toggle.is-active .menu-toggle-line:nth-child(2),
body.page-guide .menu-toggle.is-active .menu-toggle-line:nth-child(2),
body.page-vat .menu-toggle.is-active .menu-toggle-line:nth-child(2),
body.page-calendar .menu-toggle.is-active .menu-toggle-line:nth-child(2) {
    opacity: 0;
}

body.page-index .menu-toggle.is-active .menu-toggle-line:nth-child(3),
body.page-guide .menu-toggle.is-active .menu-toggle-line:nth-child(3),
body.page-vat .menu-toggle.is-active .menu-toggle-line:nth-child(3),
body.page-calendar .menu-toggle.is-active .menu-toggle-line:nth-child(3) {
    top: 7.5px;
    transform: rotate(-45deg);
}

body.app-shell .drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.32);
    backdrop-filter: blur(4px);
    z-index: 9997;
}

body.app-shell .drawer {
    background: var(--ui-surface);
    color: var(--ui-ink);
    border-left: 1px solid var(--ui-line);
    box-shadow: none;
    z-index: 9998;
}

body.app-shell .drawer-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 999px;
    background: var(--ui-surface);
    color: var(--ui-ink);
    font-size: 1.2rem;
    cursor: pointer;
}

body.app-shell .drawer-title,
body.page-guide .topbar-title,
body.page-vat .topbar-title,
body.page-calendar .topbar-title,
body.page-index .card-title,
body.page-index .card-title-row .card-title,
body.page-guide .card h2,
body.page-calendar .card h2 {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.app-shell .drawer-links {
    display: grid;
    gap: 8px;
}

body.app-shell .drawer-link {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface-soft);
    font-size: 0.95rem;
    font-weight: 600;
}

body.app-shell .drawer-footnote {
    margin-top: auto;
    color: var(--ui-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

body.page-index .card,
body.page-guide .card,
body.page-vat .calculator-shell,
body.page-vat .result-card,
body.page-calendar .card,
body.page-guide .hero,
body.page-vat .hero,
body.page-calendar .hero {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
}

body.page-index .card {
    padding: 24px;
    margin-bottom: 16px;
}

body.page-index .card-upload {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #ffffff 100%);
    border-color: rgba(17, 17, 17, 0.12);
    box-shadow: 0 18px 36px rgba(17, 17, 17, 0.06);
    overflow: hidden;
}

body.page-index .card-upload::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 8px;
    background: linear-gradient(90deg, var(--ui-cyan) 0%, var(--ui-lime) 48%, var(--ui-pink) 100%);
}

body.page-index .card-profile,
body.page-index .stat-card--count {
    background: var(--ui-blue);
}

body.page-index .stat-card--amount {
    background: var(--ui-surface);
}

body.page-index .card-records {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 8px 0 0;
}

body.page-index .card-title,
body.page-index .card-title-row .card-title {
    margin: 0 0 18px;
    color: var(--ui-ink);
}

body.page-index .btn,
body.page-vat .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 18px;
    border: 1px solid var(--ui-line-strong);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-ink);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

body.page-index .btn:hover,
body.page-vat .action-btn:hover {
    background: #f1f1ec;
}

body.page-index .btn-primary,
body.page-vat .action-btn.calculate.ready {
    background: var(--ui-ink);
    border-color: var(--ui-ink);
    color: var(--ui-surface);
}

body.page-index .btn-success {
    background: var(--ui-surface);
    border-color: var(--ui-blue-strong);
    color: var(--ui-blue-strong);
}

body.page-index .btn-warning {
    background: #f3f3ef;
    border-color: #111111;
    color: #111111;
}

body.page-index .btn-danger {
    background: #fff0ef;
    border-color: #e0b4b0;
    color: var(--ui-red);
}

body.page-index .btn-dark {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}

body.page-index #exportButtons .export-btn {
    min-height: 58px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

body.page-index #exportButtons .export-btn-excel {
    background: #1f7a55;
    border-color: #1f7a55;
    color: #ffffff;
}

body.page-index #exportButtons .export-btn-excel:hover {
    background: #196544;
    border-color: #196544;
}

body.page-index #exportButtons .export-btn-report {
    background: #cfefff;
    border-color: #9fd7f3;
    color: #111111;
}

body.page-index #exportButtons .export-btn-report:hover {
    background: #bde5fb;
    border-color: #84c8eb;
}

body.page-index #exportButtons .export-btn-csv {
    background: #ffd8ea;
    border-color: #f0aeca;
    color: #111111;
}

body.page-index #exportButtons .export-btn-csv:hover {
    background: #ffcbe1;
    border-color: #e899bb;
}

body.page-index #exportButtons .export-btn-zip {
    background: #efff78;
    border-color: #d1e45d;
    color: #111111;
}

body.page-index #exportButtons .export-btn-zip:hover {
    background: #e6f665;
    border-color: #c5d84d;
}

body.page-index .btn-inline {
    width: auto;
}

body.page-index .btn-group,
body.page-index .btn-group-three,
body.page-index .modal-actions,
body.page-index .csv-option-grid,
body.page-vat .action-row {
    display: grid;
    gap: 12px;
}

body.page-index .btn-group,
body.page-index .modal-actions,
body.page-vat .action-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body.page-index .btn-group-three {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

body.page-index .csv-option-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.page-index .upload-area {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 14px;
    min-height: 292px;
    padding: 48px 28px;
    border: 2px dashed rgba(247, 124, 37, 0.42);
    border-radius: var(--ui-radius);
    background: linear-gradient(135deg, rgba(228, 255, 127, 0.88) 0%, rgba(255, 255, 255, 0.98) 42%, rgba(255, 194, 118, 0.86) 100%);
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 20px 36px rgba(247, 124, 37, 0.1);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

body.page-index .upload-area::before,
body.page-index .upload-area::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

body.page-index .upload-area::before {
    width: 280px;
    height: 280px;
    top: -100px;
    right: -60px;
    background: radial-gradient(circle, rgba(99, 214, 84, 0.34) 0%, rgba(99, 214, 84, 0) 74%);
    animation: heroBlobDrift 8s ease-in-out infinite;
}

body.page-index .upload-area::after {
    width: 240px;
    height: 240px;
    left: -70px;
    bottom: -70px;
    background: radial-gradient(circle, rgba(255, 136, 57, 0.3) 0%, rgba(255, 136, 57, 0) 74%);
    animation: heroBlobDrift 7s ease-in-out infinite reverse;
}

body.page-index .upload-area:hover,
body.page-index .upload-area.dragover {
    transform: translateY(-4px) scale(1.01);
    border-color: #ff7c25;
    background: linear-gradient(135deg, rgba(218, 255, 106, 0.94) 0%, rgba(255, 255, 255, 1) 42%, rgba(255, 171, 90, 0.9) 100%);
    box-shadow: 0 24px 42px rgba(247, 124, 37, 0.16);
}

body.page-index .upload-camera-mark {
    position: relative;
    z-index: 1;
    width: 108px;
    height: 108px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 32px;
    background: linear-gradient(135deg, #b8ff6b 0%, #ffb04e 100%);
    color: var(--ui-ink);
    box-shadow: 0 18px 36px rgba(255, 124, 37, 0.2);
    overflow: visible;
    animation: cameraBob 2.8s ease-in-out infinite;
}

body.page-index .upload-camera-mark::before,
body.page-index .upload-camera-mark::after {
    content: "";
    position: absolute;
    border-radius: 38px;
    pointer-events: none;
}

body.page-index .upload-camera-mark::before {
    inset: -10px;
    border: 2px solid rgba(255, 124, 37, 0.38);
    animation: cameraPulseRing 2.2s ease-out infinite;
}

body.page-index .upload-camera-mark::after {
    inset: -20px;
    background: radial-gradient(circle, rgba(255, 163, 82, 0.26) 0%, rgba(255, 163, 82, 0) 70%);
    animation: cameraGlowPulse 2.6s ease-in-out infinite;
}

body.page-index .upload-camera-mark svg {
    width: 40px;
    height: 40px;
    stroke-width: 2.4;
}

body.page-index .upload-text {
    margin: 0;
    position: relative;
    z-index: 1;
    max-width: 760px;
    font-size: clamp(2.1rem, 4vw, 3.35rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 0.96;
    color: #111111;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.page-index .upload-hint,
body.page-index .text-muted,
body.page-guide .card p,
body.page-guide .card li,
body.page-vat .calc-note,
body.page-vat .section-heading p,
body.page-vat .result-placeholder,
body.page-calendar .card p,
body.page-calendar .meta-row span:first-child {
    color: var(--ui-muted);
}

body.page-index .upload-hint {
    position: relative;
    z-index: 1;
    max-width: 620px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(17, 17, 17, 0.08);
    font-size: 1rem;
    font-weight: 700;
    color: rgba(17, 17, 17, 0.72);
}

body.page-index .card-upload .btn-group {
    margin-top: 20px;
}

body.page-index .card-upload .btn-group .btn {
    min-height: 58px;
    border-color: rgba(17, 17, 17, 0.14);
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(17, 17, 17, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

body.page-index .card-upload .btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(17, 17, 17, 0.08);
}

body.page-index .card-upload .btn-group .btn:nth-child(1) {
    background: #dff0ff;
    border-color: #a7cfff;
}

body.page-index .card-upload .btn-group .btn:nth-child(2) {
    background: #fff0b8;
    border-color: #e5cb61;
}

body.page-index .card-upload .btn-group .btn:nth-child(3) {
    background: #ffd7ea;
    border-color: #f5a8c7;
}

body.page-index .report-profile-grid {
    display: grid;
    gap: 16px;
}

@keyframes heroBlobDrift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, 14px, 0) scale(1.05);
    }
}

@keyframes heroTitleIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroCardIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cameraBob {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px) scale(1.02);
    }
}

@keyframes cameraPulseRing {
    0% {
        opacity: 0.9;
        transform: scale(0.94);
    }
    70% {
        opacity: 0;
        transform: scale(1.18);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

@keyframes cameraGlowPulse {
    0%,
    100% {
        opacity: 0.42;
        transform: scale(0.96);
    }
    50% {
        opacity: 0.78;
        transform: scale(1.1);
    }
}

@keyframes menuDockFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

body.page-index .report-profile-toolbar,
body.page-index .report-profile-actions,
body.page-index .records-card-head,
body.page-index .records-selection-bar,
body.page-index .card-title-row,
body.page-vat .result-row,
body.page-vat .result-total,
body.page-calendar .card-top,
body.page-calendar .meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

body.page-index .report-profile-actions,
body.page-index .records-selection-bar {
    flex-wrap: wrap;
}

body.page-index .report-profile-status,
body.page-index .records-selection-info,
body.page-index .selection-toggle,
body.page-index .vat-helper,
body.page-index .status-badge,
body.page-guide .note,
body.page-calendar .today-chip,
body.page-vat .result-badge {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: var(--ui-surface-soft);
    color: var(--ui-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

body.page-index .report-profile-status.info,
body.page-index .vat-helper.info,
body.page-vat .result-badge,
body.page-calendar .today-chip {
    background: var(--ui-blue);
    border-color: #cbd8f6;
    color: #274aa3;
}

body.page-index .report-profile-status.success,
body.page-calendar .status-success {
    background: var(--ui-green);
    color: #28543d;
    border-color: #c8ddcf;
}

body.page-index .report-profile-status.warning,
body.page-index .vat-helper.warning,
body.page-calendar .status-danger {
    background: #fff0ef;
    color: var(--ui-red);
    border-color: #e5c0bc;
}

body.page-calendar .status-warning {
    background: #f3f3ef;
    color: #111111;
    border-color: #cfcfc8;
}

body.page-index .form-label,
body.page-vat .field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--ui-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.page-index .form-input,
body.page-index .form-select,
body.page-index .form-textarea,
body.page-vat .amount-input,
body.page-vat .custom-rate-input,
body.page-vat .select-input {
    width: 100%;
    min-height: 50px;
    padding: 14px 16px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-ink);
    font: inherit;
}

body.page-index .form-input:focus,
body.page-index .form-select:focus,
body.page-index .form-textarea:focus,
body.page-vat .amount-input:focus,
body.page-vat .custom-rate-input:focus,
body.page-vat .select-input:focus {
    outline: none;
    border-color: var(--ui-blue-strong);
    box-shadow: 0 0 0 3px rgba(31, 78, 216, 0.08);
}

body.page-index .form-textarea {
    min-height: 120px;
    resize: vertical;
}

body.page-index .form-row,
body.page-index .report-period-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.page-index .period-chip-group {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

body.page-index .period-chip {
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    padding: 10px 12px;
    background: var(--ui-surface);
    color: var(--ui-muted);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

body.page-index .period-chip.active {
    background: var(--ui-ink);
    border-color: var(--ui-ink);
    color: var(--ui-surface);
}

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

body.page-index .stat-card {
    padding: 22px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
}

body.page-index .stat-value {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 0.95;
}

body.page-index .stat-label {
    color: var(--ui-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

body.page-index .table-wrapper,
body.page-index .receipt-reference-preview,
body.page-index .record-edit-preview,
body.page-index .preview-container,
body.page-vat .phone-frame {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    overflow: hidden;
}

body.page-index .table-wrapper {
    margin-top: 14px;
}

body.page-index table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

body.page-index thead {
    background: var(--ui-surface-soft);
}

body.page-index th,
body.page-index td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--ui-line);
    vertical-align: middle;
}

body.page-index th {
    color: var(--ui-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.page-index tbody tr:hover {
    background: #f8f8f4;
}

body.page-index tr.is-selected {
    background: #eef3ff;
}

body.page-index .table-image {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--ui-line);
}

body.page-index .action-buttons {
    display: inline-flex;
    gap: 8px;
}

body.page-index .icon-btn {
    width: auto;
    min-width: 80px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: var(--ui-surface);
    color: var(--ui-ink);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

body.page-index .icon-btn.delete {
    color: var(--ui-red);
    border-color: #e3c1bd;
    background: #fff5f4;
}

body.page-index .empty-state {
    padding: 48px 16px;
    text-align: center;
}

body.page-index .progress-bar {
    height: 10px;
    border-radius: 999px;
    background: #e7e7e1;
    overflow: hidden;
}

body.page-index .progress-fill {
    height: 100%;
    background: var(--ui-blue-strong);
}

body.page-index .modal-overlay {
    background: rgba(17, 17, 17, 0.4);
    backdrop-filter: blur(4px);
}

body.page-index .modal-content {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    box-shadow: 0 16px 40px rgba(17, 17, 17, 0.08);
}

body.page-index .modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 999px;
    background: var(--ui-surface);
    color: var(--ui-ink);
}

body.page-index .loading-overlay {
    background: rgba(243, 243, 239, 0.8);
    backdrop-filter: blur(6px);
}

body.page-index .spinner {
    border: 4px solid #d7d8d1;
    border-top-color: var(--ui-blue-strong);
}

body.page-index .toast {
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: var(--ui-surface);
    color: var(--ui-ink);
}

body.page-index .toast.success {
    border-color: #cbd8f6;
    background: #edf3ff;
    color: #274aa3;
}

body.page-index .toast.error {
    border-color: #e3c1bd;
    background: #fff3f1;
    color: var(--ui-red);
}

body.app-shell .site-footer {
    width: min(1180px, calc(100vw - 40px));
    margin: 28px auto 0;
    padding: 0 0 36px;
}

body.app-shell .site-footer-inner {
    position: relative;
    overflow: hidden;
    padding: 34px 28px 32px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    background: #050505;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 20px 44px rgba(17, 17, 17, 0.18);
}

body.app-shell .site-footer-inner::before {
    content: "";
    position: absolute;
    inset: -120px auto auto 50%;
    width: 340px;
    height: 220px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 40, 32, 0.26) 0%, rgba(255, 40, 32, 0) 72%);
    filter: blur(18px);
    opacity: 0.95;
}

body.app-shell .site-footer-kicker {
    position: relative;
    z-index: 1;
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

body.app-shell .site-footer-title {
    position: relative;
    z-index: 1;
    margin: 14px 0 14px;
    font-size: clamp(2.3rem, 6vw, 4.6rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.88;
    text-transform: uppercase;
    color: #ff2c23;
}

body.app-shell .site-footer-copy,
body.app-shell .site-footer-note {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin-inline: auto;
    color: rgba(255, 255, 255, 0.94);
    line-height: 1.5;
    font-size: 1rem;
    font-weight: 600;
}

body.app-shell .site-footer-note {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.82);
}

body.app-shell .site-footer-meta {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 4px;
    margin-top: 18px;
}

body.app-shell .site-footer-meta span {
    display: block;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
    font-weight: 600;
}

body.app-shell .site-footer-meta span:first-child {
    margin-top: 4px;
    color: #ffffff;
    font-weight: 800;
}

body.page-guide .topbar,
body.page-vat .topbar,
body.page-calendar .topbar {
    width: min(1180px, calc(100vw - 40px));
    margin: 24px auto 0;
    padding: 0 96px 18px 0;
    border-bottom: 1px solid var(--ui-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

body.page-guide .page,
body.page-vat .page,
body.page-calendar .page {
    padding: 28px 0 44px;
}

body.page-guide .hero,
body.page-vat .hero,
body.page-calendar .hero {
    padding: 28px;
    margin-bottom: 18px;
}

body.page-guide .hero h1,
body.page-vat .hero h1,
body.page-calendar .hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
}

body.page-guide .hero p,
body.page-vat .hero p,
body.page-calendar .hero p {
    margin: 14px 0 0;
    max-width: 780px;
    line-height: 1.7;
    color: var(--ui-muted);
}

body.page-guide .note {
    margin-top: 18px;
}

body.page-guide .grid,
body.page-calendar .grid {
    display: grid;
    gap: 16px;
}

body.page-guide .card,
body.page-calendar .card {
    padding: 22px;
}

body.page-vat .calculator-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
    gap: 22px;
    padding: 22px;
    margin-bottom: 18px;
}

body.page-vat .panel {
    padding: 0;
}

body.page-vat .choice-list,
body.page-vat .rate-grid,
body.page-vat .result-list {
    display: grid;
    gap: 12px;
}

body.page-vat .choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface-soft);
    font-size: 0.98rem;
    font-weight: 600;
}

body.page-vat .choice input {
    margin-top: 5px;
    accent-color: var(--ui-blue-strong);
}

body.page-vat .rate-btn {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

body.page-vat .rate-btn.active {
    background: var(--ui-ink);
    border-color: var(--ui-ink);
    color: var(--ui-surface);
}

body.page-vat .custom-rate-wrap {
    margin-top: 10px;
}

body.page-vat .phone-frame {
    padding: 0;
}

body.page-vat .phone-notch {
    display: none;
}

body.page-vat .result-card {
    min-height: 100%;
    padding: 24px;
}

body.page-vat .result-card h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 20px;
}

body.page-vat .result-placeholder {
    margin-bottom: 24px;
    line-height: 1.7;
}

body.page-vat .divider {
    height: 1px;
    margin: 18px 0;
    background: var(--ui-line);
}

body.page-vat .section-heading {
    margin: 28px 0 18px;
}

body.page-vat .section-heading h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 10px;
}

body.page-calendar .today-chip {
    margin-bottom: 16px;
}

body.page-calendar .card-top {
    align-items: flex-start;
}

body.page-calendar .status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--ui-line);
    font-size: 0.8rem;
    font-weight: 700;
}

body.page-calendar .meta-list {
    display: grid;
    gap: 10px;
}

body.page-calendar .meta-row {
    padding-top: 10px;
    border-top: 1px solid var(--ui-line);
}

@media (max-width: 900px) {
    body.page-index .header-top,
    body.page-index .report-profile-toolbar,
    body.page-index .records-card-head,
    body.page-guide .topbar,
    body.page-vat .topbar,
    body.page-calendar .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    body.page-index .menu-toggle {
        right: 18px;
    }

    body.page-index .form-row,
    body.page-index .report-period-grid,
    body.page-vat .calculator-shell {
        grid-template-columns: 1fr;
    }

    body.page-index .period-chip-group {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.page-index .container,
    body.page-guide .page,
    body.page-vat .page,
    body.page-calendar .page,
    body.page-guide .topbar,
    body.page-vat .topbar,
    body.page-calendar .topbar,
    body.page-index .header-inner {
        width: calc(100vw - 24px);
    }

    body.page-index .header {
        padding: 34px 0 28px;
        border-radius: 0 0 28px 28px;
    }

    body.page-guide .topbar,
    body.page-vat .topbar,
    body.page-calendar .topbar {
        padding-right: 82px;
    }

    body.page-index .header-top {
        padding-right: 82px;
    }

    body.page-index .header h1 {
        font-size: clamp(2rem, 11vw, 2.7rem);
    }

    body.page-index .header-subtitle {
        padding: 16px 16px;
        font-size: 1rem;
    }

    body.page-index .card,
    body.page-guide .card,
    body.page-vat .hero,
    body.page-guide .hero,
    body.page-calendar .hero,
    body.page-vat .calculator-shell,
    body.page-vat .result-card,
    body.page-calendar .card {
        padding: 18px;
        border-radius: 16px;
    }

    body.app-shell .site-footer {
        width: calc(100vw - 24px);
    }

    body.app-shell .site-footer-inner {
        padding: 26px 18px 24px;
        border-radius: 18px;
    }

    body.app-shell .site-footer-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    body.app-shell .site-footer-copy,
    body.app-shell .site-footer-note,
    body.app-shell .site-footer-meta span {
        font-size: 0.92rem;
    }

    body.page-index .upload-area {
        min-height: 236px;
        padding: 32px 18px;
    }

    body.page-index .menu-toggle,
    body.page-guide .menu-toggle,
    body.page-vat .menu-toggle,
    body.page-calendar .menu-toggle {
        top: max(12px, env(safe-area-inset-top, 0px) + 12px);
        right: max(12px, env(safe-area-inset-right, 0px) + 12px);
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
        border-radius: 20px;
    }

    body.page-index .upload-camera-mark {
        width: 88px;
        height: 88px;
        border-radius: 26px;
    }

    body.page-index .upload-text {
        font-size: clamp(1.8rem, 10vw, 2.4rem);
    }

    body.page-index .upload-hint {
        padding: 9px 14px;
        font-size: 0.92rem;
    }

    body.page-index .btn-group,
    body.page-index .btn-group-three,
    body.page-index .modal-actions,
    body.page-index .csv-option-grid,
    body.page-vat .action-row {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-index .header::before,
    body.page-index .header::after,
    body.page-index .header h1,
    body.page-index .header-subtitle,
    body.page-index .upload-area::before,
    body.page-index .upload-area::after,
    body.page-index .upload-camera-mark,
    body.page-index .upload-camera-mark::before,
    body.page-index .upload-camera-mark::after {
        animation: none;
    }
}
