:root {
    --color-cream: #fffaf2;
    --color-cream-dark: #f5eadb;
    --color-paper: #fffdf8;
    --color-brown: #6f402c;
    --color-brown-dark: #4a291d;
    --color-brown-soft: #9b6a4d;
    --color-terracotta: #c97852;
    --color-terracotta-dark: #a95f40;
    --color-green: #7d9270;
    --color-green-soft: #e8eee3;
    --color-rose-soft: #f7e3dc;
    --color-text: #3f3029;
    --color-text-soft: #7d6a60;
    --color-white: #ffffff;
    --color-border: rgba(111, 64, 44, 0.12);

    --shadow-soft: 0 12px 35px rgba(79, 48, 31, 0.09);
    --shadow-card: 0 16px 45px rgba(79, 48, 31, 0.12);

    --radius-small: 14px;
    --radius-medium: 22px;
    --radius-large: 32px;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    background: var(--color-cream);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--color-text);
    background:
        radial-gradient(
            circle at top left,
            rgba(201, 120, 82, 0.12),
            transparent 36%
        ),
        linear-gradient(
            180deg,
            #fffaf2 0%,
            #f9f1e6 100%
        );
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

button:not(:disabled) {
    cursor: pointer;
}

button:disabled {
    cursor: default;
}

.app-shell {
    width: 100%;
    max-width: 560px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    position: relative;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.48),
            rgba(255, 250, 242, 0.8)
        );
}

.app-header {
    min-height: calc(76px + var(--safe-top));
    padding:
        calc(12px + var(--safe-top))
        20px
        12px;
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 250, 242, 0.9);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.header-logo-button,
.header-profile {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 16px;
    display: grid;
    place-items: center;
}

.header-logo-button {
    background: var(--color-white);
    box-shadow: 0 6px 18px rgba(79, 48, 31, 0.09);
    overflow: hidden;
}

.header-logo {
    width: 43px;
    height: 43px;
    object-fit: contain;
}

.header-profile {
    font-size: 23px;
    background: var(--color-green-soft);
}

.header-title {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.header-title span {
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header-title strong {
    margin-top: 4px;
    color: var(--color-brown);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
}

.app-main {
    padding:
        18px
        18px
        calc(110px + var(--safe-bottom));
}

.app-view {
    display: none;
    animation: viewEnter 260ms ease;
}

.app-view.is-active {
    display: block;
}

@keyframes viewEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-card {
    min-height: 470px;
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-large);
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.95),
            rgba(255, 247, 236, 0.94)
        );
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.hero-card::before {
    content: "";
    width: 220px;
    height: 220px;
    position: absolute;
    top: -90px;
    right: -80px;
    border-radius: 50%;
    background: rgba(201, 120, 82, 0.1);
}

.hero-card::after {
    content: "";
    width: 190px;
    height: 190px;
    position: absolute;
    bottom: -100px;
    left: -90px;
    border-radius: 50%;
    background: rgba(125, 146, 112, 0.12);
}

.hero-decoration {
    position: absolute;
    z-index: 1;
    font-size: 30px;
    filter: drop-shadow(0 5px 8px rgba(79, 48, 31, 0.12));
}

.hero-decoration-left {
    top: 36px;
    left: 24px;
    transform: rotate(-12deg);
}

.hero-decoration-right {
    top: 48px;
    right: 26px;
    transform: rotate(10deg);
}

.hero-logo {
    width: min(185px, 58%);
    height: 150px;
    margin: 0 auto 10px;
    position: relative;
    z-index: 2;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(79, 48, 31, 0.12));
}

.hero-eyebrow,
.section-kicker {
    color: var(--color-terracotta-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-card h1 {
    margin-top: 11px;
    position: relative;
    z-index: 2;
    color: var(--color-brown-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 8.2vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.hero-description {
    max-width: 390px;
    margin: 18px auto 24px;
    position: relative;
    z-index: 2;
    color: var(--color-text-soft);
    font-size: 15px;
    line-height: 1.65;
}

.primary-button {
    width: 100%;
    min-height: 78px;
    padding: 14px 16px;
    position: relative;
    z-index: 2;
    border: 0;
    border-radius: 22px;
    display: grid;
    grid-template-columns: 48px 1fr 25px;
    align-items: center;
    gap: 12px;
    color: var(--color-white);
    background:
        linear-gradient(
            135deg,
            var(--color-terracotta),
            var(--color-brown)
        );
    box-shadow: 0 13px 28px rgba(153, 88, 58, 0.28);
    text-align: left;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.primary-button:active {
    transform: scale(0.985);
    box-shadow: 0 8px 20px rgba(153, 88, 58, 0.22);
}

.button-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 23px;
    background: rgba(255, 255, 255, 0.16);
}

.primary-button strong {
    display: block;
    font-size: 16px;
}

.primary-button small {
    margin-top: 4px;
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
}

.button-arrow {
    font-size: 28px;
    font-weight: 300;
}

.home-section {
    margin-top: 28px;
}

.section-heading {
    margin-bottom: 15px;
}

.section-heading h2,
.empty-highlight h2,
.placeholder-card h2 {
    margin-top: 6px;
    color: var(--color-brown-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    line-height: 1.18;
}

.quick-actions {
    display: grid;
    gap: 12px;
}

.quick-card {
    width: 100%;
    min-height: 94px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    display: grid;
    grid-template-columns: 56px 1fr 22px;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
    text-align: left;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.quick-card:not(:disabled):active {
    transform: scale(0.99);
}

.quick-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 26px;
}

.quick-card-notebook .quick-card-icon {
    background: var(--color-green-soft);
}

.quick-card-favorites .quick-card-icon {
    background: var(--color-rose-soft);
}

.quick-card-content strong {
    display: block;
    color: var(--color-brown-dark);
    font-size: 16px;
}

.quick-card-content small {
    margin-top: 5px;
    display: block;
    color: var(--color-text-soft);
    font-size: 12px;
    line-height: 1.4;
}

.quick-card-arrow {
    color: var(--color-brown-soft);
    font-size: 25px;
}

.quick-card:disabled {
    opacity: 0.62;
}

.empty-highlight {
    margin-top: 18px;
    padding: 22px;
    border-radius: var(--radius-medium);
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 15px;
    background:
        linear-gradient(
            135deg,
            rgba(232, 238, 227, 0.92),
            rgba(255, 255, 255, 0.82)
        );
    border: 1px solid rgba(125, 146, 112, 0.18);
}

.empty-highlight-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 27px;
    background: rgba(255, 255, 255, 0.72);
}

.empty-highlight h2 {
    font-size: 20px;
}

.empty-highlight p {
    margin-top: 9px;
    color: var(--color-text-soft);
    font-size: 13px;
    line-height: 1.55;
}

.page-heading {
    min-height: 74px;
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 14px;
}

.page-heading h1 {
    margin-top: 4px;
    color: var(--color-brown-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 31px;
}

.back-button {
    width: 48px;
    height: 48px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--color-brown);
    background: rgba(255, 255, 255, 0.78);
    font-size: 21px;
    box-shadow: 0 7px 18px rgba(79, 48, 31, 0.07);
}

.placeholder-card {
    min-height: 410px;
    padding: 36px 24px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: var(--radius-large);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.92),
            rgba(255, 248, 238, 0.88)
        );
    box-shadow: var(--shadow-card);
    text-align: center;
}

.placeholder-icon {
    width: 86px;
    height: 86px;
    margin-bottom: 22px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    font-size: 42px;
    background: var(--color-green-soft);
    box-shadow: inset 0 0 0 1px rgba(125, 146, 112, 0.14);
}

.placeholder-card p {
    max-width: 370px;
    margin-top: 14px;
    color: var(--color-text-soft);
    font-size: 14px;
    line-height: 1.65;
}

.version-badge {
    margin-top: 22px;
    padding: 9px 14px;
    border-radius: 999px;
    color: var(--color-terracotta-dark);
    background: var(--color-rose-soft);
    font-size: 12px;
    font-weight: 800;
}

.secondary-button {
    margin-top: 24px;
    padding: 14px 20px;
    border: 0;
    border-radius: 16px;
    color: var(--color-white);
    background: var(--color-brown);
    font-weight: 750;
    box-shadow: 0 9px 22px rgba(79, 48, 31, 0.2);
}

.bottom-navigation {
    width: calc(100% - 24px);
    max-width: 536px;
    min-height: calc(76px + var(--safe-bottom));
    padding:
        8px
        12px
        calc(8px + var(--safe-bottom));
    position: fixed;
    left: 50%;
    bottom: 10px;
    z-index: 30;
    transform: translateX(-50%);
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: 26px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 18px 45px rgba(79, 48, 31, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.navigation-button {
    min-height: 56px;
    border: 0;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--color-text-soft);
    background: transparent;
}

.navigation-button span {
    font-size: 21px;
    line-height: 1;
}

.navigation-button small {
    font-size: 11px;
    font-weight: 700;
}

.navigation-button.is-active {
    color: var(--color-brown);
    background: var(--color-cream-dark);
}

.navigation-button-main {
    width: 72px;
    min-height: 64px;
    margin: -18px auto 0;
    color: var(--color-white);
    background:
        linear-gradient(
            135deg,
            var(--color-terracotta),
            var(--color-brown)
        );
    box-shadow: 0 10px 25px rgba(153, 88, 58, 0.27);
}

.navigation-button-main span {
    font-size: 30px;
    font-weight: 300;
}

.navigation-button-main.is-active {
    color: var(--color-white);
    background:
        linear-gradient(
            135deg,
            var(--color-terracotta-dark),
            var(--color-brown-dark)
        );
}

@media (min-width: 700px) {
    body {
        padding: 24px 0;
    }

    .app-shell {
        min-height: calc(100vh - 48px);
        min-height: calc(100dvh - 48px);
        border-radius: 34px;
        overflow: hidden;
        box-shadow: 0 24px 70px rgba(79, 48, 31, 0.18);
    }

    .bottom-navigation {
        bottom: 34px;
    }
}

@media (max-width: 380px) {
    .app-main {
        padding-right: 14px;
        padding-left: 14px;
    }

    .hero-card {
        min-height: 445px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .hero-logo {
        height: 125px;
    }

    .hero-card h1 {
        font-size: 30px;
    }
}