/* Handcrafted Karmagram components. Tailwind utilities refine individual pages. */
@layer base {
  :root { color-scheme: dark; --bg: #09090b; --surface: #15131b; --surface-raised: #1d1827; --text: #f8f6ff; --muted: #a9a4b6; --purple: #b49af5; --gold: #fbbf24; --border: rgb(255 255 255 / 10%); --ring: #d2bcff; }
  html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; }
  body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
  [hidden] { display: none !important; }
  ::selection { background: #7546b3; color: white; }
  h1,h2,h3,h4 { color: var(--text); font-weight: 650; line-height: 1.2; text-wrap: balance; }
  h1 { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.75rem); letter-spacing: -.04em; }
  h2 { font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem); letter-spacing: -.03em; }
  h3 { font-size: 1.25rem; letter-spacing: -.015em; }
  p { line-height: 1.75; }
  h1,h2,h3,p,li,label { overflow-wrap: break-word; }
  img,video,canvas { max-width: 100%; }
  img { object-fit: cover; }
  svg { flex-shrink: 0; }
  a { text-underline-offset: .2em; }
  button,input,textarea,select { font-family: inherit; }
  button,select,summary,[role="button"] { cursor: pointer; }
  button,a,input,textarea,select { -webkit-tap-highlight-color: transparent; }
  button { touch-action: manipulation; }
  button:disabled { cursor: not-allowed; opacity: .5; }
  input,textarea,select { min-width: 0; max-width: 100%; }
  textarea { resize: vertical; min-height: 130px; }
  input::placeholder,textarea::placeholder { color: #857f93; opacity: 1; }
  input[type="checkbox"],input[type="radio"] { accent-color: #9b69eb; width: 18px; height: 18px; flex-shrink: 0; }
  select option { background: #211b2c; color: white; }
  :where(a,button,input,textarea,select,summary,[tabindex]):focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
  :where(.grid,.flex) > * { min-width: 0; }
}

@layer components {
  .container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 32px; }
  .section { position: relative; padding-block: 88px; }
  .section-alt { background: linear-gradient(180deg, #101015, #14101c 50%, #101015); }
  .section-glow { background: radial-gradient(ellipse at 50% 0, #6d28d91a, transparent 65%); }
  .section-heading { max-width: 760px; margin: 0 auto 44px; text-align: center; }
  .section-heading h2 { margin-bottom: 16px; }
  .section-heading p { color: var(--muted); font-size: 1.125rem; }
  .eyebrow { font-size: .75rem; line-height: 1.5; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--purple); }
  .muted { color: var(--muted); }
  .gradient-text { color: transparent; background: linear-gradient(105deg, #c99cff, #a78bfa 65%, #c783f3); background-clip: text; -webkit-background-clip: text; }
  .gold-text { color: var(--gold); }
  .purple-text { color: var(--purple); }
  .hero,.page-hero { position: relative; isolation: isolate; padding-block: 88px 72px; text-align: center; overflow: clip; background: radial-gradient(ellipse at 50% 35%, #6d28d921, transparent 67%), linear-gradient(145deg,#09090b,#100d18 65%,#101014); }
  .hero::before { position: absolute; inset: 0; z-index: -1; content: ""; background-image: linear-gradient(#ffffff05 1px,transparent 1px),linear-gradient(90deg,#ffffff05 1px,transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(ellipse at center,black,transparent 75%); }
  .hero { padding-block: 100px 108px; }
  .hero h1 { max-width: 940px; margin-inline: auto; font-size: clamp(2.5rem, 1.4rem + 4.7vw, 4.65rem); line-height: 1.12; }
  .page-hero h1 { max-width: 1000px; margin: 0 auto 22px; }
  .hero p,.page-hero > .container > p { max-width: 760px; margin: 22px auto 0; color: var(--muted); font-size: clamp(1.0625rem, .9rem + .5vw, 1.25rem); line-height: 1.7; }
  .hero-badge { display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; padding: 8px 14px; margin-bottom: 24px; border: 1px solid #a78bfa2b; border-radius: 99px; background: #a78bfa0d; color: #c2a8fc; font-size: .8125rem; font-weight: 550; line-height: 1.5; }
  .hero-badge svg { width: 16px; height: 16px; }
  .hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 32px; }
  .hero-icon { display: grid; place-items: center; width: 80px; height: 80px; border: 1px solid #b28bea40; border-radius: 24px; margin: 0 auto 24px; background: linear-gradient(140deg,#a855f7,#6522b6); box-shadow: 0 16px 60px #7c3aed28; }
  .hero-icon svg { width: 36px; height: 36px; }
  .grid-2,.grid-3,.grid-4 { display: grid; gap: 24px; }
  .grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
  :where(.grid-2,.grid-3,.grid-4) > * { min-width: 0; }
  .card { min-width: 0; padding: 28px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(145deg,#ffffff05,#ffffff02); box-shadow: 0 8px 32px #00000014; }
  .card h3 { margin-bottom: 12px; }
  .card p { color: var(--muted); }
  .card-purple { border-color: #a78bfa38; background: linear-gradient(145deg,#8b5cf615,#8b5cf606); }
  .card-gold { border-color: #fbbf2440; background: linear-gradient(145deg,#fbbf2412,#fbbf2405); }
  .card-green { border-color: #86efac2c; background: linear-gradient(145deg,#4ade800b,transparent); }
  .card-red { border-color: #fb718536; background: linear-gradient(145deg,#fb718510,transparent); }
  .card-link { display: block; height: 100%; transition: border-color .2s,transform .2s,background-color .2s; }
  .card-link:hover { border-color: #a78bfa66; transform: translateY(-3px); background-color: #a78bfa07; }
  .card-icon { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; flex-shrink: 0; border-radius: 15px; margin-bottom: 22px; background: #a78bfa14; color: var(--purple); }
  .card-icon svg { width: 25px; height: 25px; }
  .card.text-center > .card-icon { margin-inline: auto; }
  .card-icon.gold { background: #fbbf2414; color: #fbbf24; }
  .card-icon.green { background: #4ade8012; color: #86d59b; }
  .card-icon.red { background: #fb718514; color: #fb9dad; }
  .button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 48px; padding: 12px 23px; border: 1px solid transparent; border-radius: 12px; color: white; font-size: .9375rem; font-weight: 600; line-height: 1.4; text-align: center; transition: background-color .18s,border-color .18s,box-shadow .18s,transform .18s; }
  .button svg { width: 19px; height: 19px; }
  .button-primary { background: linear-gradient(105deg,#a448e8,#7c3aed); border-color: #c084fc33; box-shadow: 0 7px 24px #9333ea26; }
  .button-primary:hover { background: linear-gradient(105deg,#b452f1,#8845f7); box-shadow: 0 9px 30px #9333ea40; }
  .button-secondary { background: #ffffff05; border-color: #ffffff26; }
  .button-secondary:hover { border-color: #c4b5fd66; background: #ffffff0b; }
  .button-gold { background: linear-gradient(100deg,#fbbf24,#e9ab0b); color: #211703; border-color: #fcd34d; box-shadow: 0 7px 24px #fbbf241c; }
  .button-gold:hover { background: #fcd34d; }
  .button-ghost { color: var(--purple); }
  .button-ghost:hover { background: #a78bfa10; }
  .button-sm { min-height: 44px; padding: 9px 15px; font-size: .875rem; }
  .button-lg { min-height: 56px; padding: 15px 28px; font-size: 1.0625rem; }
  .icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; color: var(--muted); }
  .icon-button:hover { color: white; background: #ffffff0a; }
  .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); font-size: .75rem; font-weight: 550; line-height: 1.5; }
  .tag svg { width: 13px; height: 13px; }
  .tag-purple { color: #c4aafa; border-color: #a78bfa30; background: #a78bfa10; }
  .tag-gold { color: #eac66c; border-color: #fbbf2430; background: #fbbf2410; }
  .tag-green { color: #8dd4a0; border-color: #86efac30; background: #4ade800d; }
  .tag-red { color: #f3a0ad; border-color: #fb718530; background: #fb718510; }
  .stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; }
  .stat { min-width: 0; padding: 24px 16px; text-align: center; }
  .stat-value { display: block; font-size: clamp(1.75rem,2.8vw,2.75rem); font-weight: 700; line-height: 1.15; letter-spacing: -.035em; color: var(--purple); }
  .stat-label { display: block; color: var(--muted); margin-top: 8px; font-size: .875rem; }
  .field { display: block; width: 100%; min-height: 48px; padding: 12px 15px; border: 1px solid #ffffff26; border-radius: 12px; background: #ffffff05; color: var(--text); font-size: 1rem; line-height: 1.4; transition: border-color .2s,box-shadow .2s; }
  .field:focus { outline: none; border-color: #b59afa; box-shadow: 0 0 0 3px #a78bfa15; }
  .form-field { display: grid; gap: 8px; font-size: .875rem; }
  .form-field > label { color: #e5ddec; font-weight: 550; }
  .form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
  .form-grid > .full-width { grid-column: 1 / -1; }
  .form-check { display: flex; align-items: flex-start; gap: 11px; min-height: 44px; color: var(--muted); font-size: .875rem; }
  .form-check input { margin-top: 4px; }
  .form-check a { color: var(--purple); text-decoration: underline; }
  .form-status,.demo-note { padding: 12px 16px; margin-top: 16px; border: 1px solid #a78bfa24; border-radius: 12px; background: #a78bfa0a; color: #c4b1e2; font-size: .8125rem; line-height: 1.65; }
  .form-status.error { border-color: #fb71852e; color: #f5a8b3; background: #fb71850a; }
  .filter-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
  .filter-chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 1px solid var(--border); border-radius: 11px; background: #ffffff04; color: var(--muted); font-size: .875rem; line-height: 1.3; transition: all .18s; }
  .filter-chip:hover { color: white; border-color: #a78bfa55; background: #a78bfa0d; }
  .filter-chip.is-active,.filter-chip[aria-pressed="true"] { background: #8b45db; border-color: #b282ea66; color: white; }
  .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
  .search-field { position: relative; flex: 1; min-width: 200px; }
  .search-field svg { position: absolute; width: 19px; height: 19px; top: 50%; left: 16px; transform: translateY(-50%); color: #9c92ac; pointer-events: none; }
  .search-field input { padding-left: 46px; }
  .avatar { display: inline-flex; justify-content: center; align-items: center; width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg,#aa76e329,#61339450); border: 1px solid #a78bfa24; color: #c1a6f3; font-size: 1.25rem; font-weight: 650; }
  .avatar img { width: 100%; height: 100%; border-radius: inherit; }
  .avatar-lg { width: 80px; height: 80px; font-size: 2rem; }
  .empty-state { grid-column: 1 / -1; padding: 48px 24px; text-align: center; border: 1px dashed var(--border); border-radius: 20px; color: var(--muted); }
  .empty-state h3 { margin-bottom: 10px; }
  .tabs { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: #ffffff04; overflow-x: auto; scrollbar-width: thin; }
  .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; min-height: 44px; padding: 10px 18px; border-radius: 9px; color: var(--muted); font-size: .9375rem; font-weight: 550; white-space: nowrap; }
  .tabs button.is-active,.tabs button[aria-selected="true"] { background: #8b45db; color: white; box-shadow: 0 4px 12px #0002; }
  .progress { width: 100%; height: 7px; overflow: hidden; border-radius: 99px; background: #ffffff0c; }
  .progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#a855f7,#a78bfa); }
  .list-row { display: flex; align-items: center; gap: 18px; padding-block: 18px; border-bottom: 1px solid var(--border); }
  .list-row:last-child { border-bottom: 0; }
  .list-row > :not(svg) { min-width: 0; }
  .check-list { display: grid; gap: 14px; color: var(--muted); }
  .check-list li { display: flex; align-items: flex-start; gap: 12px; }
  .check-list svg { width: 19px; height: 19px; margin-top: 4px; color: var(--purple); }
  .step-number { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg,#a855f7,#762cb9); font-weight: 650; }
  .callout { padding: 40px; border: 1px solid #a78bfa40; border-radius: 24px; background: radial-gradient(ellipse at 50% 0,#8b5cf619,transparent 70%),#15101e; }
  .callout h2 { margin-bottom: 20px; }
  .callout p { color: var(--muted); }
  .site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid #ffffff0c; background: #0b0914e8; backdrop-filter: blur(20px); }
  .header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; max-width: 1400px; min-height: 72px; margin-inline: auto; padding-inline: 32px; }
  .brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 1.1875rem; font-weight: 700; letter-spacing: -.025em; }
  .brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#a855f7,#7c3aed); box-shadow: 0 3px 14px #9333ea3d; }
  .brand-mark svg { width: 19px; height: 19px; }
  .desktop-nav { display: flex; align-items: center; gap: 3px; }
  .desktop-nav a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 10px 10px; border-radius: 9px; font-size: .8125rem; font-weight: 550; color: var(--muted); white-space: nowrap; }
  .desktop-nav a:hover,.desktop-nav a[aria-current="page"] { background: #a78bfa10; color: #c4a8ff; }
  .desktop-nav a.nav-gold { color: #e8c56c; }
  .desktop-nav svg { width: 14px; height: 14px; }
  .header-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .header-actions .button { padding-inline: 15px; font-size: .8125rem; }
  .menu-toggle { display: none; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: #c3b7d2; }
  .menu-toggle:hover { background: #ffffff08; }
  .mobile-nav { position: fixed; inset: 72px 0 auto; z-index: 60; max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; padding: 16px max(16px,calc((100vw - 720px) / 2)) calc(24px + env(safe-area-inset-bottom)); border-bottom: 1px solid var(--border); background: #15111d; box-shadow: 0 24px 48px #0006; }
  .mobile-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; border-radius: 10px; color: #d7cfe2; }
  .mobile-nav a:hover,.mobile-nav a[aria-current="page"] { background: #a78bfa16; color: #cfb6ff; }
  .mobile-nav svg { width: 19px; height: 19px; }
  .menu-backdrop { position: fixed; inset: 0; z-index: 35; background: #0009; backdrop-filter: blur(3px); }
  body.menu-open,body.sidebar-open { overflow: hidden; }
  .skip-link { position: fixed; top: 12px; left: 16px; z-index: 150; padding: 12px 16px; border-radius: 10px; background: #eaddff; color: #251538; transform: translateY(-180%); }
  .skip-link:focus { transform: translateY(0); }
  .site-footer { padding-block: 64px 24px; border-top: 1px solid var(--border); background: linear-gradient(#0c0b10,#070609); }
  .footer-grid { display: grid; grid-template-columns: 1.7fr repeat(4,minmax(0,1fr)); gap: 30px; }
  .footer-column h3,.footer-column h4 { margin-bottom: 20px; font-size: .6875rem; line-height: 1.5; letter-spacing: .09em; text-transform: uppercase; }
  .footer-column ul { display: grid; gap: 4px; }
  .footer-column a:not(.brand):not(.button) { display: inline-flex; align-items: center; min-height: 34px; font-size: .8125rem; color: var(--muted); line-height: 1.5; }
  .footer-column a:hover { color: #c9a9ff; }
  .footer-column p { color: var(--muted); font-size: .8125rem; margin-top: 20px; }
  .footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); color: #898292; font-size: .75rem; }
  .footer-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
  .footer-socials a { min-width: 38px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
  .dashboard-shell { min-height: 100dvh; }
  .dashboard-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 280px; padding: 28px 18px; overflow-y: auto; background: #15121d; border-right: 1px solid var(--border); }
  .dashboard-sidebar .brand { margin: 0 12px 30px; }
  .dashboard-sidebar nav { display: grid; gap: 5px; margin-top: 24px; }
  .dashboard-sidebar nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 15px; border-radius: 11px; color: var(--muted); font-size: .9375rem; }
  .dashboard-sidebar nav a svg { width: 20px; height: 20px; }
  .dashboard-sidebar nav a:hover { background: #ffffff06; color: white; }
  .dashboard-sidebar nav a[aria-current="page"],.dashboard-sidebar nav a.is-active { background: #8241cf; color: white; }
  .dashboard-main { max-width: 1700px; min-width: 0; margin-left: 280px; padding: 40px; }
  .dashboard-main h1 { font-size: clamp(1.875rem,2.5vw,2.5rem); }
  .dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; margin-bottom: 32px; }
  .dashboard-header p { color: var(--muted); margin-top: 8px; }
  .auth-card { width: 100%; max-width: 460px; margin-inline: auto; padding: 32px; border: 1px solid #a78bfa2a; border-radius: 22px; background: #ffffff04; box-shadow: 0 18px 70px #0003; }
  .auth-card form { display: grid; gap: 22px; }
  .auth-card label { color: #e1d9ed; font-size: .875rem; }
  .auth-card .button[type="submit"] { width: 100%; }
  dialog.kg-dialog,dialog.modal { width: min(600px,calc(100vw - 32px)); max-height: min(88dvh,880px); margin: auto; padding: 32px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #a78bfa44; border-radius: 24px; background: linear-gradient(145deg,#21172d,#121017 80%); color: var(--text); box-shadow: 0 32px 100px #0009; }
  dialog::backdrop { background: #040209c9; backdrop-filter: blur(8px); }
  .kg-dialog h2 { font-size: 1.75rem; padding-right: 32px; margin-bottom: 20px; }
  .kg-dialog > p { color: var(--muted); margin-bottom: 24px; }
  .kg-dialog form { display: grid; gap: 18px; }
  .dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 8px; }
  :is(.kg-dialog,.modal) :is(.icon-button,[aria-label])[data-close-modal] { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; color: #cdb9e1; }
  :is(.kg-dialog,.modal) :is(.icon-button,[aria-label])[data-close-modal]:hover { background: #ffffff08; }
  .toast { position: fixed; right: 20px; bottom: max(20px,env(safe-area-inset-bottom)); z-index: 150; width: max-content; max-width: min(440px,calc(100vw - 32px)); padding: 16px 20px; border: 1px solid #ba8fea50; border-radius: 14px; background: #291b39; color: #f1e6fd; box-shadow: 0 12px 50px #0006; font-size: .9375rem; animation: toast-in .2s ease-out; }
  .table-wrap { width: 100%; overflow-x: auto; }
  .table-wrap table { width: 100%; border-collapse: collapse; }
  .table-wrap th,.table-wrap td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; }
  .table-wrap th { font-size: .8125rem; color: var(--muted); }
  .article-body { max-width: 860px; margin-inline: auto; }
  .article-body p + p { margin-top: 20px; }
  .article-body h2 { margin-bottom: 24px; }
  .article-body ul { margin-block: 20px; }
  .profile-cover { height: 180px; background: linear-gradient(120deg,#803cce,#51237b 60%,#27163a); border-radius: 19px 19px 0 0; }
  .metric-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 14px; background: #09090b80; border-radius: 12px; text-align: center; }
  .metric-row strong { display: block; color: #ede6f7; }
  .metric-row span { font-size: .6875rem; color: var(--muted); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  @media (max-width: 1279px) {
    .desktop-nav,.header-actions { display: none; }
    .menu-toggle { display: grid; }
    .footer-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .footer-grid > :first-child { grid-column: 1 / -1; max-width: 460px; }
    .dashboard-main .grid-3,.dashboard-main .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-main { padding: 28px; }
  }
  @media (max-width: 1023px) {
    .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .grid-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-sidebar { top: 72px; width: 280px; transform: translateX(-100%); transition: transform .2s; }
    .dashboard-sidebar.is-open,body.sidebar-open .dashboard-sidebar { transform: translateX(0); }
    .dashboard-main { margin-left: 0; padding: 28px; }
    .section { padding-block: 64px; }
  }
  @media (max-width: 767px) {
    .container,.header-inner { padding-inline: 22px; }
    .grid-2,.grid-3,.dashboard-main .grid-3 { grid-template-columns: minmax(0,1fr); }
    .grid-2,.grid-3,.grid-4 { gap: 18px; }
    .hero { padding-block: 68px 72px; }
    .page-hero { padding-block: 56px 48px; }
    .hero h1 { font-size: clamp(2.35rem,7.5vw,3.75rem); }
    .section { padding-block: 52px; }
    .section-heading { margin-bottom: 30px; }
    .section-heading p { font-size: 1rem; }
    .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .card { padding: 24px; }
    .callout { padding: 28px; }
    .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 22px; }
    .footer-column h3,.footer-column h4 { margin-bottom: 12px; }
    .site-footer { padding-top: 48px; }
    .dashboard-main { padding: 24px 20px; }
    .dashboard-header { margin-bottom: 24px; }
  }
  @media (max-width: 479px) {
    .container,.header-inner { padding-inline: 16px; }
    .grid-4 { grid-template-columns: minmax(0,1fr); }
    .hero-badge { font-size: .6875rem; padding-inline: 11px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .button { width: 100%; }
    .card { padding: 20px; border-radius: 17px; }
    .card-icon { width: 48px; height: 48px; margin-bottom: 18px; }
    .callout { padding: 24px 20px; }
    .form-grid { grid-template-columns: minmax(0,1fr); }
    .toolbar { align-items: stretch; }
    .search-field { flex-basis: 100%; }
    .filter-chip { padding-inline: 12px; font-size: .8125rem; }
    .filter-bar { gap: 7px; }
    .auth-card { padding: 24px 20px; }
    .dashboard-main { padding: 22px 16px; }
    .dashboard-main .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .kg-dialog,dialog.kg-dialog,dialog.modal { padding: 24px 20px; border-radius: 20px; }
    .kg-dialog h2 { font-size: 1.5rem; }
    .dialog-actions > .button { flex: 1; }
    .toast { left: 16px; right: 16px; bottom: max(16px,env(safe-area-inset-bottom)); width: auto; }
    .list-row { gap: 12px; }
    .footer-bottom { margin-top: 32px; }
    body[data-page="KarmagromersPage"] .tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; overflow: visible; }
    body[data-page="KarmagromersPage"] .tabs button { flex-direction: column; gap: 5px; padding: 9px 4px; min-height: 68px; white-space: normal; font-size: .75rem; line-height: 1.3; }
  }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
}

/* Tailwind's built-in container is breakpoint-sized; page containers stay fluid. */
.container:not([class*="max-w-"]) { max-width: 1280px; }

/* Dialog forms use grid gap; legacy space-y utilities must not add a second gap. */
dialog.kg-dialog form > *, dialog.modal form > * { margin-block: 0; }
