/* Today/day timeline, today page (two-pane), weight page, onboarding, stack-suggestion banner, event, tagging mode, search. */
/* TODAY / DAY TIMELINE */
.day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0 11px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.day-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.day-head-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.day-nav-btn {
  background: transparent;
  border: 1px solid var(--dim);
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  flex-shrink: 0;
}
.day-nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.day-today-btn {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue);
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 2px 9px;
  cursor: pointer;
  transition: all 0.12s;
}
.day-today-btn:hover { background: var(--blue); color: #fff; }

/* TODAY PAGE (two-pane) */
.today-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.today-source {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  overflow: hidden;
  min-height: 0;
}

.today-source-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.today-source-title {
  display: block;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.today-source-filter {
  display: flex;
  gap: 0;
}

.tsf {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.1s;
}
.tsf:hover { color: var(--secondary); }
.tsf.active { color: var(--accent); border-bottom-color: var(--accent); }

.today-source-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 8px;
}

.today-src-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--secondary);
  border-radius: 3px;
  padding: 6px 8px;
  margin-bottom: 6px;
  cursor: grab;
  transition: border-color 0.1s, background 0.1s;
}
.today-src-item:hover { background: var(--bg3); border-color: var(--dim); }
.today-src-item:active { cursor: grabbing; }
.today-src-item.dragging-src { opacity: 0.4; }

.today-src-type {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-src-text {
  font-size: 11px;
  color: var(--primary);
  line-height: 1.35;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.today-src-text.done { text-decoration: line-through; color: var(--muted); }

.today-source-empty {
  padding: 20px 8px;
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

.today-timeline-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.day-dow {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--blue);
  text-transform: uppercase;
  font-weight: 500;
}

.day-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
}
body.light .day-circle { color: #fff; }
.day-circle.other-day { background: var(--dim); color: var(--secondary); }
body.light .day-circle.other-day { color: var(--secondary); }

.day-hint {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-style: italic;
}

.day-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}

.day-grid {
  position: relative;
}

.day-hour {
  position: relative;
  height: 46px;
  border-top: 1px solid var(--line);
  box-sizing: border-box;
}
.day-hour:first-child { border-top: none; }

.day-hour-label {
  position: absolute;
  top: -7px;
  left: 5px;
  font-size: 8px;
  color: var(--muted);
  background: var(--bg);
  padding: 0 3px;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 2;
}

.day-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid var(--red);
  z-index: 5;
  pointer-events: none;
}
.day-now-dot {
  position: absolute;
  left: 0;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.day-drop-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dashed var(--accent);
  z-index: 7;
  pointer-events: none;
  display: none;
}

.day-block {
  position: absolute;
  left: 42px;
  right: 6px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-left: 4px solid var(--secondary);
  border-radius: 3px;
  padding: 2px 7px;
  overflow: hidden;
  cursor: grab;
  z-index: 4;
  box-shadow: 0 1px 2px var(--shadow);
  transition: box-shadow 0.1s;
}
.day-block:hover { box-shadow: 0 2px 7px var(--shadow); z-index: 6; }
.day-block:active { cursor: grabbing; }

.day-block-time {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.day-block-type {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.day-block-clock {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.day-block-text {
  font-size: 10px;
  color: var(--primary);
  line-height: 1.32;
  word-break: break-word;
  overflow: hidden;
}
.day-block-text.done {
  text-decoration: line-through;
  color: var(--muted);
}

.day-block-x {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
}
.day-block:hover .day-block-x { opacity: 1; }
.day-block-x:hover { color: var(--red); }

.entry.dragging-src { opacity: 0.4; }
.sb-task-item[draggable="true"] { cursor: grab; }
.sb-task-item[draggable="true"]:active { cursor: grabbing; }
.sb-task-item.dragging-src { opacity: 0.4; }

/* WEIGHT PAGE */
.weight-layout {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.weight-score-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 16px;
}

.weight-total-block { flex: 1; }

.weight-total-label {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.weight-total-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font);
  line-height: 1;
  margin-bottom: 4px;
}

.weight-total-sub {
  font-size: 11px;
  color: var(--secondary);
  font-style: italic;
}

.weight-dims {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.weight-dim {
  background: var(--bg2);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.weight-dim-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.weight-dim-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
}

.weight-dim-score {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font);
}

.weight-dim-bar-bg {
  height: 3px;
  background: var(--dim);
}

.weight-dim-bar {
  height: 3px;
  transition: width 0.6s ease;
}

.weight-dim-detail {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.weight-section-title {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.weight-log {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wl-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.wl-delta {
  font-weight: 700;
  font-family: var(--font);
  min-width: 36px;
  flex-shrink: 0;
}

.wl-delta.pos { color: var(--green); }
.wl-delta.neg { color: var(--red); }

.wl-desc { color: var(--secondary); flex: 1; }
.wl-dim  { font-size: 9px; color: var(--muted); flex-shrink: 0; }

.weight-next {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resonance-block {
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resonance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.resonance-label {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.resonance-multiplier {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font);
  color: var(--purple);
  line-height: 1;
}

.resonance-multiplier-sub {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
  text-align: right;
}

.resonance-bar-track {
  position: relative;
  height: 6px;
  background: var(--dim);
  border-radius: 3px;
  overflow: hidden;
}

.resonance-bar-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 3px;
  transition: width 0.8s ease;
}

.resonance-subs {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.resonance-sub {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.resonance-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.resonance-sub-name {
  font-size: 10px;
  color: var(--secondary);
}

.resonance-sub-score {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font);
  color: var(--purple);
}

.resonance-sub-bar-bg {
  height: 2px;
  background: var(--dim);
}

.resonance-sub-bar {
  height: 2px;
  background: var(--purple);
  opacity: 0.6;
  transition: width 0.6s ease;
}

.resonance-desc {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.wn-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  font-size: 11px;
  color: var(--secondary);
  line-height: 1.5;
}

.wn-icon { color: var(--accent); flex-shrink: 0; font-size: 10px; padding-top: 1px; }

/* ONBOARDING */
.onboard-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 900;
  align-items: center;
  justify-content: center;
}

.onboard-overlay.open { display: flex; }

.onboard-modal {
  width: 480px;
  max-width: calc(100vw - 32px);
  background: var(--bg2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.onboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.onboard-logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.onboard-step-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.onboard-progress {
  height: 2px;
  background: var(--dim);
}

.onboard-progress-fill {
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.onboard-body {
  padding: 24px 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboard-q {
  font-size: 14px;
  color: var(--primary);
  line-height: 1.6;
}

.onboard-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  font-style: italic;
}

.onboard-input {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--accent);
  color: var(--primary);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 10px;
  resize: none;
  outline: none;
  line-height: 1.55;
  width: 100%;
}

.onboard-input::placeholder { color: var(--muted); }

.onboard-name-row {
  display: flex;
  gap: 10px;
}

.onboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}

.onboard-next {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 6px 18px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity 0.1s;
}

.onboard-next:hover { opacity: 0.85; }
.onboard-next:disabled { opacity: 0.4; cursor: default; }

.onboard-skip {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.1s;
  padding: 6px 0;
}

.onboard-skip:hover { color: var(--secondary); }

/* STACK SUGGESTION BANNER */
.stack-suggest {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 340px;
  background: var(--bg2);
  border: 1px solid var(--accent);
  z-index: 400;
  box-shadow: 0 4px 20px var(--shadow);
}

.stack-suggest-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.stack-suggest-icon { color: var(--accent); font-size: 11px; }

.stack-suggest-title {
  flex: 1;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack-suggest-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: color 0.1s;
}

.stack-suggest-close:hover { color: var(--primary); }

.stack-suggest-body {
  padding: 12px 14px;
  font-size: 11px;
  color: var(--secondary);
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}

.stack-field-row {
  margin-bottom: 10px;
}

.stack-field-label {
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.stack-field-value {
  font-size: 11px;
  color: var(--primary);
  line-height: 1.5;
  background: var(--bg3);
  padding: 5px 8px;
  border-left: 2px solid var(--accent);
}

.stack-suggest-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

/* EVENT */
.event-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--accent);
  flex-shrink: 0;
}
.event-dot { font-size: 7px; color: var(--accent); animation: pulse 1.5s ease-in-out infinite; }
.event-banner-name { font-size: 11px; color: var(--accent); font-weight: 700; flex: 1; letter-spacing: 0.02em; }
.event-banner-count { font-size: 9px; color: var(--muted); }
.event-banner-close {
  background: transparent; border: 1px solid var(--dim); color: var(--muted);
  font-family: var(--font); font-size: 9px; padding: 2px 7px; cursor: pointer;
  transition: all 0.1s; letter-spacing: 0.04em;
}
.event-banner-close:hover { border-color: var(--red); color: var(--red); }
.event-start-btn {
  background: transparent; border: 1px solid var(--dim); color: var(--muted);
  font-family: var(--font); font-size: 10px; padding: 3px 8px; cursor: pointer;
  transition: all 0.12s; letter-spacing: 0.04em; margin-left: auto;
}
.event-start-btn:hover { border-color: var(--accent); color: var(--accent); }
.event-start-btn.active { border-color: var(--accent); color: var(--accent); background: var(--bg3); }

/* TAGGING MODE */
body.tagging-mode .journal-feed-wrap { cursor: crosshair; }
body.tagging-mode #journal-feed .entry {
  cursor: pointer;
  transition: background 0.08s, border-left-color 0.08s, outline 0.08s;
}
body.tagging-mode #journal-feed .entry:hover {
  background: rgba(212,196,106,0.08);
  outline: 1px solid var(--accent);
  border-left: 2px solid var(--accent);
}
body.light.tagging-mode #journal-feed .entry:hover {
  background: rgba(106,84,40,0.07);
}
.tagging-banner {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 8px 20px;
  z-index: 600;
  pointer-events: none;
}
.tagging-banner.show { display: block; }
.event-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0 4px; margin-top: 6px;
}
.event-group-dot { font-size: 7px; color: var(--accent); }
.event-group-name { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.event-group-meta { font-size: 9px; color: var(--muted); }
.event-group-line { flex: 1; height: 1px; background: linear-gradient(to right, var(--accent), transparent); opacity: 0.3; }
.entry.in-event { border-left: 2px solid var(--accent); padding-left: 10px; margin-left: 2px; }
.event-name-modal {
  position: fixed; inset: 0; background: var(--overlay);
  z-index: 800; display: flex; align-items: center; justify-content: center;
}
.event-name-box {
  background: var(--bg2); border: 1px solid var(--accent);
  padding: 20px; width: 360px; display: flex; flex-direction: column; gap: 10px;
}
.event-name-label { font-size: 10px; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; }
.event-name-input {
  background: var(--bg3); border: none; border-bottom: 1px solid var(--accent);
  color: var(--primary); font-family: var(--font); font-size: 14px;
  padding: 6px 0; outline: none; width: 100%;
}
.event-name-input::placeholder { color: var(--muted); }
.event-name-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* SEARCH */
.search-overlay {
  position: fixed; inset: 0; background: var(--overlay);
  z-index: 850; display: flex; align-items: flex-start;
  justify-content: center; padding-top: 80px;
}

.search-modal {
  width: 560px; max-width: calc(100vw - 32px);
  background: var(--bg2); border: 1px solid var(--line);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 140px);
}

.search-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.search-icon { color: var(--muted); font-size: 16px; flex-shrink: 0; }

.search-input {
  flex: 1; background: transparent; border: none;
  color: var(--primary); font-family: var(--font);
  font-size: 14px; outline: none;
}

.search-input::placeholder { color: var(--muted); }

.search-close {
  background: transparent; border: 1px solid var(--dim);
  color: var(--muted); font-family: var(--font);
  font-size: 9px; padding: 2px 6px; cursor: pointer;
  letter-spacing: 0.06em; flex-shrink: 0;
  transition: all 0.1s;
}
.search-close:hover { border-color: var(--accent); color: var(--accent); }

.search-filters {
  display: flex; gap: 0; padding: 0 16px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}

.search-filter {
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted); font-family: var(--font);
  font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 7px 10px;
  cursor: pointer; transition: all 0.1s;
  margin-bottom: -1px;
}
.search-filter:hover { color: var(--secondary); }
.search-filter.active { color: var(--accent); border-bottom-color: var(--accent); }

.search-results {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 8px 0;
}

.search-empty {
  font-size: 11px; color: var(--muted);
  font-style: italic; padding: 20px 16px;
}

.search-result {
  padding: 8px 16px; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.08s;
  display: flex; flex-direction: column; gap: 3px;
}
.search-result:hover { background: var(--bg3); }

.search-result-header {
  display: flex; align-items: center; gap: 8px;
}

.search-result-time { font-size: 10px; color: var(--muted); flex-shrink: 0; }

.search-result-text {
  font-size: 12px; color: var(--primary);
  line-height: 1.45;
}

.search-result-text mark {
  background: var(--accent); color: var(--bg);
  padding: 0 2px; border-radius: 1px;
}

.search-result-meta { font-size: 10px; color: var(--muted); }

