/* =====================
   JOURNAL — Daily Check-In UI
   ===================== */

/* Header */
.j-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.j-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.j-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
}

.j-date {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* Main */
.j-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 2rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Tabs */
.j-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.j-tab {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.j-tab:hover { color: var(--fg); }

.j-tab.active {
  color: var(--ink);
  border-bottom-color: var(--rose);
  font-weight: 500;
}

/* Pattern strip */
.j-pattern {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.j-pattern-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-light);
}

.j-pattern-bars {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  height: 64px;
}

.j-pattern-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.j-pattern-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  max-height: 48px;
  transition: height 0.4s ease, background 0.4s ease;
}

.j-pattern-day-label {
  font-size: 0.65rem;
  color: var(--fg-light);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Section */
.j-section { }

.j-section-inner {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Step */
.j-step {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.j-step-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.j-step-num {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--rose);
  text-transform: uppercase;
  flex-shrink: 0;
}

.j-step-heading h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
}

/* State grid */
.j-states {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.j-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  color: var(--fg-muted);
}

.j-state:hover {
  border-color: var(--rose-light);
  box-shadow: 0 4px 16px rgba(196, 150, 122, 0.1);
  color: var(--fg);
}

.j-state.selected {
  border-color: var(--rose);
  background: var(--bg-warm);
  color: var(--ink);
}

.j-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.j-state.selected .j-state-icon { opacity: 1; }

.j-state span {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.j-step-hint {
  font-size: 0.8rem;
  color: var(--fg-light);
  text-align: center;
}

/* Prompt card */
.j-prompt-card {
  background: var(--bg-warm);
  border: 1px solid var(--rose-light);
  border-radius: 16px;
  padding: 1.75rem;
}

.j-prompt-card--evening {
  background: var(--ink);
  border-color: var(--ink);
}

.j-prompt-text {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
}

.j-prompt-card--evening .j-prompt-text {
  color: #f0e8e1;
}

/* Textarea */
.j-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 140px;
}

.j-textarea:focus {
  outline: none;
  border-color: var(--rose-light);
  box-shadow: 0 0 0 3px rgba(196, 150, 122, 0.1);
}

.j-textarea::placeholder { color: var(--fg-light); }

/* Actions */
.j-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
}

.j-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s, opacity 0.2s;
  border: none;
}

.j-btn:active { transform: scale(0.98); }
.j-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.j-btn--primary {
  background: var(--rose);
  color: #fff;
}

.j-btn--primary:hover:not(:disabled) {
  background: var(--rose-dark);
}

.j-btn--ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.j-btn--ghost:hover:not(:disabled) {
  background: var(--bg-warm);
  border-color: var(--rose-light);
}

.j-btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* Saved states */
.j-step--saved {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  gap: 1rem;
}

.j-saved-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--rose-dark);
  letter-spacing: 0.04em;
}

.j-saved-state {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.j-saved-text {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.7;
  font-style: italic;
}

/* Evening questions */
.j-evening-questions {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.j-evening-q {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.j-evening-q span {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-light);
}

/* Evening saved */
.j-evening-saved {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.j-ev-saved-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.j-ev-saved-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose);
}

.j-ev-saved-val {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* Responsive */
@media (max-width: 600px) {
  .j-main { padding: 1.5rem 1.25rem 4rem; }
  .j-states { grid-template-columns: 1fr 1fr; }
  .j-header-inner { padding: 1rem 1.25rem; }
  .j-actions { flex-direction: column-reverse; align-items: stretch; }
  .j-btn { justify-content: center; }
}