:root {
    --app-bg: radial-gradient(circle at top, #fdf7ee 0, #f5efe6 45%, #ebe3d9 100%);
    --app-ink: #111827;
    --app-muted: #475569;
    --app-line: rgba(15, 23, 42, 0.12);
    --app-max: 1240px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--app-bg);
    color: var(--app-ink);
}

.app-shell {
    width: 100%;
    max-width: var(--app-max);
    margin: 0 auto;
    padding: 24px 20px 36px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    position: relative;
    z-index: 60;
}

.site-brand {
    text-decoration: none;
    color: var(--app-ink);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.site-brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.site-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.viewer-wrap {
    position: relative;
    z-index: 30;
}

.viewer-pill {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(15,23,42,0.12);
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}

.viewer-pill-btn {
    appearance: none;
    cursor: pointer;
    font: inherit;
}

.viewer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(15,23,42,0.08);
    display: inline-grid;
    place-items: center;
    flex: 0 0 32px;
}

.viewer-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.viewer-avatar.has-image .viewer-avatar-image {
    display: block;
}

.viewer-avatar-fallback {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.viewer-avatar.has-image .viewer-avatar-fallback {
    display: none;
}

.viewer-menu {
    position: absolute;
    top: 44px;
    right: 0;
    width: max-content;
    min-width: 0;
    max-width: min(92vw, 260px);
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 10px;
    background: #ffffff;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 10px 24px rgba(15,23,42,0.10);
    z-index: 50;
}

.viewer-menu.open {
    display: flex;
}

.viewer-menu a,
.viewer-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: right;
    color: #0f172a;
    text-decoration: none;
    padding: 6px 8px;
    line-height: 1.2;
    white-space: nowrap;
    font: inherit;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
}

.viewer-menu a:active,
.viewer-menu button:active {
    background: rgba(15,23,42,0.04);
}

.viewer-menu a:focus-visible,
.viewer-menu button:focus-visible {
    outline: 2px solid rgba(45,158,103,0.45);
    outline-offset: 1px;
}

.page-heading {
    margin-bottom: 18px;
}

.page-title {
    margin: 0;
    font-size: clamp(1.55rem, 3.2vw, 2.1rem);
    line-height: 1.12;
    font-weight: 700;
    color: #0f172a;
}

.page-subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--app-muted);
}

@media (max-width: 720px) {
    .app-shell {
        padding: 16px 14px 24px;
    }
    .site-header {
        margin-bottom: 14px;
    }
}
