/* === Header ===
   One slim row (founder, 2026-11-04: "look at all this dead space at the top"):
   the mark and name, the workspace tabs, then the limit chip, Feedback and the
   gear. Frosted glass the full width of the window, with a white edge under it.

   Keep .header free of transform, filter, backdrop-filter, contain and
   will-change. The tabs live inside it, and on a phone they are position:fixed
   at the bottom of the viewport; any of those would pin them to the header. So
   the blur is on .header::before, which holds nothing. It is the one place on
   the page where content actually scrolls beneath glass. */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(var(--mac-header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--glass-top);
  box-shadow: var(--shadow-top);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header::before { background: var(--surface-elevated); }
}

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

.header-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--graphite);
}

.header-title { font-family: var(--font-body); font-weight: 700; font-size: 15px; color: var(--text-primary); line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; }

.header-right {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

/* Persistent, one-click support entry point. It stays visually quieter than
   the accent account control while remaining explicit enough to discover. */
.header-feedback-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-pill);
  background: var(--pill-bg);
  color: var(--text-secondary);
  font: 500 12px/1 var(--font-body);
  cursor: pointer;
  touch-action: manipulation;
  transition: color 140ms var(--ease), border-color 140ms var(--ease), background 140ms var(--ease), transform 140ms var(--ease);
}

.header-feedback-btn svg { flex: 0 0 auto; }
.header-feedback-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.header-feedback-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* One avatar button opens the account menu — replaces the old profile +
   logout pill pair. Menu wiring lives in settings.js. */
.header-avatar-wrap {
  position: relative;
}

/* The account entry point is a chip, not an action, so it is not chartreuse. */
.header-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--chip-ink);
  background: var(--chip-grad);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-chip);
  transition: border-color .15s ease;
}

.header-avatar-btn:hover {
  border-color: var(--border-strong);
}

.header-account-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 216px;
  z-index: 1200;
  background: var(--surface-elevated);
  border: 1px solid var(--glass-edge);
  border-radius:var(--radius-md);
  box-shadow: var(--shadow-menu);
  padding: 6px;
}

.header-account-menu.open {
  display: block;
}

.header-account-menu .ham-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 9px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}

.header-account-menu .ham-email {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.header-account-menu .ham-plan {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius:var(--radius-pill);
  border: 1px solid var(--border2);
  color: var(--text-muted);
  flex-shrink: 0;
}

.header-account-menu .ham-plan.is-pro {
  background: var(--chip-grad);
  color: var(--chip-ink);
  border-color: transparent;
}

.header-account-menu button[role="menuitem"] {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 8px 10px;
  border-radius:var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.header-account-menu button[role="menuitem"]:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.header-account-menu .ham-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 4px;
}

.header-account-menu .ham-signout:hover {
  color: var(--red);
}

.last-updated { font-size: var(--text-sm); color: var(--text-muted); font-family: var(--font-mono); }

.header-upgrade-pill {
  border-radius: 999px !important;
  padding: 8px 16px !important;
  background: var(--accent) !important;
  color: var(--text-on-accent) !important;
  border-color: var(--accent-border) !important;
  box-shadow: var(--shadow-btn-primary) !important;
  flex: none;
  white-space: nowrap;
}

.header-upgrade-pill:hover {
  background: var(--accent-hover) !important;
  box-shadow: var(--shadow-btn-primary) !important;
}

/* Step Header / Sidebar Centering — must be BEFORE media queries */

.center-under-tagline {
  position: relative;
  left: 0;
}

/* Step preview — always-visible info below each step header */
.step-preview {
  text-align: center;
  padding: 8px 20px 10px;
}
.step-preview-inner {
  display: inline-block;
  max-width: 600px;
}
.step-preview-label {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.5;
}
.step-preview-detail {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Smooth page transitions */
#view-journal {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius:var(--radius-md);
  padding: 16px;
  margin: 0 auto;
  overflow-x: clip;
}

/* Header */
