/**
 * PropoAI - Application CSS
 * メインカラー: #2563eb
 * フォント: Noto Sans JP
 */

/* ========== リセット・ベース ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

input, select, textarea {
    min-width: 0;
    max-width: 100%;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: #1e293b;
    background: #f8fafc;
    min-height: 100vh;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== ボタン ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.btn-outline {
    background: #fff;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-full {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
}

/* ========== フォーム要素 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group .required {
    color: #dc2626;
    font-size: 12px;
}

.form-group .optional {
    color: #94a3b8;
    font-size: 12px;
}

/* ========== ヘッダー ========== */
.app-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    height: 60px;
    flex-wrap: wrap;
    gap: 8px;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.header-logo:hover {
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ヘッダードロップダウン */
.header-dropdown {
    position: relative;
}

.header-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-caret {
    width: 8px;
    height: 5px;
    flex-shrink: 0;
    margin-left: 2px;
}

.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 200;
    padding: 4px;
}

.header-dropdown.is-open .header-dropdown-menu {
    display: block;
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
}

.header-dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #64748b;
}

.btn-ghost {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    text-decoration: none;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: #334155;
}

.header-plan {
    padding: 3px 10px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.header-count {
    font-size: 13px;
    color: #64748b;
}

.header-email {
    font-size: 13px;
    color: #64748b;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== メインコンテンツ ========== */
.main-content {
    padding: 32px 10%;
}

/* ========== 認証ページ ========== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}

.auth-page-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(37,99,235,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99,102,241,0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(37,99,235,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.auth-container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    padding: 44px;
    width: 100%;
    max-width: 440px;
    margin: 20px;
    position: relative;
    z-index: 1;
}

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

.auth-logo-icon {
    margin-bottom: 12px;
}

.auth-logo {
    font-size: 32px;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.auth-tagline {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

.auth-pilot-badge {
    display: inline-block;
    padding: 4px 14px;
    background: linear-gradient(135deg, #fefce8, #fef3c7);
    color: #b45309;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid #fde68a;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: none;
    border: none;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.auth-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.auth-tab:hover {
    color: #1e293b;
}

.auth-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.auth-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ========== ダッシュボード ========== */
.dashboard-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.stat-card-wide {
    flex: 1;
    min-width: 200px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2563eb;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.stat-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.stat-tag {
    font-size: 11px;
    background: #eff6ff;
    color: #2563eb;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.filter-search:focus {
    border-color: #2563eb;
    outline: none;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    min-width: 160px;
    background: #fff;
}

.filter-select:focus {
    border-color: #2563eb;
    outline: none;
}

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

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.empty-state h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.empty-state p {
    margin-bottom: 28px;
    font-size: 15px;
}

.onboarding-steps {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    max-width: 200px;
}

.onboarding-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.onboarding-step strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 2px;
}

.onboarding-step p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* 提案書カード */
.proposals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.proposal-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}

.proposal-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.proposal-card-link {
    display: block;
    padding: 20px 20px 12px;
    text-decoration: none;
    color: inherit;
}

.proposal-card-link:hover {
    text-decoration: none;
}

.proposal-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.proposal-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.proposal-industry {
    padding: 2px 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.proposal-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #94a3b8;
}

.proposal-purpose {
    padding: 1px 6px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 4px;
    font-size: 11px;
}

.proposal-card-footer {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
}

.proposal-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 20px;
    border-top: 1px solid #f1f5f9;
}

.card-action-dropdown .header-dropdown-menu {
    left: auto;
    right: 0;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.dropdown-danger {
    color: #ef4444;
}

.dropdown-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ========== 生成フォーム ========== */
.form-container {
    position: relative;
}

.form-container h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.form-description {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 28px;
}

.template-select-area {
    margin-bottom: 20px;
}

.template-select-area label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.template-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    background: #f8fafc;
    transition: border-color 0.2s;
}

.template-select:focus {
    border-color: #2563eb;
    outline: none;
}

.generate-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px;
}

/* アラート */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ローディング */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.loading-sub {
    font-size: 14px;
    color: #94a3b8;
}

/* ========== エディタ ========== */
.editor-content {
    padding-left: 10%;
    padding-right: 10%;
}

.editor-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
}

.editor-section {
    position: relative;
    margin-bottom: 24px;
    padding-bottom: 24px;
    padding-top: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.editor-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.editor-title-section {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 28px;
}

.editor-title-input {
    width: 100%;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 0;
    font-family: 'Noto Sans JP', sans-serif;
    background: transparent;
    transition: border-color 0.2s;
}

.editor-title-input:focus {
    outline: none;
    border-bottom-color: #2563eb;
}

.section-heading-input {
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    color: #2563eb;
    border: none;
    border-left: 3px solid #2563eb;
    padding: 4px 0 4px 12px;
    font-family: 'Noto Sans JP', sans-serif;
    background: transparent;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.section-heading-input:focus {
    outline: none;
    background: #f8fafc;
}

.section-content-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #334155;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.section-content-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 保存トースト */
.save-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: toastIn 0.3s ease forwards;
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ボタンローディングスピナー */
.btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    right: 8px;
    top: 50%;
    margin-top: -7px;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ローディングオーバーレイ改善 */
.loading-overlay {
    text-align: center;
    padding: 40px 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* ========== ローディングステップ ========== */
.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px auto;
    max-width: 280px;
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #94a3b8;
    transition: color 0.3s;
}

.loading-step.is-active {
    color: #2563eb;
    font-weight: 500;
}

.loading-step.is-done {
    color: #22c55e;
}

.loading-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    flex-shrink: 0;
    transition: background 0.3s;
}

.loading-step.is-active .loading-step-dot {
    background: #2563eb;
    animation: stepPulse 1s ease infinite;
}

.loading-step.is-done .loading-step-dot {
    background: #22c55e;
}

@keyframes stepPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

.loading-sub {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 12px;
}

/* ========== エディタ タブ切り替え ========== */
.editor-tabs {
    display: flex;
    margin-left: 24px;
    gap: 0;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
}

.editor-tab {
    padding: 6px 18px;
    border: none;
    background: transparent;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.editor-tab:hover {
    color: #334155;
}

.editor-tab.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ========== エディタ メタ情報 ========== */
.editor-meta-section {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.editor-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.editor-meta-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}

.editor-meta-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.editor-meta-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== プレビューモード ========== */
.preview-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

/* 表紙プレビュー */
/* ========== 表紙共通 ========== */
.preview-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 560px;
    text-align: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.cover-logo-area {
    margin-bottom: 24px;
}

.preview-cover-logo {
    max-width: 160px;
    max-height: 56px;
}

.cover-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.cover-title {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}

.cover-client {
    font-size: 19px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 24px;
}

.cover-client .honorific {
    font-size: 15px;
    color: #64748b;
    margin-left: 8px;
}

.cover-meta-line {
    display: flex;
    gap: 24px;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
    margin-top: 16px;
}

/* Simple スタイル */
.preview-cover-simple {
    background: #fff;
}

.cover-top-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
}

.cover-side-accent {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
}

.cover-bottom-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.cover-title-deco {
    margin-bottom: 24px;
}

/* Corporate スタイル */
.preview-cover-corporate {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.cover-deco-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
}

.cover-footer-band {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 14px 48px;
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

/* Modern スタイル */
.preview-cover-modern {
    color: #fff;
}

.preview-cover-modern .cover-title {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.cover-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
                       radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none;
}

.cover-accent-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
}

/* 本文プレビュー */
.preview-body {
    padding: 48px 56px;
    font-family: 'Noto Sans JP', 'Yu Gothic', sans-serif;
}

.preview-section {
    margin-bottom: 40px;
    page-break-inside: avoid;
}

.preview-section:last-child {
    margin-bottom: 0;
}

.preview-section-heading {
    font-size: 18px;
    font-weight: 700;
    padding: 12px 20px;
    margin-bottom: 20px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    border-radius: 8px;
    position: relative;
}

.preview-section-content {
    font-size: 14px;
    line-height: 2.0;
    color: #1e293b;
    white-space: pre-wrap;
    padding-left: 20px;
    margin-bottom: 18px;
    letter-spacing: 0.01em;
}

.preview-section-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.preview-section-content li {
    margin-bottom: 4px;
}

.preview-section-content strong {
    color: #0f172a;
}

.preview-section-content p {
    margin: 0 0 6px;
}

/* ========== プレビュー: ハイライトカード ========== */
.preview-highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0 20px;
    margin-top: 12px;
}

.preview-highlight-card {
    border: none;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-top: 3px solid;
}

.preview-highlight-icon {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-highlight-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.preview-highlight-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

/* ========== プレビュー: 機能カード ========== */
.preview-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px;
    margin-top: 12px;
}

.preview-feature-card {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.preview-feature-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.preview-feature-number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.preview-feature-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.preview-feature-desc {
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
    padding-left: 40px;
}

/* ========== プレビュー: メトリクステーブル ========== */
.preview-metrics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    padding: 0 20px;
    margin-top: 12px;
}

.preview-metric-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
}

.metric-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.metric-before, .metric-after {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.metric-small-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

.metric-before .metric-num {
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
}

.metric-after .metric-num {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.metric-arrow {
    flex-shrink: 0;
}

.metric-change {
    display: inline-block;
    padding: 4px 14px;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 15px;
    font-weight: 700;
    border-radius: 20px;
}

/* ========== プレビュー: スケジュール ========== */
.preview-schedule-chart {
    padding: 0 20px;
    margin-top: 12px;
}

.preview-schedule-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 10px;
}

.preview-schedule-row:last-child {
    margin-bottom: 0;
}

.preview-schedule-phase {
    width: 90px;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    display: flex;
    align-items: center;
}

.preview-schedule-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
}

.preview-schedule-bar {
    border-radius: 6px;
    padding: 10px 16px;
    color: #fff;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.preview-schedule-period {
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.preview-schedule-tasks {
    opacity: 0.95;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== プレビュー: ガントチャート ========== */
.preview-gantt {
    margin-top: 12px;
    padding: 0 20px;
}

.preview-gantt-header {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.preview-gantt-label-col {
    width: 130px;
    flex-shrink: 0;
    font-size: 12px;
    color: #334155;
    padding-right: 12px;
}

.preview-gantt-timeline {
    flex: 1;
    display: flex;
    position: relative;
    min-height: 28px;
}

.preview-gantt-month {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    border-left: 1px solid #f1f5f9;
}

.preview-gantt-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    min-height: 36px;
}

.preview-gantt-row .preview-gantt-timeline {
    background: #f8fafc;
    border-radius: 4px;
    overflow: hidden;
}

.preview-gantt-bar {
    position: absolute;
    top: 4px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    letter-spacing: 0.02em;
}

.preview-gantt-milestones {
    display: flex;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.preview-gantt-milestone {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
}

.preview-gantt-milestone-diamond {
    color: #6366f1;
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(99,102,241,0.4));
}

.preview-gantt-milestone-label {
    font-size: 10px;
    color: #6366f1;
    white-space: nowrap;
    margin-top: 2px;
}

/* ========== マイルストーンエディタ ========== */
.milestones-container {
    margin-bottom: 6px;
}

.milestone-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.milestone-row input[type="number"] {
    padding: 4px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
}

.milestone-row input[type="text"] {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
}

.milestone-remove-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
}

.milestone-remove-btn:hover {
    color: #ef4444;
}

.milestone-add-btn {
    font-size: 11px;
    padding: 4px 8px;
    border: 1px dashed #cbd5e1;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
}

.milestone-add-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

/* ========== プレビュー: 費用テーブル ========== */
.preview-pricing-table {
    width: calc(100% - 40px);
    border-collapse: collapse;
    margin: 12px 20px 0;
    font-size: 13px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.preview-pricing-table th {
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-pricing-table th:last-child {
    text-align: right;
}

.preview-pricing-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.preview-pricing-table tr:nth-child(even) td {
    background: #f8fafc;
}

.preview-price-cell {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.preview-total-row {
    background: #f0f9ff !important;
    font-weight: 700;
}

.preview-total-row td {
    border-top: 2px solid;
    border-bottom: none;
    font-size: 15px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.preview-total-row .preview-price-cell {
    font-size: 16px;
}

/* ========== プレビュー: フッター ========== */
.preview-footer {
    margin-top: 48px;
    padding: 16px 56px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.preview-footer .confidential {
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.preview-footer .page-info {
    font-variant-numeric: tabular-nums;
}

.preview-footer .powered-by {
    font-size: 9px;
    color: #94a3b8;
}

/* ========== 最終保存時刻 ========== */
.last-saved-time {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ========== 構造化データ編集UI ========== */
.section-extra-editor {
    margin-top: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.section-extra-editor-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

.extra-item-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

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

.extra-item-input {
    flex: 1;
    min-width: 80px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.extra-item-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.extra-item-label {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-bottom: 2px;
}

.extra-item-cell {
    flex: 1;
    min-width: 80px;
}

.extra-item-cell-wide {
    flex: 1.5;
    min-width: 120px;
}

.extra-row-remove-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 4px;
}

.extra-row-remove-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

.extra-row-add-btn {
    margin-top: 8px;
    padding: 4px 12px;
    font-size: 12px;
    border: 1px dashed #cbd5e1;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
}

.extra-row-add-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

/* ========== テーマ設定パネル ========== */
.theme-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: none;
}

.theme-panel-overlay.is-open {
    display: block;
}

.theme-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 201;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 24px;
}

.theme-panel.is-open {
    right: 0;
}

.theme-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.theme-panel-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.theme-panel-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.theme-panel-close:hover {
    background: #e2e8f0;
}

.theme-section {
    margin-bottom: 24px;
}

.theme-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
    display: block;
}

/* カラープリセット */
.color-preset-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.color-preset-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    padding: 0;
}

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

.color-preset-btn.is-active {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0f172a;
}

.color-custom-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-custom-row input[type="color"] {
    width: 36px;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-custom-row .color-hex-label {
    font-size: 13px;
    color: #64748b;
    font-family: monospace;
}

.color-custom-hint {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

/* フォントサイズラジオ */
.font-size-options {
    display: flex;
    gap: 8px;
}

.font-size-option {
    flex: 1;
}

.font-size-option input[type="radio"] {
    display: none;
}

.font-size-option label {
    display: block;
    text-align: center;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.font-size-option input[type="radio"]:checked + label {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

/* ロゴアップロード */
.logo-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.logo-upload-area:hover {
    border-color: #2563eb;
    background: #f8fafc;
}

.logo-upload-area.has-logo {
    border-style: solid;
    border-color: #e2e8f0;
}

.logo-upload-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}

.logo-preview-img {
    max-width: 160px;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
}

.logo-remove-btn {
    font-size: 12px;
    color: #dc2626;
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 6px;
}

.logo-remove-btn:hover {
    text-decoration: underline;
}

.logo-upload-input {
    display: none;
}

/* 会社名 */
.theme-text-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-text-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 表紙スタイル選択 */
.cover-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.cover-style-option {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cover-style-option:hover {
    border-color: #94a3b8;
}

.cover-style-option.is-active {
    border-color: #2563eb;
    background: #eff6ff;
}

.cover-style-option input[type="radio"] {
    display: none;
}

.cover-style-thumb {
    width: 100%;
    height: 64px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cover-style-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

/* テーマ設定ボタン（ヘッダー内） */
.theme-settings-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.theme-settings-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.theme-settings-btn svg {
    width: 18px;
    height: 18px;
    color: #475569;
}

/* ========== セクション並び替え・追加・削除 ========== */
.editor-section-wrapper {
    position: relative;
}

.section-drag-handle {
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #cbd5e1;
    font-size: 16px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    user-select: none;
}

.section-drag-handle:hover {
    color: #64748b;
    background: #f1f5f9;
}

.section-drag-handle:active {
    cursor: grabbing;
}

/* ========== セクションツールバー ========== */
.section-toolbar {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    z-index: 10;
    max-width: calc(100% - 32px);
    overflow: hidden;
}

.section-toolbar .section-drag-handle {
    position: static;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #94a3b8;
    font-size: 12px;
    border-radius: 4px;
}

.section-toolbar .section-drag-handle:hover {
    background: #f1f5f9;
}

.section-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    min-width: 0;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.section-toolbar-btn svg {
    width: 14px;
    height: 14px;
}

.section-toolbar-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.section-toolbar-btn.section-regenerate-btn {
    color: #6366f1;
}

.section-toolbar-btn.section-regenerate-btn:hover {
    background: #eef2ff;
}

.section-toolbar-sep {
    width: 1px;
    height: 16px;
    background: #e2e8f0;
    margin: 0 2px;
}

.section-toolbar-btn.section-delete-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ドラッグ中のスタイル */
.editor-section.is-dragging {
    opacity: 0.5;
    border: 2px dashed #2563eb;
    background: #f8fafc;
}

.editor-section.drag-over {
    border-top: 3px solid #2563eb;
}

/* セクション追加ボタン */
.section-add-area {
    margin-top: 24px;
    text-align: center;
    position: relative;
}

.section-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
}

.section-add-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.section-add-btn svg {
    width: 18px;
    height: 18px;
}

/* セクション種別選択ドロップダウン */
.section-type-dropdown {
    display: none;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 220px;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    max-width: 240px;
}

.section-type-dropdown.is-open {
    display: block;
}

.section-type-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-align: left;
    border-radius: 6px;
    transition: background 0.15s;
}

.section-type-item:hover {
    background: #f1f5f9;
}

/* ========== 表紙プレビュー: コーポレート ========== */
.preview-cover-corporate {
    display: flex;
    flex-direction: column;
    min-height: 480px;
    text-align: left;
    padding: 60px 48px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.preview-cover-corporate .preview-cover-logo {
    position: absolute;
    top: 32px;
    right: 48px;
    max-width: 140px;
    max-height: 60px;
    object-fit: contain;
}

.preview-cover-corporate .preview-cover-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-top: 80px;
    margin-bottom: 24px;
    text-align: left;
    letter-spacing: 0.02em;
}

.preview-cover-corporate .preview-cover-client {
    font-size: 18px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0;
    text-align: left;
}

.preview-cover-corporate .preview-cover-band {
    margin-top: auto;
    padding: 24px 32px;
    border-radius: 8px;
    color: #fff;
}

.preview-cover-corporate .preview-cover-band-date {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.preview-cover-corporate .preview-cover-band-author {
    font-size: 16px;
    font-weight: 600;
}

/* ========== 表紙プレビュー: モダン ========== */
.preview-cover-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    text-align: center;
    padding: 60px 48px;
    border-bottom: 1px solid #e2e8f0;
}

.preview-cover-modern .preview-cover-logo {
    max-width: 120px;
    max-height: 48px;
    object-fit: contain;
    margin-bottom: 32px;
}

.preview-cover-modern .preview-cover-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.preview-cover-modern .preview-cover-client {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
}

.preview-cover-modern .preview-cover-client .honorific {
    color: rgba(255, 255, 255, 0.7);
}

.preview-cover-modern .preview-cover-meta {
    margin-top: auto;
}

.preview-cover-modern .preview-cover-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.preview-cover-modern .preview-cover-submitter {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.preview-cover-modern .preview-cover-accent-line {
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    margin-top: 32px;
}

/* シンプル表紙のロゴ */
.preview-cover .preview-cover-logo {
    max-width: 120px;
    max-height: 48px;
    object-fit: contain;
    margin-bottom: 24px;
}

/* ========== 印刷用 ========== */
.print-area {
    display: none;
}

/* ========== レスポンシブ ========== */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 5%;
        height: auto;
        min-height: 56px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .header-right {
        gap: 8px;
    }

    .header-email {
        display: none;
    }

    .main-content {
        padding: 20px 5%;
    }

    .editor-content {
        padding-left: 5%;
        padding-right: 5%;
    }

    .proposals-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        flex-direction: column;
    }

    .stat-card {
        min-width: auto;
    }

    .dashboard-filters {
        flex-direction: column;
    }

    .filter-search {
        min-width: auto;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-container {
        padding: 24px;
        margin: 16px;
    }

    .editor-container {
        padding: 16px;
    }

    .generate-form {
        padding: 16px;
    }

    .editor-meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* エディタのタブをSP最適化 */
    .editor-tabs {
        margin-left: 12px;
    }

    /* セクションツールバーSP最適化 */
    .section-toolbar {
        top: -14px;
        padding: 2px;
        gap: 0;
    }

    .section-toolbar-btn {
        padding: 4px;
        font-size: 0;
    }

    .section-toolbar-btn svg {
        width: 16px;
        height: 16px;
    }

    /* 戻るボタンのテキスト非表示 */
    .btn-ghost span,
    .btn-ghost:not(svg) {
        font-size: 0;
    }

    /* ヘッダードロップダウンメニューの位置調整 */
    .header-dropdown-menu {
        min-width: 140px;
    }

    .preview-highlights-grid {
        grid-template-columns: 1fr;
    }

    .preview-features-grid {
        grid-template-columns: 1fr;
    }

    .preview-metrics-cards {
        grid-template-columns: 1fr;
    }

    .preview-schedule-chart {
        overflow-x: auto;
    }

    .preview-gantt {
        overflow-x: auto;
    }

    .preview-body {
        padding: 24px 20px;
    }

    .preview-cover {
        min-height: 400px;
        padding: 40px 24px;
    }

    .cover-title {
        font-size: 24px;
    }

    .preview-metrics-table,
    .preview-pricing-table {
        width: calc(100% - 20px);
        margin-left: 10px;
        margin-right: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header-plan,
    .header-count {
        font-size: 11px;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 44px;
    }

    /* テーマパネル: 小画面で全幅表示 */
    .theme-panel {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }

    .theme-panel.is-open {
        right: 0;
    }

    /* カラープリセットとロゴアップロードを縦積み */
    .color-custom-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .color-preset-grid {
        justify-content: flex-start;
    }

    .cover-style-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .font-size-options {
        flex-direction: column;
    }
}

/* ========== セクション余白カスタマイズ ========== */
.section-spacing-btn {
    /* ツールバーに移動したのでpositionスタイル不要 — .section-toolbar-btnで制御 */
    position: static;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.section-spacing-btn:hover {
    color: #2563eb;
    background: #eff6ff;
}

.section-spacing-panel {
    display: none;
    margin-top: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.section-spacing-panel.is-open {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.spacing-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.spacing-field label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.spacing-field select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
}

.spacing-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== 画像挿入UI ========== */
.section-image-area {
    margin-top: 12px;
}

.section-image-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
}

.section-image-add-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.section-image-add-btn svg {
    width: 16px;
    height: 16px;
}

.section-image-editor {
    margin-top: 10px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.section-image-preview {
    margin-bottom: 12px;
    text-align: center;
}

.section-image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
}

.section-image-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.section-image-controls label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.section-image-controls select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
}

.section-image-controls select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.section-image-caption-input {
    flex: 1;
    min-width: 120px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    color: #1e293b;
    background: #fff;
}

.section-image-caption-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.section-image-delete-btn {
    padding: 4px 12px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fee2e2;
    color: #dc2626;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.section-image-delete-btn:hover {
    background: #fecaca;
}

.section-image-file-input {
    display: none;
}

/* ========== グラフ挿入UI ========== */
.section-chart-area {
    margin-top: 8px;
}

.section-chart-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
    margin-left: 8px;
}

.section-chart-add-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.section-chart-add-btn svg {
    width: 16px;
    height: 16px;
}

.section-chart-type-dropdown {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 6px;
    z-index: 50;
    min-width: 160px;
}

.section-chart-type-dropdown.is-open {
    display: block;
}

.section-chart-type-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-align: left;
    border-radius: 6px;
    transition: background 0.15s;
}

.section-chart-type-item:hover {
    background: #f1f5f9;
}

.section-chart-editor {
    margin-top: 10px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.section-chart-editor-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

.chart-item-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: center;
}

.chart-item-row input {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    color: #1e293b;
    background: #fff;
}

.chart-item-row input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chart-item-label-input {
    flex: 1;
    min-width: 80px;
}

.chart-item-value-input {
    width: 80px;
}

.chart-item-remove-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.chart-item-remove-btn:hover {
    color: #dc2626;
    background: #fee2e2;
}

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

.chart-add-row-btn {
    padding: 4px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #2563eb;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.chart-add-row-btn:hover {
    background: #eff6ff;
}

.chart-delete-btn {
    padding: 4px 12px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fee2e2;
    color: #dc2626;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.chart-delete-btn:hover {
    background: #fecaca;
}

/* ========== プレビュー: 画像 ========== */
.preview-section-image {
    margin: 12px 0;
    text-align: center;
}

.preview-section-image img {
    max-width: 100%;
    border-radius: 8px;
}

.preview-section-image-caption {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

.preview-section-image-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.preview-section-image-layout .preview-section-image-col {
    flex: 1;
    min-width: 0;
}

.preview-section-image-layout .preview-section-image-col img {
    max-width: 100%;
    border-radius: 8px;
}

/* ========== プレビュー: 棒グラフ ========== */
.preview-bar-chart {
    padding: 0 20px;
    margin-top: 12px;
    overflow-y: auto;
}

.preview-bar-chart-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.preview-bar-chart-label {
    width: 100px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-align: right;
    padding-right: 12px;
}

.preview-bar-chart-bar-wrap {
    flex: 1;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    height: 28px;
}

.preview-bar-chart-bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    min-width: 32px;
    transition: width 0.3s ease;
}

/* ========== プレビュー: 円グラフ ========== */
.preview-pie-chart {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 20px;
    margin-top: 12px;
}

.preview-pie-chart-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    flex-shrink: 0;
}

.preview-pie-chart-legend {
    flex: 1;
}

.preview-pie-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #334155;
}

.preview-pie-chart-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.preview-pie-chart-legend-label {
    flex: 1;
}

.preview-pie-chart-legend-value {
    font-weight: 600;
}

/* ========== 保存ステータス表示 ========== */
.save-status-success {
    color: #16a34a;
}

.save-check-icon {
    font-weight: 700;
    margin-right: 2px;
}

.save-status-error {
    color: #dc2626;
    background: #fef2f2;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.save-retry-btn {
    margin-left: 6px;
}

/* ========== グラフ自動生成UI ========== */
.chart-dropdown-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    padding: 6px 12px 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 8px;
}

.chart-auto-generate-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #2563eb;
    text-align: left;
    border-radius: 6px;
    transition: background 0.15s;
}

.chart-auto-generate-btn:hover {
    background: #eff6ff;
}

.chart-auto-loading {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-spinner-sm {
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ========== プレビュー: 折れ線グラフ ========== */
.preview-line-chart {
    padding: 0 20px;
    margin-top: 12px;
}

.preview-line-chart svg {
    display: block;
}

/* ========== グラフ設定UI ========== */
.chart-settings {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.chart-setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chart-setting-row label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.chart-setting-row input[type="color"] {
    width: 32px;
    height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.chart-setting-row select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
}

.chart-setting-row select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== グラフ リアルタイムプレビュー ========== */
.chart-live-preview {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    min-height: 40px;
}

.chart-live-preview:empty {
    display: none;
}

/* ========== Word/PowerPointボタン ========== */
.btn-word {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.btn-word:hover {
    background: #bbf7d0;
}

.btn-ppt {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.btn-ppt:hover {
    background: #fed7aa;
}

/* ========== アクセシビリティ ========== */
.btn:focus-visible,
.auth-tab:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

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

/* ========== AI分析パネル ========== */
.feedback-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

.feedback-panel-overlay.is-open {
    display: block;
}

.feedback-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.feedback-panel.is-open {
    display: block;
    transform: translateX(0);
}

.feedback-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #fff;
}

.feedback-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.feedback-panel-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #64748b;
    border-radius: 4px;
}

.feedback-panel-close:hover {
    background: #f1f5f9;
}

.feedback-panel-body {
    padding: 20px;
}

.feedback-loading {
    text-align: center;
    color: #64748b;
    padding: 40px 0;
}

.feedback-error {
    text-align: center;
    color: #ef4444;
    padding: 40px 0;
}

.feedback-section {
    margin-bottom: 16px;
}

.feedback-section ul {
    margin: 0;
    padding-left: 20px;
}

.feedback-section li {
    margin-bottom: 4px;
    font-size: 13px;
    color: #334155;
}

/* ========== フィードバック反映ボタン ========== */
.feedback-reanalyze-btn {
    margin-top: 10px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-reanalyze-btn:hover {
    color: #2563eb;
    border-color: #2563eb;
    background: #eff6ff;
}

.feedback-target-select {
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #334155;
    background: #fff;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feedback-apply-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-apply-btn:hover:not(:disabled) {
    background: #dbeafe;
}

.feedback-apply-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}

.feedback-imp-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-apply-status {
    font-size: 11px;
    color: #64748b;
}

.feedback-undo-btn {
    padding: 3px 8px;
    font-size: 11px;
    color: #f59e0b;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    cursor: pointer;
}

.feedback-undo-btn:hover {
    background: #fef3c7;
}

.feedback-undo-area {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.feedback-undo-all-btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #f59e0b;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    cursor: pointer;
}

.feedback-undo-all-btn:hover {
    background: #fef3c7;
}

/* ========== ショートカットヘルプ ========== */
.shortcut-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.shortcut-help-panel {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    min-width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.shortcut-help-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    text-align: center;
}

.shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

.shortcut-row:last-child {
    border-bottom: none;
}

.shortcut-row kbd {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-family: monospace;
    color: #334155;
}

.shortcut-row span {
    font-size: 13px;
    color: #64748b;
}

/* ========== 比較表エディタ ========== */
.comparison-table-editor {
    margin-top: 8px;
}

.comparison-header-row,
.comparison-data-row {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
    align-items: center;
}

.comparison-header-input,
.comparison-cell-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
}

.comparison-header-input {
    font-weight: 600;
    background: #f1f5f9;
}

.comparison-add-col-btn,
.comparison-add-row-btn {
    font-size: 11px;
    padding: 4px 8px;
    border: 1px dashed #cbd5e1;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
}

.comparison-add-col-btn:hover,
.comparison-add-row-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.comparison-remove-row-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
}

.comparison-remove-row-btn:hover {
    color: #ef4444;
}

/* ========== FAQエディタ ========== */
.faq-item-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
}

.faq-item-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.faq-question-input,
.faq-answer-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
}

.faq-answer-input {
    resize: vertical;
}

.faq-remove-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    margin-top: 16px;
}

.faq-remove-btn:hover {
    color: #ef4444;
}

.faq-add-btn {
    font-size: 11px;
    padding: 4px 8px;
    border: 1px dashed #cbd5e1;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
}

.faq-add-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

/* ========== 印刷最適化 ========== */
@media print {
    .app-header,
    .editor-tabs,
    .header-dropdown,
    .section-toolbar,
    .section-spacing-panel,
    .section-media-buttons,
    .section-extra-editor,
    .section-add-area,
    .feedback-panel,
    .feedback-panel-overlay,
    .theme-panel,
    .theme-panel-overlay,
    .shortcut-help-overlay,
    .save-toast,
    .btn-ghost {
        display: none !important;
    }

    body {
        background: #fff;
        margin: 0;
        padding: 0;
    }

    .main-content {
        padding: 0 !important;
    }

    .preview-container {
        display: block !important;
        box-shadow: none;
        border: none;
    }

    .editor-container {
        display: none !important;
    }

    .preview-cover {
        page-break-after: always;
    }

    .preview-section {
        page-break-inside: avoid;
    }

    .preview-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
}
