:root {
    --brand: #0ABAB5;
    --brand-dark: #089e99;
    --brand-light: #e6fafa;
}
body { background: #f8f9fa; font-size: 0.9rem; }

/* ナビバー */
.navbar { border-bottom: 1px solid #e9ecef; background: #fff !important; }
.navbar-brand { font-weight: 700; color: var(--brand) !important; letter-spacing: 0.5px; text-decoration: none; }
.brand-icon { width: 30px; height: 30px; background: var(--brand); border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; flex-shrink: 0; }
.brand-icon svg { width: 20px; height: 20px; }
.brand-sub { font-size: 8px; letter-spacing: 2px; color: #aaa; font-weight: 400; line-height: 1; display: block; margin-top: 1px; font-family: sans-serif; text-transform: uppercase; }

/* サイドバー */
.sidebar { width: 220px; min-height: calc(100vh - 56px); background: #fff; border-right: 1px solid #e9ecef; padding: 1rem 0; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-nav { flex: 1; }
.sidebar .nav-link { color: #555; padding: 0.45rem 1.25rem; border-radius: 0; font-size: 0.875rem; display: flex; align-items: center; gap: 8px; }
.sidebar .nav-link:hover { background: var(--brand-light); color: var(--brand); }
.sidebar .nav-link.active { background: var(--brand-light); color: var(--brand); font-weight: 500; border-left: 3px solid var(--brand); }
.sidebar .nav-link i { font-size: 15px; width: 18px; text-align: center; }
.sidebar .nav-link.locked { opacity: 0.4; font-size: 12px; cursor: default; pointer-events: none; }
.sidebar-toggle { cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.sidebar-toggle:hover { color: #0ABAB5; }
.toggle-icon { font-size: 10px; transition: transform 0.2s; }
.toggle-icon.open { transform: rotate(180deg); }
.sidebar-group { overflow: hidden; transition: max-height 0.3s ease; }
.sidebar-group.collapsed { max-height: 0 !important; }
.sidebar-section { font-size: 0.7rem; font-weight: 600; color: #aaa; letter-spacing: 0.07em; text-transform: uppercase; padding: 0.75rem 1.25rem 0.25rem; }

/* お気に入りボタン */
.fav-btn { background: none; border: none; padding: 0 2px; font-size: 14px; color: #ccc; cursor: pointer; line-height: 1; opacity: 0; transition: opacity 0.2s, color 0.2s; }
.fav-btn::before { content: '☆'; }
.fav-btn.active::before { content: '★'; color: #f59e0b; }
.nav-link:hover .fav-btn { opacity: 1; }
.fav-btn.active { opacity: 1; color: #f59e0b; }

/* メインコンテンツ */
.main-content { flex: 1; padding: 1.5rem; overflow-x: hidden; }

/* ボタン */
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* アップグレードボックス */
.upgrade-box { margin: 12px; padding: 12px; background: linear-gradient(135deg, #0ABAB5, #089e99); border-radius: 10px; color: #fff; }
.upgrade-box .plan-name { font-size: 11px; opacity: .8; margin-bottom: 4px; }
.upgrade-box .upgrade-btn { display: block; background: #fff; color: #0ABAB5; border-radius: 6px; padding: 6px 0; font-size: 12px; font-weight: 600; text-align: center; text-decoration: none; margin-top: 8px; }
.upgrade-box .upgrade-btn:hover { background: #f0fffe; }

/* ツールカード */
.tool-card { transition: border-color 0.15s, box-shadow 0.15s; cursor: pointer; }
.tool-card:hover { border-color: var(--brand) !important; box-shadow: 0 2px 8px rgba(10,186,181,.1); }
.tool-card .icon-wrap { width: 44px; height: 44px; background: var(--brand-light); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--brand); flex-shrink: 0; }

/* reCAPTCHA */
.grecaptcha-badge { visibility: hidden !important; }

/* モバイル対応 */
@media (max-width: 767px) {
    .main-content { padding: 1rem 0.75rem; }
    .navbar { padding: 0.5rem 1rem; }

    /* オフキャンバスサイドバー */
    .sidebar {
        position: fixed; top: 56px; left: -220px; height: calc(100vh - 56px);
        z-index: 1040; transition: left 0.3s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    }
    .sidebar.show { left: 0; }
    .sidebar-overlay {
        display: none; position: fixed; top: 56px; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.4); z-index: 1039;
    }
    .sidebar-overlay.show { display: block; }
    .main-content { width: 100%; }
}

/* ハンバーガーボタン */
.sidebar-toggler {
    display: none;
    background: none; border: none; padding: 4px 8px; font-size: 20px; color: #555; cursor: pointer;
}
@media (max-width: 767px) {
    .sidebar-toggler { display: inline-flex; align-items: center; }
}

/* settings共通 */
.settings-container { max-width:960px; }
.btn-brand-sm { background:#0ABAB5; color:#fff; }
.btn-brand-sm:hover { background:#089e99; color:#fff; }
.alert-brand { background:#e6fafa; color:#0ABAB5; }

/* layouts/app 追加クラス */
.nav-brand-si { font-family:Georgia,serif; font-size:18px; font-weight:700; letter-spacing:0; color:#0ABAB5; }
.nav-brand-scan { font-family:Georgia,serif; font-size:18px; font-weight:700; letter-spacing:0; color:#1a1a1a; }
.nav-brand-beta { font-size:9px; font-weight:700; letter-spacing:1px; color:#fff; background:#0ABAB5; border-radius:3px; padding:1px 5px; line-height:1.6; font-family:sans-serif; }
.nav-plan-badge { background:#0ABAB5; font-size:10px; }
.fav-empty { font-size:12px; }
.contact-badge { font-size:10px; }
.upgrade-plan-name { font-size:13px; font-weight:600; }
.upgrade-plan-price { font-size:11px; opacity:.8; margin-top:4px; }
.main-wrap { min-height:calc(100vh - 56px); }
.app-footer { font-size:11px; color:#bbb; }
.footer-brand { font-family:Georgia,serif; font-size:13px; font-weight:700; letter-spacing:0; }
.footer-brand-si { color:#0ABAB5; }
.footer-brand-scan { color:#555; }
.footer-divider-color { color:#ddd; }
.footer-presented { font-family:Georgia,serif; letter-spacing:1px; color:#999; }
.page-top-btn { display:none; position:fixed; bottom:24px; right:24px; z-index:1000; width:44px; height:44px; border-radius:50%; background:#0ABAB5; color:white; border:none; cursor:pointer; box-shadow:0 2px 12px rgba(10,186,181,0.4); font-size:18px; align-items:center; justify-content:center; transition:opacity 0.3s; }

/* エラーページ・権限・billing */
.error-container { max-width:500px; }
.error-icon { font-size:64px; }
.emoji-md { font-size:48px; }
.emoji-xl { font-size:64px; }
.billing-success-wrap { max-width:600px; }

/* ダウングレード警告バナー */
.downgrade-warning-banner{background:linear-gradient(135deg,#fff8e1,#fff3cd);border:1px solid #ffc107;border-left:4px solid #e65100;border-radius:8px;padding:16px 20px;margin-bottom:20px;}

/* contact toast overlay */
.contact-toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
    animation: overlayIn 0.3s ease;
}
.contact-toast-overlay.hide {
    animation: overlayOut 0.3s ease forwards;
}
@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes overlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* contact toast */
.contact-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-left: 4px solid #0ABAB5;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 24px 48px 24px 24px;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    z-index: 9999;
    min-width: 300px;
    max-width: 90vw;
    animation: toastIn 0.3s ease;
}
.contact-toast-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.contact-toast-close:hover { color: #333; }
.contact-toast.hide {
    animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translate(-50%, -50%); }
    to   { opacity: 0; transform: translate(-50%, -60%); }
}

/* reCAPTCHA センタリング */
.g-recaptcha {
    margin: 12px auto;
    text-align: center;
}
.g-recaptcha > div {
    display: inline-block;
}

/* ナビバー サブタイトル */
.nav-brand-subtitle {
  font-size: 9px !important;
  letter-spacing: 0.08em;
  color: #999 !important;
  line-height: 1;
  text-transform: uppercase;
  font-weight: normal !important;
}

/* ===== フッター スマホ最適化 ===== */
@media (max-width: 575.98px) {
  .app-footer .d-flex.align-items-center.justify-content-between {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .app-footer .d-flex.align-items-center.gap-3 {
    flex-wrap: wrap;
    gap: 6px !important;
  }
  .app-footer .footer-divider-color { display: none; }
  .app-footer a.text-muted.small,
  .app-footer span { font-size: 10px; }
}

/* ===== ナビバー スマホ最適化 ===== */
@media (max-width: 575.98px) {
  .navbar { padding: 0.4rem 0.75rem; flex-wrap: nowrap; }
  .nav-brand-si, .nav-brand-scan { font-size: 15px; }
  .nav-brand-subtitle { display: none; }
  .btn.btn-sm.btn-outline-secondary { font-size: 11px; padding: 3px 10px; white-space: nowrap; }
  /* ログアウトボタンが折り返さないよう */
  .ms-auto.d-flex.align-items-center { flex-wrap: nowrap; gap: 8px !important; }
}

/* ===== プロパティ変更ボタン スマホ最適化 ===== */
@media (max-width: 575.98px) {
  .card-body .btn-outline-secondary.py-0 { white-space: nowrap; font-size: 11px; }
}
