/* ==========================================================================
   Terrapix Brand Manual — app shell
   Dashboard úvodu, oblíbené, nápověda, spodní lišta (mobil).
   Jen tokeny z tokens.css; glass recept dle AGENTS.md.
   ========================================================================== */

/* --- Dashboard ------------------------------------------------------------ */
.dashboard { display: flex; flex-direction: column; gap: var(--space-7); margin-bottom: var(--space-7); }
.dashboard:empty { display: none; }

.dash-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
}
.dash-top.no-continue { grid-template-columns: minmax(0, 1fr); }

.dash-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
}

.dash-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--mystic-ray);
}

.dash-continue {
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}
.dash-continue:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 40px rgba(31, 38, 135, 0.14);
}
.dash-continue-num { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-top: var(--space-2); }
.dash-continue-title {
  font-size: var(--h2-size);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: var(--leading-snug);
  color: var(--text-primary);
}
.dash-continue-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
  font-size: 13px;
  color: var(--text-muted);
}

.dash-status { gap: var(--space-4); justify-content: center; }
.dash-status-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.dash-big { font-size: 40px; font-weight: 600; letter-spacing: var(--tracking-display); line-height: 1; color: var(--text-primary); }
.dash-muted { font-size: 13px; color: var(--text-muted); }

.dash-bar {
  display: flex;
  gap: 3px;
  height: 12px;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--status-prep-bg);
  overflow: hidden;
}
.dash-bar-seg { flex-basis: 0; min-width: 6px; border-radius: var(--radius-pill); }
.dash-bar-seg[data-status="schvaleno"] { background: var(--status-ok-dot); }
.dash-bar-seg[data-status="navrh"] { background: var(--status-draft-dot); }
.dash-bar-seg[data-status="pripravujeme"] { background: var(--status-prep-dot); }

.dash-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); list-style: none; padding: 0; margin: 0; }
.dash-legend li { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 13px; }
.dash-legend-n { font-weight: 600; color: var(--text-primary); }
.dash-legend-l { color: var(--text-secondary); }

.dash-section { display: flex; flex-direction: column; gap: var(--space-4); }
.dash-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}
.dash-title-chapters { margin-bottom: calc(-1 * var(--space-3)); }

.dash-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 16px rgba(31, 38, 135, 0.08);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.dash-chip:hover { background: rgba(255, 255, 255, 0.75); transform: translateY(-1px); }
.dash-chip-num { color: var(--mystic-ray); font-weight: 600; }
.dash-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-chip-star { display: inline-flex; color: var(--mystic-ray); }
.dash-chip-star svg { width: 13px; height: 13px; fill: currentColor; }

.dash-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: var(--space-4);
}

.dash-tool {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}
.dash-tool:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 40px rgba(31, 38, 135, 0.14);
}
.dash-tool-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-pill);
  color: var(--mystic-ray);
  background: rgba(140, 74, 190, 0.12);
}
.dash-tool-ic svg { width: 20px; height: 20px; }
.dash-tool-title { font-size: var(--h3-size); font-weight: 600; color: var(--text-primary); line-height: var(--leading-snug); }
.dash-tool-desc { font-size: 13px; color: var(--text-muted); }

@media (max-width: 860px) {
  .dash-top { grid-template-columns: minmax(0, 1fr); }
  .dash-card { padding: var(--space-5); }
}

/* --- Oblíbené (hvězdička v hlavičce + sidebar) ---------------------------- */
.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.fav-btn svg { width: 18px; height: 18px; }
.fav-btn:hover { background: rgba(140, 74, 190, 0.12); color: var(--mystic-ray); }
.fav-btn[aria-pressed="true"] { color: var(--mystic-ray); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }

.nav-star { display: inline-flex; flex: none; margin-left: auto; color: var(--mystic-ray); }
.nav-star svg { width: 11px; height: 11px; fill: currentColor; }
.nav-star + .status-dot { margin-left: var(--space-2); }

/* --- Hlavička: tlačítko nápovědy -------------------------------------------- */
.help-trigger { color: var(--text-muted); }
.help-trigger:hover { color: var(--mystic-ray); }

/* --- Nápověda (modal) --------------------------------------------------------- */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
  background: rgba(30, 0, 48, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.help-modal[hidden] { display: none; }
.help-panel {
  width: min(480px, 100%);
  max-height: 76vh;
  overflow: auto;
  padding: var(--space-6);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  backdrop-filter: blur(40px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
}
.help-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.help-head h2 { font-size: var(--h2-size); letter-spacing: -0.02em; }
.help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.help-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--body-size);
}
.help-list li:last-child { border-bottom: 0; }
.help-keys { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; order: 2; }
.help-or { font-size: 11px; color: var(--text-muted); }
.help-keys kbd {
  min-width: 28px;
  padding: 3px 9px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
}
.help-note { margin-top: var(--space-4); font-size: 12px; color: var(--text-muted); }

/* --- Spodní lišta (mobil / tablet) ---------------------------------------------- */
.mobile-bar { display: none; }

@media (max-width: 1024px) {
  .mobile-bar {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: stretch;
    gap: 2px;
    width: min(440px, calc(100% - 24px));
    padding: 6px;
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(30px) saturate(140%);
    backdrop-filter: blur(30px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 28px rgba(31, 38, 135, 0.18);
  }
  .mb-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
  }
  .mb-btn:hover, .mb-btn:active { background: rgba(140, 74, 190, 0.12); color: var(--mystic-ray); }
  .mb-btn[aria-current="page"] { color: var(--mystic-ray); }
  .mb-btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
  .mb-ic { display: inline-flex; }
  .mb-ic svg { width: 20px; height: 20px; }

  /* místo pro lištu pod obsahem + toast nad ní */
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 640px) {
  .help-trigger { display: none; }
  .help-modal { padding-top: 8vh; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-continue, .dash-tool, .dash-chip, .mb-btn { transition: none; }
  .dash-continue:hover, .dash-tool:hover, .dash-chip:hover { transform: none; }
}
