/* Meditate — editorial chrome around the practice tool */

body.page-meditate,
body.page-journal {
  --font-meditate-display: var(--font-app-display, var(--font-display));
  --font-meditate-body: var(--font-app-body, var(--font-body));
}

body.page-meditate,
body.page-journal {
  font-family: var(--font-meditate-body);
}

body.page-meditate::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--page-wash-dark);
}

body.theme-light.page-meditate, html.theme-light body.page-meditate {
  background: var(--page-wash-light);
}

.meditate-shell,
.meditate-zone {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.meditate-zone + .meditate-zone {
  margin-top: 1.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border-color);
}

.meditate-card-head,
.meditate-zone-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  justify-content: space-between;
}

.meditate-card-head--stacked {
  flex-direction: column;
  align-items: stretch;
}

.meditate-card-title,
.meditate-section-title {
  font-family: var(--font-meditate-display);
  font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.4rem);
  font-weight: 550;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

.meditate-card-sub,
.meditate-section-sub {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.meditate-session-state,
.meditate-note-context,
.meditate-note-badge {
  align-self: flex-start;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(224, 152, 63, 0.28);
  background: rgba(224, 152, 63, 0.12);
  color: var(--accent-500);
  padding: 0.34rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 650;
}

.meditate-kpi-grid,
.meditate-top-grid,
.meditate-practice-stack {
  display: grid;
  gap: 1rem;
}

.meditate-practice-stack {
  grid-template-columns: minmax(0, 1fr);
}

.meditate-practice-stack > .meditate-manual-collapsible,
.meditate-practice-stack > .meditate-practice-collapsible {
  margin: 0;
}

.meditate-practice-stack > .meditate-save-toast[hidden] {
  display: none;
}

.meditate-kpi-grid {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.meditate-kpi-card {
  padding: 1.2rem 1.25rem;
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.meditate-kpi-card:hover {
  border-color: color-mix(in srgb, var(--accent-500) 35%, var(--border-color));
}

.meditate-kpi-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-500) 35%, transparent);
}

.meditate-kpi-card.is-active {
  border-color: color-mix(in srgb, var(--accent-500) 48%, var(--border-color));
  box-shadow: none;
}

.meditate-kpi-card .kpi-value {
  font-family: var(--font-meditate-display);
  font-weight: 550;
  letter-spacing: -0.02em;
}

.meditate-sync-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, #e2a35a 35%, var(--border-color));
  background: color-mix(in srgb, #e2a35a 10%, transparent);
}

.meditate-sync-alert p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.meditate-empty-state .btn-text {
  margin-top: 0.55rem;
}

.meditate-empty-state-hint {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

#meditateHistoryCard:focus {
  outline: none;
}

#meditateHistoryCard:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-500) 45%, transparent);
  outline-offset: 4px;
}

.meditate-private-data {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meditate-private-data > .surface-card {
  width: 100%;
  margin: 0;
  padding: 1rem 0.85rem 1.05rem;
  border-radius: calc(var(--radius-md) - 2px);
  box-shadow: none;
  border-color: color-mix(in srgb, var(--border-color) 82%, transparent);
}

.meditate-private-data .meditate-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  width: 100%;
}

.meditate-private-data .meditate-kpi-card {
  padding: 0.8rem 0.5rem;
  min-height: 5.35rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.meditate-private-data .meditate-kpi-card .kpi-label {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
  line-height: 1.25;
}

.meditate-private-data .meditate-kpi-card .kpi-value {
  font-size: clamp(1.35rem, 4.8vw, 1.75rem);
}

.meditate-private-data .meditate-kpi-card .kpi-sub {
  font-size: 0.65rem;
  margin-top: 0.15rem;
  line-height: 1.25;
}

.meditate-private-data .meditate-history-card,
.meditate-private-data .meditate-insights-card {
  padding: 1rem 0.85rem 1.05rem;
}

@keyframes meditate-history-flash {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-500) 0%, transparent);
  }
  35% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 28%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-500) 0%, transparent);
  }
}

.meditate-history-list,
.meditate-note-feed,
.meditate-live-notes {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.meditate-history-list {
  gap: 1.15rem;
}

.meditate-history-filters {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.meditate-history-filters[hidden] {
  display: none !important;
}

.meditate-history-filters-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.meditate-history-filter-segments {
  flex: 1 1 12rem;
  min-width: 0;
}

.meditate-history-filter-tab {
  flex: 1 1 0;
  min-height: 2.1rem;
  padding: 0.35rem 0.55rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--text-primary) 72%, var(--text-muted));
  font-family: var(--font-journal-ui);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.meditate-history-filter-tab.active {
  color: var(--text-primary);
  background: var(--journal-ios-group, var(--bg-elevated));
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px color-mix(in srgb, var(--border-color) 55%, transparent);
}

body.theme-light.page-meditate .meditate-history-filter-tab.active,
html.theme-light body.page-meditate .meditate-history-filter-tab.active,
body.theme-light.page-journal .meditate-history-filter-tab.active,
html.theme-light body.page-journal .meditate-history-filter-tab.active {
  background: #ffffff;
}

.meditate-history-filter-tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-500) 55%, transparent);
  outline-offset: 2px;
}

.meditate-history-filters-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  padding-bottom: 0.1rem;
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 0.65rem,
    #000 calc(100% - 0.65rem),
    transparent
  );
}

.meditate-history-filters-tags::-webkit-scrollbar {
  display: none;
}

.meditate-history-filters .meditate-filter-tag,
.meditate-history-filters .meditate-filter-more {
  flex: 0 0 auto;
}

.meditate-history-filters .meditate-filter-day {
  flex: 0 1 auto;
}

.meditate-history-filters .meditate-filter-tag.active {
  color: #1f1408;
  background: color-mix(in srgb, var(--accent-500) 96%, white 4%);
  border-color: color-mix(in srgb, var(--accent-500) 88%, black 12%);
}

.meditate-history-filters .meditate-filter-more {
  appearance: none;
  border: 1px dashed color-mix(in srgb, var(--border-color) 88%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-journal-ui);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.28rem 0.62rem;
  cursor: pointer;
  touch-action: manipulation;
}

.meditate-history-filters .meditate-filter-more:hover,
.meditate-history-filters .meditate-filter-more:focus-visible {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent-500) 35%, var(--border-color));
}

.meditate-filter-tag .meditate-filter-count {
  margin-left: 0.15rem;
  opacity: 0.72;
  font-weight: 600;
}

.meditate-insights-card {
  padding: 1.15rem 1.2rem 1.25rem;
}

.meditate-insights-panels {
  display: grid;
  gap: 1.15rem;
  margin-top: 0.95rem;
}

.meditate-insights-panel-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.meditate-insights-valence {
  margin: 0 0 0.75rem;
}

.meditate-insights-valence-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.meditate-insights-valence-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.meditate-insights-valence-stats {
  display: inline-flex;
  gap: 0.65rem;
  font-size: 0.82rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.meditate-insights-valence-stats .is-pos {
  color: color-mix(in srgb, #3f8f6b 78%, var(--text-primary));
}

.meditate-insights-valence-stats .is-neg {
  color: color-mix(in srgb, #b15b4a 78%, var(--text-primary));
}

.meditate-insights-valence-bar {
  display: flex;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--border-color) 70%, transparent);
}

.meditate-insights-valence-bar > span {
  display: block;
  height: 100%;
  min-width: 0;
}

.meditate-insights-valence-bar .is-pos {
  background: color-mix(in srgb, #3f8f6b 72%, transparent);
}

.meditate-insights-valence-bar .is-mix {
  background: color-mix(in srgb, var(--text-muted) 28%, transparent);
}

.meditate-insights-valence-bar .is-neg {
  background: color-mix(in srgb, #b15b4a 68%, transparent);
}

.meditate-insights-valence-empty {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.meditate-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meditate-insights-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.28rem 0.7rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg-page) 55%, transparent);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  touch-action: manipulation;
  transition: border-color 160ms ease, background 160ms ease;
}

.meditate-insights-row:hover {
  border-color: color-mix(in srgb, var(--accent-500) 28%, var(--border-color));
}

.meditate-insights-row:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-500) 35%, transparent);
}

.meditate-insights-row.is-active {
  border-color: color-mix(in srgb, var(--accent-500) 42%, var(--border-color));
  background: color-mix(in srgb, var(--accent-500) 8%, transparent);
}

.meditate-insights-tag {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meditate-insights-count {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.meditate-insights-bar {
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-color) 70%, transparent);
  overflow: hidden;
}

.meditate-insights-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent-500) 62%, transparent);
}

.meditate-insights-empty {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.meditate-insights-empty--solo {
  margin-top: 0.85rem;
}

.meditate-history-day {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.65rem 0.55rem 0.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent);
  background: color-mix(in srgb, var(--bg-elevated) 42%, transparent);
}

.meditate-history-day-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.meditate-history-day[data-history-day="earlier"] .meditate-history-day-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.meditate-history-day-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.meditate-history-day-date {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.meditate-history-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
}

.meditate-history-day-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  border-radius: var(--radius-sm);
}

.meditate-history-day-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-500) 35%, transparent);
}

.meditate-history-day-chevron {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.12rem;
  border-right: 2px solid var(--text-subtle);
  border-bottom: 2px solid var(--text-subtle);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.meditate-history-day[data-history-day="earlier"].is-expanded .meditate-history-day-chevron {
  transform: rotate(225deg);
  margin-top: 0.28rem;
}

.meditate-history-day-link,
.meditate-history-row-link,
.meditate-history-journal-link {
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.meditate-history-row-link {
  margin-top: 0.55rem;
  align-self: flex-start;
  display: inline-flex;
}

.meditate-history-day-list {
  display: flex;
  flex-direction: column;
}

.meditate-history-more {
  align-self: flex-start;
  margin: 0.15rem 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 650;
}

.meditate-history-day[data-history-day="earlier"] .meditate-history-more {
  margin: 0.1rem 0 0.15rem;
}

.meditate-history-row,
.meditate-note-card,
.meditate-inline-note {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.95rem 1rem;
}

.meditate-history-row {
  position: relative;
  display: block;
  border: 0;
  border-radius: 0;
  border-top: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
  background: transparent;
  padding: 0.85rem 0.1rem;
  box-shadow: none;
}

.meditate-history-list .meditate-note-card,
.meditate-history-list .meditate-inline-note {
  padding: 0.85rem 0.45rem;
}

.meditate-history-day-list .meditate-history-row:first-child {
  border-top: 0;
  padding-top: 0.15rem;
}

.meditate-history-day-list .meditate-history-row:last-child {
  padding-bottom: 0.35rem;
}

.meditate-history-row-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  outline: none;
}

.meditate-history-row-toggle:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-500) 35%, transparent);
}

.meditate-history-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meditate-history-when {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.meditate-history-moods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.meditate-history-row-trail {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  color: var(--text-muted);
  padding-top: 0.1rem;
}

.meditate-history-note-hint {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.meditate-distraction-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 1rem;
}

.meditate-distraction-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-500) 92%, white 8%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-500) 35%, transparent);
}

.meditate-distraction-dots-overflow {
  margin-left: 0.05rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: color-mix(in srgb, var(--accent-500) 88%, var(--text-muted));
}

.meditate-session-more {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.meditate-session-more:hover,
.meditate-session-more:focus-visible,
.meditate-history-row.is-menu-open .meditate-session-more {
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  color: var(--text-primary);
}

.meditate-session-menu {
  position: absolute;
  top: 2.55rem;
  right: 0.1rem;
  z-index: 5;
  min-width: 8.5rem;
  display: flex;
  flex-direction: column;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--border-color) 90%, transparent);
  background: color-mix(in srgb, var(--bg-elevated) 96%, #fff 4%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.meditate-session-menu[hidden] {
  display: none !important;
}

.meditate-session-menu button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
}

.meditate-session-menu button:hover,
.meditate-session-menu button:focus-visible {
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
}

.meditate-session-menu button.is-danger {
  color: #ff8d8d;
}

.meditate-history-row.is-inline-editing {
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--accent-500) 28%, var(--border-color));
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-500) 18%, transparent);
  padding: 1rem;
  margin: 0.35rem 0;
}

.meditate-history-main {
  min-width: 0;
}

.meditate-history-actions {
  flex: 0 0 auto;
  padding-top: 0;
}

.meditate-history-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.meditate-history-duration {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meditate-history-head,
.meditate-note-card-head,
.meditate-inline-note-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meditate-note-actions {
  margin-top: 0.55rem;
}

.meditate-inline-note.is-inline-editing,
.meditate-note-card.is-inline-editing {
  border-color: color-mix(in srgb, var(--accent-500) 28%, var(--border-color));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-500) 14%, transparent);
}

.meditate-inline-note-editor {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.meditate-inline-note-editor .journal-composer-field {
  width: 100%;
}

.meditate-history-head strong {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

@media (max-width: 560px) {
  .meditate-history-head {
    flex-wrap: wrap;
    row-gap: 0.55rem;
  }

  .meditate-history-actions {
    width: auto;
    margin-left: auto;
  }
}

.meditate-history-meta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.meditate-history-note,
.meditate-note-card p,
.meditate-inline-note p,
.meditate-empty-inline {
  margin: 0.65rem 0 0;
  color: var(--text-primary);
  line-height: 1.65;
}

.meditate-session-thoughts .meditate-empty-inline {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.meditate-note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.meditate-note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.meditate-note-valence {
  margin: 0.15rem 0 0.35rem;
}

.meditate-note-valence .thought-valence-label {
  margin-bottom: 0.35rem;
}

.meditate-mood-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
}

.timer-quote,
.meditate-pullquote {
  margin: 0.15rem 0 0.35rem;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 2px solid var(--accent-500);
  font-family: var(--font-meditate-display);
  font-style: italic;
  font-size: clamp(0.92rem, 0.84rem + 0.45vw, 1.15rem);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.015em;
  max-width: none;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.meditate-pullquote::-webkit-scrollbar {
  display: none;
}

.dur-picker {
  justify-content: center;
}

.meditate-control-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meditate-control-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.ambient-chip {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0.4rem 0.45rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  color: var(--text-muted);
  cursor: pointer;
  font: 650 0.82rem/1.1 var(--font-meditate-body, inherit);
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ambient-chip:hover {
  background: var(--button-hover);
  color: var(--text-primary);
}

.ambient-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-500) 55%, transparent);
  outline-offset: 2px;
}

.ambient-chip.active {
  color: #24190d;
  border-color: color-mix(in srgb, var(--accent-500) 68%, var(--border-color));
  background: color-mix(in srgb, var(--accent-500) 82%, white 18%);
}

.meditate-duration-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.meditate-duration-control.is-locked {
  opacity: 0.62;
}

.duration-step {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
  background: transparent;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.duration-step:hover:not(:disabled) {
  background: var(--button-hover);
}

.duration-step:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.meditate-duration-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 5.75rem;
  justify-content: center;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 650;
}

.meditate-duration-field input {
  width: 2.85rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -webkit-user-select: text;
  user-select: text;
}

.meditate-duration-field input:disabled {
  opacity: 0.7;
}

.meditate-duration-field input::-webkit-outer-spin-button,
.meditate-duration-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.meditate-duration-field input[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.meditate-ambient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ambient-seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.meditate-select {
  width: auto;
  min-width: 128px;
  min-height: 38px;
  padding: 0.45rem 0.75rem;
}

@media (min-width: 560px) {
  .ambient-seg {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.theme-light .ambient-chip,
body.theme-light .meditate-duration-control {
  background: rgba(255, 255, 255, 0.78);
}

body.theme-light .ambient-chip.active {
  background: color-mix(in srgb, var(--accent-500) 82%, white 18%);
}

.ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0.55rem auto 0.25rem;
}

.ring-wrap svg {
  transform: rotate(-90deg);
}

.meditate-timer-settings {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0.15rem 0 0.35rem;
}

.meditate-duration-block {
  align-items: center;
  text-align: center;
  width: auto;
  margin-inline: auto;
}

.meditate-duration-block .meditate-control-label {
  width: 100%;
}

.meditate-ambient-block {
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 100%;
}

.meditate-ambient-block .meditate-control-label {
  width: 100%;
}

.meditate-duration-hint {
  display: none;
}

.meditate-zone-head--practice {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.meditate-ambient-disclosure {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0;
}

.meditate-ambient-summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: min(200px, 100%);
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 2rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-card, var(--bg-secondary)) 88%, transparent);
  transition: border-color 160ms ease, background 160ms ease;
}

.meditate-ambient-summary:hover {
  border-color: color-mix(in srgb, var(--accent-500) 35%, var(--border-color));
}

.meditate-ambient-summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-500) 65%, transparent);
  outline-offset: 2px;
}

.meditate-ambient-summary::-webkit-details-marker {
  display: none;
}

.meditate-ambient-summary-label {
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-primary);
  text-align: center;
}

.meditate-ambient-chevron {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0;
  border-right: 2px solid var(--text-subtle);
  border-bottom: 2px solid var(--text-subtle);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease;
}

.meditate-ambient-disclosure[open] .meditate-ambient-chevron {
  transform: translateY(-35%) rotate(225deg);
}

.meditate-ambient-panel {
  margin-top: 0.65rem;
  width: 100%;
}

.meditate-ambient-panel .ambient-seg {
  width: 100%;
}

body.page-meditate:not(.is-timer-active) #resetBtn {
  display: none;
}

.ring-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: var(--accent-500);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-meditate-display);
  font-size: 3rem;
  font-weight: 550;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.meditate-timer-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meditate-stack-disclosure {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--journal-ios-group-border, color-mix(in srgb, var(--border-color) 72%, transparent));
  border-radius: var(--journal-ios-radius, var(--radius-md));
  background: transparent;
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 6%, transparent) inset,
    0 10px 28px color-mix(in srgb, #000 8%, transparent);
}

.meditate-stack-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 1.15rem 1.2rem;
  font: inherit;
}

.meditate-stack-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-500) 55%, transparent);
  outline-offset: 2px;
}

.meditate-stack-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.meditate-stack-summary-trail {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
}

.meditate-stack-chevron {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--text-subtle);
  border-bottom: 2px solid var(--text-subtle);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.meditate-stack-trigger[aria-expanded="true"] .meditate-stack-chevron,
.meditate-stack-trigger.is-open .meditate-stack-chevron {
  transform: rotate(225deg);
}

.meditate-stack-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.85rem 0.7rem 1rem;
  border-top: 1px solid var(--journal-ios-separator, var(--border-color));
}

.meditate-stack-panel[hidden] {
  display: none !important;
}

.meditate-manual-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0;
}

.meditate-mins-input {
  text-align: left;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  touch-action: manipulation;
}

.meditate-mins-input::-webkit-outer-spin-button,
.meditate-mins-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.meditate-date-input::-webkit-calendar-picker-indicator,
.meditate-time-input::-webkit-calendar-picker-indicator {
  opacity: 0.45;
  cursor: pointer;
}

.meditate-manual-mood {
  margin-bottom: 0.85rem;
}

body.page-meditate #liveDistractionCapture,
body.page-meditate #manualDistractionCapture {
  --capture-pad-x: 0.65rem;
  --capture-pad-y: 0.55rem;
}

body.page-meditate .meditate-session-meta-cell {
  padding-block: 0.55rem;
}

.meditate-session-meta-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.meditate-meta-segment {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.2rem 0.45rem;
}

.meditate-meta-segment.meditate-meta-field--date {
  flex: 1.25 1 0;
}

.meditate-meta-segment.meditate-meta-field--time {
  flex: 0.95 1 0;
}

.meditate-meta-segment.meditate-meta-field--mins {
  flex: 0.68 1 0;
}

.meditate-meta-divider {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  margin-block: 0.35rem;
  background: var(--journal-ios-separator, var(--border-color));
}

body.page-meditate .meditate-session-meta-row .journal-ios-cell-label {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
}

.meditate-meta-input,
body.page-meditate .meditate-session-meta-row .meditate-meta-input {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.1rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-journal-ui, var(--font-sans));
  font-size: max(16px, 0.95rem);
  font-weight: 550;
  line-height: 1.25;
  box-shadow: none;
  touch-action: manipulation;
}

.meditate-meta-input:focus,
body.page-meditate .meditate-session-meta-row .meditate-meta-input:focus {
  outline: none;
  box-shadow: none;
}

.meditate-meta-segment:focus-within .journal-ios-cell-label {
  color: var(--text-primary);
}

.meditate-meta-mins {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  min-width: 0;
  width: 100%;
}

.meditate-meta-mins .meditate-mins-input {
  flex: 0 1 auto;
  width: 2.2rem;
  max-width: 100%;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.meditate-meta-suffix {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.25;
}

body.page-meditate .meditate-inline-editor .mood-picker {
  margin: 0 0 0.85rem;
}

.meditate-distraction-capture {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.meditate-distraction-capture .journal-panel-head {
  margin-bottom: 0.55rem;
}

.meditate-distraction-preview {
  margin-top: 0.15rem;
}

.meditate-history-card.is-flash {
  animation: meditate-history-flash 900ms ease;
}

.meditate-save-toast {
  margin: 0.35rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, #3f8f6b 42%, var(--border-color));
  background: color-mix(in srgb, #3f8f6b 14%, transparent);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 650;
  text-align: center;
  animation: meditate-save-toast-in 220ms ease;
}

.meditate-save-toast[hidden] {
  display: none !important;
}

@keyframes meditate-save-toast-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meditate-manual-save-footer {
  flex-wrap: wrap;
  margin-top: 0;
}

.meditate-manual-save-footer .meditate-inline-status {
  margin-right: auto;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.meditate-manual-save-footer .meditate-inline-status.is-prominent.is-success {
  flex: 1 1 100%;
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent-500) 30%, var(--border-color));
  background: color-mix(in srgb, var(--accent-500) 10%, transparent);
  font-size: 0.9rem;
  font-weight: 650;
  text-align: center;
}

body.page-meditate .journal-ios-pill-btn.is-saved {
  background: color-mix(in srgb, #3f8f6b 82%, var(--journal-ios-tint));
  color: #fff;
  cursor: default;
  box-shadow: none;
}

body.page-meditate .journal-ios-pill-btn:disabled:not(.is-saved) {
  opacity: 0.7;
  cursor: wait;
}

.meditate-distraction-jump {
  align-self: center;
  margin: -0.15rem 0 0.15rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.meditate-distraction-jump[hidden] {
  display: none !important;
}

.meditate-manual-note {
  min-height: 5.5rem;
  border-radius: 12px;
  resize: vertical;
}

.meditate-manual-distractions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.15rem;
}

.meditate-manual-distractions-sub {
  margin: -0.15rem 0 0.15rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.meditate-manual-distractions-sub:empty {
  display: none;
}

.meditate-capture-head {
  margin-bottom: 0.55rem;
}

.meditate-capture-head + .meditate-note-context {
  margin: -0.35rem 0 0.55rem;
}

.meditate-inline-editor {
  width: 100%;
}

.meditate-inline-fields {
  margin-bottom: 0.15rem;
}

.meditate-inline-editor .inline-editor-input {
  min-height: 4.5rem;
  border-radius: 12px;
}

.meditate-note-form,
.meditate-note-controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.meditate-actions {
  justify-content: center;
}

.meditate-early-save {
  display: flex;
  justify-content: center;
  margin-top: 0.15rem;
}

.meditate-early-save[hidden] {
  display: none !important;
}

.meditate-early-save-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.meditate-quick-note {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scroll-margin-top: 5rem;
}

.meditate-quick-note[hidden] {
  display: none !important;
}

.meditate-tag-picker {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.meditate-tag-picker .thought-tags {
  margin-top: 0;
}

.meditate-tag-hint {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.meditate-history-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1rem;
}

.meditate-history-view-toggle {
  margin: 0.15rem 0 0.35rem;
}

.meditate-history-view-tab {
  flex: 1 1 0;
  min-height: 2.1rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--text-primary) 72%, var(--text-muted));
  font-family: var(--font-journal-ui);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.meditate-history-view-tab.active {
  color: var(--text-primary);
  background: var(--journal-ios-group, var(--bg-elevated));
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px color-mix(in srgb, var(--border-color) 55%, transparent);
}

body.theme-light.page-meditate .meditate-history-view-tab.active,
html.theme-light body.page-meditate .meditate-history-view-tab.active {
  background: #ffffff;
}

.meditate-history-view-tab:focus-visible {
  outline: 2px solid var(--accent, #6faf8a);
  outline-offset: 2px;
}

.meditate-distraction-feed-card .meditate-distraction-session-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.meditate-distraction-session-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.meditate-distraction-session-link {
  flex-shrink: 0;
  font-size: 0.78rem;
}

.meditate-inline-note.is-feel-only .meditate-inline-note-head,
.meditate-note-card.is-feel-only .meditate-note-card-head {
  margin-bottom: 0;
}

.meditate-inline-note.is-feel-only .meditate-note-meta,
.meditate-note-card.is-feel-only .meditate-note-meta {
  margin-top: 0;
}

.meditate-live-extras {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.15rem 0 0.25rem;
}

.meditate-live-more {
  min-height: 1.75rem;
  padding: 0.1rem 0;
  font-size: 0.82rem;
  font-weight: 650;
}

.meditate-live-valence[hidden] {
  display: none !important;
}

.meditate-tag-picker .custom-tag-compose {
  margin-top: 0.45rem;
  width: 100%;
}

.meditate-note-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font: inherit;
}

.meditate-note-toggle-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
  opacity: 0.8;
  flex: 0 0 auto;
}

.meditate-note-toggle.is-expanded .meditate-note-toggle-chevron,
.meditate-history-row.is-expanded .meditate-note-toggle-chevron {
  transform: rotate(-135deg);
  translate: 0 0.12rem;
}

.meditate-history-row.is-expanded .meditate-session-thoughts {
  animation: meditate-expand-in 220ms ease;
}

@keyframes meditate-expand-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meditate-session-thoughts {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.meditate-session-thoughts-label {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.meditate-inline-status {
  min-height: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meditate-inline-status.is-error {
  color: #ff8d8d;
}

.meditate-inline-status.is-success {
  color: var(--accent-500);
}

.post-session {
  display: none;
  flex-direction: column;
  gap: 0.9rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  width: 100%;
  max-width: none;
  align-items: stretch;
}

.post-session.show {
  display: flex;
}

.post-session .mood-picker {
  width: 100%;
}

.post-session-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 1rem;
}

.meditate-mood-row {
  gap: 0.65rem;
}

.meditate-empty-state {
  min-height: 180px;
}

.meditate-zone--top + .meditate-zone--bottom {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.meditate-zone--top > .auth-sync-banner {
  width: 100%;
  max-width: none;
  margin: 0 0 0.15rem;
}

.meditate-zone[hidden],
.meditate-private-data[hidden],
[data-auth-private][hidden] {
  display: none !important;
}

@media (min-width: 740px) {
  .meditate-stack-panel {
    padding: 0.9rem 1rem 1.1rem;
  }

  .meditate-private-data > .surface-card,
  .meditate-private-data .meditate-history-card,
  .meditate-private-data .meditate-insights-card {
    padding: 1.15rem 1.1rem 1.2rem;
  }

  .meditate-private-data .meditate-kpi-card {
    padding: 1.1rem 0.85rem;
    min-height: 0;
  }

  .meditate-private-data .meditate-kpi-card .kpi-label {
    font-size: 0.72rem;
  }

  .meditate-private-data .meditate-kpi-card .kpi-value {
    font-size: 2rem;
  }

  .meditate-private-data .meditate-kpi-card .kpi-sub {
    font-size: 0.78rem;
  }

  .meditate-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .meditate-insights-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem 1.5rem;
  }

  .meditate-top-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  .meditate-note-controls {
    flex-direction: row;
    align-items: flex-end;
  }

  .meditate-tag-picker {
    max-height: 7.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
  }
}

body.page-meditate .meditate-tag-hint[hidden] {
  display: none !important;
}

/* Lift composer panels on dark theme to match Journal contrast */
html:not(.theme-light) body.page-meditate .journal-ios-group,
body.page-meditate:not(.theme-light) .journal-ios-group {
  --journal-ios-fill: color-mix(in srgb, #fff 16%, var(--bg-surface) 84%);
  background: color-mix(in srgb, #fff 11%, var(--bg-elevated) 89%);
  border-color: color-mix(in srgb, #fff 10%, var(--border-color) 90%);
}

html:not(.theme-light) body.page-meditate .journal-composer-field,
body.page-meditate:not(.theme-light) .journal-composer-field {
  --compose-inset-bg: color-mix(in srgb, #fff 12%, var(--bg-surface) 88%);
}

@media (max-width: 720px) {
  body.page-meditate .meditate-lede {
    display: none;
  }

  body.page-meditate .meditate-title {
    font-size: clamp(1.3rem, 5.2vw, 1.55rem);
  }

  body.page-meditate .journal-panel-caption {
    display: none;
  }

  body.page-meditate .journal-panel-head {
    margin-bottom: 0.4rem;
  }
}

/* Tag manage dialog (shared with Journal) */
.tag-context-menu {
  position: fixed;
  z-index: 10001;
  min-width: 168px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-primary);
}

.tag-context-menu[hidden] { display: none !important; }

.tag-context-menu button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.tag-context-menu button:hover { background: var(--button-hover); }
.tag-context-menu button.danger { color: #c62828; }

.tag-manage-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.tag-manage-overlay[hidden] { display: none !important; }

.tag-manage-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tag-manage-sheet {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem 1.2rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.tag-manage-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.tag-manage-sheet h2 {
  margin: 0;
  font-family: var(--font-meditate-display);
  font-size: 1.15rem;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.tag-manage-hint {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tag-manage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
}

.tag-manage-list li {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--button-hover) 90%, transparent);
}

.tag-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-manage-list .tag-name { flex: 1; font-weight: 650; }

.tag-manage-list .tag-badge {
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-manage-actions { display: flex; gap: 4px; flex-shrink: 0; }
.tag-manage-actions .danger { color: #c62828; }

.tag-manage-rename {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-manage-rename[hidden] { display: none !important; }

.tag-rename-input {
  flex: 1 1 8rem;
  min-height: 2.25rem !important;
  padding: 0.35rem 0.7rem !important;
  border-radius: 10px !important;
  font-size: 1rem !important;
}
