/* changelog.css — tier 3 components.
 * Owns: "Updates" modal and its topbar button.
 *
 * Order dependencies: 1 rule(s) belonging by subject to mobile.css (1) stay
 * here to keep their cascade position beside a rule in this file; each has an
 * `order:` comment naming it. */

/* Hard-refresh tip banner at the top of the body. Static-site caches can
 * keep a stale tab pinned to an old build; this surface tells users how
 * to force a fresh fetch when a brand-new feature isn't showing up yet. */
.changelog-refresh-tip {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-5) var(--sp-6);
  margin: 0 0 var(--sp-8);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-left-width: 3px;
  border-radius: var(--radius);
  font-size: var(--fs-md);
  line-height: 1.4;
  color: var(--text);
}
.changelog-refresh-tip-icon { font-size: var(--fs-lg); line-height: 1; color: var(--accent); flex: 0 0 auto; }
.changelog-refresh-tip kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-sm);
  background: var(--sh-3);
  border: 1px solid var(--ov-5);
  border-radius: var(--radius-sm);
  padding: 1px var(--sp-3);
  margin: 0 var(--sp-1);
  color: var(--accent);
  white-space: nowrap;
}
.changelog-header { align-items: flex-start; gap: var(--sp-6); }
.changelog-header-text { flex: 1; min-width: 0; }
.changelog-meta { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.changelog-version { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: var(--radius-sm); padding: 1px var(--sp-3); }
.changelog-updated { font-style: italic; }
.changelog-body { overflow: auto; padding: var(--sp-6) var(--sp-8) var(--sp-8); }
.changelog-empty { color: var(--text-muted); text-align: center; padding: var(--sp-10) 0; }
.changelog-day { margin-bottom: var(--sp-8); }
.changelog-day:last-child { margin-bottom: 0; }
.changelog-day-head {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-md);
  text-transform: uppercase;
  letter-spacing: var(--tr-wide);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--sp-2);
}
.changelog-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-5); }
.changelog-item { display: grid; grid-template-columns: 56px 1fr; gap: var(--sp-5); align-items: start; }
.changelog-item-title { font-weight: 600; line-height: 1.35; }
.changelog-item-desc { margin-top: var(--sp-2); font-size: var(--fs-md); line-height: 1.5; color: var(--text-muted); }
.changelog-kind {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tr-normal);
  text-align: center;
  border-radius: var(--radius-xs);
  padding: var(--sp-1) 0;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  margin-top: var(--sp-1);
}
.changelog-kind-feature { background: rgba(78, 156, 96, 0.18); color: #7ed293; border-color: rgba(78, 156, 96, 0.45); }
.changelog-kind-fix { background: rgba(180, 100, 60, 0.18); color: #e9b18b; border-color: rgba(180, 100, 60, 0.45); }
.changelog-kind-change { background: rgba(96, 130, 200, 0.18); color: #aac3ee; border-color: rgba(96, 130, 200, 0.45); }
.changelog-text { min-width: 0; }

/* Topbar icon — show a small dot when there are unseen entries. */
#yaab-btn-changelog { position: relative; }
#yaab-btn-changelog.has-unseen::after {
  content: '';
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e25c5c;
  box-shadow: 0 0 0 1.5px var(--bg);
}

@media (max-width: 820px) {
  /* order: lives here, not in mobile.css: must precede `.changelog-modal` {display} below (equal specificity, same element, display). */
  .modal {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    max-height: 100dvh !important;
    height: 100dvh;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
  }
}
.changelog-modal { max-width: 640px; width: min(640px, 96vw); max-height: 90vh; display: flex; flex-direction: column; }
