/* public/custom-styles.css */
:root {
    --onepage-paper: #fffaf1;
    --onepage-paper-soft: #f8efe1;
    --onepage-ink: #17213c;
    --onepage-ink-muted: #5d6475;
    --onepage-blue: #2563eb;
    --onepage-coral: #ff7a6b;
    --onepage-mint: #8ddfd0;
    --onepage-ring: rgba(23, 33, 60, 0.12);
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    background-color: var(--onepage-paper);
    color: var(--onepage-ink);
}

.onepage-app-shell {
    background: var(--onepage-paper);
}

.onepage-paper-surface,
.onepage-paper-frame {
    border: 1px solid rgba(217, 204, 184, 0.78);
    background: linear-gradient(180deg, #fffdf7 0%, var(--onepage-paper) 100%);
    box-shadow:
        0 18px 44px rgba(23, 33, 60, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.onepage-paper-frame {
    border-radius: 1rem;
}

.onepage-date-stamp {
    display: inline-flex;
    align-items: center;
    min-height: 1.4rem;
    border-radius: 9999px;
    color: var(--onepage-coral);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
}

.onepage-motion-lift {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.onepage-motion-lift:hover {
    transform: translateY(-2px);
}

.onepage-glass-header {
    background: rgba(255, 255, 255, 0.78);
    border-bottom: 1px solid rgba(226, 232, 240, 0.82);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.onepage-nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.onepage-gallery-nav-shell {
    display: grid;
    grid-template-areas:
        "logo actions auth"
        "search search search";
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem 0.55rem;
}

.onepage-gallery-nav-shell .onepage-logo {
    grid-area: logo;
}

.onepage-nav-auth-top {
    grid-area: auth;
    justify-self: end;
    min-width: 0;
    position: relative;
}

.onepage-gallery-search {
    grid-area: search;
    width: 100%;
    min-width: 0;
}

.onepage-gallery-nav-shell .onepage-avatar-img {
    width: 2.1rem;
    height: 2.1rem;
}

.onepage-frame-nav-shell {
    display: grid;
    grid-template-areas: "back title auth";
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem 0.6rem;
}

.onepage-frame-back {
    grid-area: back;
}

.onepage-frame-title {
    grid-area: title;
    justify-self: center;
}

.onepage-frame-nav-shell .onepage-avatar-img {
    width: 2.1rem;
    height: 2.1rem;
}

.onepage-digital-frame-body {
    min-height: 100vh;
    background: var(--onepage-paper);
    color: var(--onepage-ink);
}

.onepage-frame-page {
    background: linear-gradient(180deg, #fffaf1 0%, #f4ebdd 100%);
}

.onepage-frame-shell {
    width: min(100%, 72rem);
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

.onepage-frame-console {
    padding: 1rem;
    border-radius: 1rem;
}

.onepage-frame-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    align-items: end;
}

.onepage-frame-hero-copy {
    min-width: 0;
}

.onepage-frame-eyebrow {
    margin: 0 0 0.32rem;
    color: var(--onepage-coral);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.onepage-frame-headline {
    margin: 0;
    color: var(--onepage-ink);
    font-size: clamp(1.45rem, 4vw, 2.15rem);
    font-weight: 900;
    line-height: 1.08;
}

.onepage-frame-limit-control {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    min-width: 0;
    min-height: 2.6rem;
    padding: 0.35rem 0.45rem 0.35rem 0.8rem;
    border: 1px solid rgba(217, 204, 184, 0.86);
    border-radius: 9999px;
    background: rgba(255, 253, 247, 0.88);
    color: var(--onepage-ink-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.onepage-frame-limit-select {
    max-width: min(9rem, 48%);
    min-height: 2rem;
    border: 1px solid rgba(217, 204, 184, 0.82);
    border-radius: 9999px;
    background: #fffdf7;
    color: var(--onepage-ink);
    font-size: 0.82rem;
    font-weight: 850;
    padding: 0 1.9rem 0 0.65rem;
}

.onepage-frame-control-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin-top: 1rem;
}

.onepage-frame-start-button,
.onepage-frame-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    font-weight: 850;
    line-height: 1.1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.onepage-frame-start-button {
    border: 1px solid var(--onepage-blue);
    background: var(--onepage-blue);
    color: #fff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.onepage-frame-start-button:hover:not(:disabled),
.onepage-frame-filter-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.onepage-frame-start-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.onepage-frame-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
    gap: 0.5rem;
    min-width: 0;
}

.onepage-frame-filter-button {
    min-width: 0;
    border: 1px solid rgba(217, 204, 184, 0.86);
    background: #fffdf7;
    color: var(--onepage-ink);
    padding: 0.25rem 0.55rem;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
}

.onepage-frame-filter-active {
    border-color: rgba(141, 223, 208, 0.9);
    background: rgba(141, 223, 208, 0.28);
    color: var(--onepage-ink);
    box-shadow: 0 10px 24px rgba(23, 33, 60, 0.08);
}

.onepage-frame-gallery {
    margin-top: 1rem;
}

.onepage-frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
    gap: 0.85rem;
}

.onepage-frame-status {
    width: min(100%, 24rem);
}

.onepage-frame-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(217, 204, 184, 0.74);
    border-radius: 1rem;
    background: rgba(255, 253, 247, 0.96);
    color: inherit;
    cursor: pointer;
    box-shadow: 0 18px 44px rgba(23, 33, 60, 0.1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.onepage-frame-card:hover {
    border-color: rgba(255, 122, 107, 0.42);
    box-shadow: 0 22px 52px rgba(23, 33, 60, 0.14);
}

.onepage-frame-card-stage {
    position: relative;
    aspect-ratio: 1 / 1;
    margin: 0.75rem 0.75rem 0;
    overflow: hidden;
    border: 1px solid rgba(217, 204, 184, 0.76);
    border-radius: 0.9rem;
    background: #fffaf1;
}

.onepage-frame-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.onepage-frame-card:hover .onepage-frame-card-image {
    opacity: 0.9;
    transform: scale(1.015);
}

.onepage-frame-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0.9rem;
    background: #fffaf1;
    color: var(--onepage-ink-muted);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

.onepage-frame-card-body {
    padding: 0.8rem 0.9rem 0.95rem;
}

.onepage-frame-card-title {
    margin: 0;
    overflow: hidden;
    color: var(--onepage-ink);
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onepage-frame-card-date,
.onepage-frame-card-meta {
    margin: 0.35rem 0 0;
    color: var(--onepage-ink-muted);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
}

.onepage-frame-card-meta {
    color: var(--onepage-blue);
}

.onepage-frame-like-button {
    position: absolute;
    right: 0.65rem;
    bottom: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    min-height: 2rem;
    border: 1px solid rgba(217, 204, 184, 0.82);
    border-radius: 9999px;
    background: rgba(255, 250, 241, 0.92);
    color: var(--onepage-ink);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0 0.62rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.onepage-frame-like-button:hover {
    background: #fff;
    color: #1d4ed8;
    transform: translateY(-1px) scale(1.03);
}

.onepage-frame-like-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.onepage-frame-like-button .heart-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.onepage-frame-like-button .heart-icon.liked {
    fill: #ef4444;
    stroke: #ef4444;
}

.onepage-frame-audio-button {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1400;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(217, 204, 184, 0.5);
    border-radius: 9999px;
    background: rgba(23, 33, 60, 0.94);
    color: #fff;
    box-shadow: 0 18px 44px rgba(23, 33, 60, 0.22);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.onepage-frame-audio-button:hover {
    background: #17213c;
    transform: translateY(-1px) scale(1.04);
}

#digital-frame-container.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1300;
    overflow: hidden;
    background: #171321;
}

#digital-frame-container.fullscreen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 122, 107, 0.12), transparent 34%, rgba(141, 223, 208, 0.1));
    pointer-events: none;
}

#digital-frame-container.fullscreen .frame-image {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 2;
    width: min(82vw, 82vh);
    height: min(82vw, 82vh);
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 5rem);
    object-fit: contain;
    border: clamp(0.35rem, 1vw, 0.75rem) solid var(--onepage-paper);
    border-radius: 1rem;
    background: #fffdf7;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
}

#digital-frame-container.fullscreen .frame-image.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.transition-fade.prepare {
    opacity: 0;
}

.transition-slide-right.prepare {
    opacity: 0;
    transform: translate(-15%, -50%);
}

.transition-slide-left.prepare {
    opacity: 0;
    transform: translate(-85%, -50%);
}

.transition-zoom-in.prepare {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.18);
}

.transition-zoom-out.prepare {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
}

.onepage-frame-overlay {
    position: absolute;
    inset: 1rem;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    pointer-events: none;
}

.onepage-frame-counter {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1400;
    min-height: 2.4rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9999px;
    background: rgba(255, 253, 247, 0.9);
    color: var(--onepage-ink);
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
}

.onepage-frame-close-button {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1400;
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.onepage-frame-close-button.visible {
    display: inline-flex;
}

@media (min-width: 720px) {
    .onepage-frame-shell {
        padding: 1.25rem 1.25rem 2.5rem;
    }

    .onepage-frame-console {
        padding: 1.25rem;
    }

    .onepage-frame-hero {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .onepage-frame-control-panel {
        grid-template-columns: minmax(11rem, 0.45fr) minmax(0, 1fr);
        align-items: center;
    }

    .onepage-frame-filter-bar {
        justify-content: flex-end;
    }

    .onepage-frame-grid {
        grid-template-columns: repeat(auto-fill, minmax(11.75rem, 14rem));
        justify-content: center;
        gap: 1rem;
    }
}

.onepage-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.onepage-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: #2563eb;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
}

.onepage-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}

.onepage-nav-actions::-webkit-scrollbar {
    display: none;
}

.onepage-glass-header .onepage-nav-actions {
    flex-wrap: nowrap;
}

.onepage-nav-actions:has(#userMenuDraw:not(.hidden)) {
    overflow: visible;
}

.onepage-nav-actions.onepage-gallery-actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
    width: auto;
    min-width: 0;
    gap: 0.25rem;
    overflow: visible;
}

.onepage-nav-actions.onepage-gallery-actions .onepage-nav-action {
    width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    min-width: 0;
    border-radius: 9999px;
    padding: 0;
}

.onepage-nav-action,
.onepage-menu-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.75rem;
    border-radius: 0.85rem;
    border: 1px solid transparent;
    padding: 0.45rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.onepage-nav-action {
    flex-direction: column;
    flex: 0 0 auto;
}

.onepage-nav-action:hover {
    transform: translateY(-1px);
}

.onepage-nav-primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.onepage-nav-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.onepage-nav-secondary {
    background: rgba(255, 255, 255, 0.64);
    border-color: rgba(148, 163, 184, 0.38);
    color: #334155;
}

.onepage-nav-secondary:hover,
.onepage-nav-ghost:hover {
    background: rgba(241, 245, 249, 0.9);
    color: #0f172a;
}

.onepage-nav-ghost {
    background: transparent;
    color: #475569;
}

.onepage-icon {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.onepage-icon-stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.onepage-action-label {
    display: block;
    max-width: 5.5rem;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onepage-avatar-img {
    width: 2.25rem;
    height: 2.25rem;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 9999px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    object-fit: cover;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.onepage-avatar-img:hover {
    opacity: 0.86;
    transform: translateY(-1px);
}

.onepage-draw-paper-body {
    background:
        linear-gradient(180deg, #fffaf1 0%, #f4ebdd 100%) !important;
}

.onepage-paper-stage {
    position: relative;
    width: min(100%, 52rem);
    max-width: 52rem;
    margin: 0 auto;
}

.onepage-paper-stage::before {
    content: "";
    position: absolute;
    inset: 1.1rem 1rem auto;
    height: 0.8rem;
    border-radius: 9999px;
    background: rgba(255, 122, 107, 0.18);
    transform: rotate(-0.7deg);
    pointer-events: none;
}

.onepage-paper-stage canvas {
    position: relative;
    border: 1px solid rgba(217, 204, 184, 0.84);
    border-radius: 0.9rem;
    background-color: #fffdf7;
    box-shadow:
        0 26px 72px rgba(23, 33, 60, 0.16),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.message-box.onepage-draw-message {
    min-height: 2.35rem;
    border: 1px solid rgba(141, 223, 208, 0.82);
    border-radius: 9999px;
    background: rgba(255, 253, 247, 0.96);
    color: var(--onepage-ink);
    font-weight: 850;
    box-shadow: 0 16px 36px rgba(23, 33, 60, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.message-box.onepage-draw-message.error {
    border-color: rgba(255, 122, 107, 0.68);
    background: rgba(255, 250, 241, 0.98);
    color: #b91c1c;
}

.message-box.onepage-draw-message.info {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(255, 253, 247, 0.98);
    color: var(--onepage-blue);
}

.onepage-layers-panel {
    border-color: rgba(217, 204, 184, 0.84) !important;
    border-radius: 1rem !important;
    background: linear-gradient(180deg, #fffdf7 0%, var(--onepage-paper) 100%) !important;
    color: var(--onepage-ink);
    box-shadow: 0 24px 64px rgba(23, 33, 60, 0.18) !important;
}

.onepage-layers-title {
    margin: 0 0 0.65rem;
    border-bottom: 1px solid rgba(217, 204, 184, 0.72);
    padding-bottom: 0.55rem;
    color: var(--onepage-ink);
    font-size: 1rem;
    font-weight: 900;
}

.onepage-layer-list {
    display: grid;
    gap: 0.35rem;
}

.gallery-link-button-wrapper.onepage-draw-header {
    display: grid;
    grid-template-areas: "back title utility";
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem 0.45rem;
    min-height: 4.25rem;
    padding: 0.45rem 0.7rem;
}

.onepage-draw-back-action {
    grid-area: back;
}

.onepage-draw-title {
    grid-area: title;
    min-width: 0;
}

.onepage-draw-utility-actions {
    grid-area: utility;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    min-width: 0;
}

.onepage-draw-utility-actions:has(#userMenuDraw:not(.hidden)) {
    overflow: visible;
}

.gallery-link-button-wrapper.onepage-draw-header .onepage-nav-action {
    min-height: 2.35rem;
    border-radius: 0.7rem;
    padding: 0.32rem 0.45rem;
    font-size: 0.66rem;
}

.gallery-link-button-wrapper.onepage-draw-header .onepage-draw-utility-actions .onepage-nav-action {
    min-width: 2.35rem;
    padding-right: 0.35rem;
    padding-left: 0.35rem;
}

.gallery-link-button-wrapper.onepage-draw-header .onepage-icon {
    width: 1rem;
    height: 1rem;
}

.gallery-link-button-wrapper.onepage-draw-header .onepage-action-label {
    max-width: 4.6rem;
    font-size: 0.66rem;
}

.gallery-link-button-wrapper.onepage-draw-header .onepage-avatar-img {
    width: 2.1rem;
    height: 2.1rem;
}

.onepage-menu {
    width: min(18rem, calc(100vw - 2rem));
    padding: 0.45rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.onepage-menu-item {
    justify-content: flex-start;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.65rem 0.75rem;
    background: transparent;
    color: #334155;
    font-size: 0.88rem;
    text-align: left;
}

.onepage-menu-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

button.onepage-menu-item {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.onepage-menu-section {
    margin: 0.35rem 0;
    padding: 0.65rem 0.75rem;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.onepage-menu-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
}

.onepage-menu-select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.7rem;
    background: #fff;
    color: #0f172a;
    font-size: 0.88rem;
    padding: 0.5rem 0.65rem;
}

.onepage-search-form {
    width: min(100%, 18rem);
}

.onepage-gallery-search .relative {
    width: 100%;
}

.onepage-gallery-search-input {
    min-height: 2.4rem;
    border-color: rgba(226, 232, 240, 0.95) !important;
    background: rgba(248, 250, 252, 0.92) !important;
    color: var(--onepage-ink);
    font-size: 0.86rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.onepage-gallery-search-input::placeholder {
    color: #94a3b8;
}

.onepage-gallery-search-button {
    width: 2.4rem;
    justify-content: center;
    padding-right: 0 !important;
    color: #64748b;
}

.onepage-gallery-search-button .onepage-icon {
    width: 1rem;
    height: 1rem;
}

.onepage-gallery-action-rail .onepage-nav-action {
    flex: 0 0 2.5rem;
    box-shadow: none;
}

.onepage-gallery-action-rail .onepage-nav-primary {
    background: var(--onepage-ink);
    border-color: var(--onepage-ink);
}

.onepage-gallery-action-rail .onepage-nav-primary:hover {
    background: #0f172a;
}

.onepage-gallery-action-rail .onepage-nav-secondary,
.onepage-gallery-action-rail .onepage-nav-ghost {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(226, 232, 240, 0.88);
}

.onepage-gallery-action-rail .onepage-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.onepage-gallery-action-rail .onepage-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.onepage-page-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: center;
}

.onepage-home-hero {
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.36);
    box-shadow: 0 24px 70px rgba(23, 33, 60, 0.18);
}

.onepage-home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(23, 33, 60, 0.08), rgba(23, 33, 60, 0.42));
}

.onepage-hero-copy {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 24px rgba(15, 23, 42, 0.32);
}

.onepage-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 28rem;
}

.onepage-hero-primary,
.onepage-hero-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3.25rem;
    width: 100%;
    border-radius: 9999px;
    padding: 0 1.25rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
}

.onepage-hero-primary {
    background: var(--onepage-blue);
    color: #fff;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.28);
}

.onepage-hero-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.72);
    color: #fff;
}

.onepage-hero-page-stack {
    position: relative;
    z-index: 1;
    width: min(17.5rem, calc(100vw - 3rem));
    height: 12rem;
    margin: -0.25rem auto 0;
}

.onepage-hero-page {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 1rem;
    background: var(--onepage-paper);
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.22);
}

.onepage-hero-page-back {
    transform: rotate(-5deg) translate(-0.6rem, 0.4rem);
    background: #f4fffb;
}

.onepage-hero-page-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1.35rem 1.25rem;
    color: var(--onepage-ink);
    text-align: left;
    transform: rotate(2deg);
}

.onepage-hero-tape {
    position: absolute;
    top: -0.55rem;
    left: 50%;
    width: 4.6rem;
    height: 1.15rem;
    border-radius: 0.25rem;
    background: rgba(141, 223, 208, 0.78);
    transform: translateX(-50%) rotate(-2deg);
}

.onepage-hero-date {
    margin: 0;
    color: var(--onepage-coral);
    font-size: 0.75rem;
    font-weight: 900;
    line-height: 1;
}

.onepage-hero-paper-title {
    margin: 0.55rem 0 0.75rem;
    max-width: 11rem;
    color: var(--onepage-ink);
    font-size: 1.18rem;
    font-weight: 900;
    line-height: 1.18;
}

.onepage-hero-line,
.onepage-hero-stroke {
    display: block;
    border-radius: 9999px;
}

.onepage-hero-line {
    width: 100%;
    height: 0.42rem;
    margin-top: 0.45rem;
    background: rgba(23, 33, 60, 0.1);
}

.onepage-hero-line-short {
    width: 68%;
}

.onepage-hero-stroke {
    height: 0.38rem;
    margin-top: 0.7rem;
}

.onepage-hero-stroke-coral {
    width: 62%;
    background: var(--onepage-coral);
}

.onepage-hero-stroke-mint {
    width: 42%;
    background: var(--onepage-mint);
}

.onepage-detail-shell {
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding: 1rem 1rem 2.5rem;
}

.onepage-detail-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.onepage-detail-post-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.onepage-detail-post-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.9rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(241, 245, 249, 0.96);
    background: #fff;
}

.onepage-detail-author {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    color: var(--onepage-ink);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onepage-detail-author:hover {
    color: #1d4ed8;
}

.onepage-detail-date {
    flex: 0 0 auto;
    margin: 0;
    color: var(--onepage-ink-muted);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

.onepage-detail-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
}

.onepage-detail-stage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.onepage-detail-stage img[hidden] {
    display: none;
}

.onepage-detail-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
}

.onepage-detail-image-placeholder[hidden] {
    display: none;
}

.onepage-detail-mode-badge {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    max-width: calc(100% - 4.6rem);
    border: 1px solid rgba(45, 212, 191, 0.42);
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
    background: rgba(240, 253, 250, 0.9);
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.onepage-detail-post-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.55rem 0.75rem 0.25rem;
    background: #fff;
}

.onepage-detail-edit-host {
    display: inline-flex;
    margin-left: auto;
}

.onepage-detail-action,
.onepage-detail-like-button,
.onepage-detail-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    min-height: 1.9rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--onepage-ink);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0;
    padding: 0 0.58rem;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.onepage-detail-action:hover,
.onepage-detail-like-button:hover,
.onepage-detail-edit-button:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.onepage-detail-action svg,
.onepage-detail-like-button svg,
.onepage-detail-edit-button svg {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
}

.onepage-detail-like-button {
    cursor: pointer;
}

.onepage-detail-like-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.onepage-detail-like-button .heart-icon.liked {
    fill: #ef4444;
    stroke: #ef4444;
}

.onepage-detail-caption-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.25rem 0.75rem 0.75rem;
    background: #fff;
}

.onepage-detail-title {
    margin: 0;
    color: var(--onepage-ink);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.onepage-detail-caption {
    margin: 0.32rem 0 0;
    color: var(--onepage-ink-muted);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.42;
    overflow-wrap: anywhere;
}

.onepage-detail-comments-section {
    border-top: 1px solid rgba(241, 245, 249, 0.96);
    padding: 0.75rem;
    background: #fff;
}

.onepage-comments-title {
    margin: 0;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.25;
}

.onepage-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.7rem;
}

.onepage-comment-item {
    min-width: 0;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.6rem;
}

.onepage-comment-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.onepage-comment-item-reply {
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.55rem;
}

.onepage-comment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
}

.onepage-comment-author {
    color: #1d4ed8;
    font-weight: 850;
    text-decoration: none;
}

.onepage-comment-owner-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.25rem;
    border-radius: 9999px;
    background: #0f172a;
    color: #fff;
    padding: 0 0.45rem;
    font-size: 0.66rem;
    font-weight: 800;
}

.onepage-comment-body,
.onepage-comments-empty,
.onepage-comments-error {
    margin: 0.35rem 0 0;
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.42;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.onepage-comments-empty {
    color: #64748b;
}

.onepage-comments-error {
    color: #dc2626;
}

.onepage-comment-reply-button {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    margin-top: 0.5rem;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0 0.58rem;
}

.onepage-comment-reply-button:hover {
    background: #e2e8f0;
}

.onepage-comment-thread-replies {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0.6rem 0 0 0.8rem;
    border-left: 1px solid #e2e8f0;
    padding-left: 0.8rem;
}

.onepage-comment-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.onepage-comment-form-reply {
    margin-top: 0.65rem;
}

.onepage-comment-input {
    min-width: 0;
    flex: 1 1 auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 0.84rem;
    padding: 0.65rem 0.75rem;
}

.onepage-comment-submit {
    flex: 0 0 auto;
    min-width: 4.35rem;
    border: 1px solid #0f172a;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0 0.85rem;
}

.onepage-comment-submit:hover:not(:disabled) {
    background: #1e293b;
}

.onepage-comment-submit:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.onepage-comment-hint {
    margin-top: 0.45rem;
    color: #64748b;
    font-size: 0.74rem;
}

.onepage-shared-create-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.65rem;
    border: 1px solid rgba(141, 223, 208, 0.92);
    border-radius: 8px;
    padding: 0 0.9rem;
    background: rgba(141, 223, 208, 0.18);
    color: var(--onepage-ink);
    font-size: 0.86rem;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(23, 33, 60, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.onepage-shared-create-cta:hover,
.onepage-shared-create-cta:focus-visible {
    border-color: var(--onepage-blue);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

@media (min-width: 768px) {
    .onepage-detail-shell {
        max-width: 40rem;
        padding-top: 1.35rem;
    }
}

.onepage-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    gap: 1rem;
}

.onepage-list-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.onepage-list-card-image-first {
    background: #fff;
}

.onepage-list-card:hover {
    border-color: rgba(148, 163, 184, 0.72);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}

.onepage-list-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.9rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(241, 245, 249, 0.96);
    background: #fff;
}

.onepage-list-meta {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.55rem 0.75rem 0.75rem;
}

.onepage-list-caption {
    background: #fff;
}

.onepage-list-title {
    margin: 0;
    color: var(--onepage-ink);
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.onepage-list-author {
    min-width: 0;
    margin: 0;
    color: var(--onepage-ink);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onepage-list-card-date {
    flex: 0 0 auto;
    margin: 0;
    color: var(--onepage-ink-muted);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

.onepage-list-feed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    min-width: 0;
    min-height: 1.6rem;
    margin: 0 0 0.42rem;
}

.onepage-list-comments {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 1.45rem;
    margin: 0;
    padding: 0.1rem 0.48rem;
    border-radius: 9999px;
    background: #f8fafc;
    color: var(--onepage-ink-muted);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.onepage-list-personal-caption {
    margin: 0.28rem 0 0;
    min-height: 0;
    color: var(--onepage-ink-muted);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.38;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.onepage-list-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-top: 0.72rem;
    min-width: 0;
}

.onepage-list-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.onepage-list-action-primary,
.onepage-list-action-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    border-radius: 9999px;
    padding: 0.2rem 0.72rem;
    font-size: 0.75rem;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.onepage-list-action-primary {
    border: 1px solid var(--onepage-blue);
    background: var(--onepage-blue);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.onepage-list-action-secondary {
    border: 1px solid rgba(217, 204, 184, 0.86);
    background: #fffdf7;
    color: var(--onepage-ink);
}

.onepage-list-visibility-select {
    min-width: 6.8rem;
    padding-right: 1.8rem;
    appearance: auto;
}

.onepage-list-action-primary:hover,
.onepage-list-action-secondary:hover {
    transform: translateY(-1px);
}

.onepage-list-mode-badge {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    max-width: calc(100% - 4.6rem);
    border: 1px solid rgba(226, 232, 240, 0.84);
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
    background: rgba(255, 255, 255, 0.88);
    color: var(--onepage-ink-muted);
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.onepage-list-mode-badge[data-visibility="shared"] {
    border-color: rgba(45, 212, 191, 0.42);
    background: rgba(240, 253, 250, 0.9);
    color: #0f766e;
}

.onepage-list-mode-badge[data-visibility="public"] {
    border-color: rgba(96, 165, 250, 0.46);
    background: rgba(239, 246, 255, 0.92);
    color: #1d4ed8;
}

.onepage-list-mode-badge[data-visibility="private"] {
    border-color: rgba(203, 213, 225, 0.78);
    background: rgba(248, 250, 252, 0.92);
    color: #475569;
}

.onepage-author-hero {
    padding: 1rem;
    border-radius: 1rem;
}

.onepage-author-title {
    margin: 0;
    color: var(--onepage-ink);
    font-size: clamp(1.45rem, 4vw, 2.15rem);
    font-weight: 900;
    line-height: 1.12;
}

.onepage-author-subtitle {
    margin: 0.35rem 0 0;
    color: var(--onepage-ink-muted);
    font-size: 0.86rem;
    font-weight: 750;
}

.onepage-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.onepage-tag-list-inline {
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

.onepage-tag-chip {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    max-width: 7.5rem;
    min-width: 0;
    min-height: 1.35rem;
    padding: 0.06rem 0.46rem;
    border: 1px solid transparent;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.onepage-tag-chip:hover,
.onepage-tag-chip:focus-visible {
    border-color: #93c5fd;
    background: #dbeafe;
}

.onepage-list-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
}

.onepage-list-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.onepage-list-card:hover .onepage-list-image {
    opacity: 0.9;
    transform: scale(1.015);
}

.onepage-list-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0.75rem;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

.onepage-list-placeholder[data-loading="true"] {
    color: #475569;
}

.onepage-list-like-button {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    min-height: 1.9rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--onepage-ink);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0 0.58rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.onepage-list-like-button:hover {
    background: #fff;
    color: #1d4ed8;
    transform: translateY(-1px) scale(1.03);
}

.onepage-list-like-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.onepage-list-like-button .heart-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.onepage-list-like-button .heart-icon.liked {
    fill: #ef4444;
    stroke: #ef4444;
}

.onepage-status-surface {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: min(100%, 26rem);
    min-height: 8.5rem;
    margin: 2rem auto;
    padding: 1.4rem;
    border: 1px solid rgba(217, 204, 184, 0.78);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fffdf7 0%, var(--onepage-paper) 100%);
    color: var(--onepage-ink-muted);
    text-align: center;
    box-shadow: 0 18px 44px rgba(23, 33, 60, 0.08);
}

.onepage-status-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.75rem;
    background: rgba(141, 223, 208, 0.32);
    color: var(--onepage-blue);
    font-weight: 900;
}

.onepage-status-title {
    margin: 0;
    color: var(--onepage-ink-muted);
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.45;
}

.toolbar.onepage-draw-toolbar {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.22rem;
    top: 4.75rem !important;
    margin-bottom: 0.75rem !important;
    padding: 0.25rem !important;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.onepage-tool-save-slot {
    display: contents;
}

.onepage-tool-main-group {
    order: 1;
    flex: 1 1 calc(100% - 4.9rem);
}

.onepage-tool-group {
    display: grid;
    grid-template-columns: minmax(2.5rem, auto) repeat(auto-fit, minmax(2.35rem, 1fr));
    align-items: stretch;
    gap: 0.22rem;
    flex: 1 1 13rem;
    min-width: min(100%, 13rem);
    padding: 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    background: #f8fafc;
}

.onepage-tool-group-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    max-width: 5rem;
    padding: 0 0.25rem;
    border-right: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar.onepage-draw-toolbar .onepage-tool-button,
.toolbar.onepage-draw-toolbar .onepage-tool-control {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    min-width: 0;
    min-height: 3rem;
    height: auto;
    border: 1px solid #cbd5e1;
    border-radius: 0.6rem;
    background: #fff;
    color: #334155;
    padding: 0.25rem 0.2rem;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.toolbar.onepage-draw-toolbar .onepage-tool-button {
    cursor: pointer;
}

.toolbar.onepage-draw-toolbar .onepage-tool-button[hidden] {
    display: none;
}

.toolbar.onepage-draw-toolbar .onepage-tool-save-icon-only-mobile .onepage-tool-label {
    display: none;
}

.toolbar.onepage-draw-toolbar .onepage-tool-button:hover:not(:disabled),
.toolbar.onepage-draw-toolbar .onepage-tool-control:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.toolbar.onepage-draw-toolbar .onepage-tool-button.active {
    border-color: #cbd5e1;
    background: #fff;
    color: #334155;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.toolbar.onepage-draw-toolbar .onepage-tool-button-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.toolbar.onepage-draw-toolbar .onepage-tool-button-primary:hover:not(:disabled) {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #fff;
}

.toolbar.onepage-draw-toolbar .onepage-tool-button-danger {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.2);
}

.toolbar.onepage-draw-toolbar .onepage-tool-button-danger:hover:not(:disabled) {
    border-color: #b91c1c;
    background: #b91c1c;
    color: #fff;
}

.toolbar.onepage-draw-toolbar .onepage-tool-button-secondary {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.toolbar.onepage-draw-toolbar .onepage-tool-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    box-shadow: none;
}

.toolbar.onepage-draw-toolbar svg {
    width: 1rem;
    height: 1rem;
    flex: none;
}

.toolbar.onepage-draw-toolbar #layerBadge {
    top: 0.2rem;
    right: 0.2rem;
    width: 0.9rem;
    height: 0.9rem;
    margin: 0;
    font-size: 0.58rem;
    line-height: 0.9rem;
}

.onepage-tool-label,
.onepage-tool-value {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0;
}

.onepage-tool-label {
    font-size: 0.6rem;
}

.onepage-tool-value {
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.62rem;
}

.onepage-tool-color-width {
    position: relative;
    overflow: hidden;
}

.onepage-tool-color-input {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.onepage-tool-color-width .clr-field {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.toolbar.onepage-draw-toolbar .toolbar-color-control .clr-field,
.toolbar.onepage-draw-toolbar .toolbar-color-control #lineColor {
    width: 1.1rem;
    height: 1.1rem;
    min-height: 1.1rem;
    border-radius: 9999px;
}

.onepage-tool-width #penSize {
    flex: none;
    order: 1;
}

.onepage-tool-width-preview {
    display: block;
    width: 1.55rem;
    height: 0;
    border-top-style: solid;
    border-top-color: currentColor;
    border-radius: 9999px;
}

.onepage-tool-width .onepage-tool-value {
    order: 2;
}

.onepage-tool-width .onepage-tool-label {
    order: 3;
}

.onepage-pen-settings-panel {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.75rem);
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: min(calc(100vw - 2rem), 18rem);
    padding: 0.8rem;
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
    transform: translateX(-50%);
}

.onepage-pen-settings-row {
    display: grid;
    grid-template-columns: 4.3rem minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
}

.onepage-pen-settings-label {
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.toolbar.onepage-draw-toolbar .onepage-line-color-swatch {
    justify-self: start;
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    min-height: 2rem;
    border: 2px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0;
    box-shadow: inset 0 0 0 2px #fff;
    cursor: pointer;
}

.onepage-line-width-slider {
    width: 100%;
    accent-color: #2563eb;
    cursor: pointer;
}

@media (max-width: 639px) {
    .onepage-nav-actions {
        justify-content: flex-start;
    }

    .gallery-link-button-wrapper.onepage-draw-header .onepage-page-title {
        font-size: 0.95rem;
    }
}

@media (min-width: 640px) {
    .onepage-nav-shell {
        gap: 1rem;
    }

    .onepage-gallery-nav-shell {
        display: flex;
        flex-wrap: nowrap;
    }

    .onepage-frame-nav-shell {
        display: flex;
        flex-wrap: nowrap;
    }

    .onepage-frame-back {
        order: 1;
    }

    .onepage-frame-title {
        order: 2;
        flex: 1 1 auto;
        justify-self: auto;
        text-align: center;
    }

    .onepage-gallery-search {
        order: 2;
        flex: 0 1 18rem;
        min-width: 12rem;
        width: min(100%, 18rem);
    }

    .onepage-nav-actions.onepage-gallery-actions {
        order: 3;
        display: flex;
        flex: 0 1 auto;
        width: auto;
        justify-content: flex-end;
        overflow: visible;
    }

    .onepage-nav-actions.onepage-gallery-actions .onepage-nav-action {
        width: auto;
        height: 2.5rem;
        min-height: 2.5rem;
        min-width: 0;
        border-radius: 9999px;
        padding-right: 0.72rem;
        padding-left: 0.72rem;
    }

    .onepage-nav-auth-top {
        order: 4;
    }

    .onepage-nav-actions {
        gap: 0.65rem;
    }

    .onepage-nav-action {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.6rem 0.95rem;
        font-size: 0.88rem;
    }

    .onepage-action-label {
        max-width: 10rem;
        text-align: left;
    }

    .onepage-gallery-action-rail .onepage-action-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: hidden;
        clip: auto;
        max-width: 7rem;
        font-size: 0.78rem;
        text-align: left;
    }

    .gallery-link-button-wrapper.onepage-draw-header {
        display: flex;
        gap: 0.75rem;
        min-height: 4.25rem;
        padding: 0.5rem 1rem;
    }

    .onepage-draw-back-action {
        order: 1;
    }

    .onepage-draw-title {
        order: 2;
        flex: 1 1 auto;
    }

    .onepage-draw-utility-actions {
        order: 3;
        gap: 0.65rem;
    }

    .gallery-link-button-wrapper.onepage-draw-header .onepage-nav-action {
        min-height: 2.75rem;
        padding: 0.6rem 0.95rem;
        font-size: 0.88rem;
    }

    .gallery-link-button-wrapper.onepage-draw-header .onepage-draw-utility-actions .onepage-nav-action {
        min-width: 0;
        padding-right: 0.95rem;
        padding-left: 0.95rem;
    }

    .gallery-link-button-wrapper.onepage-draw-header .onepage-icon {
        width: 1.2rem;
        height: 1.2rem;
    }

    .gallery-link-button-wrapper.onepage-draw-header .onepage-action-label {
        max-width: 10rem;
        font-size: inherit;
    }

    .gallery-link-button-wrapper.onepage-draw-header .onepage-avatar-img {
        width: 2.25rem;
        height: 2.25rem;
    }

    .onepage-hero-actions {
        flex-direction: row;
        justify-content: center;
        max-width: none;
        width: auto;
    }

    .onepage-hero-primary,
    .onepage-hero-secondary {
        width: auto;
        min-width: 12rem;
        min-height: 3.5rem;
        padding: 0 1.5rem;
        font-size: 1rem;
    }

        .toolbar.onepage-draw-toolbar {
            justify-content: center;
            gap: 0.5rem;
            top: 4.25rem !important;
            margin-bottom: 1rem !important;
            padding: 0.45rem !important;
        }

        .onepage-tool-group {
            display: flex;
        align-items: center;
        flex: 0 1 auto;
        min-width: 0;
        padding: 0.35rem 0.45rem;
    }

    .onepage-tool-group-label {
        grid-column: auto;
        min-height: auto;
        max-width: none;
        margin-right: 0.15rem;
        padding: 0;
        border-right: 0;
        white-space: nowrap;
    }

    .toolbar.onepage-draw-toolbar .onepage-tool-button,
    .toolbar.onepage-draw-toolbar .onepage-tool-control {
        flex-direction: row;
        gap: 0.4rem;
        width: auto;
        min-height: 2.5rem;
        padding: 0.45rem 0.6rem;
        text-align: left;
    }

    .toolbar.onepage-draw-toolbar svg {
        width: 1.15rem;
        height: 1.15rem;
    }

    .onepage-tool-label {
        max-width: 6rem;
        font-size: 0.74rem;
    }

    .toolbar.onepage-draw-toolbar .onepage-tool-save-icon-only-mobile .onepage-tool-label {
        display: inline;
    }

    .onepage-tool-width .onepage-tool-label,
    .onepage-tool-width #penSize,
    .onepage-tool-width .onepage-tool-value {
        order: initial;
    }
}

.toolbar.onepage-draw-toolbar.onepage-floating-tools {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: var(--onepage-floating-tools-bottom, 1.25rem);
    top: auto !important;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: calc(100vw - 2rem);
    margin: 0 !important;
    padding: 0.45rem !important;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: translateX(-50%);
}

.toolbar.onepage-floating-tools.onepage-floating-tools-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.onepage-floating-tools .onepage-tool-main-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    position: relative;
}

.onepage-floating-tools .onepage-tool-group-label,
.onepage-floating-tools .onepage-tool-value {
    display: none;
}

.onepage-floating-tools .onepage-tool-label {
    display: block;
    max-width: 2.7rem;
    color: currentColor;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.toolbar.onepage-floating-tools .onepage-tool-button,
.toolbar.onepage-floating-tools .onepage-tool-control {
    flex-direction: column;
    gap: 0.22rem;
    width: 3.05rem;
    min-width: 3.05rem;
    height: 3.25rem;
    min-height: 3.25rem;
    padding: 0.3rem 0.18rem;
    border: 0;
    border-radius: 0.9rem;
    background: transparent;
    color: #334155;
    box-shadow: none;
}

.toolbar.onepage-floating-tools .onepage-tool-button-primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
}

.toolbar.onepage-floating-tools .onepage-tool-button.active {
    background: #fff;
    color: #334155;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.34), 0 8px 18px rgba(15, 23, 42, 0.08);
}

.toolbar.onepage-floating-tools .onepage-tool-button-danger {
    background: #dc2626;
    color: #fff;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.24);
}

.toolbar.onepage-floating-tools .onepage-tool-control {
    gap: 0.25rem;
}

.toolbar.onepage-floating-tools .onepage-tool-save-icon-only-mobile .onepage-tool-label {
    display: block;
}

.toolbar.onepage-floating-tools svg {
    width: 1.2rem;
    height: 1.2rem;
}

.toolbar.onepage-floating-tools #layerBadge {
    top: 0.12rem;
    right: 0.12rem;
}

@media (min-width: 1024px) {
    .toolbar.onepage-draw-toolbar.onepage-floating-tools {
        left: max(1.25rem, calc((100vw - 60rem) / 2 - 5.25rem));
        right: auto;
        top: 50% !important;
        bottom: auto;
        max-width: none;
        transform: translateY(-50%);
    }

    .onepage-floating-tools .onepage-tool-main-group {
        flex-direction: column;
    }

    .onepage-floating-tools .onepage-pen-settings-panel {
        left: calc(100% + 0.75rem);
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
    }
}

.onepage-more-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0.8rem 1rem;
}

.onepage-more-menu-overlay.hidden {
    display: none;
}

.onepage-more-menu-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.onepage-more-menu-panel {
    position: relative;
    width: min(100%, 26rem);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.onepage-more-menu-handle {
    display: block;
    width: 2.5rem;
    height: 0.2rem;
    margin: 0.7rem auto 0.5rem;
    border-radius: 9999px;
    background: #cbd5e1;
}

.onepage-more-menu-list {
    display: flex;
    flex-direction: column;
}

.onepage-more-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
    width: 100%;
    min-height: 3.35rem;
    padding: 0 1rem;
    border: 0;
    border-top: 1px solid #e2e8f0;
    border-radius: 0;
    background: transparent;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
}

.onepage-more-menu-item svg {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
}

.onepage-more-menu-item .onepage-tool-label {
    display: inline;
    max-width: none;
    font-size: 0.9rem;
}

.onepage-more-menu-danger {
    color: #dc2626;
}

.onepage-save-modal-layer {
    z-index: 1200;
}

.onepage-save-card {
    border: 1px solid rgba(217, 204, 184, 0.82);
    background: linear-gradient(180deg, #fffdf7 0%, var(--onepage-paper) 100%) !important;
    box-shadow: 0 28px 80px rgba(23, 33, 60, 0.24);
}

.onepage-draft-restore-layer {
    z-index: 1200;
}

.onepage-draft-restore-card {
    border-radius: 1.1rem;
}

.onepage-draft-restore-summary {
    margin: 0.85rem 0 0;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(217, 204, 184, 0.76);
    border-radius: 0.85rem;
    background: rgba(255, 253, 247, 0.82);
    color: var(--onepage-ink-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.onepage-draft-status {
    position: fixed;
    top: 4.85rem;
    right: 0.8rem;
    z-index: 1000;
    max-width: min(16rem, calc(100vw - 1.6rem));
    padding: 0.36rem 0.62rem;
    border: 1px solid rgba(217, 204, 184, 0.78);
    border-radius: 9999px;
    background: rgba(255, 253, 247, 0.92);
    color: var(--onepage-ink-muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    box-shadow: 0 10px 24px rgba(23, 33, 60, 0.1);
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.onepage-draft-status[data-status="saved"] {
    border-color: rgba(141, 223, 208, 0.84);
    color: #0f766e;
}

.onepage-draft-status[data-status="error"] {
    border-color: rgba(220, 38, 38, 0.32);
    color: #b91c1c;
}

.onepage-draft-status[data-status="idle"] {
    display: none;
}

@media (max-width: 639px) {
    .onepage-draft-status {
        top: 4.65rem;
        right: 0.65rem;
        margin: 0;
    }
}

.onepage-draw-paper-body.onepage-drawing-active .onepage-draft-status {
    opacity: 0;
}

.onepage-starter-prompts {
    width: min(100% - 1.5rem, 800px);
    margin: 0.18rem auto 0.45rem;
    padding: 0.5rem 0.6rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    border: 1px solid rgba(217, 204, 184, 0.82);
    border-radius: 0.75rem;
    background: rgba(255, 253, 247, 0.78);
    box-shadow: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.onepage-starter-prompts[hidden] {
    display: none;
}

.onepage-starter-prompts-collapsed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.onepage-starter-prompts-title {
    margin: 0;
    color: var(--onepage-ink);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.25;
    white-space: nowrap;
}

.onepage-starter-prompt-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    min-width: 0;
}

.onepage-starter-prompt-chip {
    min-height: 1.85rem;
    border: 1px solid rgba(141, 223, 208, 0.9);
    border-radius: 9999px;
    padding: 0 0.6rem;
    background: rgba(141, 223, 208, 0.18);
    color: var(--onepage-ink);
    font-size: 0.72rem;
    font-weight: 800;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.onepage-starter-prompt-chip:hover,
.onepage-starter-prompt-chip:focus-visible {
    border-color: var(--onepage-blue);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

@media (max-width: 639px) {
    .onepage-starter-prompts {
        display: block;
        overflow: hidden;
    }

    .onepage-starter-prompts-title {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .onepage-starter-prompt-list {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .onepage-starter-prompt-list::-webkit-scrollbar {
        display: none;
    }

    .onepage-starter-prompt-chip {
        flex: 0 0 auto;
    }

    .onepage-starter-prompt-chip:nth-of-type(n + 2) {
        display: none;
    }
}

.onepage-save-title {
    color: var(--onepage-ink);
}

.onepage-save-intro {
    margin: -0.45rem 0 1rem;
    color: var(--onepage-ink-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.onepage-save-field {
    display: block;
}

.onepage-save-label {
    color: var(--onepage-ink);
    font-weight: 800;
}

.onepage-visibility-grid {
    grid-template-columns: 1fr;
}

.onepage-visibility-option {
    align-items: flex-start;
    min-height: 4.1rem;
    border-color: rgba(217, 204, 184, 0.86);
    border-radius: 0.85rem;
    background: rgba(255, 253, 247, 0.84);
    color: var(--onepage-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.onepage-visibility-option:hover {
    transform: translateY(-1px);
}

.onepage-visibility-option:has(input:checked) {
    border-color: var(--onepage-blue);
    background: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
}

.onepage-visibility-public:has(input:checked) {
    border-color: var(--onepage-blue);
}

.onepage-visibility-shared:has(input:checked) {
    border-color: var(--onepage-mint);
}

.onepage-visibility-private:has(input:checked) {
    border-color: var(--onepage-coral);
}

.onepage-visibility-radio {
    margin-top: 0.15rem;
    flex: 0 0 auto;
}

.onepage-visibility-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.18rem;
    line-height: 1.2;
}

.onepage-visibility-copy strong {
    color: var(--onepage-ink);
    font-size: 0.86rem;
}

.onepage-visibility-copy small {
    color: var(--onepage-ink-muted);
    font-size: 0.7rem;
    line-height: 1.25;
}

@media (min-width: 520px) {
    .onepage-visibility-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.onepage-save-complete-layer {
    z-index: 1200;
}

.onepage-save-complete-card {
    border: 1px solid rgba(217, 204, 184, 0.84);
    border-radius: 1.1rem;
    background: linear-gradient(180deg, #fffdf7 0%, var(--onepage-paper) 100%);
    box-shadow: 0 28px 80px rgba(23, 33, 60, 0.24);
}

.onepage-save-complete-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.onepage-save-complete-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    flex: 0 0 auto;
    border-radius: 0.85rem;
    background: rgba(141, 223, 208, 0.32);
    color: var(--onepage-blue);
    font-weight: 900;
}

.onepage-save-complete-status {
    margin: 0 0 0.22rem;
    color: var(--onepage-coral);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

.onepage-save-complete-title {
    margin: 0;
    color: var(--onepage-ink);
    font-size: 1.18rem;
    font-weight: 900;
    line-height: 1.2;
}

.onepage-save-complete-preview-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    margin: 1rem 0 0.85rem;
    overflow: hidden;
    border: 1px solid rgba(217, 204, 184, 0.78);
    border-radius: 0.95rem;
    background: #fffdf7;
}

.onepage-save-complete-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fffdf7;
}

.onepage-save-complete-message {
    margin: 0;
    color: var(--onepage-ink-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.onepage-save-complete-actions {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.onepage-save-complete-action {
    min-height: 2.65rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 850;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.onepage-save-complete-action:hover:not(:disabled) {
    transform: translateY(-1px);
}

.onepage-save-complete-primary {
    border: 1px solid var(--onepage-blue);
    background: var(--onepage-blue);
    color: #fff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.onepage-save-complete-secondary,
.onepage-save-complete-quiet {
    border: 1px solid rgba(217, 204, 184, 0.86);
    background: #fffdf7;
    color: var(--onepage-ink);
}

.onepage-save-complete-quiet {
    background: transparent;
}

.onepage-save-complete-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.onepage-guide-onboarding {
    max-width: min(58rem, calc(100vw - 1.5rem));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
}

.onepage-guide-header {
    padding: 1.35rem 3.25rem 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.onepage-guide-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    margin-bottom: 0.55rem;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.18rem 0.62rem;
}

.onepage-guide-title {
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 850;
    line-height: 1.2;
    margin: 0;
}

.onepage-guide-description {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0.55rem 0 0;
}

.onepage-guide-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
}

.onepage-guide-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
    min-height: 8.25rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #f8fafc;
}

.onepage-guide-card-primary {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.onepage-guide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 0.9rem;
    background: #fff;
    color: #2563eb;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.onepage-guide-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.onepage-guide-icon-ink {
    color: #0f172a;
}

.onepage-guide-icon-save {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.onepage-guide-icon-gesture {
    color: #475569;
}

.onepage-guide-width-mark {
    display: block;
    width: 1.35rem;
    height: 0;
    border-top: 0.42rem solid currentColor;
    border-radius: 9999px;
}

.onepage-guide-card-body {
    min-width: 0;
}

.onepage-guide-step {
    display: block;
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1;
    margin-bottom: 0.38rem;
    text-transform: uppercase;
}

.onepage-guide-card-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.25;
    margin: 0;
}

.onepage-guide-card-desc,
.onepage-guide-hint {
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0.45rem 0 0;
}

.onepage-guide-hint {
    color: #1d4ed8;
    font-weight: 750;
}

.onepage-guide-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid transparent;
    border-radius: 9999px;
    background: transparent;
    color: #64748b;
}

.onepage-guide-close:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

.onepage-guide-close svg {
    width: 1.15rem;
    height: 1.15rem;
}

@media (min-width: 768px) {
    .onepage-guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem;
        padding: 1.1rem;
    }

    .onepage-guide-card-wide {
        grid-column: span 2;
    }
}

/* Input element focus rings (example from Tailwind UI) */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
    --tw-ring-offset-width: 0px;
    --tw-ring-offset-color: #fff;
    --tw-ring-color: #2563eb; /* Tailwind blue-500 */
    --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
    border-color: #2563eb; /* Tailwind blue-500 */
}


/* Custom styles for range input (slider) - Tailwind UI inspired */
input[type="range"].custom-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #d1d5db; /* gray-300 */
    border-radius: 9999px;
    outline: none;
    padding: 0; /* Ensure no extra padding */
}

input[type="range"].custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3b82f6; /* blue-500 */
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06); /* shadow-sm */
    margin-top: -7px; /* Vertically center thumb on track */
}

input[type="range"].custom-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3b82f6; /* blue-500 */
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

input[type="range"].custom-range::-ms-thumb {
    width: 20px;
    height: 20px;
    background: #3b82f6; /* blue-500 */
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

/* Custom styles for color input - make it a simple clickable swatch */
input[type="color"].custom-color-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    cursor: pointer;
    background-color: transparent; /* Remove default background */
    overflow: hidden; /* Needed for older Edge */
}
input[type="color"].custom-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"].custom-color-input::-webkit-color-swatch {
    border: none; /* Remove default border on swatch */
    border-radius: 0.25rem; /* rounded-sm, slightly smaller than parent */
}
input[type="color"].custom-color-input::-moz-color-swatch { /* Firefox */
    border: none;
    border-radius: 0.25rem;
}


/* Alert / Message Box (Tailwind UI Inspired) */
.alert-message-box {
    position: fixed;
    top: 1.5rem; /* 24px */
    right: 1.5rem; /* 24px */
    z-index: 5000; /* High z-index */
    width: auto;
    max-width: 320px; /* sm:max-w-sm */
    padding: 1rem; /* p-4 */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); /* shadow-xl */
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    display: flex;
    align-items: flex-start;
}
.alert-message-box.show {
    opacity: 1;
    transform: translateX(0);
}

.alert-icon {
    flex-shrink: 0;
    width: 1.25rem; /* w-5 */
    height: 1.25rem; /* h-5 */
    margin-right: 0.75rem; /* mr-3 */
}

.alert-content {
    flex-grow: 1;
}
.alert-title {
    font-weight: 500; /* font-medium */
    margin-bottom: 0.25rem; /* mb-1 */
}
.alert-description {
    font-size: 0.875rem; /* text-sm */
}

/* Success Alert */
.alert-message-box.success {
    background-color: #ECFDF5; /* green-50 */
    color: #065F46; /* green-800 */
}
.alert-message-box.success .alert-icon {
    color: #10B981; /* green-500 */
}
.alert-message-box.success .alert-title {
    color: #047857; /* green-700 */
}

/* Error Alert */
.alert-message-box.error {
    background-color: #FFF1F2; /* red-50 / rose-50 */
    color: #991B1B; /* red-800 / rose-800 */
}
.alert-message-box.error .alert-icon {
    color: #F43F5E; /* red-500 / rose-500 */
}
.alert-message-box.error .alert-title {
    color: #B91C1C; /* red-700 / rose-700 */
}

/* Info Alert */
.alert-message-box.info {
    background-color: #EFF6FF; /* blue-50 */
    color: #1E40AF; /* blue-800 */
}
.alert-message-box.info .alert-icon {
    color: #3B82F6; /* blue-500 */
}
.alert-message-box.info .alert-title {
    color: #1D4ED8; /* blue-700 */
}

/* Canvas focus outline */
.canvas-container:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb; /* Example ring, similar to Tailwind focus rings */
}

/* public/custom-styles.css 또는 draw.html의 <style> 태그에 추가 */

/* 툴바 그룹 버튼 (펜/지우개, 실행취소/복구) */
.toolbar-group-button {
    @apply px-2.5 py-2 text-sm font-medium text-slate-700 bg-white hover:bg-slate-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500;
    /* 기본적으로 border-slate-200을 갖도록 하거나, 부모 div에 border를 줄 수 있습니다. */
    border: 1px solid #e5e7eb; /* slate-200 */
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out, color .15s ease-in-out;
}
.toolbar-group-button:not(:last-child) {
    border-right-width: 0; /* 그룹 내 중간 버튼들은 오른쪽 테두리 제거 */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.toolbar-group-button:first-child {
    @apply rounded-l-md;
}
.toolbar-group-button:last-child {
    @apply rounded-r-md;
     border-right-width: 1px;
}
.toolbar-group-button.active {
    @apply bg-blue-500 text-white border-blue-500 hover:bg-blue-600 z-10;
}
.toolbar-group-button:disabled {
    @apply opacity-50 cursor-not-allowed hover:bg-white;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .onepage-motion-lift:hover,
    .onepage-list-card:hover,
    .onepage-list-like-button:hover,
    .onepage-visibility-option:hover,
    .onepage-save-complete-action:hover:not(:disabled) {
        transform: none;
    }
}

/* 일반 아이콘 버튼 (예: 클리어) */
.toolbar-icon-button {
    @apply p-2.5 rounded-lg text-slate-500 hover:text-slate-700 hover:bg-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1;
}
.toolbar-icon-button.active { /* 펜/지우개와 다른 활성 스타일이 필요하다면 */
    @apply bg-blue-100 text-blue-600 hover:bg-blue-200;
}
.toolbar-icon-button:disabled {
    @apply opacity-50 cursor-not-allowed hover:bg-transparent hover:text-slate-500;
}

/* 주요 액션 버튼 (저장, 삭제, ID로드) */
.action-button {
    @apply inline-flex items-center justify-center px-3 py-2 border border-transparent text-sm font-medium rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2; /* 기본 패딩, 둥글기 증가 */
}
.action-button.save { @apply text-white bg-green-500 hover:bg-green-600 focus:ring-green-400; }
.action-button.delete { @apply text-white bg-red-500 hover:bg-red-600 focus:ring-red-400; }
.action-button.load-id { @apply text-white bg-sky-500 hover:bg-sky-600 focus:ring-sky-400; }

/* 로컬 액션 버튼 (주석 처리된 버튼용 스타일 예시) */
.local-action-button {
     @apply inline-flex items-center justify-center px-3 py-2 border border-slate-300 text-sm font-medium rounded-lg text-slate-700 bg-white hover:bg-slate-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500;
}

/* 입력 요소 wrapper 스타일 개선 */
.toolbar .input-wrapper { /* 예: 색상선택기, 선굵기 div에 이 클래스 추가 */
    @apply p-0.5 border border-slate-200 rounded-lg hover:border-slate-400 transition-colors flex items-center;
}

.toolbar .input-wrapper #lineWidthValue {
    @apply text-xs sm:text-sm ml-1.5 sm:ml-2 w-7 text-right text-slate-600;
}
