/* ===================================
   Shopping Memo App - Figma Design v3
   Card stack + smooth FLIP + no dashes
   ================================== */

:root {
    --theme-meat: #E8B4AE;
    --theme-vegetable: #B8CEAB;
    --theme-seafood: #A9C4D3;
    --theme-seasoning: #C8C3BE;
    --theme-other: #DECEB8;

    --bg-card: #F5F3EF;
    --text-dark: #3A3A3A;
    --text-gray: #BDBDBD;
    --text-checked: #C8C8C8;
    --green-check: #6BBF6B;
    --blue-tag: #B8DDE8;
    --blue-tag-hover: #98CDE0;
    --blue-fab: #8DD0DC;
    --purple-dash: #A08CDC;
    --btn-gray: #E4E2DE;
    --btn-gray-hover: #D4D2CE;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);

    --theme-bg: #E8B4AE;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic Pro', sans-serif;
    background: var(--theme-bg);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease;
}

body.walkthrough-active #app {
    filter: blur(8px) saturate(0.92);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 430px;
    margin: 0 auto;
    position: relative;
    transition: filter 0.3s;
}

body.locked #app {
    filter: blur(5px);
}

/* ===================================
   New Login Screen (Premium Design)
   =================================== */

.screen-container {
    background: #FFFFFF;
    /* ブランドオレンジ */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px) scale(0.98);
    transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.screen-container.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.screen-content {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    position: relative;
    z-index: 2;
    min-height: 100%;
}

.login-content {
    justify-content: center;
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
}

.brand-header {
    text-align: center;
}

.logo-image {
    display: block;
    margin: 0 auto;
}

.logotype-main {
    width: 160px;
    height: auto;
}

.catch-copy {
    color: #F59223;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    margin: 16px 0 24px 0;
    display: flex;
    justify-content: center;
}

.catch-copy span {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 2;
}

.auth-btn {
    width: 100%;
    height: 48px;
    border-radius: 999px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.auth-btn:active {
    transform: scale(0.97);
}

.auth-btn.apple {
    background: #000;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(92, 74, 61, 0.05);
}

.auth-btn.line {
    background: #06C755;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(92, 74, 61, 0.05);
}

.auth-btn.google {
    background: #fff;
    color: #5C4A3D;
    border: 2px solid #EAE3DA;
    box-shadow: 0 4px 12px rgba(92, 74, 61, 0.05);
}

.auth-btn.email {
    background: #F59223;
    color: #FFFFFF;
}

.divider {
    text-align: center;
    margin: 8px 0;
    position: relative;
    height: 20px;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 100%;
    height: 2px;
    background: #F0E9DF;
    border-radius: 2px;
}

.divider span {
    background: #FFFFFF;
    padding: 0 16px;
    color: #F59223;
    font-size: 14px;
    font-weight: 700;
    position: relative;
    top: -2px;
}

.terms-text {
    text-align: center;
    font-size: 12px;
    color: #F59223;
    margin-top: 32px;
    line-height: 1.6;
    font-weight: 500;
}

.terms-link {
    color: #F59223;
    text-decoration: underline;
    transition: color 0.2s;
}

.terms-link:active {
    color: #d4790f;
}

.auth-input {
    font-size: 16px;
    padding: 14px;
    border-radius: 12px;
    border: 1.5px solid #D0D0D0;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    color: #333;
}

/* ==============================
   Intro Walkthrough
   ============================== */
.walkthrough-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--safe-top) + 18px) 18px calc(var(--safe-bottom) + 18px);
    background: #F59223;
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 1200;
}

.walkthrough-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.walkthrough-shell {
    width: min(100%, 430px);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.walkthrough-topbar {
    display: flex;
    justify-content: flex-end;
}

.walkthrough-skip {
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.walkthrough-card {
    background: #FFF9F0;
    border-radius: 32px;
    padding: 30px 24px 26px;
    box-shadow: 0 22px 56px rgba(92, 74, 61, 0.18);
    color: #5C4A3D;
    min-height: min(580px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 118px));
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 118px);
    overflow-y: auto;
}

.walkthrough-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(245, 146, 35, 0.14);
    color: #D87612;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
}

.walkthrough-title {
    font-size: 1.48rem;
    line-height: 1.45;
    font-weight: 800;
    margin-bottom: 18px;
}

.walkthrough-body {
    color: #81695A;
}

.walkthrough-paragraph {
    margin: 0;
    color: #81695A;
    font-size: 0.95rem;
    line-height: 1.9;
    font-weight: 600;
}

.walkthrough-body[hidden],
.walkthrough-visual[hidden] {
    display: none;
}

.walkthrough-body-paragraphs {
    display: grid;
    gap: 12px;
}

.walkthrough-flow {
    display: grid;
    gap: 0;
}

.walkthrough-flow-item {
    display: grid;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(245, 146, 35, 0.34);
}

.walkthrough-flow-item + .walkthrough-flow-item {
    padding-top: 16px;
}

.walkthrough-flow-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.walkthrough-flow-item--center {
    justify-items: center;
}

.walkthrough-flow-item--compact {
    gap: 6px;
}

.walkthrough-flow-copy {
    color: #7E6859;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
}

.walkthrough-flow-demo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.walkthrough-flow-demo--end {
    justify-content: flex-end;
    padding-right: 4px;
}

.walkthrough-flow-demo--center {
    justify-content: center;
}

.walkthrough-visual {
    margin-top: 18px;
    min-height: 170px;
}

.walkthrough-visual--separated {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(245, 146, 35, 0.28);
}

.walkthrough-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.walkthrough-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(92, 74, 61, 0.2);
    transition: width 0.2s ease, background-color 0.2s ease;
}

.walkthrough-dot.active {
    width: 24px;
    background: #F59223;
}

.walkthrough-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#walkthroughBackBtn {
    grid-column: 1;
}

#walkthroughNextBtn,
#walkthroughStartBtn {
    grid-column: 2;
}

.walkthrough-nav {
    width: 100%;
    min-height: 46px;
    border-radius: 18px;
    border: none;
    font-size: 0.94rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
}

.walkthrough-nav:active,
.walkthrough-skip:active {
    transform: scale(0.97);
}

.walkthrough-nav--ghost {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.walkthrough-nav--primary {
    background: #fff;
    color: #D96F08;
    box-shadow: 0 10px 24px rgba(92, 74, 61, 0.14);
}

.walkthrough-nav[hidden],
.walkthrough-skip[hidden] {
    display: none;
}

.walkthrough-visual-board {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 170px;
    padding: 2px 0 0;
}

.walkthrough-visual-board--share {
    gap: 8px;
}

.walkthrough-category-tabs-shell {
    width: min(100%, 274px);
    display: flex;
    align-items: flex-end;
    gap: 0;
    min-width: 0;
    padding: 0 0 8px 8px;
    box-sizing: border-box;
    margin: 0 auto;
}

.walkthrough-category-tabs {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    overflow: visible;
    padding-left: 2px;
}

.walkthrough-category-tab {
    position: relative;
    width: 46px;
    height: 36px;
    padding: 0 9px 4px;
    background: #F2EBE5;
    border-radius: 13px 13px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-right: -8px;
    box-shadow: 2px -2px 8px rgba(92, 74, 61, 0.08);
}

.walkthrough-category-tab.active {
    width: 106px;
    height: 44px;
    padding: 0 13px 5px;
    justify-content: flex-start;
    gap: 7px;
    background: #FFF9F0;
    border-radius: 16px 16px 0 0;
    margin-bottom: -2px;
    z-index: 2;
    box-shadow:
        -12px 9px 16px rgba(92, 74, 61, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.walkthrough-category-tab-label {
    color: #2E2B2A;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}

.walkthrough-category-tab-icon {
    width: 21px;
    height: 21px;
    object-fit: contain;
    opacity: 0.92;
}

.walkthrough-category-tab:not(.active) .walkthrough-category-tab-icon {
    width: 18px;
    height: 18px;
    opacity: 0.78;
}

.walkthrough-category-tab-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FF3B30;
    box-shadow: 0 0 0 2px #F2EBE5;
}

.walkthrough-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.walkthrough-chip-card {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(141, 208, 220, 0.22);
    color: #3A3A3A;
    text-align: center;
    font-size: 0.86rem;
    font-weight: 800;
}

.walkthrough-add-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    justify-content: center;
    text-align: center;
}

.walkthrough-plus-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #8DD0DC;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
}

.walkthrough-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.walkthrough-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #6BBF6B;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
}

.walkthrough-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    flex-wrap: nowrap;
    min-width: 0;
}

.walkthrough-qty-value {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    white-space: nowrap;
}

.walkthrough-qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(92, 74, 61, 0.08);
    color: #7B746C;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.08rem;
    font-weight: 800;
}

.walkthrough-qty-text {
    color: #5C4A3D;
    font-size: 1.1rem;
    font-weight: 800;
}

.walkthrough-product-name {
    color: #5C4A3D;
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
}

.walkthrough-reorder-scene {
    width: 100%;
    border-radius: 22px;
    overflow: hidden;
}

.walkthrough-asset-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 22px;
}

.walkthrough-asset:not(.is-loaded) .walkthrough-asset-image {
    display: none;
}

.walkthrough-asset-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 168px;
    padding: 20px;
    border: 1px dashed rgba(92, 74, 61, 0.18);
    border-radius: 22px;
    color: #9A8576;
    text-align: center;
    font-size: 0.86rem;
    line-height: 1.7;
    background: rgba(255, 255, 255, 0.5);
}

.walkthrough-asset.is-loaded .walkthrough-asset-fallback {
    display: none;
}

.walkthrough-menu-guide {
    color: #7E6859;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.7;
}

.walkthrough-share-arrow {
    color: #F59223;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    margin: -2px 0;
}

.walkthrough-share-preview {
    display: grid;
    gap: 8px;
}

.walkthrough-share-preview__label {
    color: #9E8F81;
    font-size: 0.78rem;
    font-weight: 700;
}

.walkthrough-share-preview__button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: var(--blue-fab);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
}

.walkthrough-share-preview__join {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.walkthrough-share-preview__input {
    flex: 8 1 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #EAE3DA;
    background: #FFF;
    color: #B0A295;
    font-size: 0.9rem;
    font-weight: 600;
}

.walkthrough-share-preview__submit {
    flex: 2 1 0;
    min-width: 0;
    padding: 0 12px;
    border-radius: 12px;
    background: #5C4A3D;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ==============================
   Login Drawer (Bottom Sheet Card)
   ============================== */

/* 半透明の背景オーバーレイ */
.login-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: -1;  /* デフォルトは完全に後ろに隠す（チラつき防止） */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.login-drawer-overlay.active {
    z-index: 998; /* loginOverlay(1000)より下 */
    opacity: 1;
    pointer-events: auto;
}

/* ドロワーカード本体 */
.login-drawer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 430px;
    background: #FFFFFF;
    border-radius: 32px 32px 0 0;
    padding: 12px 52px 40px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(92, 74, 61, 0.15);
    z-index: 999;
    /* 出現: Ease-Out スッと上がる / 消失: Ease-In 重力落下 */
    transition: transform 0.45s cubic-bezier(0.5, 0, 1, 1),
                padding-top 0.45s ease,
                padding-bottom 0.45s ease,
                border-radius 0.45s ease;
}

/* ドロワーが開いている状態（開く時用: Ease-Out スッと上がる） */
.login-drawer-overlay.active .login-drawer {
    transform: translateX(-50%) translateY(0);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 「新規登録してログイン！」押下後: padding-bottomでオレンジ枠だけを上に伸ばす（0.6s） */
.login-drawer-overlay.active .login-drawer.expanding {
    padding-bottom: 120dvh; /* 下のクッションを爆発的に分厚くすることで、中の要素を画面の一番上へ押し出す */
    border-radius: 0;
    
    /* 0.6sかけて中のテキストを歪めずに背景ごと上に移動させる */
    transition: padding-bottom 0.6s cubic-bezier(0.85, 0, 0.15, 1),
                border-radius 0.6s cubic-bezier(0.85, 0, 0.15, 1);
}

/* ドラッグハンドル */
.drawer-handle {
    display: flex;
    justify-content: center;
    padding: 8px 0 20px;
}

.drawer-handle span {
    width: 40px;
    height: 4px;
    background: rgba(245, 146, 35, 0.4);
    border-radius: 2px;
}

/* タイトル */
.drawer-title {
    color: #F59223;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 12px;
    font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic Pro', sans-serif;
}

/* 説明文 */
.drawer-description {
    color: rgba(245, 146, 35, 0.85);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 28px;
}

/* 2カラムの正円ボタンコンテナ */
.drawer-buttons {
    display: flex;
    justify-content: space-between;
}

/* 正円ボタン共通 */
.drawer-circle-btn {
    width: 114px;
    height: 114px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic Pro', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
    /* 離した時のスプリングバウンス */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-appearance: none;
    appearance: none;
    user-select: none;
    -webkit-user-select: none;
}

/* JavaScript で .pressed クラスを付けた時に沈み込む */
.drawer-circle-btn.pressed {
    transform: scale(0.9);
    transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 上記の :active はデスクトップブラウザ用に残す */
.drawer-circle-btn:active {
    transform: scale(0.9);
    transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 左: ログインせずに利用（白背景 + オレンジ文字 + オレンジボーダー） */
.drawer-circle-btn.guest {
    background: #FFFFFF;
    color: #F59223;
    border: 2px solid #F59223;
}

/* 右: 新規登録してログイン！（オレンジ背景 + 白文字） */
.drawer-circle-btn.register {
    background: #F59223;
    color: #FFF;
    border: 2px solid #F59223;
}

/* ドロワーのフェードアウト用コンテンツ（拡張アニメーション時に非表示にする） */
.login-drawer .drawer-content-fade {
    transition: opacity 0.2s ease;
}

.login-drawer.expanding .drawer-content-fade {
    opacity: 0;
    pointer-events: none;
}

/* ==================== PAYWALL SCREEN (PREMIUM) ==================== */
.premium-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #F59223;
    /* var(--bg-color) equivalent from prototype */
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    visibility: hidden;
}

.premium-overlay.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.paywall-bg-blob {
    position: absolute;
    /* 画面幅が大きくなるにつれて円を大きくしつつ、最下部を同じ位置に保つ魔法の計算式 */
    top: calc(-150vw + 380px);
    left: 50%;
    transform: translateX(-50%);
    width: 150vw;
    height: 150vw;
    background: radial-gradient(circle, #FFF2D1 0%, #FFDCA8 100%);
    border-radius: 50%;
    z-index: -1;
}

.paywall-content {
    flex: 1;
    position: relative;
    width: 100%;
    max-width: 430px;
    padding: 24px;
    padding-bottom: Env(safe-area-inset-bottom, 32px);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.close-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: #FFF;
    color: #9E8F81;
    /* var(--text-sub) */
    border: none;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(92, 74, 61, 0.08);
}

.paywall-header {
    margin-top: 60px;
    margin-bottom: 24px;
    text-align: center;
}

.paywall-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 16px;
}

.logotype-sub {
    width: 200px;
    height: auto;
    margin: 0;
}

.badge {
    background: #F59223;
    /* primary */
    color: #FFF;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    position: relative;
    top: 5px;
    font-weight: 800;
}

.paywall-header p {
    font-size: 15px;
    color: #5C4A3D;
    line-height: 1.6;
    font-weight: 700;
    margin-top: 8px;
    margin-bottom: 0px;
}

.feature-list {
    list-style: none;
    background: #FFF;
    padding: 24px;
    border-radius: 32px;
    box-shadow: 0 8px 30px rgba(92, 74, 61, 0.06);
    margin: 0 0 24px 0;
}

.feature-list li {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.feature-list li:last-child {
    margin-bottom: 0;
}

.feature-check-icon {
    width: 34px;
    height: 34px;
    background: #FFF2E0;
    color: #F59223;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.feature-list strong {
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
    color: #5C4A3D;
    font-weight: 800;
}

.highlight-yellow {
    background: linear-gradient(transparent 77%, #FFD54F 77%);
}

.feature-list p {
    font-size: 13px;
    color: #9E8F81;
    line-height: 1.5;
    font-weight: 500;
    margin: 0;
}

.pricing-options {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.plan-card {
    flex: 1;
    background: #FFF;
    border: 3px solid transparent;
    border-radius: 28px;
    padding: 24px 12px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(92, 74, 61, 0.04);
}

.plan-card.selected {
    border-color: #F59223;
    background: #FFFDF8;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(245, 146, 35, 0.15);
}

.best-value {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #FF6B6B;
    color: #FFF;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.best-value::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #FF6B6B;
    border-bottom: 0;
}

.plan-name {
    font-size: 14px;
    font-weight: 700;
    color: #9E8F81;
    margin-bottom: 8px;
}

.plan-card.selected .plan-name {
    color: #5C4A3D;
}

.plan-price {
    font-size: 26px;
    font-weight: 800;
    color: #5C4A3D;
    margin-bottom: 0px;
}

.plan-price .period {
    font-size: 14px;
    font-weight: 700;
    color: #9E8F81;
}

.plan-calc {
    font-size: 12px;
    color: #F59223;
    margin-top: 8px;
    font-weight: 800;
}

.cta-btn {
    width: 100%;
    padding: 20px;
    border-radius: 999px;
    border: 2px solid #FFFFFF;
    background: #F59223;
    color: #FFF;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(245, 146, 35, 0.35);
    transition: 0.2s;
}

.cta-btn:active {
    transform: scale(0.96);
}

.trial-note {
    text-align: center;
    font-size: 12px;
    color: #FFF;
    margin-bottom: 24px;
    margin-top: 0px;
    line-height: 1.6;
    font-weight: 500;
}

.paywall-footer {
    display: flex;
    justify-content: space-evenly;
}

.paywall-footer a {
    color: #FFF;
    font-size: 12px;
    text-decoration: none;
    font-weight: 700;
}


.status-bar-spacer {
    height: var(--safe-top);
    flex-shrink: 0;
}

/* ==============================
   Top Spacer & Settings
   ============================== */
.top-spacer {
    height: 16px;
    flex-shrink: 0;
}

.settings-btn {
    background: transparent;
    border: none;
    color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    margin-bottom: 6px;
    margin-right: -2px;
}

.settings-btn svg {
    width: 20px;
    height: 20px;
}

.settings-btn:hover,
.settings-btn:active {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.7);
}

.auth-modal {
    width: 90%;
    max-width: 360px;
}

/* ==============================
   Card Container
   ============================== */
.card-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 4px;
    padding: 0 16px;
    padding-bottom: 24px;
    overflow: hidden;
    transition: transform 0.25s ease, opacity 0.15s ease;
}

.card-container.switching {
    opacity: 0.85;
    transform: scale(0.985);
}

/* ==============================
   Tabs
   ============================== */
.tabs-container {
    display: flex;
    align-items: flex-end;
    margin-bottom: -5px;
    /* Overlap with main-card to hide border-radius gap */
    padding-left: 0;
}

.tab-btn {
    position: relative;
    height: 40px;
    padding: 0 18px;
    /* Slightly wider */
    padding-bottom: 5px;
    /* Sink into card */
    background: #F2EBE5;
    /* Light gray-ish / off-white matching image somewhat */
    border: none;
    border-radius: 12px 12px 0 0;
    margin-right: -10px;
    /* overlap to the right */
    cursor: pointer;
    box-shadow: 2px -2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-btn.active {
    height: 50px;
    padding: 0 22px;
    /* Wider active tab */
    padding-bottom: 5px;
    background: var(--bg-card);
    z-index: 10 !important;
    margin-bottom: -2px;
    border-radius: 14px 14px 0 0;
    box-shadow: none;
    /* ← 浮いて分離して見える原因だった影を削除 */
    min-width: 125px;
    /* ← 3文字のタブの幅に統一 */
}

.tab-label {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-right: 4px;
    margin-bottom: 4px;
    /* compensate for padding-bottom offset */
}

.tab-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-bottom: 2px;
}

.tab-btn:not(.active) .tab-icon-img {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

/* Red Badge for Unchecked Items */
.tab-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #FF3B30;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #F2EBE5;
    pointer-events: none;
}

/* ==============================
   Main Card (active, frontmost)
   ============================== */
.main-card {
    flex: 1;
    position: relative;
    z-index: 5;
    background: var(--bg-card);
    border-radius: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Removing box shadow to fix the "floating" issue */
}

/* ==============================
   Summary Bar
   ============================== */
.summary-bar {
    display: flex;
    flex-direction: column;
    /* Stack header and progress bar */
    padding: 16px 24px 10px;
    flex-shrink: 0;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.summary-actions {
    display: flex;
    gap: 8px;
}

.btn-summary {
    background: #E87A7D;
    /* Soft Red matching UI themes */
    border: none;
    border-radius: 12px;
    /* rounded buttons */
    color: #fff;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(232, 122, 125, 0.3);
}

.btn-summary:hover {
    background: #D86A6D;
}

.btn-summary:active {
    transform: scale(0.95);
}

.btn-summary-all {
    background: #bbb;
    box-shadow: 0 2px 6px rgba(187, 187, 187, 0.3);
}

.btn-summary-all:hover {
    background: #aaa;
}

.summary-count {
    font-size: 0.82rem;
    color: #aaa;
    white-space: nowrap;
    font-weight: 500;
}

.summary-progress {
    flex: 1;
    height: 4px;
    background: #E8E6E2;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green-check), #9AD89A);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================
   Content Area
   ============================== */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    padding-bottom: calc(90px + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
}

/* ==============================
   Item Row
   ============================== */
.item-row {
    display: flex;
    align-items: center;
    padding: 16px 0;
    position: relative;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 18px;
    transition: background-color 0.2s ease;
    touch-action: manipulation;
}

.item-row,
.item-row *,
.action-sheet,
.action-sheet * {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.item-row+.item-row {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.item-row--pressing {
    background: rgba(92, 74, 61, 0.07);
}

/* Checkbox */
.item-checkbox {
    width: 30px;
    height: 30px;
    border: 2.5px solid var(--text-gray);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s;
    background: transparent;
}

.item-checkbox:hover {
    border-color: var(--green-check);
}

.item-row.checked .item-checkbox {
    border: none;
    background: var(--green-check);
}

.item-checkbox .check-icon {
    display: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.item-row.checked .item-checkbox .check-icon {
    display: block;
}

/* Item Info (Name + Memo) */
.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 14px;
    min-width: 0;
}

.item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    overflow-wrap: break-word;
    /* 長い単語でも折り返すように */
}

.item-memo {
    font-size: 0.75rem;
    color: #C0B7B1;
    /* Thinner, lighter placeholder color */
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.item-row.checked .item-name,
.item-row.checked .item-memo {
    color: var(--text-checked);
    text-decoration: line-through;
}

/* Quantity Controls */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
    /* Push completely to the right */
}

.qty-btn {
    width: 34px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--btn-gray);
    border: none;
    border-radius: 10px;
    color: #777;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    transition: all 0.15s;
    user-select: none;
    font-family: inherit;
}

.qty-btn:hover {
    background: var(--btn-gray-hover);
}

.qty-btn:active {
    transform: scale(0.9);
}

.item-row.checked .qty-btn {
    opacity: 0.3;
}

/* Qty Display */
.qty-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    min-width: 52px;
    text-align: center;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.3s;
    padding: 4px 2px;
    border-radius: 8px;
    user-select: none;
}

.qty-num {
    font-size: 1.25rem;
    font-weight: 800;
}

.qty-unit {
    font-size: 0.95rem;
    /* +20% larger than previous 0.8rem */
    font-weight: 700;
    margin-left: 1px;
    color: #7A7A7A;
}

.qty-display:hover {
    background: rgba(0, 0, 0, 0.04);
}

.item-row.checked .qty-display {
    color: var(--text-checked);
    text-decoration: line-through;
}

/* Qty Edit Input */
.qty-input {
    width: 64px;
    padding: 6px 4px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    background: #fff;
    border: 2px solid var(--blue-fab);
    border-radius: 10px;
    color: var(--text-dark);
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-unit-label {
    font-size: 0.8rem;
    color: #999;
    font-weight: 500;
    margin-left: 2px;
}

/* ==============================
   Quick Add (no border)
   ============================== */
.quick-add-section {
    margin-top: 18px;
    padding: 0 0 8px;
}

.quick-add-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c0b8ae;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.quick-add-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.quick-add-chip {
    padding: 11px 6px;
    background: var(--blue-tag);
    border: none;
    border-radius: 22px;
    color: #3A3A3A;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
    user-select: none;
}

.quick-add-chip:hover {
    background: var(--blue-tag-hover);
    transform: scale(1.03);
}

.quick-add-chip:active {
    transform: scale(0.95);
}

/* ==============================
   FAB
   ============================== */
.fab {
    position: fixed;
    bottom: calc(26px + var(--safe-bottom));
    right: calc(50% - 195px);
    width: 54px;
    height: 54px;
    background: var(--blue-fab);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(141, 208, 220, 0.4);
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.3s ease;
    z-index: 100;
}

.fab.transparent {
    opacity: 0.4;
}

.fab:hover {
    transform: scale(1.08);
}

.fab:active {
    transform: scale(0.95);
}

.fab.spinning {
    transform: rotate(90deg);
}

@media (max-width: 430px) {
    .fab {
        right: 20px;
    }
}

/* ==============================
   Modal
   ============================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center the modal instead of flex-end */
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: #fff;
    border-radius: 26px;
    /* All corners rounded */
    padding: 28px 24px 24px;
    /* Standard padding without safe-bottom */
    width: 92%;
    max-width: 430px;
    margin-bottom: 15vh;
    /* Lift the modal up slightly to avoid keyboard */
    transform: translateY(20px) scale(0.95);
    /* Slide up and scale in slightly */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-modal-card {
    margin-bottom: 0;
    width: min(100%, 380px);
    max-height: min(760px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.settings-modal__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: transparent;
    color: #5C4A3D;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.settings-modal__back-icon {
    font-size: 1.4rem;
    line-height: 1;
    transform: translateY(-1px);
}

.settings-modal__back:hover,
.settings-modal__back:active {
    opacity: 0.7;
}

.settings-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: none;
    border-radius: 999px;
    background: rgba(245, 146, 35, 0.12);
    color: #D87612;
    font-size: 0.8rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
}

.settings-link-btn:active {
    transform: scale(0.97);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    color: #999;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    background: #F7F6F4;
    border: 1px solid #E8E6E2;
    border-radius: 14px;
    color: var(--text-dark);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--blue-fab);
    box-shadow: 0 0 0 3px rgba(141, 208, 220, 0.2);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.btn {
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s;
}

.btn--primary {
    background: var(--blue-fab);
    color: #fff;
}

.btn--primary:hover {
    opacity: 0.85;
}

.btn--cancel {
    background: #F0EEEA;
    color: #888;
}

.btn--danger {
    background: #FFF1F1;
    color: #C95B5B;
    border: 1px solid rgba(201, 91, 91, 0.18);
}

.btn--danger:hover {
    background: #FFE4E4;
}

.btn--danger-solid {
    background: #C95B5B;
    color: #fff;
}

.btn--danger-solid:hover {
    background: #b74a4a;
}

.room-member-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #F5F3EF;
    padding: 12px;
    border-radius: 12px;
}

.room-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.room-member-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-member-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.room-member-name {
    min-width: 0;
    font-size: 15px;
    color: #5C4A3D;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-member-me {
    color: #9E8F81;
    font-size: 12px;
    font-weight: 500;
}

.room-member-role {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.14);
    color: #A37C11;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.room-member-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.room-member-action {
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.room-member-action--kick {
    background: #FFF1F1;
    color: #C95B5B;
}

.room-member-action--kick:hover {
    background: #FFE4E4;
}

.room-danger-zone {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed #EAE3DA;
}

.room-owner-note {
    font-size: 12px;
    line-height: 1.5;
    color: #9E8F81;
    margin-bottom: 10px;
}

.account-delete-modal {
    width: min(100%, 360px);
    margin-bottom: 0;
}

.account-delete-message,
.account-delete-warning {
    font-size: 14px;
    line-height: 1.7;
    color: #5C4A3D;
}

.account-delete-message {
    margin-bottom: 10px;
}

.account-delete-warning {
    color: #9E8F81;
    margin-bottom: 6px;
}

.btn--cancel:hover {
    background: #E6E4E0;
}

.action-sheet-overlay {
    align-items: flex-end;
}

.action-sheet {
    width: min(100%, 430px);
    background: #fff;
    border-radius: 28px 28px 20px 20px;
    padding: 12px 14px calc(14px + var(--safe-bottom));
    box-shadow: 0 24px 60px rgba(60, 42, 30, 0.18);
    transform: translateY(28px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .action-sheet {
    transform: translateY(0);
}

.action-sheet__header {
    padding: 10px 12px 14px;
    text-align: center;
}

.action-sheet__eyebrow {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #B3A69A;
    margin-bottom: 6px;
}

.action-sheet__title {
    font-size: 1rem;
    font-weight: 700;
    color: #5C4A3D;
    line-height: 1.4;
    word-break: break-word;
}

.action-sheet__actions {
    display: grid;
    gap: 10px;
}

.action-sheet__btn {
    width: 100%;
    border: 1px solid #ECE8E2;
    background: #F7F6F4;
    color: #5C4A3D;
    border-radius: 16px;
    padding: 15px 18px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.action-sheet__btn:active {
    transform: scale(0.98);
}

.action-sheet__btn--danger {
    background: #FFF1F1;
    color: #C95B5B;
    border-color: rgba(201, 91, 91, 0.2);
}

.action-sheet__btn--cancel {
    background: #EFEDE8;
    color: #7B746C;
}

/* ==============================
   Toast
   ============================== */
.toast {
    position: fixed;
    bottom: calc(100px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #444;
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 2000;
    font-family: inherit;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==============================
   Empty state
   ============================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #ccc;
    text-align: center;
}

.empty-state__icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state__text {
    font-size: 0.9rem;
}

@media (max-width: 380px) {
    .walkthrough-card {
        padding: 24px 18px 22px;
        border-radius: 28px;
        min-height: min(540px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 104px));
        max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 104px);
    }

    .walkthrough-title {
        font-size: 1.3rem;
        margin-bottom: 18px;
    }

    .walkthrough-skip {
        padding: 7px 11px;
        font-size: 0.78rem;
    }

    .walkthrough-nav {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .walkthrough-body {
        font-size: 0.9rem;
    }

    .walkthrough-visual {
        min-height: 150px;
    }

    .walkthrough-visual-board {
        min-height: 150px;
    }

    .walkthrough-flow {
        gap: 16px;
    }

    .walkthrough-chip-grid {
        gap: 8px;
    }

    .walkthrough-category-tabs-shell {
        width: min(100%, 246px);
        padding: 0 0 7px 6px;
    }

    .walkthrough-category-tab {
        width: 38px;
        height: 31px;
        padding: 0 7px 4px;
        margin-right: -6px;
    }

    .walkthrough-category-tab.active {
        width: 88px;
        height: 38px;
        padding: 0 11px 5px;
        gap: 5px;
        box-shadow:
            -10px 7px 12px rgba(92, 74, 61, 0.17),
            inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }

    .walkthrough-category-tab-label {
        font-size: 0.88rem;
    }

    .walkthrough-category-tab-icon {
        width: 18px;
        height: 18px;
    }

    .walkthrough-category-tab:not(.active) .walkthrough-category-tab-icon {
        width: 15px;
        height: 15px;
    }

    .walkthrough-plus-badge {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .walkthrough-product-row,
    .walkthrough-share-preview__join {
        gap: 6px;
    }

    .walkthrough-product-row {
        gap: 8px;
    }

    .walkthrough-product-name {
        font-size: 0.88rem;
    }

    .walkthrough-qty-value {
        gap: 6px;
    }

    .walkthrough-qty-btn {
        width: 30px;
        height: 30px;
        font-size: 0.98rem;
    }

    .walkthrough-qty-text {
        font-size: 0.98rem;
    }

    .walkthrough-share-preview__input,
    .walkthrough-share-preview__submit {
        font-size: 0.84rem;
    }

}

@keyframes logoAppear {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#loadingLogo {
    animation: logoAppear 0.6s ease-out forwards;
}
