* { box-sizing: border-box; }
body { margin: 0; padding: 0; background-color: #f3f4f6; font-family: 'Inter', 'Noto Sans JP', sans-serif; color: #374151; }

/* === Login Page Styles === */
.login-page-body {
    background-color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.login-page-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    margin-bottom: auto;
    padding-top: 100px;
}

.main-logo-img {
    height: 80px;
    width: auto;
    margin-bottom: 32px;
}

.welcome-text {
    font-size: 32px;
    font-weight: 500;
    color: #111;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.sub-text {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 48px;
}

.auth-buttons-area {
    width: 100%;
    max-width: 400px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-google:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-google svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

.login-footer {
    margin-top: auto;
    padding: 40px 0 20px 0;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
}

.terms-text {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.5;
    max-width: 480px;
    margin: 0;
}

.terms-text a {
    color: #9ca3af;
    text-decoration: none;
    margin: 0 4px;
}

.terms-text a:hover {
    text-decoration: underline;
    color: #6b7280;
}

.dynamic-msg {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    text-align: left;
    margin-bottom: 20px;
}
.dynamic-msg.error { background: #fee2e2; color: #ef4444; }


/* === Dashboard Styles === */
.dashboard-wrapper { display: flex; flex-direction: column; height: 100dvh; width: 100vw; overflow: hidden; }

/* Header */
.app-header { height: 64px; background: #fff; border-bottom: none; display: flex; justify-content: space-between; align-items: center; padding: 0; z-index: 20; }
.header-left { width: 240px; text-align: center; }
.header-logo { height: 40px; width: auto; }
.header-right { padding-right: 24px; display: flex; align-items: center; gap: 20px; }

/* ▼ 追加: ロゴリンクのスタイル */
.header-logo-link {
    display: inline-block;
    transition: opacity 0.2s;
}
.header-logo-link:hover {
    opacity: 0.7;
}

/* ▼▼▼ 追加: ミニバッジ (v3.6.1) ▼▼▼ */
.bonus-badge {
    background-color: #fff;
    color: #2563eb;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #d1d5db;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s;
    white-space: nowrap;
}

.bonus-badge:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.bonus-badge.disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: default;
    transform: none;
    box-shadow: none;
}
/* ▲▲▲ 追加終了 ▲▲▲ */

/* Credit Display */
.header-credit-wrapper { display: flex; align-items: center; gap: 10px; }
.credit-label { font-size: 12px; font-weight: 600; color: #6b7280; }
.header-credit-container { background: #f3f4f6; padding: 6px 12px; border-radius: 8px; display: flex; flex-direction: column; gap: 4px; width: 140px; }
.header-credit-info { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #374151; line-height: 1; }
.header-credit-total { font-size: 11px; color: #9ca3af; font-weight: 500; }
.header-credit-bar-bg { width: 100%; height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden; }
.header-credit-bar-fill { height: 100%; background: linear-gradient(135deg, #00E0FF 0%, #0078FF 100%); transition: width 0.3s ease; border-radius: 3px; }

.app-body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.app-sidebar { width: 240px; background: #fff; border-right: none; display: flex; flex-direction: column; }
.sidebar-content { padding: 20px 0; flex: 1; display: flex; flex-direction: column; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-btn-wrapper { padding: 0 20px 10px 20px; }
.nav-cta {
    width: 100%; padding: 12px; 
    background: #3b82f6; 
    color: #fff !important; 
    border: none; border-radius: 10px; 
    font-size: 14px; font-weight: 700; 
    cursor: pointer; text-align: center;
    transition: background 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    text-decoration: none;
}
.nav-cta:hover { background: #2563eb; color: #fff; }
.nav-cta:active { transform: translateY(0); box-shadow: none; }
.nav-cta img { filter: brightness(0) invert(1); }

.nav-item { 
    display: flex; align-items: center; gap: 10px;
    padding: 10px 24px; 
    text-decoration: none; color: #6b7280; 
    font-size: 14px; font-weight: 500; 
    transition: all 0.2s; 
    border-left: 3px solid transparent; 
}
.nav-item img { transition: filter 0.2s; }
.nav-item:hover { color: #111; background-color: #f9fafb; }
.nav-item.active { background: transparent; color: #2563eb; font-weight: 700; }
.nav-item.active img { filter: invert(29%) sepia(92%) saturate(1961%) hue-rotate(210deg) brightness(96%) contrast(96%); }

.sidebar-bottom { margin-top: auto; padding: 20px 0; border-top: none; }

.legal-links { margin-top: 10px; padding: 0 24px; font-size: 11px; display: flex; flex-direction: column; gap: 6px; }
.legal-links a { color: #9ca3af; text-decoration: none; }
.legal-links a:hover { color: #6b7280; text-decoration: underline; }


/* =========================================
   Main Content Area
   ========================================= */
.app-content { flex: 1; overflow-y: auto; background-color: #f3f4f6; padding: 32px; }
.content-inner { max-width: 1100px; margin: 0 auto; }

.create-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.create-main-col { min-width: 0; }
.create-side-col { display: flex; flex-direction: column; gap: 24px; }

.tips-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 20px; }
.sidebar-title { font-size: 14px; font-weight: 700; color: #1e3a8a; margin: 0 0 15px 0; display: flex; align-items: center; gap: 6px; }
.tips-content { color: #4b5563; font-size: 13px; line-height: 1.6; }
.tips-content h1, .tips-content h2, .tips-content h3, .tips-content h4 { font-size: 14px; font-weight: 700; color: #2563eb; margin: 12px 0 6px 0; }
.tips-content p { margin: 0 0 10px 0; }
.tips-content ul { margin: 0 0 10px 20px; padding: 0; }

/* My Template Styles (v3.5.2) */
.user-template-tag {
    background: #fff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.user-template-tag:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.template-delete-btn {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px; height: 14px;
    border-radius: 50%;
}

.template-delete-btn:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}

.btn-add-template-trigger {
    background: none; border: none; cursor: pointer;
    font-size: 11px; font-weight: 700; color: #2563eb;
    margin-left: 8px;
}
.btn-add-template-trigger:hover { text-decoration: underline; }

.template-input-row {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
    animation: slideDown 0.2s ease-out;
}

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

.input-stylish {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.input-stylish:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.btn-circle-save {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}
.btn-circle-save:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

#rhs-timeline-container { display: flex; flex-direction: column; gap: 20px; margin-top: 32px; }


/* =========================================
   Settings Page
   ========================================= */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .settings-grid { grid-template-columns: 1fr; } }

.settings-content { padding: 10px 0; }

.plan-info-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.plan-name { font-size: 20px; font-weight: 700; color: #111; margin: 0; }
.plan-price { font-size: 13px; font-weight: 700; color: #6b7280; background: #f3f4f6; padding: 4px 12px; border-radius: 20px; }

.credit-status { margin-bottom: 16px; }
.credit-labels { display: flex; justify-content: space-between; font-size: 14px; color: #6b7280; margin-bottom: 8px; }
.credit-val { font-weight: 700; color: #2563eb; }
.progress-bg { width: 100%; height: 10px; background: #f3f4f6; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(135deg, #00E0FF 0%, #0078FF 100%); border-radius: 5px; }
.next-reset { font-size: 12px; color: #9ca3af; text-align: right; }

.setting-row { margin-bottom: 16px; }
.setting-row label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.setting-actions { margin-top: 24px; text-align: right; }

/* Button Styles */
.submit-btn { background-color: #2563eb; color: #fff; border: none; padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.submit-btn:hover { background-color: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3); }
.submit-btn:disabled { background-color: #93c5fd; cursor: wait; transform: none; box-shadow: none; }

/* Input Forms */
.panel-section { margin-bottom: 32px; }
.input-card { background: #fff; border-radius: 0; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid #e5e7eb; }
.card-header { margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; }
.card-title { margin: 0; font-size: 16px; font-weight: 700; color: #111; }
.suggestions-area { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.suggestion-tag { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; border-radius: 0; padding: 4px 12px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.suggestion-tag:hover { background: #2563eb; color: #fff; border-color: #2563eb; }
.input-row-stack { margin-bottom: 16px; }
.topic-input { width: 100%; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 0; font-size: 16px; background: #fff; transition: .2s; }
.topic-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.topic-input.is-invalid, .length-input.is-invalid { border-color: #ef4444; background-color: #fef2f2; }
.input-error-msg { color: #ef4444; font-size: 12px; font-weight: 600; margin-top: 6px; display: none; }

.conditions-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.condition-item { width: 100%; }

.number-input-wrap { position: relative; display: inline-block; width: 100%; }
.length-input { width: 100%; padding: 14px 50px 14px 16px; border: 1px solid #e5e7eb; border-radius: 0; font-size: 16px; background: #fff; transition: .2s; text-align: left; }
.length-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #6b7280; pointer-events: none; background: transparent; }

.custom-select { width: 100%; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 0; font-size: 16px; background: #fff; transition: .2s; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5%22%20stroke%3D%22%236b7280%22%20stroke-width%3D%222%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.custom-select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.btn-row-wrapper { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 24px; position: relative; }
.spacer { display: none; }

.generate-wrapper { grid-column: 2; text-align: center; }
.credit-cost-hint { font-size: 11px; color: #9ca3af; margin-top: 6px; }

#rhs-generate-btn { 
    padding: 12px 60px; width: 100%;
    background: #3b82f6; 
    color: #fff; border: none; border-radius: 10px; 
    font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.2s; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex; align-items: center; justify-content: center;
}
#rhs-generate-btn:hover { 
    transform: translateY(-1px); 
    background: #2563eb; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: #fff !important;
}
#rhs-generate-btn:active { transform: translateY(0); box-shadow: none; }
#rhs-generate-btn:disabled { background: #9ca3af; cursor: wait; transform: none; box-shadow: none; }

.cost-badge { display: flex; align-items: center; gap: 2px; font-size: 13px; opacity: 0.9; background: rgba(0,0,0,0.1); padding: 2px 6px; border-radius: 4px; }

.reset-wrapper { justify-self: end; }
.reset-btn { background: none; border: none; cursor: pointer; padding: 8px; opacity: 0.5; transition: opacity 0.2s; display: flex; position: relative; }
.reset-btn:hover { opacity: 1; }
.reset-btn img { width: 20px; height: 20px; }

.btn-danger { background: #fee2e2; color: #ef4444; border: 1px solid #fecaca; padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s; }
.btn-danger:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -8px); background-color: #333; color: #fff; padding: 6px 10px; border-radius: 4px; font-size: 11px; white-space: nowrap; z-index: 100; pointer-events: none; box-shadow: 0 4px 10px rgba(0,0,0,0.15); opacity: 0; animation: tooltipFade 0.2s forwards; }
@keyframes tooltipFade { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, -8px); } }

#rhs-output-placeholder { background: #fff; border-radius: 0; border: 2px dashed #e5e7eb; height: 300px; display: flex; align-items: center; justify-content: center; text-align: center; color: #9ca3af; }
.placeholder-content { display: flex; flex-direction: column; align-items: center; }
#rhs-output-placeholder p { font-size: 14px; line-height: 1.6; }
.output-card { background: #fff; border-radius: 0; box-shadow: 0 4px 6px rgba(0,0,0,0.05); overflow: visible; border: 1px solid #e5e7eb; }
.output-header { background: #f8fafc; padding: 12px 24px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.result-badge { font-size: 11px; font-weight: 700; color: #2563eb; text-transform: uppercase; letter-spacing: 0.05em; background: #eff6ff; padding: 4px 8px; border-radius: 0; }
.action-buttons { display: flex; gap: 8px; }
.action-icon-btn { background: transparent; border: none; cursor: pointer; display: flex; align-items: center; padding: 8px; position: relative; opacity: 0.6; transition: opacity 0.2s; }
.action-icon-btn:hover { opacity: 1; }
.action-icon-btn img { width: 18px; height: 18px; margin: 0; }
.editor-container { padding: 40px; min-height: 400px; }
#rhs-output-title, #rhs-detail-title { margin: 0 0 24px 0; font-size: 24px; font-weight: 700; color: #111; border-bottom: 2px solid #f3f4f6; padding-bottom: 16px; line-height: 1.4; }
.editor-view { font-size: 16px; line-height: 1.8; color: #374151; white-space: pre-wrap; }

/* === Modal Styles (v3.5.0 Ad Focus) === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    width: 90%; max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden; 
    display: flex; flex-direction: column;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
@keyframes modalPop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* メイン広告エリア */
.modal-ad-area {
    padding: 20px;
    min-height: 300px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #f8fafc;
}
.ad-label-top {
    font-size: 10px; font-weight: 700; color: #94a3b8; letter-spacing: 1px;
    margin-bottom: 15px; text-transform: uppercase;
}
#rhs-ad-slot { width: 100%; display: flex; justify-content: center; }
#rhs-ad-slot img { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }

/* 下部進捗エリア */
.modal-progress-area {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}
.progress-bar-box {
    width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-bottom: 8px;
}
.bar-fill {
    height: 100%; width: 0%; background: #2563eb; transition: width 0.3s linear;
}
.progress-info {
    display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #64748b; font-weight: 600;
}
.progress-time { color: #94a3b8; font-weight: 500; }

/* 閉じるボタン */
.close-btn-floating {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,0.8); border: none; cursor: pointer;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #64748b; transition: .2s;
}
.close-btn-floating:hover { background: #fff; color: #ef4444; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Spinner */
.spinner {
    width: 18px; height: 18px; margin-left: 10px;
    border: 3px solid #e5e7eb; border-top-color: #2563eb;
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* =========================================
   Saved Report List (v3.5.1 Icons)
   ========================================= */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.report-item-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.report-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #bfdbfe;
}

.report-card-body {
    padding: 20px;
    flex: 1;
}

.report-item-date {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 600;
}

.report-item-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.report-item-excerpt {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.report-item-actions {
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    padding: 10px 20px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* アイコンボタン */
.btn-icon-trash, .btn-icon-restore {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.btn-icon-trash:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #ef4444;
}

.btn-icon-restore:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #2563eb;
}

/* 旧ボタン */
.btn-trash { background: #fee2e2; color: #ef4444; border: none; padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-restore { background: #dbeafe; color: #2563eb; border: none; padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }

.btn-back { background: transparent; border: none; color: #6b7280; font-weight: 600; cursor: pointer; font-size: 14px; margin-bottom: 10px; }
.btn-back:hover { text-decoration: underline; color: #2563eb; }


/* =========================================
   Mobile Responsiveness
   ========================================= */
.mobile-menu-btn {
    display: none;
    background: none; border: none; cursor: pointer; padding: 10px; margin-right: 8px; color: #374151;
}

/* --- Mobile / Tablet (<768px) --- */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

    .app-sidebar {
        position: fixed; top: 64px; left: -250px;
        width: 250px; height: calc(100% - 64px);
        z-index: 100; transition: left 0.3s ease;
        box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    }
    .app-sidebar.open { left: 0; }
    
    .app-sidebar-overlay {
        display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5); z-index: 90;
    }
    .app-sidebar-overlay.active { display: block; }

    .header-left { width: auto; padding-left: 16px; display: flex; align-items: center; }
    .header-logo { height: 32px; }
    .header-right { padding-right: 16px; gap: 10px; }
    
    .credit-label { display: none; }
    .header-credit-container { width: auto; background: transparent; padding: 0; }
    .header-credit-info { font-size: 14px; }
    .header-credit-bar-bg { display: none; }

    .app-content { padding: 20px 16px 120px 16px; } 

    .input-row-stack, .conditions-grid { display: flex; flex-direction: column; gap: 12px; }
    .conditions-grid { grid-template-columns: 1fr; }
    
    .btn-row-wrapper { display: flex; flex-direction: column; gap: 15px; }
    .generate-wrapper { width: 100%; }
    #rhs-generate-btn { width: 100%; }
    .reset-wrapper { align-self: flex-end; }

    .settings-grid { grid-template-columns: 1fr; }
    .setting-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
    .setting-row label { margin-bottom: 0; }
    .rhs-toggle { align-self: flex-end; }
}

/* --- Mobile (<480px) --- */
@media (max-width: 480px) {
    .login-page-wrapper { padding: 20px; }
    .main-logo-img { height: 50px; margin-bottom: 24px; }
    .welcome-text { font-size: 24px; }
    .auth-buttons-area { width: 100%; }
    .terms-text { font-size: 10px; max-width: 100%; padding: 0 10px; }
}