/* ============================================
   OpenToad — account.css
   Shared UI for the Dashboard (profile/funds/contributions)
   and the Launch-a-project drafts workspace.
   ============================================ */

.page-head { padding: 2.5rem var(--content-pad) 0.5rem; max-width: var(--max-w); margin: 0 auto; }
.page-head p { max-width: 520px; margin-top: 0.4rem; }

/* --- Two-column dashboard layout: identity sidebar (left) + content (right),
   LinkedIn-style — the profile card itself carries enough context that a
   separate "Your profile" page heading above it is redundant, so the
   dashboard skips page-head entirely and starts straight into this layout. --- */
.dash-layout {
  display: flex; align-items: flex-start; gap: 1.75rem;
  max-width: var(--max-w); margin: 2rem auto 4rem; padding: 0 var(--content-pad);
}
.dash-sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1rem; }
.dash-main { flex: 1; min-width: 0; }

/* --- Profile card (sidebar, vertical) --- */
.profile-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 1.75rem 1.5rem;
}
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--forest); color: var(--lime);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.5rem;
}
.avatar-edit-btn {
  position: absolute; bottom: -2px; right: -2px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--wht); border: 1px solid var(--bdr);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: var(--inkm);
}
.profile-info h2 { font-size: 1.2rem; margin-top: 4px; margin-bottom: 4px; }
.profile-roles { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; justify-content: center; }
.profile-bio { font-size: 0.85rem; }
.profile-actions { width: 100%; }
.profile-actions .btn { width: 100%; justify-content: center; }

/* --- Inline edit form (profile + new idea) --- */
.edit-panel-inner { padding: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--inkm); }
.field label .req { color: var(--red); }
.field-hint { font-size: 0.74rem; color: var(--slate); margin-top: -2px; }
.field input, .field textarea, .field select {
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--bdr); border-radius: var(--r-md);
  background: var(--wht); color: var(--ink);
  resize: vertical; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--canopy); }
.field-row { display: grid; grid-template-columns: 1fr 110px; gap: 1rem; }
.field-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.upload-box {
  border: 1.5px dashed var(--bdr); border-radius: var(--r-md);
  padding: 1.5rem; text-align: center; color: var(--slate); font-size: 0.82rem;
  background: var(--surf);
}
.upload-box strong { color: var(--inkm); display: block; margin-bottom: 4px; font-size: 0.86rem; }

/* --- Stat tiles --- */
.stat-row-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat-tile {
  display: flex; flex-direction: column; gap: 8px;
  /* Grid items default to min-width:auto, which refuses to shrink below the
     content's natural size — that's what let long values like "$3,850.00"
     push past the card border. min-width:0 lets the tile (and the text
     inside it) actually respect the grid track it's been given. */
  min-width: 0;
}
.stat-label { font-family: 'DM Mono', monospace; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate); }
.stat-value {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--ink);
  line-height: 1.15;
  overflow-wrap: break-word; word-break: break-word;
}
.stat-tile .btn { align-self: flex-start; margin-top: 2px; }

/* Fluid type: the value's font-size scales down with the tile's own
   rendered width, so it never has to overflow or wrap awkwardly to fit —
   this is what actually delivers "shrink to fit the box." Falls back to
   the fixed 1.5rem above in browsers without container query support. */
@supports (container-type: inline-size) {
  .stat-tile { container-type: inline-size; }
  .stat-value { font-size: clamp(1.05rem, 10.5cqi, 1.5rem); }
}

/* --- Section tab-switcher --- */
/* overflow-x:auto so an extra tab (or a narrow phone) scrolls the tab
   strip horizontally instead of silently widening the whole page —
   flex-shrink:0 on each tab keeps them from getting squished instead. */
.section-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--bdr); margin-top: 2rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.section-tab {
  background: none; border: none; cursor: pointer; flex-shrink: 0;
  padding: 0.85rem 0.25rem; margin-right: 1.75rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 600; color: var(--slate);
  border-bottom: 2px solid transparent;
}
.section-tab.active { color: var(--forest); border-bottom-color: var(--forest); }
.section-panel { padding: 1.5rem 0 1rem; }

/* --- Cross-link between dashboard Projects tab and the Launch drafts workspace --- */
.drafts-nudge {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-top: 1.25rem; background: var(--dew);
}
.drafts-nudge p { color: var(--forest); font-size: 0.85rem; margin: 0; }

@media (max-width: 900px) {
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; position: static; }
  /* .dash-layout uses align-items:flex-start (needed on desktop so the
     sticky sidebar doesn't stretch to the main column's height) — but in
     column mode that same flex-start also lets .dash-main size to its
     widest unshrinkable content (the section-tabs row) instead of the
     viewport, which silently widened the whole page on phones. Pin it to
     the full column width here, where flex-direction is actually column. */
  .dash-main { width: 100%; }
  .idea-form-grid { grid-template-columns: 1fr; }
  .video-preview-frame { max-width: 320px; }
}

/* ============================================
   New idea: two-column creation panel
   (fields left, pitch video + editor right)
   ============================================ */
.idea-panel-head { display: flex; align-items: flex-start; gap: 0.85rem; margin-bottom: 1.5rem; }
.idea-panel-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--dew); color: var(--forest);
  display: flex; align-items: center; justify-content: center;
}
.idea-panel-head h3 { margin-bottom: 2px; }
.idea-panel-sub { font-size: 0.85rem; margin: 0; max-width: 520px; }

.btn-new-idea { display: inline-flex; align-items: center; gap: 6px; }

.idea-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; margin-bottom: 0.5rem; }
.idea-form-col .field:last-child { margin-bottom: 0; }

/* --- Video upload dropzone --- */
.upload-box-interactive {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast);
}
.upload-box-interactive svg { color: var(--slate); margin-bottom: 2px; }
.upload-box-interactive:hover, .upload-box-interactive.drag-over { border-color: var(--canopy); background: var(--dew); }
.upload-box-interactive span { max-width: 260px; }

/* --- Video preview + Insta/TikTok-style editor --- */
.video-editor[hidden] { display: none; }
.video-editor { display: flex; flex-direction: column; gap: 0.85rem; }
.video-preview-frame {
  position: relative; width: 100%; max-width: 260px; aspect-ratio: 9 / 16; margin: 0 auto;
  background: #111; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--bdr);
}
.video-preview-frame video { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter var(--t-fast); }
.video-replace-btn { align-self: center; }

.text-overlay-layer { position: absolute; inset: 0; pointer-events: none; }
.text-overlay {
  position: absolute; pointer-events: auto; cursor: grab; touch-action: none;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; text-align: center;
  padding: 2px 6px; max-width: 90%; word-wrap: break-word;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  outline: none; user-select: text;
}
.text-overlay.selected { outline: 1.5px dashed rgba(255,255,255,0.85); border-radius: 4px; }
.text-overlay:active { cursor: grabbing; }

.editor-tabs { display: flex; gap: 0.4rem; border-bottom: 1px solid var(--bdr); }
.editor-tab {
  background: none; border: none; cursor: pointer; padding: 0.5rem 0.15rem; margin-right: 1rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--slate);
  border-bottom: 2px solid transparent;
}
.editor-tab.active { color: var(--forest); border-bottom-color: var(--forest); }
.editor-panel { padding-top: 0.6rem; }

.filter-swatches { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.filter-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  font-size: 0.68rem; color: var(--inkm); padding: 2px;
}
.swatch-dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; display: block; }
.filter-swatch.active .swatch-dot { border-color: var(--forest); }
.filter-swatch.active { color: var(--forest); font-weight: 700; }

.text-style-row { display: flex; align-items: center; gap: 0.85rem; margin-top: 0.75rem; flex-wrap: wrap; }
.swatch-row { display: flex; gap: 6px; }
.color-dot { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--bdr); cursor: pointer; padding: 0; }
.color-dot.active { outline: 2px solid var(--forest); outline-offset: 2px; }

.trim-slider { position: relative; height: 26px; }
.trim-track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; border-radius: 2px; background: var(--bdr); transform: translateY(-50%); }
.trim-range { position: absolute; top: 50%; height: 4px; border-radius: 2px; background: var(--forest); transform: translateY(-50%); }
.trim-slider input[type="range"] {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 100%; margin: 0; background: none;
  -webkit-appearance: none; appearance: none; pointer-events: none;
}
.trim-slider input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 4px; }
.trim-slider input[type="range"]::-moz-range-track { background: transparent; height: 4px; }
.trim-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--wht); border: 2px solid var(--forest); cursor: pointer;
}
.trim-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 16px; height: 16px; border-radius: 50%;
  background: var(--wht); border: 2px solid var(--forest); cursor: pointer;
}
.trim-labels { display: flex; justify-content: space-between; font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--slate); }

/* --- "Tips for a great pitch" accordion --- */
.pitch-tips { border: 1px solid var(--bdr); border-radius: var(--r-md); margin-top: 1.5rem; overflow: hidden; }
.pitch-tips-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: var(--surf); border: none; cursor: pointer;
  padding: 0.85rem 1.1rem; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 700; color: var(--ink);
}
.pitch-tips-chevron { color: var(--slate); font-size: 1rem; }
.pitch-tips-body { padding: 0.25rem 1.1rem 1rem; }
.pitch-tips-body ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 6px; }
.pitch-tips-body li { font-size: 0.83rem; color: var(--inkm); line-height: 1.55; }

/* --- List rows (contributions / submissions) --- */
.list-row {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 0.75rem; flex-wrap: wrap;
}
.list-row-main { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 200px; }
.list-title { font-weight: 700; font-size: 0.92rem; }
.list-sub { font-size: 0.78rem; color: var(--slate); margin-top: 2px; }
.list-row-amount { font-family: 'DM Mono', monospace; font-weight: 600; color: var(--forest); min-width: 90px; text-align: right; }
.empty-note { color: var(--slate); font-size: 0.86rem; padding: 1rem 0; }

/* --- Draft / idea cards (Launch a project workspace) --- */
.drafts-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin: 1.75rem var(--content-pad) 0; max-width: var(--max-w); margin-left: auto; margin-right: auto;
  padding-left: var(--content-pad); padding-right: var(--content-pad); flex-wrap: wrap; gap: 1rem;
}
.drafts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem;
  margin: 1.5rem var(--content-pad) 4rem; max-width: var(--max-w); margin-left: auto; margin-right: auto;
  padding-left: var(--content-pad); padding-right: var(--content-pad);
}
.draft-card { display: flex; flex-direction: column; gap: 8px; }
.draft-title { font-size: 1.05rem; margin-top: 6px; }
.draft-pitch {
  font-size: 0.85rem; margin: 2px 0 4px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.draft-meta { font-size: 0.74rem; color: var(--slate); }
.draft-plan-link {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--inkm); text-decoration: none; margin-top: 2px;
}
.draft-plan-link:hover { color: var(--canopy); }
.draft-plan-link .pill { padding: 2px 8px; font-size: 0.68rem; }
.draft-actions { display: flex; gap: 0.6rem; margin-top: 6px; }
.pill-slate { background: #eef0eb; color: var(--stone); }

/* ============================================
   Idea plan page (business model / marketing / financials)
   ============================================ */
.plan-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--slate); text-decoration: none;
}
.plan-back-link:hover { color: var(--canopy); }
.plan-page-head { max-width: var(--max-w); margin: 1.5rem auto 0.5rem; padding: 0 var(--content-pad); }
.plan-page-head p { max-width: 560px; margin-top: 0.5rem; }
.plan-summary-note {
  display: flex; gap: 0.75rem; align-items: flex-start;
  max-width: var(--max-w); margin: 1.25rem auto 0; padding: 1rem 1.25rem;
  background: var(--dew); border-radius: var(--r-md);
}
.plan-summary-note p { color: var(--forest); font-size: 0.85rem; margin: 0; }

.plan-sections { display: flex; flex-direction: column; gap: 1rem; max-width: var(--max-w); margin: 1.5rem auto 2.5rem; padding: 0 var(--content-pad); }
.plan-section { padding: 0; overflow: hidden; }
.plan-section-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 1.25rem 1.5rem;
}
.plan-section-head h3 { margin-bottom: 4px; }
.plan-section-head p { font-size: 0.82rem; margin: 0; }
.plan-section-toggle-right { display: flex; align-items: center; gap: 0.85rem; flex-shrink: 0; }
.plan-section-chevron { color: var(--slate); font-size: 1.1rem; transition: transform var(--t-fast); }
.plan-section.open .plan-section-chevron { transform: rotate(180deg); }
.plan-section-body { padding: 0 1.5rem 1.5rem; }

.plan-save-bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  max-width: var(--max-w); margin: 0 auto 4rem; padding: 0 var(--content-pad);
}
.plan-save-confirm {
  font-size: 0.85rem; color: var(--forest); font-weight: 600;
  opacity: 0; transition: opacity var(--t-fast);
}
.plan-save-confirm.visible { opacity: 1; }

@media (max-width: 640px) {
  .plan-section-toggle { flex-wrap: wrap; }
}

/* --- Poll questions (business model / marketing / financials voting) --- */
.poll-question { margin-bottom: 1.5rem; }
.poll-question:last-of-type { margin-bottom: 0; }
.poll-question h4 { font-size: 0.92rem; margin-bottom: 0.65rem; }
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-option {
  position: relative; display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; background: var(--wht); border: 1px solid var(--bdr); border-radius: var(--r-md);
  padding: 0.65rem 0.9rem; cursor: pointer; font-family: 'DM Sans', sans-serif; overflow: hidden;
}
.poll-option-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--dew); z-index: 0; transition: width var(--t-fast); }
.poll-option-label, .poll-option-count, .poll-option-reason, .poll-option-leading-tag { position: relative; z-index: 1; }
.poll-option-label { flex: 1; font-size: 0.86rem; color: var(--ink); }
.poll-option-reason { font-size: 0.78rem; color: var(--slate); font-weight: 400; margin-left: 4px; }
.poll-option-count { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--slate); flex-shrink: 0; }
.poll-option.selected { border-color: var(--forest); }
.poll-option.selected .poll-option-label::before { content: "✓ "; color: var(--forest); }
.poll-option.leading .poll-option-fill { background: #d7ecd9; }
.poll-option-leading-tag { font-size: 0.64rem; font-weight: 700; color: var(--forest); text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }

.poll-add-option-btn { background: none; border: none; color: var(--canopy); font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 4px 0; margin-top: 4px; }
.poll-add-option-btn:hover { text-decoration: underline; }
.poll-add-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.poll-add-row input[type="text"], .poll-add-row input[type="number"] {
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem; padding: 0.5rem 0.7rem;
  border: 1px solid var(--bdr); border-radius: var(--r-sm); flex: 1; min-width: 140px;
}
.poll-add-row input[type="number"] { flex: 0 0 110px; min-width: 0; }

/* --- Financials: line items with an AI-suggested starting point + community estimates --- */
.finance-item { padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--bdr); }
.finance-item:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.finance-item h4 { font-size: 0.92rem; margin-bottom: 4px; }
.finance-ai-note { font-size: 0.78rem; color: var(--slate); margin: 0 0 0.75rem; }
.finance-ai-note strong { color: var(--inkm); }

.finance-total-card { margin-top: 1.25rem; background: var(--dew); border-radius: var(--r-md); padding: 1.1rem 1.25rem; }
.finance-total-row { display: flex; justify-content: space-between; font-size: 0.84rem; color: var(--forest); padding: 3px 0; }
.finance-total-row.grand { font-size: 1.05rem; font-weight: 700; border-top: 1px solid rgba(13,74,44,0.18); margin-top: 6px; padding-top: 8px; }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .list-row-amount { text-align: left; order: 3; width: 100%; }
  .idea-panel-head { flex-direction: column; }
  .video-preview-frame { max-width: 240px; }
  .editor-tab { margin-right: 0.65rem; }
}
