/*
  Dispute Letter Hero — PHP SaaS UI Kit (no build tools)
  ---------------------------------------------------------------------------
  Goals:
  - Visually rich marketing pages (gradient hero, cards, testimonials)
  - App shell (sidebar + topbar) for dashboard/admin
  - Simple auth layout
  - Mobile-first, consistent spacing system
*/

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.85);
  --text: #0f172a;
  --muted: #475569;
  --muted-2: #64748b;
  --border: rgba(2, 6, 23, 0.10);

  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --accent: #06b6d4;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;

  --shadow-sm: 0 6px 16px rgba(2, 6, 23, 0.06);
  --shadow-md: 0 18px 40px rgba(2, 6, 23, 0.10);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --container: 1120px;
  --g1: linear-gradient(135deg, #7c3aed 0%, #2563eb 50%, #06b6d4 100%);
  --g2: radial-gradient(1200px 420px at 12% 0%, rgba(124, 58, 237, 0.35), rgba(37, 99, 235, 0) 60%),
        radial-gradient(800px 360px at 80% 10%, rgba(6, 182, 212, 0.25), rgba(37, 99, 235, 0) 55%);
}

* { box-sizing: border-box; }

/* Ensure consistent button rendering across browsers */
button { font: inherit; }
button.btn { -webkit-appearance: none; appearance: none; }
button.btn::-moz-focus-inner { border: 0; padding: 0; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

/* Utilities */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 14px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }

.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

/* Admin tabs */
.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tabbar .tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.tabbar .tab.active {
  background: rgba(79,70,229,.14);
  border-color: rgba(79,70,229,.35);
  color: var(--primary);
}

/* Tables */
.table-wrap.no-x { overflow-x: hidden; }
.table-fixed { table-layout: fixed; }
.table-fixed th, .table-fixed td { vertical-align: top; }
.table-fixed td { white-space: normal; }

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  border-radius: 12px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:hover { background: #fff; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  min-height: 44px;
  line-height: 1;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--g1);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.16); }

.btn-soft {
  background: rgba(79, 70, 229, 0.10);
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--text);
}
.btn-soft:hover { background: rgba(79, 70, 229, 0.14); }

.btn-danger {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.25);
  color: #991b1b;
}

.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card.pad { padding: 18px; }

.card.soft {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
}

.card-title {
  margin: 0;
  font-size: 18px;
}

.kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.kpi strong { font-size: 24px; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid rgba(2,6,23,.06); }
th { color: #0f172a; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; background: rgba(2,6,23,.02); }
tr:hover td { background: rgba(79,70,229,.03); }

/* Forms */
label { font-weight: 700; font-size: 13px; color: #0f172a; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid rgba(2,6,23,.12);
  border-radius: 14px;
  font-size: 15px;
  background: rgba(255,255,255,.9);
  outline: none;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(79,70,229,.45);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}

.help { font-size: 13px; color: var(--muted-2); margin-top: 6px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 820px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Notices */
.notice {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
}
.notice.success { border-color: rgba(22,163,74,.25); background: rgba(22,163,74,.08); color: #065f46; }
.notice.error { border-color: rgba(220,38,38,.25); background: rgba(220,38,38,.08); color: #7f1d1d; }

/* ---------------------------------------------------------------------------
   MARKETING LAYOUT
--------------------------------------------------------------------------- */

.layout-marketing {
  background: var(--g2), #0b1020;
}

.layout-marketing .page-bg {
  background: var(--bg);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  margin-top: 14px;
  box-shadow: 0 -8px 24px rgba(2,6,23,.14);
}

.mkt-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 16, 32, 0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.mkt-nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
}

.brand img { height: 45px; width: auto; }

.mkt-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mkt-links a {
  color: rgba(255,255,255,.82);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 12px;
}

.mkt-links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.mkt-links a.active { background: rgba(255,255,255,.12); color: #fff; }

.mkt-actions { display: flex; align-items: center; gap: 10px; }

.mkt-menu { display: none; }

.mkt-panel {
  display: none;
}

@media (max-width: 920px) {
  .mkt-links { display: none; }
  .mkt-menu { display: inline-flex; }
  .mkt-panel {
    display: block;
    position: fixed;
    inset: 72px 0 auto 0;
    background: rgba(11,16,32,.88);
    border-bottom: 1px solid rgba(255,255,255,.10);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .mkt-panel[data-open="true"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .mkt-panel .container { padding: 18px 0 22px 0; }
  .mkt-panel a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin: 8px 0;
    border-radius: 14px;
    color: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    font-weight: 700;
  }
}

@media (max-width: 520px) {
  /* Give the logo enough room on very small screens */
  .mkt-actions .btn-secondary { display: none; }
  .mkt-actions .btn-primary { padding: 10px 12px; min-height: 40px; border-radius: 12px; }
  .brand { min-width: 0; }
  .brand img { height: 40px; max-width: 170px; }
  .mkt-nav { gap: 10px; }
}

/* ---------------------------------------------------------------------------
   BLOG
--------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   BLOG
--------------------------------------------------------------------------- */

/* Breadcrumbs appear on light cards, so force readable ink colors there */
.page-bg .breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: rgba(15,23,42,.68);
  margin: 0 0 14px 0;
}

.page-bg .breadcrumbs a {
  color: rgba(15,23,42,.86);
  text-decoration: none;
}

.page-bg .breadcrumbs a:hover {
  text-decoration: underline;
}

.page-bg .breadcrumbs .sep {
  opacity: .55;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* Card image */
.blog-card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(2,6,23,.08);
}

.blog-card {
  min-height: 260px;
}

/* Blog card meta (prevents awkward wrapping gaps under the image) */
.blog-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.blog-byline {
  color: var(--muted);
  font-size: 12px;
}

/* Category chip styling for light blog cards (does not affect dark-hero chips) */
.blog-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.22);
  background: rgba(79, 70, 229, 0.10);
  color: rgba(15, 23, 42, 0.92);
  font-weight: 600;
  font-size: 12px;
  width: fit-content;
}

.blog-category-chip svg {
  width: 14px;
  height: 14px;
  opacity: .9;
}

.blog-post .blog-post-content {
  color: var(--text);
  line-height: 1.7;
}

.blog-post .blog-post-content p {
  margin: 0 0 12px 0;
}

.blog-post .blog-post-content ul,
.blog-post .blog-post-content ol {
  margin: 0 0 12px 18px;
}

.blog-post .blog-post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-post .blog-post-content blockquote {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 3px solid rgba(79,70,229,.35);
  background: rgba(79,70,229,.06);
  border-radius: 12px;
}

.blog-post .blog-post-content pre {
  overflow: auto;
  padding: 12px 14px;
  background: rgba(2,6,23,.04);
  border: 1px solid rgba(2,6,23,.08);
  border-radius: 12px;
}

/* Featured image injected into post content */
.blog-featured-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(2,6,23,.08);
  margin: 0 0 14px 0;
}

@media (max-width: 980px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-card-image { height: 170px; }
}

@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-card-image { height: 180px; }
}


.mkt-hero {
  padding: 34px 0 26px 0;
  color: #fff;
}

.mkt-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 26px;
  align-items: center;
}

.mkt-hero h1 {
  margin: 12px 0 10px 0;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.mkt-hero p {
  margin: 0;
  font-size: 18px;
  color: rgba(255,255,255,.85);
}

.hero-card {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.hero-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(520px 260px at 25% 10%, rgba(124,58,237,.35), rgba(0,0,0,0) 60%),
              radial-gradient(520px 260px at 85% 40%, rgba(6,182,212,.22), rgba(0,0,0,0) 65%);
  pointer-events: none;
}

.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }

.hero-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px;
}

.stat strong { display: block; font-size: 18px; }
.stat span { display: block; font-size: 12px; color: rgba(255,255,255,.78); }

@media (max-width: 980px) {
  .mkt-hero-grid { grid-template-columns: 1fr; }
  .mkt-hero h1 { font-size: 40px; }
}

.page-bg section { padding: 46px 0; }

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 980px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .steps  { grid-template-columns: 1fr; }
}

.feature {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
}

.feature .icon {
  width: 22px; height: 22px;
  color: var(--primary);
}

.feature h3 { margin: 10px 0 6px 0; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.step {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
}

.step .num {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(79,70,229,.10);
  border: 1px solid rgba(79,70,229,.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--primary);
}

.step h3 { margin: 10px 0 6px 0; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.guarantee-band {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(22,163,74,.25);
  background: linear-gradient(135deg, rgba(22,163,74,.12), rgba(34,197,94,.06));
}

.guarantee-band .inner {
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.guarantee-band h3 { margin: 0; font-size: 18px; }

.guarantee-band p { margin: 4px 0 0 0; color: #14532d; }

@media (max-width: 920px) {
  .guarantee-band .inner { grid-template-columns: 1fr; }
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 980px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

.pricing {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.pricing.popular {
  border-color: rgba(79,70,229,.30);
  box-shadow: var(--shadow-md);
}

.pricing .tag {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(79,70,229,.10);
  border: 1px solid rgba(79,70,229,.25);
  color: var(--primary);
}

.pricing h3 { margin: 0 0 6px 0; font-size: 18px; }
.pricing .price { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; }
.pricing .sub { color: var(--muted); font-size: 13px; }

.pricing ul { margin: 14px 0 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pricing li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 14px; }
.pricing li .icon { width: 18px; height: 18px; color: var(--success); margin-top: 1px; }

.testimonials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 980px) { .testimonials { grid-template-columns: 1fr; } }

.quote {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
}

.stars { display: inline-flex; gap: 4px; color: #f59e0b; }

.quote p { margin: 12px 0 0 0; color: var(--muted); }
.quote .who { margin-top: 14px; font-weight: 800; }
.quote .meta { color: var(--muted-2); font-size: 13px; }

.cta {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(79,70,229,.22);
  background: radial-gradient(700px 220px at 20% 10%, rgba(124,58,237,.20), rgba(0,0,0,0) 60%),
              radial-gradient(700px 220px at 80% 50%, rgba(6,182,212,.14), rgba(0,0,0,0) 60%),
              rgba(255,255,255,.95);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.mkt-footer {
  padding: 34px 0 46px 0;
  color: rgba(255,255,255,.78);
  background: rgba(11,16,32,.78);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
}

.footer-grid h4 { margin: 0 0 10px 0; color: #fff; }
.footer-grid a { color: rgba(255,255,255,.82); display: block; padding: 6px 0; font-weight: 600; }
.footer-grid a:hover { color: #fff; }
.footer-note { margin-top: 18px; font-size: 12px; color: rgba(255,255,255,.62); }

@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr; }
  .mkt-footer { background: rgba(11, 16, 32, 0.92); }
}


/* ---------------------------------------------------------------------------
   AUTH LAYOUT
--------------------------------------------------------------------------- */

.layout-auth {
  background: var(--g2), #0b1020;
  color: #fff;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.auth-card {
  width: min(520px, calc(100% - 40px));
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  padding: 22px;
}

.auth-card h1 { margin: 0 0 6px 0; font-size: 26px; }
.auth-card p { margin: 0 0 14px 0; color: rgba(255,255,255,.82); }

.auth-card label { color: rgba(255,255,255,.92); }

.auth-card input, .auth-card select, .auth-card textarea {
  background: rgba(255,255,255,.92);
}

.auth-card .btn-primary { width: 100%; }

.auth-foot {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-foot a { color: rgba(255,255,255,.88); font-weight: 700; }

/* ---------------------------------------------------------------------------
   APP LAYOUT (Dashboard + Admin)
--------------------------------------------------------------------------- */

.layout-app { background: var(--bg); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.app-sidebar {
  background: #0b1020;
  color: rgba(255,255,255,.86);
  border-right: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
}

.app-sidebar .brand { color: #fff; }
.app-sidebar .brand img { height: 38px; }

.nav-group { margin-top: 18px; }
.nav-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.55); margin: 14px 0 10px 0; }

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: rgba(255,255,255,.84);
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  font-weight: 700;
  font-size: 14px;
  margin: 8px 0;
}

.side-link .icon { width: 18px; height: 18px; }

.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.active { background: rgba(79,70,229,.22); border-color: rgba(79,70,229,.30); color: #fff; }

.app-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246,247,251,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(2,6,23,.08);
}

.app-topbar .inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 18px;
}

.app-main {
  padding: 22px 0 40px 0;
}

.app-footer {
  margin-top: auto;
  padding: 18px 0 26px 0;
  color: var(--muted-2);
  font-size: 12px;
}

.app-shell .mobile-only { display: none; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 86vw;
    max-width: 320px;
    transform: translateX(-110%);
    transition: transform .22s ease;
    z-index: 80;
  }
  .app-shell[data-sidebar-open="true"] .app-sidebar { transform: translateX(0); }
  .app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    z-index: 70;
  }
  .app-shell[data-sidebar-open="true"]::before {
    opacity: 1;
    pointer-events: auto;
  }
  .app-shell .mobile-only { display: inline-flex; }
}

/* Letter display */
.letter-pre {
  background: #0b1020;
  color: rgba(255,255,255,.92);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.10);
  padding: 18px;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Small "Copied" affordance */
[data-copy-letter][data-copied="true"]::after {
  content: "Copied";
  margin-left: 10px;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(22,163,74,.14);
  border: 1px solid rgba(22,163,74,.25);
}

/* WYSIWYG editor (simple contenteditable) */
.wysiwyg {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: rgba(255,255,255,.02);
}
.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.wysiwyg-toolbar .sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.10);
  margin: 0 2px;
}
.wysiwyg-toolbar .icon-btn {
  width: auto;
  padding: 8px 10px;
}
.wysiwyg-editor {
  padding: 18px;
  min-height: 520px;
  outline: none;
}

/* Letter paper look */
.letter-paper {
  background: #ffffff;
  color: #0b1020;
  border-radius: 16px;
}
.letter-paper p { margin: 0 0 12px 0; }
.letter-paper ul { margin: 0 0 14px 22px; }
.letter-paper li { margin: 6px 0; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ---------------------------------------------------------------------------
   MOBILE FIXES (2026-02-16)
   - Stack "How it works" steps on mobile
   - Stack hero stats cards on mobile
   - Prevent header logo squeeze on very small screens
   - Stabilize marketing footer background on mobile
--------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .steps { grid-template-columns: 1fr !important; }
  .hero-stats { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .mkt-footer { background: rgba(11,16,32,.92); }
}

@media (max-width: 520px) {
  /* Stack header rows so the logo is always readable */
  .mkt-panel { inset: 118px 0 auto 0; }

  .mkt-nav {
    height: auto;
    padding: 12px 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .brand {
    flex: 1 1 100%;
    justify-content: center;
    min-width: 0;
  }

  .brand img {
    height: 44px;
    width: auto;
    max-width: min(320px, 82vw);
    object-fit: contain;
  }

  .mkt-actions {
    flex: 1 1 100%;
    width: 100%;
    justify-content: space-between;
  }

  /* Keep the primary action + menu on the second row */
  .mkt-actions .btn-secondary { display: none; }
  .mkt-actions .btn-primary {
    flex: 1;
    justify-content: center;
    min-width: 0;
    padding: 10px 12px;
    min-height: 40px;
    border-radius: 12px;
  }
}
