* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { width: 19px; height: 19px; stroke-width: 1.8; }

.app-shell { min-height: 100vh; display: flex; }
.app-main { min-width: 0; width: calc(100% - var(--sidebar)); margin-left: var(--sidebar); }
.page-wrap { width: 100%; max-width: 100%; margin: 0; padding: 22px clamp(16px, 2.5vw, 36px) 24px; display: flex; flex-direction: column; min-height: calc(100vh - 72px); }

@media (min-width: 768px) {
    html, body {
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
    }
    .app-shell {
        min-height: 100vh;
        min-height: 100dvh;
    }
    .app-main {
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .page-wrap {
        flex: 1;
        min-height: calc(100vh - 72px);
        min-height: calc(100dvh - 72px);
        padding: 14px clamp(14px, 2vw, 28px);
        display: flex;
        flex-direction: column;
    }
    .page-wrap > * {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        width: 100%;
    }
    .page-heading {
        margin-bottom: 10px;
        flex-shrink: 0;
    }
    .page-title {
        font-size: clamp(24px, 2.2vw, 32px);
    }
    .page-subtitle {
        margin: 4px 0 0;
        font-size: 13px;
        line-height: 1.4;
    }
    .toolbar {
        margin-bottom: 10px;
        flex-shrink: 0;
    }
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(135deg, #e3815f, var(--brand) 55%, #c05a3f); box-shadow: 0 3px 8px rgba(217,108,79,.4), inset 0 1px 0 rgba(255,255,255,.3); color: #fff; }
.brand-mark svg { width: 19px; height: 19px; stroke-width: 2.1; }
.brand-name { font: 700 19px/1 "DM Sans", sans-serif; letter-spacing: -.5px; }
.brand-name span { color: var(--brand); }

.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 3px; background: #9aaba2; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-actions { display: flex; align-items: center; gap: 9px; }
.page-title { margin: 0; font: 700 clamp(28px, 2.6vw, 38px)/1.15 "DM Sans", sans-serif; letter-spacing: -1.15px; }
.page-subtitle { max-width: 680px; margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.accent-word { position: relative; color: inherit; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: #c5cfca; text-decoration: none; font-size: 12px; }
.back-link:hover { color: white; }

@media (max-width: 991.98px) {
    .app-main { width: 100%; margin-left: 0; }
    .page-wrap { padding: 28px 24px 54px; }
}

@media (max-width: 767.98px) {
    .page-wrap { padding: 22px 16px 46px; }
    .page-heading { align-items: stretch; flex-direction: column; margin-bottom: 22px; }
    .page-heading .btn { width: 100%; }
    .page-actions { flex-direction: column-reverse; align-items: stretch; }
    .page-title { font-size: 31px; letter-spacing: -1.2px; }
    .page-subtitle { font-size: 14px; }
}

@media (max-width: 390px) {
    .page-wrap { padding-inline: 12px; }
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: 100ms cubic-bezier(0.4, 0, 1, 1) both page-fade-out;
}

::view-transition-new(root) {
    animation: 220ms cubic-bezier(0, 0, 0.2, 1) both page-fade-in;
}

@keyframes page-fade-out {
    to {
        opacity: 0;
        transform: translateY(-2px);
    }
}

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
