:root{
  /* Core palette */
  --bg:            #0B0B0E;
  --surface:       #141419;
  --surface-2:     #1B1B22;
  --border:        #262634;

  /* Text */
  --text:          #EDEDED;
  --text-muted:    #A0A0AA;
  --text-subtle:   #8A8A95;

  /* Brand / accents */
  --primary:       #7C5CFF;   /* Purple accent */
  --primary-600:   #6C4BFF;
  --primary-700:   #5B3AF6;
  --success:       #2BD67B;   /* Installed/ok */
  --warning:       #F6C142;
  --danger:        #FF5A67;

  /* States / overlays */
  --overlay:       rgba(5,5,10,0.6);

  /* Elevation / shadows */
  --shadow-sm:     0 4px 12px rgba(0,0,0,0.25);
  --shadow-md:     0 8px 24px rgba(0,0,0,0.25);
  --shadow-lg:     0 16px 40px rgba(0,0,0,0.35);

  /* Radius */
  --radius-xs:     8px;
  --radius-sm:     12px;
  --radius-md:     16px;
  --radius-lg:     20px;
  --radius-xl:     24px;

  /* Spacing scale */
  --space-1:       4px;
  --space-2:       8px;
  --space-3:       12px;
  --space-4:       16px;
  --space-5:       20px;
  --space-6:       24px;
  --space-8:       32px;
  --space-10:      40px;
  --space-12:      48px;

  /* Typography */
  --font-sans:     'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --fs-hero:       clamp(30px, 4.2vw, 40px);
  --fs-h2:         24px;
  --fs-h3:         18px;
  --fs-body:       16px;
  --fs-small:      14px;

  /* Layout */
  --container:     1100px;

  /* Motion */
  --easing:        cubic-bezier(.2,.6,.2,1);
  --dur-fast:      120ms;
  --dur:           200ms;

  /* Z-index */
  --z-header:      50;
  --z-overlay:     70;
  --z-modal:       80;
}

/* Light theme overrides */
:root.light {
  --bg:        #F8F8FB;
  --surface:   #FFFFFF;
  --surface-2: #F2F3F7;
  --text:      #1D1E22;
  --text-muted:#5A5C66;
  --border:    #E5E7EE;
}

/* Accent color options */
:root.accent-purple { --primary:#7C5CFF; }
:root.accent-blue   { --primary:#3D8BFF; }
:root.accent-teal   { --primary:#2BCBBA; }
:root.accent-orange { --primary:#FF8A3D; }
:root.accent-pink   { --primary:#FF4D8D; }

html,body{background:var(--bg);color:var(--text);font-family:var(--font-sans);transition:background-color var(--dur) var(--easing), color var(--dur) var(--easing)}
.wrap{max-width:var(--container);margin:0 auto;padding:0 20px}

/* Header */
.sh-header{
  position:sticky; top:0; z-index:var(--z-header);
  background: color-mix(in oklab, var(--bg), transparent 30%);
  border-bottom:1px solid var(--border);
  backdrop-filter: saturate(140%) blur(6px);
}
.sh-header .bar{max-width:var(--container); margin:0 auto; padding:12px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:18px;}
.sh-brand{display:flex; align-items:center; gap:10px; font-weight:700;}
.sh-brand img{height:28px;border-radius:var(--radius-xs);}
.sh-nav{display:flex;gap:16px;align-items:center;}
.sh-nav a{color:var(--text-muted); margin:0 12px; text-decoration:none;}
.sh-nav button{color:var(--text-muted); background:none; border:none; cursor:pointer; font-size:inherit;}
.sh-cta{background:var(--primary); color:#fff; padding:10px 14px; border-radius:var(--radius-sm); text-decoration:none; font-weight:600;}
/* Hero */
.sh-hero{padding:72px 0 40px;
  background: radial-gradient(80% 60% at 50% 0%, #1a1727 0%, var(--bg) 60%);}
.sh-hero h1{font-size:var(--fs-hero); line-height:1.1; margin:0 0 10px;}
.sh-hero p{color:var(--text-muted); margin:0 0 22px;}
.sh-actions{display:flex; gap:12px; flex-wrap:wrap;}
.btn{border-radius:var(--radius-sm); padding:12px 18px; font-weight:600; text-decoration:none; display:inline-block; transition: all var(--dur) var(--easing);}
.btn-primary{background:var(--primary); color:#fff;}
.btn-ghost{background:var(--surface); color:var(--text); border:1px solid var(--border);}
.btn:hover{transform:translateY(-1px);}
.sh-trust{margin-top:14px;color:var(--text-subtle);font-size:var(--fs-small);}
/* Make Quick Access sticky on mobile */
@media (max-width:760px){
  .quick-access-sticky{position:sticky;top:64px;z-index:40;background:var(--bg)}
  .sh-hero h1{font-size:30px}
}
/* Favorites row */
.favs{max-width:var(--container); margin:0 auto; padding:var(--space-6) 20px; display:flex; align-items:center; gap:var(--space-4);}
.favs .title{font-weight:700; color:var(--text);}
.favs .apps{display:flex; gap:var(--space-3); flex-wrap:wrap;}
.favs .manage{margin-left:auto; color:var(--text-muted);}

/* Card */
.card{background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-md); box-shadow:var(--shadow-md); padding:16px;
  transition: transform var(--dur) var(--easing), box-shadow var(--dur) var(--easing);}
.card:hover{transform:translateY(-2px); box-shadow:var(--shadow-lg);}
.card .title{font-weight:700;}
.card .meta{color:var(--text-muted); font-size:var(--fs-small);}
.card .actions{display:flex; justify-content:space-between; align-items:center; margin-top:12px;}
.card .pin{color:var(--text-subtle);}

/* Notes panel (modal/slide-over) */
.notes-overlay{position:fixed; inset:0; background:var(--overlay); z-index:var(--z-overlay); display:none;}
.notes{position:fixed; right:0; top:0; bottom:0; width:min(420px, 92vw);
  background:var(--surface); border-left:1px solid var(--border); padding:20px; z-index:var(--z-modal); display:none;}
.notes h3{margin:0 0 12px; font-size:var(--fs-h2);}
.notes .toolbar{display:flex; gap:8px; margin-bottom:12px;}
.notes textarea{width:100%; min-height:50vh; background:var(--surface-2);
  border:1px solid var(--border); color:var(--text); border-radius:var(--radius-sm); padding:12px;}

/* Calendar widget */
.calendar{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:16px;}
.calendar .grid{display:grid; grid-template-columns:repeat(7,1fr); gap:8px; margin-top:8px;}
.calendar .day{aspect-ratio:1/1; display:grid; place-items:center; border-radius:var(--radius-xs); background:var(--surface-2); color:var(--text);}
.calendar .day.is-today{outline:2px solid var(--primary);}

/* Action buttons (header) */
.header-actions{display:flex; gap:var(--space-2); align-items:center;}
.header-actions button{
  background:var(--surface-2); border:1px solid var(--border); 
  color:var(--text-muted); padding:8px 12px; border-radius:var(--radius-sm);
  font-size:var(--fs-small); cursor:pointer;
  transition: all var(--dur) var(--easing);
}
.header-actions button:hover{
  background:var(--primary); color:#fff; transform:translateY(-1px);
}

.muted{color:var(--text-muted)}

/* Compliant Ad Placement */
.ad-banner-bottom{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  z-index:1000;
  background:var(--surface);
  border-top:1px solid var(--border);
  min-height:50px;
  max-height:90px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px;
}

.ad-banner-inline{
  margin:20px 0;
  min-height:100px;
  max-height:250px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators for keyboard navigation */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --shadow: 0 2px 8px rgba(0,0,0,0.8);
  }
  .light {
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
}