/* ============================================
   LAYOUT – Sidebar (desktop) + Tabbar (mobile)
   ============================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
}

/* === Sidebar === */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--rule);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
@media (max-width: 880px) {
  .sidebar { display: none; }
}
.side-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 var(--space-3);
}
.side-section { display: flex; flex-direction: column; gap: 2px; }
.side-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 var(--space-3) var(--space-2);
  font-weight: 500;
}
.side-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  font-size: 14px;
  color: var(--text-2);
  border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease-emil), color var(--t-fast) var(--ease-emil);
  cursor: pointer;
}
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.active {
  background: color-mix(in oklch, var(--brand-pink) 10%, var(--surface));
  color: var(--brand-pink);
  font-weight: 500;
}
.side-icon {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: var(--surface-2);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--text-muted);
}
.side-item.active .side-icon {
  background: var(--brand-gradient);
  color: white;
}
.side-footer {
  margin-top: auto;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-top: 1px solid var(--rule);
}
.side-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
}
.side-user-info { line-height: 1.2; font-size: 13px; }
.side-user-info .small { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* === Tabbar (mobile only) === */
.tabbar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--tabbar-h);
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--rule);
  z-index: var(--z-nav);
  padding: 8px 12px 14px;
}
@media (max-width: 880px) {
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); }
  .main { padding-bottom: calc(var(--tabbar-h) + var(--space-4)); }
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease-emil), opacity var(--t-fast);
  cursor: pointer;
}
.tab-item .icon-box {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--text-muted);
  transition: background var(--t-fast) var(--ease-emil), transform var(--t-fast);
}
.tab-item:active .icon-box { transform: scale(0.9); }
.tab-item.active { color: var(--brand-pink); }
.tab-item.active .icon-box { background: var(--brand-gradient); color: white; }

/* === Main content area === */
.main {
  padding: var(--space-7) var(--space-6);
  max-width: 100%;
  overflow-x: hidden;
}
@media (max-width: 880px) {
  .main { padding: var(--space-5) var(--space-4); }
}
.main-inner {
  max-width: 880px;
  margin: 0 auto;
}
.main-inner-wide { max-width: 1180px; margin: 0 auto; }

/* === Mobile topbar (replaces sidebar branding on small screens) === */
.mobile-top {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
@media (max-width: 880px) {
  .mobile-top { display: flex; }
}
.mobile-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-emil),
              background var(--t-base) var(--ease-emil),
              border-color var(--t-base) var(--ease-emil),
              box-shadow var(--t-base) var(--ease-emil),
              color var(--t-base) var(--ease-emil);
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--brand-pink); outline-offset: 2px; }
.btn-primary {
  background: var(--brand-gradient);
  color: white;
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover { box-shadow: 0 8px 28px oklch(0.66 0.24 5 / 0.35); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--rule);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--rule-2); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-link {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
}
.btn-link:hover { color: var(--text); }
.btn-lg { padding: 16px 28px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }

/* CTA button (full-width, like mockup) */
.cta-block {
  width: 100%;
  background: var(--brand-gradient);
  color: white;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 16px 24px;
  border-radius: var(--r-lg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-cta);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-emil), box-shadow var(--t-base);
  text-decoration: none;
}
.cta-block:hover { box-shadow: 0 10px 32px oklch(0.66 0.24 5 / 0.35); }
.cta-block:active { transform: scale(0.98); }

/* ============================================
   INPUTS
   ============================================ */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.field-hint { font-size: 13px; color: var(--text-muted); margin-top: -2px; }
.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color var(--t-base) var(--ease-emil),
              background var(--t-base) var(--ease-emil),
              box-shadow var(--t-base) var(--ease-emil);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--rule-2); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand-pink);
  background: white;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand-pink) 12%, transparent);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--space-5);
}
.card.outline {
  background: transparent;
  border: 1px solid var(--rule);
}
.card.elev { box-shadow: var(--shadow-card); }
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
  color: var(--text);
}
.card-body { color: var(--text-muted); font-size: 14px; }

/* ============================================
   ROLE CARDS (onboarding step 1 – mockup 02)
   ============================================ */
.role-cards { display: flex; flex-direction: column; gap: var(--space-3); }
.role-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease-emil),
              background var(--t-base) var(--ease-emil),
              box-shadow var(--t-base) var(--ease-emil),
              transform var(--t-fast) var(--ease-emil);
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  position: relative;
}
.role-card:hover { border-color: var(--rule-2); }
.role-card:active { transform: scale(0.995); }
.role-card.active {
  border-color: var(--brand-pink);
  background: color-mix(in oklch, var(--brand-pink) 5%, var(--surface));
  box-shadow: var(--shadow-glow);
}
.role-card.active::after {
  content: "✓";
  font-size: 16px;
  color: var(--brand-pink);
  font-weight: 700;
  margin-left: auto;
}
.role-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  flex-shrink: 0;
  transition: background var(--t-base) var(--ease-emil), color var(--t-base);
}
.role-card.active .role-icon {
  background: var(--brand-gradient);
  color: white;
  border-color: transparent;
}
.role-info { flex: 1; min-width: 0; }
.role-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.role-desc { font-size: 13px; color: var(--text-muted); line-height: 1.45; }

/* ============================================
   PROGRESS (linear with segments)
   ============================================ */
.app-progress { display: flex; gap: 4px; width: 100%; }
.app-progress span {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 3px;
}
.app-progress span.done { background: var(--brand-gradient); }
.step-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   MINI-CALENDAR (dashboard mockup 03)
   ============================================ */
.mini-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: var(--space-4);
}
.mini-day {
  aspect-ratio: 1 / 1.15;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-emil), background var(--t-fast);
}
.mini-day:hover { background: var(--surface-2); }
.mini-day .dnum {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.mini-day.today { border-color: var(--brand-pink); background: color-mix(in oklch, var(--brand-pink) 5%, var(--surface)); }
.mini-day .marker {
  margin-top: auto;
  height: 3px;
  border-radius: 2px;
}
.mini-day .marker.w { background: var(--brand-orange); }
.mini-day .marker.s { background: var(--brand-pink); }
.mini-day .marker.d { background: var(--brand-violet); }
.mini-day-dow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}
.mini-cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }

/* ============================================
   DASH STATS (dashboard mockup 03)
   ============================================ */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); }
.dash-stat {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.dash-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.dash-stat-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ============================================
   TILE CARDS (day detail mockup 04)
   ============================================ */
.tile-card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.tile-card.active {
  border-color: var(--brand-pink);
  background: color-mix(in oklch, var(--brand-pink) 4%, var(--surface));
}
.tile-card.active::before {
  content: "";
  position: absolute;
  top: 12px; bottom: 12px; left: -1px;
  width: 3px;
  border-radius: 2px;
  background: var(--brand-gradient);
}
.tile-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.tile-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}
.tile-head { display: flex; align-items: center; gap: var(--space-2); }
.tile-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.tile-body { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.tile-meta {
  display: flex;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* === Phase badges (warmup/sales/daily/cta) === */
.phase-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.phase-pill.w, .phase-pill.warmup { background: color-mix(in oklch, var(--brand-orange) 15%, white); color: var(--brand-orange); }
.phase-pill.s, .phase-pill.sales, .phase-pill.sales-build { background: color-mix(in oklch, var(--brand-pink) 15%, white); color: var(--brand-pink); }
.phase-pill.d, .phase-pill.daily { background: color-mix(in oklch, var(--brand-violet) 15%, white); color: var(--brand-violet); }
.phase-pill.c, .phase-pill.cta { background: color-mix(in oklch, var(--brand-violet) 15%, white); color: var(--brand-violet); }

/* ============================================
   MONTHLY GRID (desktop dashboard D01)
   ============================================ */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.month-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.month-dow span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.month-day {
  min-height: 88px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--t-fast) var(--ease-emil);
}
.month-day:hover { border-color: var(--rule-2); }
.month-day.today { border-color: var(--brand-pink); background: color-mix(in oklch, var(--brand-pink) 4%, var(--surface)); }
.month-day.dim { opacity: 0.5; }
.month-day-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.month-day .phase-pill { font-size: 9px; padding: 2px 6px; }
.month-day-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: auto;
}

/* ============================================
   GENERATOR LOADER (mockup 05)
   ============================================ */
.gen-pulse {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.gen-pulse span {
  width: 12px; height: 12px;
  border-radius: 50%;
  animation: gen-pulse 1.4s ease-in-out infinite;
}
.gen-pulse span:nth-child(1) { background: var(--brand-orange); box-shadow: 0 0 16px var(--brand-orange); }
.gen-pulse span:nth-child(2) { background: var(--brand-pink); box-shadow: 0 0 16px var(--brand-pink); animation-delay: 0.2s; }
.gen-pulse span:nth-child(3) { background: var(--brand-violet); box-shadow: 0 0 16px var(--brand-violet); animation-delay: 0.4s; }
@keyframes gen-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.4); opacity: 1; }
}

.gen-steps { display: flex; flex-direction: column; gap: var(--space-2); }
.gen-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  transition: all var(--t-base) var(--ease-emil);
}
.gen-step .gs-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--rule-2);
  flex-shrink: 0;
  transition: all var(--t-base);
}
.gen-step.done { color: var(--text); border-color: var(--rule-2); }
.gen-step.done .gs-dot { background: oklch(0.65 0.18 145); box-shadow: 0 0 0 3px color-mix(in oklch, oklch(0.65 0.18 145) 20%, transparent); }
.gen-step.active { border-color: var(--brand-pink); color: var(--text); background: color-mix(in oklch, var(--brand-pink) 5%, var(--surface)); }
.gen-step.active .gs-dot { background: var(--brand-pink); box-shadow: 0 0 0 4px color-mix(in oklch, var(--brand-pink) 20%, transparent); animation: pulse-dot 1.5s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* ============================================
   SLIDERS (voice & tone)
   ============================================ */
.slider-row { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) 0; }
.slider-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.slider-track {
  position: relative;
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  cursor: pointer;
}
.slider-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-gradient); border-radius: inherit; transition: width var(--t-fast) var(--ease-emil); }
.slider-thumb {
  position: absolute; top: 50%;
  width: 20px; height: 20px;
  background: white;
  border: 2px solid var(--brand-pink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform var(--t-fast) var(--ease-emil);
}
.slider-track:hover .slider-thumb { transform: translate(-50%, -50%) scale(1.1); }

/* ============================================
   BIG CALENDAR (vision step – selectable days)
   ============================================ */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day {
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  font-family: var(--font-mono);
  transition: background var(--t-fast) var(--ease-emil), border-color var(--t-fast);
  user-select: none;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.holiday { background: color-mix(in oklch, var(--brand-orange) 25%, var(--surface)); border-color: var(--brand-orange); color: var(--brand-orange); font-weight: 600; }
.cal-day.event { background: color-mix(in oklch, var(--brand-violet) 25%, var(--surface)); border-color: var(--brand-violet); color: var(--brand-violet); font-weight: 600; }

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.badge.gradient { background: var(--brand-gradient); color: white; }
.badge.solid { background: var(--surface-2); color: var(--text-2); }
.badge.outline { border: 1px solid var(--rule); color: var(--text-muted); background: transparent; }

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: var(--shadow-card);
  z-index: var(--z-toast);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ============================================
   ONBOARDING SHELL
   ============================================ */
.onb-shell { max-width: 640px; margin: 0 auto; padding: 0 var(--space-4); }
.onb-header { margin-bottom: var(--space-6); }
.onb-progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.onb-actions {
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  border-top: 1px solid var(--rule);
}

/* ============================================
   UTILITIES
   ============================================ */
.stack { display: flex; flex-direction: column; }
.stack-2 > * + * { margin-top: var(--space-2); }
.stack-3 > * + * { margin-top: var(--space-3); }
.stack-4 > * + * { margin-top: var(--space-4); }
.stack-5 > * + * { margin-top: var(--space-5); }
.stack-6 > * + * { margin-top: var(--space-6); }
.row { display: flex; gap: var(--space-3); align-items: center; }
.row-between { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; }
.hidden { display: none !important; }
.section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 0 var(--space-3);
}

/* ============================================
   MONTHLY PLANNER (D01) – light theme port
   ============================================ */
.dt-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.dt-month-head {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 0 12px 4px;
  font-weight: 500;
}
.dt-day {
  aspect-ratio: 1 / 0.95;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-emil);
  text-decoration: none;
  color: inherit;
  min-height: 92px;
}
.dt-day:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .dt-day:hover { border-color: var(--rule-2); background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-card); }
}
.dt-day-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.dt-day.dim { opacity: 0.35; cursor: default; }
.dt-day.dim:hover { transform: none; box-shadow: none; }
.dt-day.today {
  border-color: var(--brand-pink);
  background: color-mix(in oklch, var(--brand-pink) 6%, var(--surface));
}
.dt-day.today .dt-day-num {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.dt-tile-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  align-self: flex-start;
}
.dt-tile-pill.w { background: color-mix(in oklch, var(--brand-orange) 18%, white); color: var(--brand-orange); border: 1px solid color-mix(in oklch, var(--brand-orange) 25%, transparent); }
.dt-tile-pill.s { background: color-mix(in oklch, var(--brand-pink) 18%, white); color: var(--brand-pink); border: 1px solid color-mix(in oklch, var(--brand-pink) 25%, transparent); }
.dt-tile-pill.d { background: color-mix(in oklch, var(--brand-violet) 18%, white); color: var(--brand-violet); border: 1px solid color-mix(in oklch, var(--brand-violet) 25%, transparent); }
.dt-tile-pill.c { background: color-mix(in oklch, var(--brand-violet) 18%, white); color: var(--brand-violet); border: 1px solid color-mix(in oklch, var(--brand-violet) 25%, transparent); }
.dt-tile-count {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .dt-day { padding: 7px 8px; min-height: 70px; }
  .dt-day-num { font-size: 11px; }
  .dt-tile-pill { font-size: 9px; padding: 2px 5px; }
  .dt-tile-count { font-size: 10px; }
}

/* ============================================
   DAY EDITOR (D02) – split layout + IG preview
   ============================================ */
.dt-editor {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-5);
  align-items: start;
}
@media (max-width: 960px) {
  .dt-editor { grid-template-columns: 1fr; }
}

.dt-edit-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.dt-edit-card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  position: relative;
  transition: all var(--t-base) var(--ease-emil);
  cursor: pointer;
}
.dt-edit-card:hover { border-color: var(--rule-2); }
.dt-edit-card.active {
  border-color: var(--brand-pink);
  background: color-mix(in oklch, var(--brand-pink) 4%, var(--surface));
  box-shadow: var(--shadow-glow);
}
.dt-edit-card.active::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-gradient);
  border-radius: var(--r-lg) 0 0 var(--r-lg);
}
.dt-edit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  gap: var(--space-2);
}
.dt-edit-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brand-pink);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.dt-edit-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: var(--r-xs);
}
.dt-edit-hook {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 var(--space-3);
}
.dt-edit-text {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0 0 var(--space-3);
}
.dt-edit-cta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--brand-pink);
  margin-bottom: var(--space-3);
}
.dt-edit-meta {
  display: flex;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.02em;
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
}
.dt-edit-meta .lbl { color: var(--brand-pink); margin-right: 4px; text-transform: none; letter-spacing: 0.02em; font-weight: 600; }

/* IG Story preview */
.dt-edit-preview {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: sticky;
  top: var(--space-5);
}
.dt-prev-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.dt-prev-frame {
  aspect-ratio: 9 / 16;
  background:
    radial-gradient(at 30% 20%, color-mix(in oklch, var(--brand-orange) 50%, transparent), transparent 55%),
    radial-gradient(at 80% 80%, color-mix(in oklch, var(--brand-violet) 45%, transparent), transparent 55%),
    #0a0a0e;
  border-radius: var(--r-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--rule-2);
  overflow: hidden;
  position: relative;
}
.dt-prev-frame::before {
  content: "";
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 70px; height: 5px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}
.dt-prev-top {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 24px;
}
.dt-prev-hook {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: white;
  margin: 0 0 var(--space-2);
}
.dt-prev-text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255,255,255,0.92);
  margin: 0;
}
.dt-prev-foot {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dt-prev-cta {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: white;
  font-weight: 600;
  font-size: 11px;
}

/* Day navigation header */
.day-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--rule);
}
.day-nav-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.day-nav-day { font-family: var(--font-display); font-weight: 700; font-size: 32px; letter-spacing: -0.02em; line-height: 1; }
.day-nav-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.day-nav-controls { display: flex; gap: var(--space-2); align-items: center; }
.day-nav-arrow {
  width: 40px; height: 40px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-emil);
  text-decoration: none;
}
.day-nav-arrow:hover { border-color: var(--rule-2); background: var(--surface-2); }
.day-nav-arrow[disabled], .day-nav-arrow.disabled { opacity: 0.3; pointer-events: none; }

/* ============================================
   POLISH v1 – Emil curves, hover lifts, focus rings
   (additive, nie nadpisuje istniejących definicji bazowych)
   ============================================ */

/* === Page enter animation === */
.main-inner, .main-inner-wide {
  animation: page-enter 480ms var(--ease-emil) both;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Card hover lift (subtle) === */
.card:not(.outline):not(.elev),
.dash-stat,
.role-card,
.dt-edit-card {
  transition: transform var(--t-base) var(--ease-emil),
              border-color var(--t-base) var(--ease-emil),
              box-shadow var(--t-base) var(--ease-emil),
              background var(--t-base) var(--ease-emil);
}
@media (hover: hover) and (pointer: fine) {
  .card:not(.outline):not(.elev):not(.dt-edit-preview):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
  }
  .role-card:not(.active):hover,
  .dt-edit-card:not(.active):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
  }
}

/* === Press states z Emil bounce === */
.btn:active,
.role-card:active,
.dt-edit-card:active,
.month-day:active,
.dt-day:active,
.tab-item:active,
.day-nav-arrow:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

/* === Focus ring (lepsza accessibility) === */
.btn:focus-visible,
.role-card:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.day-nav-arrow:focus-visible {
  outline: 2px solid var(--brand-pink);
  outline-offset: 3px;
  border-radius: var(--r-md);
}

/* === IG Story preview: bardziej realistyczne ===*/
.dt-prev-frame {
  /* Story progress bar (top – 7 segmentów) */
  padding-top: 30px !important;
}
.dt-prev-frame::before {
  /* Override istniejacego ::before (kreska notch) na progress bars */
  content: "" !important;
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  height: 3px;
  width: auto !important;
  transform: none !important;
  background: linear-gradient(to right,
    rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.95) 14.2%,
    rgba(255,255,255,0.25) 14.2%, rgba(255,255,255,0.25) 16.6%,
    rgba(255,255,255,0.25) 30.4%, rgba(255,255,255,0.25) 32.8%,
    rgba(255,255,255,0.25) 100%);
  border-radius: 2px;
  pointer-events: none;
}
.dt-prev-frame::after {
  /* Profile circle + handle u góry */
  content: "•••";
  position: absolute;
  top: 20px;
  right: 14px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  letter-spacing: 1px;
}
.dt-prev-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: var(--space-3);
}
.dt-prev-profile-pic {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-gradient);
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.9);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: white;
}
.dt-prev-profile-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: white;
  font-size: 12px;
  font-weight: 500;
}
.dt-prev-profile-info .handle { color: rgba(255,255,255,0.95); }
.dt-prev-profile-info .time { color: rgba(255,255,255,0.6); font-size: 11px; }

/* === Generator loader: pulses bardziej synchronized z Emil === */
.gen-pulse span {
  animation: gen-pulse 1.6s var(--ease-emil) infinite;
}

/* === Onboarding step transition === */
form#onboarding-form {
  animation: step-enter 380ms var(--ease-emil) both;
}
@keyframes step-enter {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* === Smooth scroll site-wide === */
html { scroll-behavior: smooth; }

/* === Buttons w sidebar/tabbar: pink wash na hover === */
.side-item:hover {
  transform: translateX(2px);
  transition: transform var(--t-fast) var(--ease-emil), background var(--t-fast), color var(--t-fast);
}

/* === Toast: glass effect === */
.toast {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: color-mix(in oklch, var(--surface) 80%, transparent);
}

/* === Input focus: subtle pulse animation === */
.input:focus,
.textarea:focus {
  animation: input-focus 600ms var(--ease-emil);
}
@keyframes input-focus {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--brand-pink) 15%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--brand-pink) 15%, transparent); }
  100% { box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand-pink) 12%, transparent); }
}

/* === Empty state mesh bg – animowany subtle === */
.card[style*="brand-mesh"] {
  background-size: 200% 200% !important;
  animation: mesh-shift 24s ease-in-out infinite;
}
@keyframes mesh-shift {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

/* === Onboarding role-card check icon animation === */
.role-card.active::after {
  animation: check-pop 380ms var(--ease-emil);
}
@keyframes check-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* === Progress bar fill animation === */
.progress-fill, .app-progress span.done {
  animation: progress-shimmer 2s ease-in-out infinite alternate;
  background-size: 200% 100%;
}
@keyframes progress-shimmer {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

/* === Mobile: lepsza spacing dla touch === */
@media (max-width: 720px) {
  .btn { min-height: 44px; padding: 12px 20px; }
  .role-card { padding: 16px; min-height: 76px; }
  .input, .textarea { font-size: 16px; /* zapobiega zoom na iOS */ }
}

/* === IG Poll sticker overlay (na preview frame) === */
.ig-poll-sticker {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 12px 14px;
  margin: var(--space-3) 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.ig-poll-q {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  color: #18181c;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.3;
}
.ig-poll-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(0,0,0,0.08);
  border-radius: 8px;
  overflow: hidden;
}
.ig-poll-opts span {
  background: white;
  padding: 8px 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #18181c;
}
.ig-slider-track {
  height: 4px;
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
  position: relative;
  margin: 14px 8px 8px;
}
.ig-slider-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  background: var(--brand-gradient);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* === Calendar day-of-week headers (re-added – zostały usunięte w polish v1) === */
.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.cal-dow > span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 0;
}

/* === Edit affordance: visible signal że pole jest klikalne === */
.editable,
.editable-title {
  position: relative;
  cursor: text;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: var(--r-sm);
  border-bottom: 1px dashed transparent;
  transition: background var(--t-fast) var(--ease-emil), border-color var(--t-fast);
}

/* Subtelny dash zawsze widoczny – sygnalizuje "to się da edytować" */
.editable:not(:focus),
.editable-title:not(:focus) {
  border-bottom-color: color-mix(in oklch, var(--brand-pink) 35%, transparent);
}

/* Hover: pink wash + mocniejszy dash + ikona ołówka */
.editable:hover,
.editable-title:hover {
  background: color-mix(in oklch, var(--brand-pink) 6%, transparent);
  border-bottom-color: var(--brand-pink);
}

/* Pencil icon w prawym górnym rogu na hover */
.editable::after,
.editable-title::after {
  content: "✎";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  color: var(--brand-pink);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity var(--t-fast) var(--ease-emil), transform var(--t-fast);
  pointer-events: none;
}
.editable:hover::after,
.editable-title:hover::after {
  opacity: 0.7;
  transform: translateY(0);
}

/* Editing state: pełen pink outline (zostaje z istniejącego JS) */
.editable[contenteditable="true"],
.editable-title[contenteditable="true"] {
  border-bottom-color: transparent !important;
  background: color-mix(in oklch, var(--brand-pink) 4%, var(--surface));
}
.editable[contenteditable="true"]::after,
.editable-title[contenteditable="true"]::after {
  opacity: 0;
}

/* Mała etykieta "edytuj" pod pierwszym editable w karcie (subtelna instrukcja) */
.dt-edit-card .editable:first-of-type::before {
  content: "kliknij, by edytować";
  position: absolute;
  bottom: -16px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-emil);
  pointer-events: none;
}
.dt-edit-card:hover .editable:first-of-type::before {
  opacity: 0.6;
}

/* Title w campaign show – większy edit affordance */
.editable-title {
  padding: 8px 12px;
  margin: 0 -12px 0 -12px;
  display: inline-block;
}
.editable-title::after {
  top: 8px;
  right: 12px;
  font-size: 16px;
}

/* === Brand logo === */
.brand-logo {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand-gradient);
  color: white;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 6px color-mix(in oklch, var(--brand-pink) 30%, transparent);
}
.brand-logo-sm {
  width: 24px; height: 24px;
  font-size: 10px;
  border-radius: 7px;
}
.side-mark-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--space-3);
  text-decoration: none;
  color: inherit;
}
.mobile-mark-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

/* === Clickable progress segments === */
.progress-segment {
  flex: 1;
  display: block;
  padding: 4px 0;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-emil);
}
.progress-segment:hover { transform: translateY(-2px); }
.progress-segment > span {
  display: block;
  height: 4px;
  background: var(--surface-2);
  border-radius: 3px;
  transition: background var(--t-fast);
}
.progress-segment.done > span { background: var(--brand-gradient); }
.progress-segment.current > span {
  background: var(--brand-gradient);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand-pink) 15%, transparent);
}
.progress-segment:hover > span {
  background: color-mix(in oklch, var(--brand-pink) 50%, var(--surface-2));
}

/* === Footer === */
.app-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-7);
}
.footer-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.footer-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: 4px;
}
.footer-links {
  display: flex;
  gap: var(--space-4);
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--brand-pink); }

/* Sidebar gap zwiększony dla logo */
.sidebar { gap: var(--space-6); }

/* === Brand stack (logo + dwuwierszowy tekst) === */
.brand-stack {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--space-3);
  text-decoration: none;
  color: inherit;
  transition: opacity var(--t-fast);
}
.brand-stack:hover { opacity: 0.85; }

.brand-stack .brand-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-gradient);
  color: white;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  padding-top: 6px;        /* polski cudzysłów ma wysoką pozycję, korekta */
  flex-shrink: 0;
  box-shadow: 0 3px 10px color-mix(in oklch, var(--brand-pink) 35%, transparent),
              inset 0 1px 0 rgba(255,255,255,0.15);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* === Footer brand logo override === */
.app-footer .brand-logo {
  width: 24px; height: 24px;
  font-size: 18px;
  padding-top: 4px;
  border-radius: 7px;
  box-shadow: 0 2px 6px color-mix(in oklch, var(--brand-pink) 25%, transparent);
}

/* Mobile compact */
.brand-stack-mobile .brand-logo {
  width: 28px; height: 28px;
  font-size: 20px;
  padding-top: 4px;
  border-radius: 8px;
}


/* === Brand mark: SVG-based (phone cascade) – override gradientu z poprzedniej wersji === */
.brand-logo {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  width: 36px !important;
  height: 36px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-logo svg { width: 100%; height: 100%; display: block; }
.brand-logo-sm {
  width: 28px !important;
  height: 28px !important;
}
.app-footer .brand-logo {
  width: 24px !important;
  height: 24px !important;
}
.brand-stack-mobile .brand-logo {
  width: 26px !important;
  height: 26px !important;
}


/* === SVG icons in nav – sizing override === */
.side-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  color: inherit;
}
.side-icon {
  background: transparent !important;
  border: none !important;
  width: auto;
  height: auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.side-item.active .side-icon {
  background: transparent !important;
  color: var(--brand-pink);
}
.side-item.active .side-icon svg {
  stroke: url(#brand-grad) var(--brand-pink);
}

.tab-item .icon-box svg {
  width: 16px;
  height: 16px;
  display: block;
}
.tab-item.active .icon-box {
  background: var(--brand-gradient);
  color: white;
}
.tab-item.active .icon-box svg {
  color: white;
}


/* === Onboarding polish – wzmocnione przejścia między krokami === */
form#onboarding-form {
  animation: onb-step-enter 540ms var(--ease-emil) both;
}
@keyframes onb-step-enter {
  0% { opacity: 0; transform: translateY(16px) scale(0.985); }
  60% { opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}

/* Onboarding header – typografia większa, smooth */
.onb-shell .app-h1 {
  font-size: clamp(32px, 5vw, 48px);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: onb-headline-enter 700ms var(--ease-emil) both;
  animation-delay: 100ms;
}
@keyframes onb-headline-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.onb-shell .app-sub {
  animation: onb-headline-enter 700ms var(--ease-emil) both;
  animation-delay: 200ms;
}

/* Progress segments – staggered emergence */
.app-progress .progress-segment {
  animation: progress-stagger 400ms var(--ease-emil) both;
}
.app-progress .progress-segment:nth-child(1) { animation-delay: 50ms; }
.app-progress .progress-segment:nth-child(2) { animation-delay: 100ms; }
.app-progress .progress-segment:nth-child(3) { animation-delay: 150ms; }
.app-progress .progress-segment:nth-child(4) { animation-delay: 200ms; }
.app-progress .progress-segment:nth-child(5) { animation-delay: 250ms; }
.app-progress .progress-segment:nth-child(6) { animation-delay: 300ms; }
.app-progress .progress-segment:nth-child(7) { animation-delay: 350ms; }
@keyframes progress-stagger {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Onboarding cards – staggered */
.onb-shell .role-cards .role-card,
.onb-shell .field,
.onb-shell .card {
  animation: card-stagger 500ms var(--ease-emil) both;
}
.onb-shell .role-cards .role-card:nth-child(1) { animation-delay: 300ms; }
.onb-shell .role-cards .role-card:nth-child(2) { animation-delay: 380ms; }
.onb-shell .role-cards .role-card:nth-child(3) { animation-delay: 460ms; }
.onb-shell .role-cards .role-card:nth-child(4) { animation-delay: 540ms; }
@keyframes card-stagger {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Onboarding footer – subtelne pojawienie */
.onb-actions {
  animation: onb-headline-enter 600ms var(--ease-emil) both;
  animation-delay: 600ms;
}

/* Role-card active state – bardziej dramatyczne pink glow */
.role-card.active {
  border-color: var(--brand-pink);
  background: color-mix(in oklch, var(--brand-pink) 6%, var(--surface));
  box-shadow: 0 0 0 1px var(--brand-pink),
              0 8px 24px color-mix(in oklch, var(--brand-pink) 22%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* Smooth transition na input focus */
.input, .textarea, .select {
  transition: all var(--t-base) var(--ease-emil);
}

/* Slider track polish */
.slider-track {
  transition: background var(--t-base);
}
.slider-track:hover {
  background: var(--surface-3);
}

/* Onboarding complete celebration – pulsing gradient mesh background */
.onb-complete-hero {
  background:
    radial-gradient(ellipse at top left, color-mix(in oklch, var(--brand-orange) 25%, transparent), transparent 50%),
    radial-gradient(ellipse at bottom right, color-mix(in oklch, var(--brand-violet) 25%, transparent), transparent 50%),
    var(--surface);
  animation: celebration-pulse 4s ease-in-out infinite;
}
@keyframes celebration-pulse {
  0%, 100% { background-size: 100% 100%; }
  50% { background-size: 120% 120%; }
}


/* ============================================
   BRAND DASHBOARD v2 – Centrum marki (wow polish)
   ============================================ */

.brand-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-7);
  padding: var(--space-6) var(--space-6);
  background:
    radial-gradient(ellipse at top right, color-mix(in oklch, var(--brand-pink) 12%, transparent), transparent 60%),
    radial-gradient(ellipse at bottom left, color-mix(in oklch, var(--brand-violet) 10%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
@media (max-width: 880px) {
  .brand-hero { grid-template-columns: 1fr; padding: var(--space-5); }
}

.brand-hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: var(--space-2) 0 var(--space-3);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-hero-sub {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0 0 var(--space-5);
  max-width: 52ch;
}

.brand-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  max-width: 520px;
}
@media (max-width: 540px) {
  .brand-hero-stats { grid-template-columns: repeat(2, 1fr); }
}
.brand-stat {
  padding: 14px 16px;
  background: color-mix(in oklch, var(--surface-2) 70%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  text-align: center;
}
.brand-stat-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.brand-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Overall ring (radial progress) */
.overall-ring {
  width: 240px; height: 240px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 880px) { .overall-ring { width: 200px; height: 200px; margin: 0 auto; } }
.overall-ring svg {
  width: 100%; height: 100%;
}
.overall-ring .ring-progress {
  transition: stroke-dashoffset 1.4s var(--ease-emil);
  filter: drop-shadow(0 4px 12px color-mix(in oklch, var(--brand-pink) 30%, transparent));
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ring-percent {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  letter-spacing: -0.04em;
  line-height: 1;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ring-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 180px;
}

/* Sections grid */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.brand-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  transition: all var(--t-base) var(--ease-emil);
  animation: brand-card-enter 480ms var(--ease-emil) both;
  cursor: pointer;
}
@keyframes brand-card-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) and (pointer: fine) {
  .brand-card:hover {
    transform: translateY(-3px);
    border-color: var(--rule-2);
    box-shadow: var(--shadow-card-hover);
  }
  .brand-card:hover .brand-card-icon {
    transform: scale(1.08) rotate(-2deg);
  }
}

.brand-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.brand-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: transform var(--t-base) var(--ease-emil);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
}

.brand-card-status {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.brand-card-status.ok { background: color-mix(in oklch, oklch(0.65 0.18 145) 15%, white); color: oklch(0.45 0.18 145); }
.brand-card-status.wip { background: color-mix(in oklch, var(--brand-orange) 15%, white); color: var(--brand-orange); }
.brand-card-status.starter { background: color-mix(in oklch, var(--brand-pink) 12%, white); color: var(--brand-pink); }
.brand-card-status.empty { background: var(--surface-2); color: var(--text-muted); }

.brand-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.brand-card-meta {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  font-family: var(--font-mono);
}

.brand-card-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
}
.brand-card-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.brand-card-fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: inherit;
  width: 0;
  animation: fill-bar 1.4s var(--ease-emil) both;
  animation-delay: 400ms;
}
@keyframes fill-bar {
  from { width: 0; }
  to { width: var(--target-width); }
}
.brand-card-percent {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 40px;
  text-align: right;
}

/* Quick actions */
.brand-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.brand-action {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--t-base) var(--ease-emil);
}
.brand-action.primary {
  background: var(--brand-gradient);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-cta);
}
.brand-action.primary .brand-action-sub { color: rgba(255,255,255,0.85); }
.brand-action.primary .brand-action-icon { background: rgba(255,255,255,0.15); color: white; }
.brand-action.primary:hover { box-shadow: 0 10px 28px color-mix(in oklch, var(--brand-pink) 35%, transparent); transform: translateY(-2px); }

.brand-action:not(.primary):hover {
  border-color: var(--rule-2);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.brand-action-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--brand-pink);
  flex-shrink: 0;
}
.brand-action-icon svg { width: 22px; height: 22px; }

.brand-action-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: inherit;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.brand-action-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.brand-action-arrow {
  margin-left: auto;
  font-size: 22px;
  color: inherit;
  opacity: 0.7;
  transition: transform var(--t-fast);
}
.brand-action:hover .brand-action-arrow { transform: translateX(4px); }

/* === Ring percent – fix overflow === */
.ring-percent {
  font-size: 42px !important;
  letter-spacing: -0.035em !important;
}
.ring-label {
  font-size: 10px !important;
  margin-top: 6px !important;
  max-width: 140px !important;
  line-height: 1.3 !important;
}
@media (max-width: 880px) {
  .ring-percent { font-size: 38px !important; }
}


/* ============================================
   LOADING OVERLAY – global, używany dla avatar upload + tile regen
   ============================================ */
.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  animation: overlay-fade-in 280ms var(--ease-emil);
}
.app-overlay.active { display: flex; }
@keyframes overlay-fade-in {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(16px); }
}

.overlay-content {
  max-width: 480px;
  width: 90%;
  text-align: center;
  background:
    radial-gradient(ellipse at top, color-mix(in oklch, var(--brand-orange) 8%, transparent), transparent 60%),
    radial-gradient(ellipse at bottom, color-mix(in oklch, var(--brand-violet) 8%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-2xl);
  padding: var(--space-7) var(--space-6);
  box-shadow: var(--shadow-premium);
  animation: overlay-scale-in 500ms var(--ease-emil) both;
}
@keyframes overlay-scale-in {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.overlay-pulse {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  height: 80px;
  margin-bottom: var(--space-5);
}
.overlay-pulse span {
  width: 16px; height: 16px;
  border-radius: 50%;
  animation: overlay-pulse 1.4s var(--ease-emil) infinite;
}
.overlay-pulse span:nth-child(1) { background: var(--brand-orange); box-shadow: 0 0 24px var(--brand-orange); }
.overlay-pulse span:nth-child(2) { background: var(--brand-pink); box-shadow: 0 0 24px var(--brand-pink); animation-delay: 0.2s; }
.overlay-pulse span:nth-child(3) { background: var(--brand-violet); box-shadow: 0 0 24px var(--brand-violet); animation-delay: 0.4s; }
@keyframes overlay-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.5); opacity: 1; }
}

.overlay-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.overlay-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-pink);
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.overlay-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: var(--space-5) 0 var(--space-4);
  text-align: left;
}
.overlay-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  transition: all 280ms var(--ease-emil);
}
.overlay-step .step-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--rule-2);
  flex-shrink: 0;
  transition: all 280ms;
}
.overlay-step.done { color: var(--text); }
.overlay-step.done .step-dot { background: oklch(0.65 0.18 145); box-shadow: 0 0 0 3px color-mix(in oklch, oklch(0.65 0.18 145) 20%, transparent); }
.overlay-step.active { border-color: var(--brand-pink); color: var(--text); background: color-mix(in oklch, var(--brand-pink) 5%, var(--surface-2)); }
.overlay-step.active .step-dot { background: var(--brand-pink); box-shadow: 0 0 0 4px color-mix(in oklch, var(--brand-pink) 25%, transparent); animation: pulse-dot 1.4s ease-in-out infinite; }

.overlay-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
