/* =========================================
   ベーススタイル (共通設定)
   ========================================= */
:root {
    --primary-gradient: linear-gradient(135deg, #00c6ff, #0072ff);
    --bg-gradient: linear-gradient(to bottom right, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-sub: #b0b0b0;
    --card-bg: #1c1c1e;
}

/* 重要: はみ出し防止のための設定 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-gradient);
    color: var(--text-main);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.hidden {
    display: none !important;
}

.app-container {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
}

/* PC用サイドバー */
.desktop-only {
    display: none !important;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: flex !important;
    }

    .app-container {
        flex-direction: row;
        height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        width: 280px;
        min-width: 280px;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(20px);
        border-right: var(--glass-border);
        flex-direction: column;
        padding: 40px 25px;
        z-index: 100;
    }

    .logo-area {
        margin-bottom: 40px;
    }

    .logo-area h2 {
        margin: 0 0 15px 0;
        font-size: 2rem;
        font-weight: 800;
        background: var(--primary-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .lang-toggle-sidebar {
        display: flex;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 20px;
        padding: 2px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        width: fit-content;
    }

    .lang-toggle-sidebar button {
        background: transparent;
        border: none;
        color: #888;
        padding: 6px 16px;
        border-radius: 18px;
        font-weight: bold;
        cursor: pointer;
        font-size: 0.85rem;
        transition: 0.2s;
    }

    .lang-toggle-sidebar button.active {
        background: #00c6ff;
        color: white;
    }

    .profile-mini {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 15px;
        background: var(--glass-bg);
        border: var(--glass-border);
        border-radius: 16px;
        margin-bottom: 30px;
        cursor: pointer;
        transition: 0.3s;
    }

    .profile-mini:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .avatar-circle {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        overflow: hidden;
        background: #333;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        border: 2px solid rgba(255, 255, 255, 0.2);
    }

    .avatar-circle img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .nav-item {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 16px 20px;
        background: transparent;
        color: var(--text-sub);
        border: none;
        border-radius: 12px;
        font-size: 1.1rem;
        cursor: pointer;
        text-align: left;
        font-weight: 600;
    }

    .nav-item.active {
        background: var(--primary-gradient);
        color: white;
        box-shadow: 0 4px 15px rgba(0, 114, 255, 0.4);
    }

    .logout-link {
        margin-top: auto;
        color: #666;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }

    .main-content {
        height: 100vh;
        overflow-y: auto;
    }
}

/* スマホヘッダー & ナビ */
.mobile-header {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    background: rgba(15, 12, 41, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: var(--glass-border);
    z-index: 100;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.header-logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-toggle-header {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-toggle-header button {
    background: transparent;
    border: none;
    color: #888;
    padding: 4px 12px;
    border-radius: 18px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.75rem;
    transition: 0.2s;
}

.lang-toggle-header button.active {
    background: #00c6ff;
    color: white;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #333;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-link {
    color: #888;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.bottom-nav {
    height: 70px;
    background: rgba(15, 12, 41, 0.98);
    backdrop-filter: blur(20px);
    border-top: var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2500;
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.nav-icon {
    background: none;
    border: none;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    flex: 1;
}

.nav-icon.active {
    color: #00c6ff;
}

.nav-icon .material-icons-round {
    font-size: 28px;
}

/* コンテンツ */
.main-content {
    flex: 1;
    width: 100%;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 20px 100px 20px;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 120px 5px 160px 5px;
    }
}

/* モード切り替え */
.mode-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    flex: 1;
    min-width: 100px;
    max-width: 150px;
}

.mode-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(0, 114, 255, 0.4);
}

/* カレンダー */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.calendar-controls h2 {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.icon-btn {
    background: var(--glass-bg);
    border: var(--glass-border);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 20px;
}

.day {
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.day.active {
    border: 2px solid #00c6ff;
    z-index: 5;
}

.day.has-entry::after {
    content: '💮';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 1rem;
    z-index: 15;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

.day span {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
    text-shadow: 0 1px 3px black;
}

.day img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.8;
}

/* エディタ */
.daily-editor {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin: 0 5px;
}

.editor-top {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.date-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.lang-toggle {
    display: flex;
    background: #222;
    border-radius: 20px;
    padding: 2px;
    border: 1px solid #444;
}

.lang-toggle button {
    background: transparent;
    border: none;
    color: #888;
    padding: 6px 16px;
    border-radius: 18px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
}

.lang-toggle button.active {
    background: #00c6ff;
    color: white;
}

.photo-uploader {
    height: 200px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.photo-uploader img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.input-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-row .icon {
    margin-top: 8px;
    font-size: 1.2rem;
}

.submit-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

.sos-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff4757;
    font-weight: bold;
    cursor: pointer;
}

/* ログ入力画面 */
.log-card {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin: 0 5px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.cat-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.cat-btn.selected {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.4);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.input-group label {
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.9rem;
}

.log-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
}

.log-input:focus {
    outline: none;
    border-color: #00c6ff;
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
}

textarea.log-input {
    min-height: 80px;
    resize: vertical;
}

/* 今日のログ表示 */
.today-logs-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin: 0 5px;
}

.log-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.log-item-category {
    font-size: 1.2rem;
    font-weight: bold;
}

.log-item-duration {
    color: #00c6ff;
    font-weight: bold;
}

.log-item-desc {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-top: 5px;
}

.log-item-time {
    color: #666;
    font-size: 0.75rem;
    margin-top: 5px;
}

/* タイムライン */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.timeline-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feed-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 16px;
    overflow: visible;
    backdrop-filter: blur(10px);
    margin: 0 5px;
    position: relative;
}

.card-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #333;
    overflow: hidden;
    margin-right: 10px;
    cursor: pointer;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.follow-icon {
    color: #00c6ff;
    margin-left: 5px;
    cursor: pointer;
    border: 1px solid #00c6ff;
    border-radius: 50%;
    padding: 2px;
    font-size: 1rem;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.audio-btn {
    background: none;
    border: none;
    color: #00c6ff;
    cursor: pointer;
    margin-left: auto;
}

/* 音声ボタン */
.card-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: #000;
}

.card-body {
    padding: 15px;
}

.card-footer {
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 20px;
    align-items: center;
    position: relative;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.action-btn:hover {
    color: #00c6ff;
}

.action-btn.liked {
    color: #ff4757;
}

/* リアクションピッカー */
.reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(20, 20, 25, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    z-index: 100;
    margin-bottom: 8px;
}

.reaction-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

.reaction-btn.active {
    background: rgba(0, 198, 255, 0.3);
    transform: scale(1.1);
}

.reaction-display {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 15px 10px 15px;
}

.reaction-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.reaction-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.reaction-item.my-reaction {
    background: rgba(0, 198, 255, 0.2);
    border: 1px solid rgba(0, 198, 255, 0.5);
}

/* コメントエリア */
.comment-section {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
}

.comment-section.open {
    display: block;
}

.comment-input {
    width: 100%;
    background: #222;
    border: 1px solid #444;
    color: white;
    padding: 8px;
    border-radius: 4px;
    box-sizing: border-box;
}

.comment-list {
    margin-bottom: 10px;
    max-height: 100px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.comment-item {
    margin-bottom: 4px;
}

/* セクション別コメント */
.content-section {
    position: relative;
}

.mini-comment-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.mini-comment-btn:hover {
    background: rgba(0, 198, 255, 0.2);
    color: #00c6ff;
}

.section-comments {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 2px solid rgba(0, 198, 255, 0.5);
}

.mini-comment {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.mini-comment strong {
    color: #00c6ff;
    margin-right: 5px;
}

.mini-comment-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.mini-comment-input:focus {
    outline: none;
    border-color: #00c6ff;
}

/* はなまるアニメーション */
#hanamaru-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hanamaru-svg {
    width: 200px;
    height: 200px;
}

.hanamaru-circle {
    animation: drawCircle 0.8s ease-in-out forwards;
}

.hanamaru-check {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawCheck 0.5s ease-in-out 0.8s forwards;
}

.hanamaru-text {
    margin-top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #ff4757;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out 1.2s forwards;
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: 80px;
}

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

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2001;
}

/* 設定画面 */
.settings-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.avatar-edit {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    margin: 0 auto 20px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-edit img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-avatar-preview {
    font-size: 2rem;
    font-weight: bold;
}

.setting-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-row label {
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.9rem;
}

.setting-row input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
}

.setting-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.setting-toggle span {
    color: white;
    font-weight: 500;
}

.setting-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* フォローリスト */
.list-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #333;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* プロフィールページ */
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.stat-item:hover {
    transform: scale(1.05);
}

.stat-val {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #00c6ff;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 5px;
}

.follow-btn-large {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.follow-btn-large.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
}

.settings-icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 20px;
}

/* ログイン画面用 */
.auth-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: #000;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

.auth-visual {
    flex: 1;
    background: var(--primary-gradient);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-visual::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.visual-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.app-logo-large {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 20px;
    display: block;
    opacity: 0.9;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.visual-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 800;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.visual-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    opacity: 0.95;
}

.auth-form-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: white;
}

.auth-header p {
    color: var(--text-sub);
    font-size: 0.95rem;
    margin: 0;
}

.badge {
    background: #ff4757;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    color: white;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
}

.input-with-icon:focus-within {
    border-color: #00c6ff;
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.input-with-icon .material-icons-round {
    color: #888;
    padding: 0 15px;
    font-size: 1.3rem;
}

.input-with-icon input {
    flex: 1;
    padding: 16px 16px 16px 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    outline: none;
}

.auth-btn {
    width: 100%;
    padding: 16px;
    margin-top: 15px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 5px 20px rgba(0, 114, 255, 0.4);
}

.auth-footer {
    margin-top: 35px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 25px;
}

.sub-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
    text-align: center;
    transition: 0.2s;
    box-sizing: border-box;
}

.avatar-upload {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        position: relative;
    }

    .auth-visual {
        flex: 0 0 auto;
        padding: 50px 25px;
        text-align: center;
    }

    .auth-form-wrapper {
        flex: 1;
        padding: 25px;
    }

    .auth-card {
        padding: 30px 20px;
        box-shadow: none;
        background: transparent;
        border: none;
    }
}

/* =========================================
   複数写真対応スタイル
   ========================================= */
.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.photo-uploader-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--glass-bg);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
}

.photo-uploader-item:hover {
    border-color: #00c6ff;
    background: rgba(0, 198, 255, 0.1);
}

.photo-uploader-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-placeholder-mini {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.4);
}

.upload-placeholder-mini .material-icons-round {
    font-size: 32px;
}

/* =========================================
   3行入力フィールド & コントロールボタン
   ========================================= */
.text-inputs .input-row {
    margin-bottom: 15px;
}

/* 複数の入力欄をまとめるコンテナ */
.multi-line-editor {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* 行間の隙間 */
}

/* 個別の入力ライン */
.line-input {
    width: 100%;
    padding: 10px 12px;
    padding-right: 70px;
    /* 右上のボタンと重ならないように余白確保 */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    transition: 0.3s;
}

.line-input:focus {
    outline: none;
    border-color: #00c6ff;
    background: rgba(0, 198, 255, 0.05);
}

.line-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* コントロールボタン群 (絶対配置) */
.textarea-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.control-btn {
    width: 32px;
    height: 32px;
    background: rgba(0, 198, 255, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0, 198, 255, 0.3);
}

.control-btn:hover {
    background: #00c6ff;
    transform: scale(1.1);
}

.control-btn .material-icons-round {
    font-size: 16px;
}

/* 翻訳結果表示 */
.translation-result {
    margin-top: 10px;
    padding: 12px 15px;
    background: rgba(0, 198, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid #00c6ff;
    animation: slideDown 0.3s ease;
}

.translation-result>div:first-child {
    font-weight: 600;
    color: #00c6ff;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.translation-result>div:last-child {
    color: #fff;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 翻訳音声再生ボタン */
.trans-audio-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.trans-audio-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.trans-audio-btn .material-icons-round {
    font-size: 16px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* =========================================
   カレンダー表示の更新
   ========================================= */
.calendar-grid .day img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.calendar-grid .day.has-entry {
    background: rgba(0, 198, 255, 0.2);
}

@media (max-width: 480px) {
    .photo-grid {
        gap: 8px;
    }
}

/* タイムラインの各セクション用音声ボタン */
.section-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-btn-mini {
    background: none;
    border: none;
    color: inherit;
    /* 親要素(セクションのタイトル色)を引き継ぐ */
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: 0.2s;
}

.audio-btn-mini:hover {
    opacity: 1;
    transform: scale(1.2);
}