* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    overflow-x: hidden !important;
    width: 100vw;
    max-width: 100vw;
    height: 100%;
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f0f8 100%);
    min-height: 100vh;
    transition: background 0.3s ease;
    overflow-x: hidden !important;
    width: 100vw;
    max-width: 100vw;
    position: relative;
}

/* すべての子要素が画面幅を超えないように */
body > * {
    max-width: 100%;
    overflow-x: hidden;
}

header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 100vw;
    overflow: visible;
    position: relative;
    z-index: 9999;
}

nav {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 10000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c5aa0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-user-container {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.user-info-below-logo {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #666;
    align-items: flex-start;
}

.user-info-below-logo .username-display {
    color: #2c5aa0;
    font-weight: 500;
}

.user-info-below-logo .plan-display {
    color: #666;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.user-info-below-logo .plan-display:hover {
    background: #f0f4f8;
}

.patent-badge {
    font-size: 0.65rem;
    background: #e3f2fd;
    color: #2c5aa0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.hamburger-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.patent-notice {
    font-size: 0.65rem;
    font-weight: 600;
    color: #1565c0;
    background: #b3d9ff;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
    margin-left: -1rem;
}

.hamburger-menu {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #2c5aa0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    transition: all 0.3s;
    position: relative;
    z-index: 10001;
    margin-left: -0.45cm;
}

.hamburger-menu:hover {
    background: #f0f4f8;
}

.hamburger-menu span {
    display: block;
    width: 20px;
    height: 2px;
    background: #2c5aa0;
    transition: all 0.3s;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.dropdown-menu {
    position: absolute;
    top: 50px;
    left: 0;
    background: white;
    border: 2px solid #2c5aa0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
    min-width: 180px;
    overflow: hidden;
    z-index: 10000;
}

.dropdown-menu.active {
    display: flex;
}

.dropdown-menu a {
    padding: 1rem 1.5rem;
    color: #2c5aa0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 1px solid #e3f2fd;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #f0f4f8;
    padding-left: 2rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: #666;
    font-size: 0.9rem;
}

.btn-logout {
    padding: 0.6rem 1rem;
    background: transparent;
    color: #2c5aa0;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-logout:hover {
    color: #1e4278;
    text-decoration: underline;
}

.btn-signup {
    padding: 0.6rem 1.5rem;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-signup:hover {
    background: #234a85;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 3rem auto;
    padding: 0 2rem;
    overflow-x: hidden;
    box-sizing: border-box;
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.page-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.page-note {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 3rem;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.step-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
}

.step-card#step1 {
    padding-bottom: 0.8rem;
}

.step-card#step1 .step-title {
    margin-bottom: 0.5rem;
    margin-top: 0.8rem;
}

.step-card#step3 {
    padding-bottom: 0.8rem;
}

.step-card#step3 .step-title {
    margin-bottom: 0.5rem;
    margin-top: 0.8rem;
}

.step-card.active {
    border: 3px solid #2c5aa0;
}

.step-number {
    position: absolute;
    top: -15px;
    left: 20px;
    background: #2c5aa0;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.step-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: #1a1a1a;
}

.search-box {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.search-box:focus {
    outline: none;
    border-color: #2c5aa0;
}

.works-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
}

.work-item {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
}

.work-item:hover {
    background: #e3f2fd;
}

.work-item.selected {
    background: #2c5aa0;
    color: white;
}

.work-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.work-author {
    font-size: 0.85rem;
    opacity: 0.7;
}

.style-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.style-card {
    padding: 0.8rem;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

.style-card:hover {
    border-color: #2c5aa0;
    background: #f0f4f8;
}

.style-card.selected {
    border-color: #2c5aa0;
    background: #e3f2fd;
}

.style-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.style-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: #1a1a1a;
    display: block;
}

.style-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    display: block;
    margin-top: 0;
}

.preview-area {
    padding: 1.2rem 1.2rem 1rem 1.2rem;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    text-align: left;
    height: auto;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #2c5aa0;
}

.selected-info {
    background: #f0f4f8;
    padding: 0.7rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    text-align: left;
}

.info-item {
    display: flex;
    justify-content: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    color: #1a1a1a;
}

.generate-btn {
    width: 100%;
    padding: 0.8rem;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.generate-btn:hover:not(:disabled) {
    background: #234a85;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 90, 160, 0.3);
}

.generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5aa0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-area {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
    max-width: 100%;
}

.result-area.show {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-content {
    line-height: 2;
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 2rem;
    text-align: left;
    overflow-x: hidden;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* コピー防止：テキスト選択を無効化 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* モバイル：タッチ操作の制御 */
    -webkit-touch-callout: none;
    touch-action: pan-y;
    /* ドラッグ防止 */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

/* リンクスタイル（iPad対応） */
.result-content a {
    color: #2196F3 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(33, 150, 243, 0.3);
    touch-action: manipulation;
    pointer-events: auto !important;
}

.result-content a:hover {
    color: #1976D2 !important;
    text-decoration: underline !important;
}

.result-content a:active {
    color: #0D47A1 !important;
}

.result-content img {
    /* 画像のドラッグとコンテキストメニューを防止 */
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

.result-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #2c5aa0;
    color: white;
}

.btn-primary:hover {
    background: #234a85;
}

.action-btn.btn-secondary {
    background: white !important;
    color: #2c5aa0 !important;
    border: 2px solid #2c5aa0 !important;
}

.action-btn.btn-secondary:hover {
    background: #f0f4f8 !important;
}

.action-btn.btn-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

.action-btn.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
}

.btn-back {
    background: #78909c;
    color: white;
}

.btn-back:hover {
    background: #607d8b;
}

.btn-rating {
    background: white;
    color: #ff9800;
    border: 2px solid #ff9800;
}

.btn-rating:hover {
    background: #fff3e0;
}

.btn-back-to-top {
    background: white;
    color: #4caf50;
    border: 2px solid #4caf50;
}

.btn-back-to-top:hover {
    background: #e8f5e9;
}

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.selected-text-display {
    background: #f0f4f8;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-style: italic;
    color: #666;
}

.note-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.note-textarea:focus {
    outline: none;
    border-color: #2c5aa0;
}

.color-picker {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #1a1a1a;
}

.color-option.yellow {
    background: #ffd966;
}

.color-option.blue {
    background: #64b5f6;
}

.color-option.pink {
    background: #f48fb1;
}

.color-option.green {
    background: #81c784;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn {
    background: #2c5aa0;
    color: white;
}

.save-btn:hover {
    background: #234a85;
}

.cancel-btn {
    background: #e0e0e0;
    color: #666;
}

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

.delete-btn {
    background: #f44336;
    color: white;
}

/* 評価モーダルのスタイル */
.rating-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.rating-modal.show {
    display: flex;
}

.rating-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.rating-work-info {
    background: #f0f4f8;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.rating-work-title {
    font-weight: 600;
    color: #2c5aa0;
    margin: 0;
}

.rating-stars {
    text-align: center;
    margin-bottom: 1.5rem;
}

.rating-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.stars-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.star {
    font-size: 3rem;
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s;
}

.star:hover,
.star.active {
    color: #ff9800;
    transform: scale(1.1);
}

.rating-text {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
}

.rating-comment {
    margin-bottom: 1.5rem;
}

.rating-comment label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.rating-comment textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.rating-comment textarea:focus {
    outline: none;
    border-color: #ff9800;
}

.delete-btn:hover {
    background: #d32f2f;
}

@media (max-width: 968px) {
    .steps-container {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 2rem;
    }

    .modal-actions {
        flex-direction: column;
    }
}

    .result-content {
        font-size: 1rem;
        line-height: 1.8;
    }
}

/* ========================================
   ハイライト機能
   ======================================== */

/* ハイライト表示 */
.highlight {
    background-color: #ffff00 !important;
    position: relative;
    cursor: pointer;
    padding: 2px 0;
    display: inline;
    -webkit-tap-highlight-color: rgba(255, 235, 59, 0.5);
    touch-action: manipulation;
}

.highlight:hover {
    background-color: #ffeb3b !important;
}

.highlight:active {
    background-color: #ffeb3b !important;
}

/* ハイライトメモのポップアップ */
.highlight-memo {
    position: fixed;
    background: white;
    border: 2px solid #ffeb3b;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    width: 90vw; /* 画面幅の90% */
    max-width: 320px;
    font-size: 0.9rem;
    box-sizing: border-box;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    left: 50% !important;
    transform: translateX(-50%);
}

/* 矢印を削除（画面外にはみ出る原因になるため） */
/* .highlight-memo::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #ffeb3b;
} */

.memo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.memo-title {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
}

.memo-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.memo-close:hover {
    background: #f5f5f5;
    color: #333;
}

.memo-text {
    color: #555;
    line-height: 1.6;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.memo-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 150px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    -webkit-appearance: none;
}

.memo-textarea:focus {
    outline: none;
    border-color: #ffeb3b;
}

.memo-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.memo-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.memo-btn-save {
    background: #ffeb3b;
    color: #333;
}

.memo-btn-save:hover {
    background: #fdd835;
}

.memo-btn-delete {
    background: #f44336;
    color: white;
}

.memo-btn-delete:hover {
    background: #d32f2f;
}

.memo-btn-cancel {
    background: #e0e0e0;
    color: #333;
}

.memo-btn-cancel:hover {
    background: #bdbdbd;
}

/* ハイライトツールバー */
.highlight-toolbar {
    position: fixed; /* fixed に変更して viewport 基準に */
    background: white;
    border: 2px solid #ffeb3b;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 2001;
    display: none;
    transform: translateX(-50%); /* 中央揃え */
    -webkit-user-select: none; /* テキスト選択を防ぐ（iPad対応） */
    user-select: none;
    pointer-events: auto; /* タッチイベントを確実に受け取る（iPad対応） */
    will-change: transform; /* パフォーマンス最適化（iPad対応） */
}

.highlight-toolbar.show {
    display: block;
}

.toolbar-btn {
    padding: 12px 24px;
    background: #ffeb3b;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(255, 235, 59, 0.5);
    touch-action: manipulation;
    min-width: 150px; /* 最小幅を拡大（iPad対応） */
    min-height: 44px; /* タッチターゲットの最小サイズ（Appleガイドライン） */
    -webkit-user-select: none; /* テキスト選択を防ぐ（iPad対応） */
    user-select: none;
    position: relative; /* z-indexを有効にする */
    z-index: 1; /* ボタンを前面に */
}

.toolbar-btn:hover {
    background: #fdd835;
    transform: translateY(-1px);
}

.toolbar-btn:active {
    background: #f9a825;
    transform: translateY(0);
}

/* ========================================
   しおり機能（葉っぱ型・横向き）
   ======================================== */

/* しおりコンテナ */
.bookmark-container {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: none;
}

.bookmark-container.show {
    display: block;
}

/* 葉っぱ型しおり（横向き・小サイズ） */
.leaf-bookmark {
    width: 48px;
    height: 30px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.3));
}

.leaf-bookmark:hover {
    transform: scale(1.1);
    filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.4));
}

.leaf-bookmark:active {
    transform: scale(0.95);
}

/* 葉っぱのSVG */
.leaf-bookmark svg {
    width: 100%;
    height: 100%;
}

/* 茎部分 */
.leaf-bookmark .leaf-stem {
    fill: #5d4037;
}

/* しおり設定パネル */
.bookmark-settings {
    position: fixed;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: none;
    min-width: 200px;
}

.bookmark-settings.show {
    display: block;
}

.bookmark-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.bookmark-settings-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.bookmark-settings-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.bookmark-settings-close:hover {
    background: #f5f5f5;
}

/* しおりアクションボタン */
.bookmark-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bookmark-action-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.bookmark-action-btn.save {
    background: #4caf50;
    color: white;
}

.bookmark-action-btn.save:hover {
    background: #388e3c;
}

.bookmark-action-btn.goto {
    background: #2196f3;
    color: white;
}

.bookmark-action-btn.goto:hover {
    background: #1976d2;
}

.bookmark-action-btn.delete {
    background: #f44336;
    color: white;
}

.bookmark-action-btn.delete:hover {
    background: #d32f2f;
}

/* しおり位置インジケーター */
.bookmark-indicator {
    position: absolute;
    left: -30px;
    width: 20px;
    height: 30px;
    opacity: 0.7;
    pointer-events: none;
}

.bookmark-indicator svg {
    width: 100%;
    height: 100%;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .bookmark-container {
        right: 10px;
    }

    .leaf-bookmark {
        width: 40px;
        height: 64px;
    }

    .bookmark-settings {
        right: 60px;
        min-width: 180px;
        padding: 12px;
    }
}

