@import url("base.css");

/* ==========================================================================
   Public marketing site + user dashboard shared chrome.
   ========================================================================== */

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Site header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  min-width: 0;
}

.brand-stacked {
  min-width: 0;
}
.brand-stacked .brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.brand-stacked .brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-stacked .brand-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }

@media (min-width: 860px) {
  .nav-links { display: flex; }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-toggle {
  display: inline-flex;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}
@media (min-width: 860px) { .nav-toggle { display: none; } }

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  padding: 10px 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.nav-mobile a:hover { background: var(--surface-soft); color: var(--text); }
@media (min-width: 860px) { .nav-mobile { display: none !important; } }

/* ---------- Hero ---------- */

.hero {
  padding: 88px 24px 70px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  animation: badge-glow 3s ease-in-out infinite;
}
.hero-badge svg { animation: sparkle-spin 5s linear infinite; transform-origin: center; }

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { box-shadow: 0 0 14px 2px color-mix(in srgb, var(--accent) 25%, transparent); }
}
@keyframes sparkle-spin {
  0%, 92% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-badge, .hero-badge svg { animation: none; }
}

.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.1;
  max-width: 18ch;
  margin: 0 auto 20px;
}

.hero h1 .grad {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 auto 34px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 46px;
}

.hero-ctas .btn { padding: 13px 26px; font-size: 15px; }

.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-faint);
  font-weight: 600;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }

.hero-visual {
  max-width: 920px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 8px;
  overflow: hidden;
  transition: var(--theme-transition);
}

.hero-visual-inner {
  border-radius: calc(var(--radius-xl) - 8px);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface-soft));
  padding: 46px 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.hero-visual-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  animation: card-rise .6s cubic-bezier(.2,.7,.3,1) forwards;
  display: flex;
  flex-direction: column;
  min-height: 150px;
}
.hero-visual-card:nth-child(1) { animation-delay: .05s; }
.hero-visual-card:nth-child(2) { animation-delay: .2s; }
.hero-visual-card:nth-child(3) { animation-delay: .35s; }

.hv-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.hv-label svg { color: var(--accent); flex-shrink: 0; }

@keyframes card-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mini mockup 1: floor plan sketch that "draws" itself in a loop */
.mock-plan {
  width: 100%;
  flex: 1;
  color: var(--accent);
}
.plan-draw {
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  stroke-linecap: round;
  animation: plan-draw-line 3.2s ease-in-out infinite;
}
.plan-d2 { animation-delay: .5s; }
.plan-d3 { animation-delay: .8s; }
.plan-d4 { animation-delay: 1.1s; }
.plan-fade { opacity: 0; animation: plan-dot-fade 3.2s ease-in-out infinite; animation-delay: 1.6s; }

@keyframes plan-draw-line {
  0% { stroke-dashoffset: 620; opacity: .3; }
  35%, 85% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: .3; }
}
@keyframes plan-dot-fade {
  0%, 40% { opacity: 0; transform: scale(.3); }
  55%, 85% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.3); }
}

/* Mini mockup 2: a live-updating cost estimate bar chart */
.mock-chart {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  min-height: 74px;
}
.chart-bar {
  flex: 1;
  height: var(--h);
  border-radius: 4px 4px 1px 1px;
  background: var(--accent-gradient);
  transform-origin: bottom;
  animation: chart-grow 2.6s cubic-bezier(.34,1.2,.64,1) infinite;
  animation-delay: var(--d);
}
@keyframes chart-grow {
  0% { transform: scaleY(0); opacity: .5; }
  35%, 70% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0); opacity: .5; }
}

/* Mini mockup 3: a chat preview with a typing indicator */
.mock-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}
.mock-bubble {
  font-size: 11.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 88%;
  line-height: 1.4;
}
.mock-bubble.user {
  align-self: flex-end;
  background: var(--accent-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
  opacity: 0;
  animation: bubble-in .4s ease .3s forwards;
}
.mock-bubble.ai {
  align-self: flex-start;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  padding: 11px 13px;
  opacity: 0;
  animation: bubble-in .4s ease 1s forwards;
}
.mock-bubble.ai span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: typing-bounce 1.1s ease-in-out infinite;
}
.mock-bubble.ai span:nth-child(2) { animation-delay: .15s; }
.mock-bubble.ai span:nth-child(3) { animation-delay: .3s; }

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual-card { opacity: 1; animation: none; }
  .plan-draw { stroke-dashoffset: 0; opacity: 1; animation: none; }
  .plan-fade { opacity: 1; transform: none; animation: none; }
  .chart-bar { transform: scaleY(1); opacity: 1; animation: none; }
  .mock-bubble.user, .mock-bubble.ai { opacity: 1; transform: none; animation: none; }
  .mock-bubble.ai span { animation: none; opacity: 1; }
}

@media (max-width: 640px) {
  .hero-visual-inner { grid-template-columns: 1fr 1fr; }
}

/* ---------- Section shell ---------- */

.section { padding: 70px 24px; }
.section-tight { padding: 40px 24px; }

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 46px;
}
.section-head h2 { font-size: clamp(24px, 3.2vw, 34px); margin: 10px 0 12px; }
.section-head p { color: var(--text-muted); font-size: 15px; margin: 0; }

/* ---------- Feature grid (10 tools) ---------- */

.feature-grid {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 980px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 24px color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.feature-card h3 { font-size: 15.5px; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.55; }
.feature-card .credit-tag {
  display: inline-flex;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Comparison table ---------- */

.compare-wrap {
  max-width: 980px;
  margin: 0 auto;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--surface);
}

.compare-table th, .compare-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.compare-table thead th {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-soft);
  white-space: nowrap;
}

.compare-row-label {
  text-align: left !important;
  font-weight: 600;
  color: var(--text);
  min-width: 220px;
}
thead .compare-row-label { background: var(--surface-soft); }

.compare-featured-col {
  background: var(--accent-soft);
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--accent) 25%, transparent), inset -1px 0 0 color-mix(in srgb, var(--accent) 25%, transparent);
  font-weight: 700;
  color: var(--accent);
}
.compare-table thead th.compare-featured-col {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.compare-table tbody tr:last-child .compare-featured-col {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.compare-check { color: var(--accent); }
.compare-x { color: var(--text-faint); }
.compare-table svg { display: inline-block; vertical-align: middle; }

.compare-disclaimer {
  text-align: center;
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-faint);
  max-width: 640px;
  margin: 18px auto 0;
}

@media (max-width: 700px) {
  .compare-row-label { min-width: 160px; }
}

/* ---------- Steps ---------- */

.steps {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

.step {
  text-align: left;
  position: relative;
}
.step .step-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: var(--shadow-glow);
}
.step h3 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ---------- Testimonials ---------- */

.testimonials {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 860px) { .testimonials { grid-template-columns: 1fr; } }

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.testimonial-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
  box-shadow: var(--shadow);
}
.testimonial-card p.quote {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 18px;
}
.testimonial-person {
  display: flex;
  align-items: center;
  gap: 10px;
}
.testimonial-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.testimonial-person .name { font-size: 13.5px; font-weight: 700; }
.testimonial-person .role { font-size: 12px; color: var(--text-muted); }

/* ---------- CTA banner ---------- */

.cta-banner {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--accent-gradient-wide);
  background-size: 200% auto;
  animation: gradient-flow 8s ease infinite;
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at 15% 20%, rgba(255,255,255,.16), transparent 60%);
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 10px; }
.cta-banner p { opacity: .92; margin: 0 0 26px; font-size: 14.5px; }
.cta-banner .btn-primary { background: #fff; color: var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.cta-banner .btn-primary:hover { transform: translateY(-1px); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 50px 24px 26px;
  margin-top: 20px;
}
.footer-grid {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 36px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

.footer-brand p { font-size: 13px; color: var(--text-muted); margin: 12px 0 0; max-width: 32ch; }
.footer-col h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 13.5px; color: var(--text-muted); }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  max-width: 1160px;
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- Page header (about/contact/pricing) ---------- */

.page-header {
  padding: 56px 24px 20px;
  text-align: center;
}
.page-header h1 { font-size: clamp(26px, 4vw, 40px); margin: 10px 0 12px; }
.page-header p { color: var(--text-muted); max-width: 56ch; margin: 0 auto; font-size: 15px; }

/* ---------- Pricing ---------- */

.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin: 24px auto 0;
}
.billing-toggle button {
  border: none;
  background: transparent;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.billing-toggle button.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.plans-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.plans-grid.has-free {
  max-width: 1320px;
  grid-template-columns: repeat(4, 1fr);
}
.plans-grid.plans-grid-wide { max-width: none; margin-bottom: 36px; }
@media (max-width: 860px) { .plans-grid { grid-template-columns: 1fr; max-width: 420px; } }
@media (max-width: 1100px) { .plans-grid.has-free { grid-template-columns: repeat(2, 1fr); max-width: 700px; } }
@media (max-width: 640px) { .plans-grid.has-free { grid-template-columns: 1fr; max-width: 420px; } }

.plan-card.free { border-style: dashed; }
.plan-card.free .plan-price span { color: var(--text-muted); }

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.plan-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: scale(1.02);
}
.plan-card .plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-glow);
}
.plan-card h3 { font-size: 17px; margin-bottom: 6px; }
.plan-card .plan-price { font-family: var(--font-display); font-size: 38px; font-weight: 800; margin: 14px 0 2px; }
.plan-card .plan-price span { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.plan-card .plan-credits { font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 18px; }
.plan-card .plan-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan-card li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.plan-card li svg { flex-shrink: 0; margin-top: 2px; color: var(--success); }

/* ---------- Contact ---------- */

.contact-layout {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 30px;
}
@media (max-width: 780px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-info-card {
  padding: 26px;
  height: fit-content;
}
.contact-info-card .info-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.contact-info-card .info-row:last-child { margin-bottom: 0; }
.contact-info-card .info-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-info-card .info-row h4 { font-size: 13.5px; margin-bottom: 2px; }
.contact-info-card .info-row p { font-size: 13px; color: var(--text-muted); margin: 0; }

.contact-form-card { padding: 28px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .contact-form .row-2 { grid-template-columns: 1fr; } }

/* ---------- Generic page content (about) ---------- */

.prose {
  max-width: 760px;
  margin: 0 auto;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.8;
}
.prose h2 { color: var(--text); font-size: 20px; margin: 30px 0 12px; }
.prose p { margin: 0 0 16px; }

.values-grid {
  max-width: 900px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 700px) { .values-grid { grid-template-columns: 1fr; } }
.value-card { padding: 22px; text-align: center; }
.value-card .feature-icon { margin: 0 auto 14px; }
.value-card h3 { font-size: 14.5px; margin-bottom: 6px; }
.value-card p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ==========================================================================
   Logged-in app shell (user dashboard + tools). Admin has its own variant
   in admin.css but shares these same tokens via base.css.
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
}

.app-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 49;
  }
  .sidebar-backdrop.open { display: block; }
}

.app-sidebar .brand {
  padding: 6px 10px 20px;
}

.admin-return-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 16px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  transition: background .15s, transform .15s;
}
.admin-return-link:hover { transform: translateX(-2px); background: color-mix(in srgb, var(--accent) 16%, var(--accent-soft)); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.sidebar-nav a svg { flex-shrink: 0; opacity: .85; }
.sidebar-nav a:hover { background: var(--surface-soft); color: var(--text); }
.sidebar-nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 16px 12px 6px;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 10px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.sidebar-user-email { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.sidebar-logout {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  padding: 9px 12px; border-radius: var(--radius-sm); margin-top: 4px;
}
.sidebar-logout:hover { background: var(--danger-soft); color: var(--danger); }

.app-main { min-width: 0; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.app-topbar h1 { font-size: 18px; }

.topbar-left { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle {
  display: inline-flex; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px; cursor: pointer; color: var(--text);
}
@media (min-width: 901px) { .sidebar-toggle { display: none; } }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.credit-pill.low { background: var(--warning-soft); color: var(--warning); }
.credit-pill.zero { background: var(--danger-soft); color: var(--danger); }

.app-content { padding: 28px; }
@media (max-width: 560px) { .app-content { padding: 18px; } }

/* ---------- Dashboard widgets ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

.stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-faint); }
.stat-card .stat-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}

.section-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title-row h2 { font-size: 16px; }
.section-title-row a { font-size: 12.5px; font-weight: 700; color: var(--accent); }

.tool-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}
@media (max-width: 1080px) { .tool-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .tool-tiles { grid-template-columns: repeat(2, 1fr); } }

.tool-tile {
  padding: 18px 16px;
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.tool-tile .feature-icon { width: 36px; height: 36px; margin-bottom: 10px; }
.tool-tile h3 { font-size: 13px; margin-bottom: 4px; line-height: 1.3; }
.tool-tile .credit-tag { margin-top: 8px; }

.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.activity-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.activity-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.activity-table tr:last-child td { border-bottom: none; }
.activity-table .tool-name { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.activity-table .tool-name .feature-icon { width: 28px; height: 28px; margin: 0; }

.empty-state {
  text-align: center;
  padding: 46px 24px;
}
.empty-state .feature-icon { margin: 0 auto 16px; width: 52px; height: 52px; border-radius: 16px; }
.empty-state h3 { font-size: 15px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-muted); margin: 0 0 18px; max-width: 40ch; margin-left: auto; margin-right: auto; }

/* ---------- Billing / checkout ---------- */

.checkout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.checkout-summary .plan-name { font-size: 15px; font-weight: 800; }
.checkout-summary .plan-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.checkout-summary .plan-price-tag { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--accent); }

.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.payment-method-card {
  position: relative;
  cursor: pointer;
}
.payment-method-card input { position: absolute; opacity: 0; }
.payment-method-card .pm-body {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  height: 100%;
  box-sizing: border-box;
}
.payment-method-card input:checked + .pm-body {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.pm-body .pm-name { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.pm-body .pm-hint { font-size: 12px; color: var(--text-muted); }

.account-details-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.7;
  margin-bottom: 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.upload-dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-dropzone:hover, .upload-dropzone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.upload-dropzone svg { color: var(--text-muted); margin-bottom: 8px; }
.upload-dropzone .uz-title { font-size: 13.5px; font-weight: 700; }
.upload-dropzone .uz-hint { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.upload-dropzone input[type=file] { display: none; }
.upload-preview { margin-top: 14px; display: none; align-items: center; gap: 10px; }
.upload-preview.show { display: flex; }
.upload-preview img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.upload-preview .uf-name { font-size: 12.5px; font-weight: 600; }
.upload-preview .uf-remove { font-size: 11.5px; color: var(--danger); cursor: pointer; background: none; border: none; padding: 0; }

.tx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tx-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tx-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.tx-table tr:last-child td { border-bottom: none; }
.tx-table .proof-link { font-size: 12px; font-weight: 700; color: var(--accent); }

/* ---------- Planner board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }

.board-col {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 160px;
  transition: background .15s, border-color .15s;
}
.board-col.drag-over { background: var(--accent-soft); border-color: var(--accent); }

.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.board-col-head h3 { font-size: 13px; font-weight: 700; }
.board-col-head .count {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 1px 8px; border-radius: 999px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.project-card:hover { box-shadow: var(--shadow); }
.project-card.dragging { opacity: .5; }
.project-card h4 { font-size: 13.5px; margin-bottom: 5px; }
.project-card p { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; max-height: 3em; overflow: hidden; }
.project-card .card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-faint); }

.board-empty-hint { font-size: 12px; color: var(--text-faint); text-align: center; padding: 18px 6px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,10,15,.5);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 26px;
}
.modal-box h3 { font-size: 16px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Project detail */
.project-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.project-detail-head h2 { font-size: 19px; margin-bottom: 4px; }
.project-detail-head p { color: var(--text-muted); font-size: 13px; margin: 0; max-width: 60ch; }

.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.gen-card { padding: 14px; }
.gen-card .gen-thumb {
  width: 100%; height: 120px; border-radius: 8px; overflow: hidden;
  background: var(--surface-soft); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px; color: var(--text-faint);
}
.gen-card .gen-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gen-card h4 { font-size: 12.5px; margin-bottom: 3px; }
.gen-card .gen-date { font-size: 11px; color: var(--text-faint); }

/* ---------- History table ---------- */

.history-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: flex-end; }
.history-filters .field { min-width: 160px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; }
.pagination a, .pagination span {
  min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border);
}
.pagination a:hover { background: var(--surface-soft); color: var(--text); }
.pagination .current { background: var(--accent-gradient); color: #fff; border-color: transparent; }
