/* ══════════════════════════════════════════════
   VARIANT G — Temporal Flow / Timeline Discovery
   Palette: white #fff, ink #0f172a, blue #2563eb,
            now-red #ef4444, sage #4a7c59, muted #94a3b8
   ══════════════════════════════════════════════ */

/* ─── Tokens ─── */
:root {
  --white:    #ffffff;
  --ink:      #0f172a;
  --ink-mid:  #334155;
  --ink-soft: #64748b;
  --muted:    #94a3b8;
  --border:   #e2e8f0;
  --surface:  #f8fafc;

  --blue:     #2563eb;
  --blue-lt:  #dbeafe;
  --red:      #ef4444;
  --red-lt:   #fee2e2;
  --now-red:  #ef4444;
  --sage:     #4a7c59;
  --sage-lt:  #dcfce7;
  --orange:   #f97316;
  --orange-lt:#ffedd5;
  --purple:   #8b5cf6;
  --purple-lt:#ede9fe;
  --amber:    #d97706;
  --amber-lt: #fef3c7;

  --gold:     #f59e0b;

  --lane-h:   52px;
  --header-h: 48px;
  --zoom-bar-h: 36px;
  --bottom-nav-h: 60px;
  --label-w:  84px;

  /* Timeline pixel per minute at zoom=1 (1 day visible in ~310px) */
  --px-per-min: 0.36px;

  --radius:   12px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:   0 4px 16px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.18);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Heebo', sans-serif;
  background: #1e293b;
  direction: rtl;
  overflow: hidden;
}

/* ─── Desktop Wrapper ─── */
#desktop-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 0;
}

/* ─── Side Panel ─── */
#side-panel {
  display: none;
  width: 320px;
  height: 844px;
  background: var(--white);
  border-radius: var(--radius) 0 0 var(--radius);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--ink);
}

.side-logo {
  font-size: 22px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
}

.side-variant-badge {
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 1px;
}

.side-panel-body { padding: 20px; }

.side-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.3;
}

.side-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}

.side-section { margin-bottom: 20px; }

.side-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
}

.concept-diagram {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 11px;
}

.diag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.diag-lane {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid;
  width: 64px;
  text-align: center;
}

.diag-blocks { display: flex; align-items: center; flex: 1; }

.diag-block {
  height: 16px;
  border-radius: 3px;
  color: transparent;
  font-size: 1px;
  opacity: 0.85;
}

.diag-now {
  font-size: 10px;
  color: var(--red);
  font-weight: 700;
  margin-top: 4px;
  padding-right: 72px;
}

.feature-list { list-style: none; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--ink-mid);
  border-bottom: 1px solid var(--border);
}
.feat-icon { font-size: 14px; }

.legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-mid);
}

.leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-extras { display: flex; flex-direction: column; gap: 4px; }

.leg-extra {
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.leg-urgent { color: var(--red); }
.leg-sponsored { color: var(--gold); }
.leg-imported { color: var(--muted); letter-spacing: 2px; }

.whats-next-panel {
  font-size: 12px;
  color: var(--ink-mid);
  line-height: 1.6;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px;
}

/* ─── Phone Frame ─── */
#phone-frame {
  width: 390px;
  height: 844px;
  background: var(--white);
  border-radius: 0 var(--radius) var(--radius) 0;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

@media (min-width: 769px) {
  #side-panel { display: flex; flex-direction: column; }
  #phone-frame {
    border-radius: 0 var(--radius) var(--radius) 0;
  }
}

@media (max-width: 768px) {
  #desktop-wrapper {
    align-items: stretch;
    justify-content: stretch;
  }
  #phone-frame {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }
}

/* ─── App Root ─── */
#app {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ─── Screens ─── */
.screen {
  display: none;
  flex-direction: column;
  position: absolute;
  inset: 0;
  background: var(--white);
  overflow: hidden;
}
.screen.active { display: flex; }

/* ─── App Header ─── */
.app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
  z-index: 10;
}

.header-right { display: flex; align-items: center; gap: 10px; }
.header-left  { display: flex; align-items: center; gap: 4px; }

.app-logo-sm {
  font-size: 16px;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -0.5px;
}

.header-location {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 14px;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--surface); }

/* ─── Screen Header (back) ─── */
.screen-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.screen-header h1 { font-size: 16px; font-weight: 700; color: var(--ink); }

.btn-back {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--blue);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.btn-back:hover { background: var(--blue-lt); }

/* ─── Bottom Nav ─── */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 50;
}

.nav-btn {
  flex: 1;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  font-family: 'Heebo', sans-serif;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-btn i { font-size: 16px; }
.nav-btn.active { color: var(--blue); }

/* ─── FAB ─── */
.fab {
  position: absolute;
  bottom: calc(var(--bottom-nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
  z-index: 51;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover { transform: translateX(-50%) scale(1.08); box-shadow: 0 6px 24px rgba(37,99,235,.5); }

/* ══════════════════════════════════════════════
   TIMELINE SCREEN
   ══════════════════════════════════════════════ */

/* Zoom Bar */
.zoom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: var(--zoom-bar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

.zoom-label {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
  white-space: nowrap;
}

.zoom-group {
  display: flex;
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.zoom-btn {
  padding: 2px 8px;
  border: none;
  border-radius: 4px;
  font-family: 'Heebo', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--ink-soft);
  transition: all 0.15s;
}
.zoom-btn.active {
  background: var(--white);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.whats-next-btn {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-family: 'Heebo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.whats-next-btn:hover { background: var(--blue-lt); }

/* What's Next Popup */
.whats-next-popup {
  position: absolute;
  top: calc(var(--header-h) + var(--zoom-bar-h));
  left: 8px;
  right: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 0;
  overflow: hidden;
}

.wnp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}
.wnp-header button { background: none; border: none; color: var(--white); cursor: pointer; font-size: 14px; }

.wnp-list { padding: 8px 0; }

.wnp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.wnp-item:hover { background: var(--surface); }

.wnp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wnp-info { flex: 1; min-width: 0; }
.wnp-title { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wnp-time  { font-size: 11px; color: var(--ink-soft); }

/* Timeline Layout */
.timeline-outer {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  padding-bottom: var(--bottom-nav-h);
}

.lane-labels {
  width: var(--label-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--white);
  z-index: 20;
  box-shadow: -2px 0 8px rgba(0,0,0,.06);
}

.lane-label-header {
  height: 48px;  /* day header + ticks */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.lane-label {
  height: var(--lane-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  padding: 0 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cat-events { color: var(--blue);   background: #eff6ff; }
.cat-help   { color: var(--red);    background: #fff5f5; }
.cat-offer  { color: var(--sage);   background: #f0fdf4; }
.cat-seek   { color: var(--orange); background: #fff7ed; }
.cat-give   { color: var(--purple); background: #f5f3ff; }
.cat-sale   { color: var(--amber);  background: #fffbeb; }

.timeline-scroll {
  flex: 1;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  position: relative;
}

.timeline-scroll::-webkit-scrollbar { height: 4px; }
.timeline-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.timeline-grid {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 100%;
  /* width is set via JS */
}

/* Day Headers Row */
.timeline-headers {
  height: 28px;
  display: flex;
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 15;
  flex-shrink: 0;
}

.day-header {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mid);
  border-left: 1px solid var(--border);
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s;
  background: var(--white);
}
.day-header:hover { background: var(--blue-lt); }
.day-header.today { color: var(--blue); background: var(--blue-lt); }
.day-header .day-date { font-size: 9px; font-weight: 400; color: var(--muted); }

/* Hour Ticks */
.timeline-ticks {
  height: 20px;
  position: sticky;
  top: 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 14;
  flex-shrink: 0;
}

.hour-tick {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding-right: 4px;
  font-size: 9px;
  color: var(--muted);
  border-right: 1px solid #f1f5f9;
}

/* Lane Rows */
.timeline-lane {
  height: var(--lane-h);
  position: relative;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lane-events { background: #f8fbff; }
.lane-help   { background: #fff8f8; }
.lane-offer  { background: #f7fdf9; }
.lane-seek   { background: #fff9f4; }
.lane-give   { background: #faf7ff; }
.lane-sale   { background: #fffdf0; }

/* Vertical day dividers in lanes */
.day-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  pointer-events: none;
  z-index: 1;
}

/* Now Marker */
.now-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  z-index: 20;
  pointer-events: none;
}

.now-line {
  width: 2px;
  height: 100%;
  background: var(--now-red);
  box-shadow: 0 0 6px var(--now-red);
}

.now-label {
  position: absolute;
  top: -6px;
  right: 50%;
  transform: translateX(50%);
  background: var(--now-red);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
}

/* Item Blocks */
.tl-item {
  position: absolute;
  top: 6px;
  height: calc(var(--lane-h) - 12px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  color: var(--white);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 5;
  min-width: 24px;
}

.tl-item:hover { transform: scaleY(1.08); z-index: 10; }

.tl-item .tl-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Urgency glow */
.tl-item.urgent {
  box-shadow: 0 0 0 2px var(--red), 0 0 12px rgba(239,68,68,.5);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 2px var(--red), 0 0 12px rgba(239,68,68,.5); }
  50%       { box-shadow: 0 0 0 2px var(--red), 0 0 22px rgba(239,68,68,.8); }
}

/* Sponsored gold glow */
.tl-item.sponsored {
  box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(245,158,11,.4);
  outline: none;
}

/* Imported dashed border */
.tl-item.imported {
  outline: 2px dashed rgba(255,255,255,0.6);
  outline-offset: -2px;
}

/* Ongoing (no-time) bars */
.tl-item.ongoing {
  opacity: 0.55;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 6px,
    rgba(255,255,255,.25) 6px,
    rgba(255,255,255,.25) 12px
  );
  border: 2px dashed currentColor;
  top: 10px;
  height: calc(var(--lane-h) - 20px);
}

/* Category colors */
.tl-events { background: var(--blue); }
.tl-help   { background: var(--red); }
.tl-offer  { background: var(--sage); }
.tl-seek   { background: var(--orange); }
.tl-give   { background: var(--purple); }
.tl-sale   { background: var(--amber); }

/* ══════════════════════════════════════════════
   TODAY SCREEN
   ══════════════════════════════════════════════ */

.today-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 calc(var(--bottom-nav-h) + 12px);
}

.today-section {
  margin-bottom: 0;
}

.today-section-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}

.today-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.today-item:hover { background: var(--surface); }

.today-item-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  min-width: 38px;
  padding-top: 2px;
  text-align: center;
}

.today-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.today-item-body { flex: 1; min-width: 0; }
.today-item-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.today-item-desc  { font-size: 11px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.today-item-badges {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}
.badge-urgent   { background: var(--red-lt);    color: var(--red); }
.badge-imported { background: var(--surface);   color: var(--muted); border: 1px dashed var(--muted); }
.badge-sponsored{ background: #fef9c3;           color: var(--amber); }

.today-empty {
  padding: 16px 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ══════════════════════════════════════════════
   WEEK SCREEN
   ══════════════════════════════════════════════ */

.week-container {
  flex: 1;
  overflow: auto;
  padding-bottom: var(--bottom-nav-h);
}

.week-grid {
  display: grid;
  grid-template-columns: 36px repeat(7, 1fr);
  border-left: 1px solid var(--border);
  min-width: 520px;
}

.week-col-header {
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 2px solid var(--border);
  border-left: 1px solid var(--border);
  padding: 6px 2px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-mid);
  z-index: 10;
}
.week-col-header.today-col { color: var(--blue); background: var(--blue-lt); }
.week-col-header .wch-day  { font-size: 9px; color: var(--muted); font-weight: 400; }

.week-time-cell {
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  padding: 2px 3px;
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
}

.week-cell {
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  min-height: 28px;
  padding: 2px;
  position: relative;
  cursor: pointer;
  transition: background 0.1s;
}
.week-cell:hover { background: var(--surface); }

.week-event-block {
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* ══════════════════════════════════════════════
   HOT LIST
   ══════════════════════════════════════════════ */

.hot-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 calc(var(--bottom-nav-h) + 12px);
}

.hot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.hot-item:hover { background: var(--surface); }

.hot-rank {
  font-size: 18px;
  font-weight: 900;
  color: var(--border);
  min-width: 24px;
  text-align: center;
}

.hot-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.hot-info { flex: 1; min-width: 0; }
.hot-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.hot-meta  { font-size: 11px; color: var(--ink-soft); }

.hot-urgency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-glow 1.5s infinite;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   MAP SCREEN
   ══════════════════════════════════════════════ */

#map-container {
  flex: 1;
  min-height: 0;
  padding-bottom: var(--bottom-nav-h);
}

#map-container > div { height: 100% !important; }

/* ══════════════════════════════════════════════
   LIST SCREEN
   ══════════════════════════════════════════════ */

.list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 calc(var(--bottom-nav-h) + 12px);
}

.list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.list-item:hover { background: var(--surface); }

.list-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.list-body { flex: 1; min-width: 0; }
.list-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.list-meta  { font-size: 11px; color: var(--ink-soft); }
.list-dist  { font-size: 11px; color: var(--blue); font-weight: 600; }

/* ══════════════════════════════════════════════
   LANDING SCREEN
   ══════════════════════════════════════════════ */

.screen#screen-landing {
  background: var(--ink);
}

.landing-bg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  overflow: auto;
}

.landing-logo {
  font-size: 48px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -2px;
  margin-bottom: 8px;
}

.landing-tagline {
  font-size: 28px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
  text-align: center;
}

.highlight-time {
  color: var(--now-red);
  position: relative;
}

.landing-desc {
  font-size: 14px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 280px;
}

/* Timeline preview animation */
.timeline-preview {
  width: 100%;
  max-width: 300px;
  height: 80px;
  background: #1e293b;
  border-radius: var(--radius);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  border: 1px solid #334155;
}

.tp-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 40px;
  width: 2px;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.tp-block {
  position: absolute;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}

.tp-block.b1 { top: 12px; left: 44px; width: 80px; background: var(--blue); animation: slide-in 0.8s ease; }
.tp-block.b2 { top: 12px; left: 160px; width: 90px; background: var(--sage); animation: slide-in 1.0s ease; }
.tp-block.b3 { top: 46px; left: 230px; width: 100px; background: var(--purple); animation: slide-in 1.2s ease; }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.landing-content { display: flex; flex-direction: column; align-items: center; width: 100%; }

.btn-primary {
  width: 100%;
  max-width: 300px;
  padding: 13px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'Heebo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.2s;
}
.btn-primary:hover { background: #1d4ed8; }

.btn-ghost {
  width: 100%;
  max-width: 300px;
  padding: 11px;
  background: transparent;
  color: var(--muted);
  border: 1px solid #334155;
  border-radius: var(--radius);
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ══════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════ */

.login-body {
  flex: 1;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  font-size: 40px;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.login-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.form-group {
  width: 100%;
  max-width: 300px;
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mid);
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  background: var(--white);
  direction: rtl;
}
.form-input:focus { border-color: var(--blue); }

.login-divider {
  margin: 14px 0;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}

.btn-social {
  width: 100%;
  max-width: 300px;
  padding: 11px;
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Heebo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════
   ONBOARDING SCREEN
   ══════════════════════════════════════════════ */

.onboarding-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 32px;
  background: linear-gradient(180deg, #f0f9ff 0%, var(--white) 100%);
}

.ob-steps-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 40px;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, width 0.2s;
}
.ob-dot.active { background: var(--blue); width: 24px; border-radius: 4px; }

.ob-slides { width: 100%; flex: 1; }

.ob-slide {
  display: none;
  text-align: center;
  flex-direction: column;
  align-items: center;
}
.ob-slide.active { display: flex; }

.ob-icon { font-size: 60px; margin-bottom: 20px; }

.ob-slide h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 12px;
}

.ob-slide p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 280px;
}

.ob-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}
.ob-actions .btn-ghost { border-color: var(--border); color: var(--ink-soft); }

/* ══════════════════════════════════════════════
   ITEM DETAIL
   ══════════════════════════════════════════════ */

.item-detail {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--bottom-nav-h);
}

.item-hero {
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 16px;
  color: var(--white);
  position: relative;
}

.item-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.2), rgba(0,0,0,.6));
  border-radius: 0;
}

.item-hero > * { position: relative; z-index: 1; }

.item-hero-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(255,255,255,.2);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.item-hero-title { font-size: 18px; font-weight: 800; line-height: 1.2; }

.item-back-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,.3);
  border: none;
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.item-body { padding: 16px; }

.item-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.item-meta-row i { color: var(--blue); font-size: 13px; }

.item-desc {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.7;
  margin-bottom: 16px;
}

.item-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-action {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Heebo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-action.primary { background: var(--blue); color: var(--white); }
.btn-action.outline { background: var(--white); color: var(--blue); border: 1.5px solid var(--blue); }

.item-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.item-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.item-author-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.item-author-sub  { font-size: 11px; color: var(--ink-soft); }

/* ══════════════════════════════════════════════
   BOTTOM SHEET
   ══════════════════════════════════════════════ */

.bottom-sheet-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 80;
}

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 90;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 85%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet-overlay.open { display: block; }

.bs-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.bs-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 24px;
}

/* ══════════════════════════════════════════════
   QUICK CREATE MODAL
   ══════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 80;
}
.modal-overlay.open { display: block; }

.quick-modal {
  position: absolute;
  bottom: calc(var(--bottom-nav-h) + 60px);
  left: 16px;
  right: 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0;
  z-index: 90;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  overflow: hidden;
}

.quick-modal.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.qm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}
.qm-header button { background: none; border: none; color: var(--white); cursor: pointer; font-size: 14px; }
.quick-modal .form-group { padding: 0 14px; margin-bottom: 10px; }
.quick-modal .form-group:first-of-type { margin-top: 12px; }
.quick-modal .btn-primary { margin: 0 14px 14px; width: calc(100% - 28px); }

/* ══════════════════════════════════════════════
   SETTINGS / PROFILE / MISC
   ══════════════════════════════════════════════ */

.settings-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--bottom-nav-h);
}

.setting-item {
  display: flex;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.setting-text { flex: 1; }
.setting-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.setting-desc  { font-size: 12px; color: var(--ink-soft); }

.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  top: 3px;
  right: 3px;
  transition: transform 0.2s;
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::after { transform: translateX(-18px); }

/* Profile */
.profile-body { flex: 1; overflow-y: auto; padding-bottom: var(--bottom-nav-h); }

.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--blue-lt) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
}

.profile-name { font-size: 18px; font-weight: 800; color: var(--ink); }
.profile-sub  { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.profile-stats {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.stat-box {
  flex: 1;
  text-align: center;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.stat-num { font-size: 18px; font-weight: 800; color: var(--ink); }
.stat-lbl { font-size: 10px; color: var(--muted); }

.profile-menu { padding: 8px 0; }
.pmenu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.pmenu-item:hover { background: var(--surface); }
.pmenu-item i { width: 18px; text-align: center; color: var(--ink-soft); }
.pmenu-item.danger { color: var(--red); }
.pmenu-item.danger i { color: var(--red); }

/* Create */
.create-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: calc(var(--bottom-nav-h) + 12px);
}
.create-body .btn-primary { margin-top: 8px; }
.create-body textarea.form-input { resize: vertical; }

/* Responders */
.responders-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--bottom-nav-h);
}

.responder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.resp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-lt);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.resp-info { flex: 1; }
.resp-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.resp-time { font-size: 11px; color: var(--ink-soft); }

.btn-sm-primary {
  padding: 6px 12px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Heebo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Scroll indicator hint on timeline ── */
.scroll-hint {
  position: absolute;
  bottom: calc(var(--bottom-nav-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,42,.75);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 1;
  transition: opacity 1s;
}
.scroll-hint.hidden { opacity: 0; }

/* ── Responsive tweaks for very small screens ── */
@media (max-width: 400px) {
  :root {
    --label-w: 68px;
    --lane-h: 46px;
  }
  .lane-label { font-size: 8px; }
}

/* ══════════════════════════════════════════════
   WHAT'S NEXT FLOATING PILL
   ══════════════════════════════════════════════ */

.wn-pill {
  position: absolute;
  top: calc(var(--header-h) + var(--zoom-bar-h) + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  z-index: 50;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: pill-drop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wn-pill:hover {
  transform: translateX(-50%) scale(1.04);
  box-shadow: var(--shadow-lg);
}

.wn-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wn-pill-text { flex: 1; }
.wn-pill-text strong { color: var(--white); }
.wn-pill-text em { font-style: normal; color: var(--muted); }
.wn-pill-arrow { color: var(--muted); font-size: 14px; }

@keyframes pill-drop {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ══════════════════════════════════════════════
   QUICK CREATE MODAL — enhanced
   ══════════════════════════════════════════════ */

.qm-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.qm-cat-chip {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
  border: 1.5px solid;
  background: transparent;
  color: var(--ink-mid);
  transition: all 0.15s;
}

.qm-time-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.qm-time-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Heebo', sans-serif;
  transition: background 0.15s;
}
.qm-time-btn:hover { background: var(--blue-lt); }

.qm-time-display {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  min-width: 70px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ─── Today Empty Slots ─── */
.today-empty-slot {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  margin: 4px 12px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  min-height: 40px;
}
.today-empty-slot-text {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

/* ─── Keyboard help button in zoom bar ─── */
#kb-hint-btn {
  margin-inline-start: auto;
  color: var(--ink-soft);
}
#kb-hint-btn:hover { color: var(--blue); }

/* ─── FA spin animation (if not present) ─── */
@keyframes fa-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.fa-spin { animation: fa-spin 1s linear infinite; }
