/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+TC:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* === Theme Variables === */
:root, [data-theme="dark"] {
    --bg: #0f1117;
    --bg-elevated: #161822;
    --bg-card: #1a1c2b;
    --bg-card-hover: #222438;
    --bg-input: #161822;
    --bg-sidebar: #12131d;
    --text: #eaedf3;
    --text-secondary: #a0a6b8;
    --text-muted: #636b82;
    --border: #262940;
    --border-light: #1e2035;
    --accent: #7c6aff;
    --accent-hover: #9186ff;
    --accent-glow: rgba(124,106,255,0.15);
    --accent-soft: rgba(124,106,255,0.08);
    --success: #34d399;
    --success-soft: rgba(52,211,153,0.12);
    --warning: #fbbf24;
    --warning-soft: rgba(251,191,36,0.12);
    --danger: #f87171;
    --danger-soft: rgba(248,113,113,0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px rgba(124,106,255,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}
[data-theme="light"] {
    --bg: #f4f5f9;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fc;
    --bg-input: #f4f5f9;
    --bg-sidebar: #1a1c2b;
    --text: #1a1c2b;
    --text-secondary: #5a6070;
    --text-muted: #9098ad;
    --border: #e2e5ee;
    --border-light: #eceef4;
    --accent: #6c5ce7;
    --accent-hover: #7f71ef;
    --accent-glow: rgba(108,92,231,0.1);
    --accent-soft: rgba(108,92,231,0.06);
    --success: #10b981;
    --success-soft: rgba(16,185,129,0.08);
    --warning: #f59e0b;
    --warning-soft: rgba(245,158,11,0.08);
    --danger: #ef4444;
    --danger-soft: rgba(239,68,68,0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 20px rgba(108,92,231,0.06);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', 'Noto Sans TC', -apple-system, sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100vh; display: flex;
    font-size: 14px; line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Sidebar === */
.sidebar {
    width: 260px; min-height: 100vh;
    background: var(--bg-sidebar);
    display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06);
    position: fixed; left: 0; top: 0; z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-header { padding: 24px 20px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    color: #fff; width: 40px; height: 40px;
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 20px;
    box-shadow: 0 4px 12px rgba(124,106,255,0.3);
}
.logo-icon.large {
    width: 64px; height: 64px; font-size: 32px; border-radius: 18px;
    box-shadow: 0 8px 24px rgba(124,106,255,0.3);
}
.logo-text { font-weight: 700; font-size: 17px; color: #fff; letter-spacing: -0.3px; }
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: rgba(255,255,255,0.5); margin: 4px 0; border-radius: 1px; }
.nav-links { list-style: none; flex: 1; padding: 8px 12px; }
.nav-links li { margin-bottom: 2px; }
.nav-links a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: rgba(255,255,255,0.5); font-size: 14px; font-weight: 500;
    transition: all 0.2s; position: relative;
}
.nav-links a:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.nav-links a.active {
    background: linear-gradient(135deg, rgba(124,106,255,0.15), rgba(167,139,250,0.08));
    color: #fff; font-weight: 600;
}
.nav-links a.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-links svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; }
.nav-links a.active svg { opacity: 1; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar-actions { display: flex; gap: 6px; margin-bottom: 12px; }
.action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
    font-size: 12px; font-weight: 700; transition: all 0.2s;
}
.action-btn svg { width: 16px; height: 16px; }
.action-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.user-info { display: flex; justify-content: space-between; align-items: center; }
.user-name { font-size: 13px; color: rgba(255,255,255,0.5); font-weight: 500; }
.logout-btn { font-size: 12px; color: var(--danger); font-weight: 500; transition: opacity 0.2s; }
.logout-btn:hover { opacity: 0.8; }

/* === Main Content === */
.main-content { flex: 1; margin-left: 260px; min-height: 100vh; }
.top-bar {
    padding: 16px 32px; display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg); position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(12px);
}
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 1px; transition: all 0.3s; }
.search-form { flex: 1; max-width: 480px; position: relative; }
.search-form input {
    width: 100%; padding: 10px 12px 10px 40px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
    transition: all 0.25s;
}
.search-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-form input::placeholder { color: var(--text-muted); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }
.content { padding: 28px 36px; max-width: 1200px; }

/* === Page Header === */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.page-header-left { display: flex; align-items: center; gap: 14px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link { font-size: 22px; color: var(--text-muted); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: all 0.2s; }
.back-link:hover { background: var(--accent-soft); color: var(--accent); }

/* === Stats === */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--bg-card); padding: 22px 24px;
    border-radius: var(--radius); border: 1px solid var(--border);
    transition: all 0.3s; position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.5;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.accent::before { background: linear-gradient(90deg, var(--warning), transparent); }
.stat-number { font-size: 36px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-card.accent .stat-number { color: var(--warning); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }

/* === Filter Bar === */
.filter-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    padding: 7px 18px; border-radius: 20px; font-size: 13px; font-weight: 500;
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
    transition: all 0.25s; cursor: pointer;
}
.filter-btn:hover { background: var(--bg-card-hover); color: var(--text); border-color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(124,106,255,0.3); }
.display-options { display: flex; align-items: center; gap: 6px; }
.display-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.cols-btn {
    width: 30px; height: 30px; border-radius: var(--radius-xs); font-size: 12px; font-weight: 600;
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; cursor: pointer;
}
.cols-btn:hover, .cols-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === Project Grid === */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 32px; }
.project-grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.project-grid.cols-6 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.project-grid.cols-9 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.project-card {
    background: var(--bg-card); padding: 20px 22px;
    border-radius: var(--radius); border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative; display: block; color: var(--text); overflow: hidden;
}
.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 0;
    transition: width 0.3s;
}
.project-card:hover {
    background: var(--bg-card-hover); transform: translateY(-3px);
    box-shadow: var(--shadow-lg); color: var(--text); border-color: transparent;
}
.project-card:hover::before { width: 4px; }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 8px; }
.project-card h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.4; }
.project-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.project-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.6; }
.project-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.project-grid.cols-6 .project-desc, .project-grid.cols-9 .project-desc { font-size: 12px; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.project-grid.cols-9 .project-card h3 { font-size: 14px; }

/* === Badges === */
.pin-badge {
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent), #a78bfa); color: #fff;
    padding: 3px 10px; border-radius: 10px;
}
.status-badge {
    font-size: 11px; padding: 4px 12px; border-radius: 20px; font-weight: 600;
    letter-spacing: 0.2px;
}
.status-planning { background: rgba(96,165,250,0.12); color: #60a5fa; }
.status-developing { background: rgba(52,211,153,0.12); color: #34d399; }
.status-completed { background: rgba(251,191,36,0.12); color: #fbbf24; }
.status-paused { background: rgba(248,113,113,0.12); color: #f87171; }

/* === Tabs === */
.tabs-container { margin-bottom: 32px; }
.tabs {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border); margin-bottom: 20px;
    flex-wrap: wrap; gap: 8px; padding-bottom: 0;
}
.tab-group { display: flex; gap: 2px; }
.tab-actions { display: flex; gap: 8px; align-items: center; }
.tab {
    padding: 10px 18px; font-size: 13px; font-weight: 500;
    color: var(--text-muted); border-bottom: 2px solid transparent;
    transition: all 0.25s; margin-bottom: -1px;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* === Notes === */
.notes-list { display: flex; flex-direction: column; gap: 10px; }
.note-card {
    background: var(--bg-card); padding: 16px 20px;
    border-radius: var(--radius); border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    transition: all 0.25s;
}
.note-card:hover { background: var(--bg-card-hover); box-shadow: var(--shadow-sm); }
.note-card.pinned { border-left-color: var(--accent); background: var(--accent-soft); }
.note-card.resolved { opacity: 0.55; }
.note-card.resolved:hover { opacity: 0.75; }
.note-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.note-header-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.note-type {
    font-size: 10px; padding: 3px 10px; border-radius: 20px;
    font-weight: 700; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px;
}
.type-problem { background: var(--danger-soft); color: var(--danger); }
.type-idea { background: rgba(96,165,250,0.12); color: #60a5fa; }
.type-todo { background: var(--success-soft); color: var(--success); }
.type-link { background: var(--warning-soft); color: var(--warning); }
.type-general { background: rgba(148,163,184,0.1); color: var(--text-muted); }
.note-title {
    font-weight: 500; font-size: 14px; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note-title:hover { color: var(--accent); }
.note-actions { display: flex; gap: 4px; flex-shrink: 0; }
.note-preview { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-top: 8px; }
.note-meta { font-size: 12px; color: var(--text-muted); margin-top: 10px; font-weight: 500; }
.note-link { margin-top: 8px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.note-project { font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.pin-icon { font-size: 13px; }
.favicon { width: 16px; height: 16px; border-radius: 3px; }
.favicon-lg { width: 24px; height: 24px; border-radius: 4px; }
.note-images-preview { display: flex; gap: 8px; margin-top: 10px; }
.thumb {
    width: 56px; height: 56px; object-fit: cover;
    border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid var(--border); transition: all 0.2s;
}
.thumb:hover { transform: scale(1.08); box-shadow: var(--shadow-md); }
.more-images { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; font-weight: 500; }
.note-footer {
    display: flex; gap: 20px; font-size: 12px; color: var(--text-muted);
    margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); font-weight: 500;
}

/* === Link Card === */
.link-card {
    background: var(--bg-card); padding: 18px 22px;
    border-radius: var(--radius); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.link-url { font-weight: 600; font-size: 15px; }
.link-domain { font-size: 12px; color: var(--text-muted); }

/* === Knowledge === */
.knowledge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.knowledge-card {
    background: var(--bg-card); padding: 20px;
    border-radius: var(--radius); border: 1px solid var(--border);
    display: block; color: var(--text); transition: all 0.3s;
}
.knowledge-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--text); }
.knowledge-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.knowledge-card h3 { font-size: 15px; font-weight: 600; }
.knowledge-preview { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.knowledge-meta { font-size: 12px; color: var(--text-muted); margin-top: 10px; font-weight: 500; }
.category-badge {
    font-size: 11px; padding: 3px 10px; border-radius: 20px;
    background: var(--accent-soft); color: var(--accent); font-weight: 600;
}

/* === Markdown === */
.markdown-body { line-height: 1.75; font-size: 15px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.2em 0 0.5em; font-weight: 700; letter-spacing: -0.3px; }
.markdown-body p { margin-bottom: 0.8em; }
.markdown-body pre {
    background: var(--bg); padding: 18px; border-radius: var(--radius-sm);
    overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--border);
}
.markdown-body code { font-family: 'JetBrains Mono', monospace; font-size: 0.88em; }
.markdown-body :not(pre) > code { background: var(--accent-soft); color: var(--accent); padding: 2px 7px; border-radius: 5px; }
.markdown-body blockquote { border-left: 3px solid var(--accent); padding-left: 18px; color: var(--text-secondary); margin: 1em 0; font-style: italic; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.markdown-body th, .markdown-body td { padding: 10px 14px; border: 1px solid var(--border); }
.markdown-body th { background: var(--bg-elevated); font-weight: 600; }
.markdown-body img { border-radius: var(--radius-sm); }
.markdown-body ul, .markdown-body ol { padding-left: 2em; margin-bottom: 0.8em; }
.content-body {
    background: var(--bg-card); padding: 28px; border-radius: var(--radius);
    border: 1px solid var(--border); margin-bottom: 24px; position: relative;
}
.project-description { background: var(--bg-card); padding: 18px; border-radius: var(--radius); margin-bottom: 22px; font-size: 14px; border: 1px solid var(--border); }

/* === Image Gallery === */
.image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery-item img {
    width: 100%; height: 180px; object-fit: cover;
    border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border);
    transition: all 0.3s;
}
.gallery-item img:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.image-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.image-item { position: relative; }
.image-item .btn { position: absolute; top: 4px; right: 4px; }
.image-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92); z-index: 1000;
    display: none; align-items: center; justify-content: center; cursor: pointer;
    backdrop-filter: blur(8px); animation: fadeIn 0.2s;
}
.image-overlay.active { display: flex; }
.image-overlay img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* === Activity / Timeline === */
.section { margin-top: 36px; }
.section h2, .section h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.2px; }
.activity-list { position: relative; padding-left: 22px; }
.activity-list::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); border-radius: 1px; }
.activity-item { display: flex; gap: 14px; margin-bottom: 14px; position: relative; }
.activity-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); margin-top: 5px; flex-shrink: 0;
    position: relative; z-index: 1;
    box-shadow: 0 0 0 3px var(--bg);
}
.activity-content { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; line-height: 1.5; }
.activity-action { color: var(--text-muted); font-weight: 500; }
.activity-detail { color: var(--text); font-weight: 600; }
.activity-time { color: var(--text-muted); font-size: 12px; }
.activity-list.compact .activity-item { margin-bottom: 10px; }

/* === Forms === */
.form-card {
    background: var(--bg-card); padding: 28px;
    border-radius: var(--radius); border: 1px solid var(--border);
    max-width: 720px; box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.form-group .hint { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"],
.form-group input[type="url"], .form-group textarea, .form-group select {
    width: 100%; padding: 11px 14px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
    transition: all 0.25s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group textarea { resize: vertical; font-family: 'JetBrains Mono', monospace; min-height: 120px; }
.form-group input[type="color"] { width: 44px; height: 40px; padding: 3px; cursor: pointer; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.type-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.type-option { cursor: pointer; }
.type-option input { display: none; }
.type-option .type-label {
    padding: 8px 18px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); display: inline-block; transition: all 0.25s;
    font-weight: 500;
}
.type-option .type-label:hover { border-color: var(--accent); }
.type-option input:checked + .type-label { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.inline-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form-row input, .inline-form-row select { padding: 9px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 13px; }

/* === Color Picker === */
.color-picker { display: flex; align-items: flex-start; gap: 14px; }
.color-swatches { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; max-width: 360px; }
.color-swatch {
    width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
    border: 2px solid transparent; transition: all 0.2s;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0,0,0,0.3); transform: scale(1.1); }

/* === Table === */
.table-container { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table th { font-weight: 600; color: var(--text-muted); background: var(--bg-elevated); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.data-table tr:hover td { background: var(--bg-card-hover); }
.table-input { padding: 7px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 13px; width: 100%; transition: border-color 0.2s; }
.table-input:focus { outline: none; border-color: var(--accent); }
.actions-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer; border: none;
    transition: all 0.25s; text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #a78bfa); color: #fff; box-shadow: 0 2px 8px rgba(124,106,255,0.25); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(124,106,255,0.35); color: #fff; transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ef4444; color: #fff; box-shadow: 0 2px 8px rgba(248,113,113,0.3); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text); border-color: var(--accent); }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: var(--radius-xs); }

/* === Alerts === */
.alert { padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }

/* === Login === */
.auth-main {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; width: 100%;
    background: linear-gradient(135deg, #0f1117 0%, #1a1040 50%, #0f1117 100%);
    position: relative;
}
.auth-main::before {
    content: ''; position: absolute; top: 20%; left: 50%; transform: translate(-50%, -50%);
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(124,106,255,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.login-container { width: 100%; max-width: 420px; padding: 20px; position: relative; z-index: 1; }
.login-card {
    background: rgba(26,28,43,0.9); padding: 44px;
    border-radius: 20px; border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px); box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.login-logo { text-align: center; margin-bottom: 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-logo h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: #fff; }
.login-tagline { font-size: 13px; color: rgba(255,255,255,0.65); letter-spacing: 0.5px; margin-top: -4px; }
.login-form { margin-top: 28px; }
.login-form .form-group { margin-bottom: 18px; }
.login-form .form-group label { color: rgba(255,255,255,0.6); }
.login-form .form-group input { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: #fff; }
.login-form .form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-lang { text-align: center; margin-top: 24px; font-size: 13px; color: rgba(255,255,255,0.4); }
.login-lang a { color: rgba(255,255,255,0.5); }
.login-lang a:hover { color: #fff; }

/* === Empty State === */
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-state p { font-size: 15px; font-weight: 500; }
.empty-state::before {
    content: ''; display: block; width: 64px; height: 64px; margin: 0 auto 16px;
    background: var(--accent-soft); border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%237c6aff' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
    background-size: 28px; background-repeat: no-repeat; background-position: center;
}

/* === Pagination === */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 28px; padding: 16px 0; }
.page-btn {
    width: 34px; height: 34px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600;
    color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border);
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === Copy Button === */
.content-copy-btn { float: right; margin-left: 8px; }

/* === Batch Mode === */
.batch-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }
#toggleBatchBtn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.batch-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px; background: var(--accent-soft);
    border: 1px solid var(--accent); border-radius: var(--radius);
    margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
    animation: slideDown 0.2s;
}
.batch-toolbar-left, .batch-toolbar-right { display: flex; align-items: center; gap: 8px; }
.batch-info { font-size: 13px; color: var(--accent); margin-left: 4px; font-weight: 600; }

/* === Structure === */
.structure-graph { width: 100%; height: 450px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.structure-legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    padding: 14px 18px; margin-top: 10px;
    background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.legend-line { display: inline-block; width: 24px; height: 0; border-top: 3px solid; border-radius: 2px; }
.structure-panel { margin-top: 20px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; }
.structure-panel .section { margin-bottom: 20px; }
.structure-panel .section:last-child { margin-bottom: 0; }
.links-list { display: flex; flex-direction: column; gap: 8px; }
.link-arrow { font-size: 18px; color: var(--text-muted); padding: 0 4px; }
.link-arrow-sm { font-size: 14px; color: var(--text-muted); padding: 0 4px; }
.link-from, .link-to { font-weight: 600; font-size: 14px; }
.linked-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--bg-elevated);
    border-radius: var(--radius-sm); font-size: 13px; flex-wrap: wrap;
    border: 1px solid var(--border);
}
.link-desc { font-size: 12px; color: var(--text-muted); }
.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form select { padding: 7px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 13px; flex: 1; }

/* === Link Form & Types === */
.link-form { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.link-form-row { display: flex; gap: 8px; }
.link-form-row input, .link-form-row select { padding: 8px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 13px; flex: 1; }
.link-form-row input:focus, .link-form-row select:focus { border-color: var(--accent); outline: none; }
.link-type-badge { font-size: 10px; padding: 3px 8px; border-radius: 20px; font-weight: 700; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }
.lt-related { background: rgba(148,163,184,0.1); color: #94a3b8; }
.lt-shared_db { background: rgba(96,165,250,0.12); color: #60a5fa; }
.lt-saas_bundle { background: var(--warning-soft); color: var(--warning); }
.lt-api_dependency { background: rgba(167,139,250,0.12); color: #a78bfa; }
.lt-shared_auth { background: var(--success-soft); color: var(--success); }
.lt-microservice { background: var(--danger-soft); color: var(--danger); }
.link-pricing { font-size: 11px; color: var(--warning); background: var(--warning-soft); padding: 3px 8px; border-radius: 20px; font-weight: 600; }

/* === Fixed 3-col Project Grid === */
.project-grid-fixed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.project-card { position: relative; overflow: hidden; }
.project-card::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 4px; background: var(--card-color, var(--accent)); }
.project-card-top { position: absolute; top: 10px; right: 10px; z-index: 2; }
.project-card-body { display: block; padding: 20px 22px; color: var(--text); }
.project-card-body:hover { color: var(--text); }
.pin-toggle {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xs);
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 13px; opacity: 0.4; transition: all 0.2s;
}
.pin-toggle:hover { opacity: 0.8; }
.pin-toggle.active { opacity: 1; background: var(--accent-soft); border-color: var(--accent); }

/* === Progress Bar === */
.progress-bar-wrap {
    position: relative; height: 6px; background: var(--border);
    border-radius: 3px; margin: 12px 0 4px; overflow: hidden;
}
.progress-bar {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    transition: width 0.5s ease;
}
.progress-text { font-size: 11px; color: var(--accent); font-weight: 700; position: absolute; right: 0; top: -16px; }

/* === Progress Slider === */
.progress-slider-wrap { padding: 4px 0; }
.progress-slider-wrap input[type="range"] {
    width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
    background: var(--border); border-radius: 3px; outline: none;
}
.progress-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent); cursor: pointer; box-shadow: 0 2px 8px rgba(124,106,255,0.3);
}
.progress-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }

/* === Notes Grid (3 columns) === */
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.note-card {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); border-top: 3px solid var(--note-color, var(--border));
    transition: all 0.25s; display: flex; flex-direction: column;
}
.note-card:hover { background: var(--bg-card-hover); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.note-card.pinned { border-top-color: var(--accent); background: var(--accent-soft); }
.note-card.resolved { opacity: 0.5; }
.note-card-top { display: flex; align-items: center; gap: 6px; padding: 12px 16px 0; }
.note-card-top .pin-badge { margin-left: auto; }
.note-card-content { display: block; padding: 10px 16px; flex: 1; color: var(--text); }
.note-card-content p { font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.note-card-content:hover { color: var(--text); }
.note-card-content:hover p { color: var(--text); }
.note-card-footer { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 12px; }
.note-card-footer .note-meta { font-size: 11px; }

/* === Flash Messages === */
.flash-msg {
    padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
}
.flash-success { background: var(--success-soft); color: var(--success); }
.flash-error { background: var(--danger-soft); color: var(--danger); }

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .content { padding: 16px; }
    .top-bar { padding: 12px 16px; }
    .project-grid-fixed, .project-grid, .project-grid.cols-3, .project-grid.cols-6, .project-grid.cols-9 { grid-template-columns: minmax(0, 1fr); }
    .project-card { min-width: 0; }
    .project-card h3, .project-desc { overflow-wrap: anywhere; word-break: break-word; }
    .project-meta { gap: 8px; flex-wrap: wrap; }
    .notes-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
    .tabs { flex-direction: column; align-items: flex-start; }
    .inline-form-row { flex-direction: column; }
    .stats-row { grid-template-columns: 1fr; }
    .batch-toolbar { flex-direction: column; align-items: flex-start; }
    .color-swatches { grid-template-columns: repeat(5, 1fr); }
}

/* === Priority list view (horizontal rows with drag-to-reorder) === */
.drag-handle {
    width: 28px; height: 28px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted); background: var(--bg-elevated);
    border: 1px solid var(--border); cursor: grab;
    font-size: 13px; line-height: 1; user-select: none;
    flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }

/* Force single-column list layout + row cards + auto-numbering */
.notes-grid.priority-list {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px;
    counter-reset: note-order;
    width: 100%; max-width: 100%; min-width: 0;
}
.notes-grid.priority-list .note-card {
    counter-increment: note-order;
    flex-direction: row; align-items: center;
    padding: 8px 12px; gap: 10px; min-height: 50px;
    border-top: 1px solid var(--border);
    border-left: 4px solid var(--note-color, var(--border));
    position: relative;
    min-width: 0; overflow: hidden;
    touch-action: pan-y;
}
.notes-grid.priority-list .note-card:hover { transform: none; background: var(--bg-card-hover); }
.notes-grid.priority-list .note-card::before {
    content: counter(note-order);
    flex-shrink: 0;
    min-width: 30px; height: 30px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff;
    font-weight: 700; font-size: 13px; border-radius: 999px;
}
.notes-grid.priority-list .note-card:hover .drag-handle {
    color: var(--accent); border-color: var(--accent);
}

/* In list mode hide the stacked top bar, link preview, image preview;
   keep content + footer inline */
.notes-grid.priority-list .note-card-top,
.notes-grid.priority-list .note-link,
.notes-grid.priority-list .note-images-preview { display: none; }
.notes-grid.priority-list .note-card-content {
    padding: 0; flex: 1; min-width: 0; display: flex; align-items: center;
}
.notes-grid.priority-list .note-card-content p {
    margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 13px; line-height: 1.5; width: 100%;
}
.notes-grid.priority-list .reorder-type {
    display: inline-flex; font-size: 11px; padding: 2px 8px;
    border-radius: 999px; background: var(--bg-elevated);
    color: var(--text-secondary); flex-shrink: 0;
    border: 1px solid var(--border); white-space: nowrap;
}
.notes-grid.priority-list .note-card.pinned .reorder-type::before {
    content: '📌 '; margin-right: 2px;
}
.notes-grid.priority-list .note-card-footer {
    padding: 0; flex-shrink: 0; gap: 4px; width: auto;
}
.notes-grid.priority-list .note-card-footer .note-meta { display: none; }
.notes-grid.priority-list .note-card-footer .note-actions { gap: 2px; flex-wrap: nowrap; }

/* drag handle should not pan-scroll the page when dragging on touch */
.notes-grid.priority-list .drag-handle { touch-action: none; }

/* drag states */
.note-card.dragging { opacity: 0.5; box-shadow: var(--shadow-md); }
.notes-grid.priority-list .note-card.drop-placeholder {
    background: var(--accent-soft); border-style: dashed;
    visibility: hidden;
}

.reorder-hint {
    font-size: 12px; color: var(--text-muted);
    padding: 8px 12px; margin: 8px 0;
    background: var(--accent-soft); border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 10px;
}
.reorder-status { font-weight: 600; }
.reorder-status.ok { color: var(--success); }
.reorder-status.err { color: var(--danger); }

/* === DayBiz note: Framework / Pitch / Causal UI === */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 28px; font-weight: 700; }
.page-subtitle { color: var(--text-secondary); margin-top: 4px; }
/* DayBiz note 文字型返回連結（覆蓋既有 36x36 方塊版本） */
.framework-detail .back-link,
.framework-detail-head .back-link,
.gf-header .back-link,
.guided-framework .back-link,
.pitch-toolbar .back-link,
.page-header .back-link {
    width: auto;
    height: auto;
    display: inline-flex;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
}
.framework-detail .back-link:hover,
.framework-detail-head .back-link:hover,
.gf-header .back-link:hover,
.guided-framework .back-link:hover,
.pitch-toolbar .back-link:hover,
.page-header .back-link:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.framework-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.framework-tabs .tab { padding: 8px 18px; border-radius: 999px; background: var(--bg-card); color: var(--text-secondary); text-decoration: none; font-size: 14px; border: 1px solid var(--border); transition: all 0.15s; }
.framework-tabs .tab:hover { background: var(--bg-card-hover); color: var(--text); }
.framework-tabs .tab.active { background: var(--accent); color: white; border-color: var(--accent); }

.framework-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.framework-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--accent, #7c6aff); border-radius: 12px; padding: 18px; text-decoration: none; color: var(--text); transition: transform 0.15s, box-shadow 0.15s; display: flex; flex-direction: column; gap: 8px; }
.framework-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.framework-card-head { display: flex; justify-content: space-between; align-items: center; }
.framework-icon { font-size: 28px; }
.framework-cat-tag { font-size: 11px; padding: 3px 8px; background: var(--bg-input); border-radius: 999px; color: var(--text-muted); }
.framework-card h3 { font-size: 16px; font-weight: 600; }
.framework-en { font-size: 11px; color: var(--text-muted); margin-top: -4px; }
.framework-summary { font-size: 13px; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.framework-card-footer { margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.framework-card-footer small { display: block; margin-top: 4px; }

.progress-bar { height: 6px; background: var(--border-light); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.3s; border-radius: 999px; }
.progress-bar.large { height: 10px; }

.framework-detail { max-width: 800px; margin: 0 auto; }
.framework-detail-head { margin-bottom: 24px; }
.framework-icon-lg { font-size: 36px; vertical-align: middle; }
.framework-en-lg { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.framework-info-card { background: var(--bg-card); border-radius: 12px; padding: 20px; margin-bottom: 24px; border: 1px solid var(--border); line-height: 1.7; }
.framework-info-card p { margin: 6px 0; }
.framework-actions { background: var(--bg-card); padding: 20px; border-radius: 12px; margin-bottom: 24px; border: 1px solid var(--border); }
.framework-start-form { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.framework-start-form input[type=text] { flex: 1; min-width: 200px; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }

.framework-instances h3 { margin-bottom: 12px; }
.instance-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.instance-row .instance-card { flex: 1; margin-bottom: 0; }
.instance-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; text-decoration: none; color: var(--text); transition: background 0.15s; }
.instance-card:hover { background: var(--bg-card-hover); }
.instance-info strong { display: block; }
.instance-info small { color: var(--text-muted); font-size: 11px; }
.instance-progress { flex: 0 0 200px; }
.instance-progress small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 11px; text-align: right; }
.instance-actions { display: flex; gap: 4px; }
.instance-rename { flex: 1; display: flex; gap: 6px; align-items: center; padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.instance-rename input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg2, var(--bg-card)); color: var(--text); font-size: 14px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; transition: all 0.15s; padding: 0; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.icon-btn-danger:hover { background: rgba(220, 53, 69, 0.12); color: #dc3545; border-color: #dc3545; }
.gf-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gf-title-row h1 { flex: 1; min-width: 0; }
.gf-title-actions { display: flex; gap: 6px; flex-shrink: 0; }
.gf-rename { display: flex; gap: 6px; align-items: center; margin: 0 0 14px; }
.gf-rename input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text); font-size: 18px; font-weight: 600; }

/* Guided framework breakthrough cards */
.guided-framework { max-width: 800px; margin: 0 auto; }
.gf-header { margin-bottom: 28px; }
.gf-header .back-link {
    font-size: 14px;
    padding: 6px 12px 6px 8px;
    margin: 0 0 14px -8px;
    gap: 4px;
}
.gf-header h1 { font-size: 28px; margin: 0 0 14px; line-height: 1.25; }
.gf-progress-row { display: flex; align-items: center; gap: 16px; }
.gf-progress-row .progress-bar { flex: 1; }
.gf-progress-text { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.gf-warning { margin-top: 14px; padding: 12px 16px; background: var(--warning-soft); border-left: 3px solid var(--warning); border-radius: 6px; font-size: 13px; }

.gf-stack { display: flex; flex-direction: column; gap: 14px; }
.gf-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--step-color, var(--accent)); border-radius: 12px; padding: 18px 22px; transition: opacity 0.2s; }
.gf-card.locked { opacity: 0.45; }
.gf-card.completed { background: var(--bg-card); border-left-color: var(--success); }
.gf-card.active { box-shadow: 0 0 0 2px var(--accent-soft); }
.gf-card-head { display: flex; align-items: center; gap: 12px; }
.gf-step-number { width: 30px; height: 30px; border-radius: 999px; background: var(--accent); color: white; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.gf-card.completed .gf-step-number { background: var(--success); }
.gf-card-head h3 { flex: 1; font-size: 17px; }
.gf-card-status { font-size: 18px; color: var(--success); }
.gf-card-status.locked { color: var(--text-muted); }
.gf-card-body { margin-top: 14px; }
.gf-explainer { color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; }
.gf-prompts { background: var(--bg-input); border-radius: 8px; padding: 12px 18px 12px 36px; font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.gf-prompts li { margin: 4px 0; }
.gf-examples { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.gf-input textarea { width: 100%; padding: 12px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: 14px; resize: vertical; }
.gf-input textarea:focus { outline: none; border-color: var(--accent); }
.gf-radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.gf-radio-pill { display: flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 14px; }
.gf-radio-pill input { accent-color: var(--accent); }
.gf-radio-pill:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.gf-checklist { display: flex; flex-direction: column; gap: 8px; }
.gf-check { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-input); border-radius: 8px; cursor: pointer; font-size: 14px; }
.gf-check input { accent-color: var(--accent); width: 18px; height: 18px; }
.gf-computed-result { padding: 14px 18px; background: linear-gradient(135deg, var(--accent-soft), transparent); border-radius: 8px; font-size: 15px; font-weight: 600; white-space: pre-wrap; }
.gf-actions { display: flex; gap: 10px; margin-top: 14px; }
.gf-locked-hint { padding: 8px; color: var(--text-muted); font-size: 13px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 9px 18px; border-radius: 8px; cursor: pointer; }
.btn-ghost:hover { background: var(--bg-card-hover); }

.gf-celebration { margin-top: 32px; padding: 32px; background: linear-gradient(135deg, var(--accent), var(--accent-hover)); border-radius: 16px; color: white; text-align: center; }
.gf-celebration h2 { font-size: 28px; margin-bottom: 12px; }
.gf-celebration p { font-size: 15px; line-height: 1.6; opacity: 0.95; }
.gf-celebration .gf-next { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gf-celebration .btn-ghost { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: white; }
.gf-celebration .btn-ghost:hover { background: rgba(255,255,255,0.25); }

/* Pitch */
.pitch-actions { margin-bottom: 24px; }
.pitch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pitch-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); transition: background 0.15s; }
.pitch-card:hover { background: var(--bg-card-hover); }
.pitch-card small { color: var(--text-muted); font-size: 11px; }
.pitch-snippet { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.pitch-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.pitch-render { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 32px 40px; line-height: 1.8; max-width: 800px; }
.pitch-render h1 { font-size: 26px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); margin-bottom: 16px; }
.pitch-render h2 { font-size: 19px; color: var(--accent); margin-top: 24px; }
.pitch-render h3 { font-size: 15px; margin-top: 14px; }
.pitch-render blockquote { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 10px 16px; margin: 12px 0; }
.empty-state { color: var(--text-muted); padding: 32px; text-align: center; background: var(--bg-card); border: 1px dashed var(--border); border-radius: 12px; }
