/* ============================================================
 * Reflection H5 — Production styles
 * Depends on: colors_and_type.css (design tokens + utility classes)
 * ============================================================ */

* {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

/* ─── Container (phone shell) ──────────────────────────── */

.container {
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg-surface);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  border: none;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ─── Header ───────────────────────────────────────────── */

.header {
  background: var(--bg-surface);
  padding: 10px 12px 8px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule-line);
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
}

.header-brand-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-brand-left img {
  width: 24px;
  height: 24px;
}

.header-brand-left h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  letter-spacing: -0.005em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── Tab bar ──────────────────────────────────────────── */

.page-switch-card {
  margin-top: 4px;
  padding: 3px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-input);
  background: var(--bg-canvas);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.page-switch-card::-webkit-scrollbar { display: none; }

.page-switch-option {
  border: none;
  border-radius: 8px;
  background: transparent;
  padding: 5px 8px;
  min-height: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-standard);
  flex-shrink: 0;
  white-space: nowrap;
}

.page-switch-option.is-active {
  background: var(--bg-surface);
  color: var(--fg-primary);
  box-shadow: var(--shadow-1);
}

.page-switch-option-title {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  color: var(--fg-secondary);
}

.page-switch-option.is-active .page-switch-option-title {
  color: var(--fg-primary);
}

/* ─── Page panels ──────────────────────────────────────── */

.form-container {
  padding: 8px 12px 12px;
}

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

/* ─── Form ─────────────────────────────────────────────── */

.compact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#formFieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: contents;
}

#formFieldset:disabled {
  opacity: 0.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group {
  margin-bottom: 0;
}

.form-group.time-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group.time-inline label {
  width: 78px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.form-group.time-inline input[type="datetime-local"] {
  flex: 1;
}

.form-group.time-range {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.time-field-row {
  display: grid;
  grid-template-columns: 42px minmax(10.5rem, 1fr) 84px;
  align-items: center;
  gap: 6px;
}

.time-field-row > label:first-child {
  margin: 0;
  color: var(--fg-secondary);
  font-size: 12px;
}

.form-group.time-range input[type="datetime-local"] {
  width: 100%;
  min-width: 10.5rem;
}

.start-now-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  background: var(--bg-surface);
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  white-space: nowrap;
}

.start-now-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  opacity: 0;
  white-space: nowrap;
  cursor: pointer;
}

.start-now-toggle:has(input:checked) {
  border-color: var(--ink-cobalt);
  background: var(--ink-cobalt-soft);
  color: var(--ink-cobalt);
}

.start-now-toggle:focus-within {
  border-color: var(--ink-cobalt);
  box-shadow: var(--shadow-inset);
}

/* Toggles the completion time between now and 30 minutes after the start. */
.time-quick-btn {
  min-width: 76px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.time-quick-btn:hover {
  color: var(--fg-primary);
  border-color: var(--fg-muted);
}

.historical-review-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin: 0;
  padding: 2px 7px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  background: var(--bg-canvas);
  color: var(--fg-muted);
  font-size: 0.85em;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}

.historical-review-toggle input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: initial;
  -webkit-appearance: checkbox;
  appearance: checkbox;
  accent-color: var(--ink-cobalt);
  cursor: pointer;
}

.historical-review-toggle[hidden] {
  display: none;
}

.historical-review-toggle:has(input:checked) {
  color: var(--ink-cobalt);
  border-color: var(--ink-cobalt);
  background: var(--ink-cobalt-soft);
}

.historical-review-toggle:hover,
.historical-review-toggle:focus-within {
  color: var(--fg-primary);
  border-color: var(--fg-muted);
}

.form-group.select-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group.select-inline label {
  width: 78px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.form-group.select-inline select {
  flex: 1;
}

#dodArchiveFilter,
#todayArchiveFilter {
  flex: 0 0 auto;
  width: 90px;
  font-size: 12px;
}

/* Recent SubPlan quick-fill: full width, dense and scan-friendly. */
.form-group.recent-subplans-group {
  display: grid;
  gap: 5px;
  padding: 7px 8px 8px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-input);
  background: var(--bg-canvas);
}

.form-group.recent-subplans-group[hidden] {
  display: none;
}

.form-group.recent-subplans-group > label {
  width: auto;
  margin: 0;
  color: var(--fg-secondary);
  font-size: 12px;
}

.recent-subplans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.recent-subplan-chip {
  width: 100%;
  min-width: 0;
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid var(--border-subtle, #d0d0d0);
  border-radius: 14px;
  background: var(--bg-subtle, #f5f5f5);
  color: var(--fg-primary);
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-subplan-chip:hover {
  border-color: var(--accent, #4a90d9);
}

.recent-subplan-chip.is-active {
  border-color: var(--accent, #4a90d9);
  background: var(--accent, #4a90d9);
  color: #fff;
}

.assist-links-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
}

.recent-subplans-more {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  cursor: pointer;
}

.recent-subplans-more[hidden] {
  display: none;
}

label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-ui);
  font-weight: var(--fw-semibold);
  font-size: 13px;
  color: var(--fg-primary);
}

input,
textarea,
select {
  width: 100%;
  padding: 9px 10px;
  border: 1.5px solid var(--rule-line);
  border-radius: var(--radius-input);
  font-size: 15px;
  font-family: var(--font-ui);
  line-height: 1.35;
  background: var(--bg-surface);
  color: var(--fg-primary);
  outline: none;
  transition: all var(--duration-base) var(--ease-standard);
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ink-cobalt);
  box-shadow: var(--shadow-inset);
}

textarea {
  resize: vertical;
  min-height: 72px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input[readonly],
textarea[readonly] {
  background: var(--bg-surface);
  color: var(--fg-muted);
}

/* ─── Buttons ──────────────────────────────────────────── */

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.form-actions .secondary-btn {
  grid-column: 1 / -1;
}

.form-actions-primary {
  grid-template-columns: 1fr 1fr;
}

.secondary-actions {
  justify-self: end;
  position: relative;
  color: var(--fg-muted);
  font-size: 12px;
}

.secondary-actions summary {
  cursor: pointer;
  padding: 2px 0;
  text-align: right;
}

.secondary-actions-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.secondary-actions-content .historical-review-toggle {
  min-height: 32px;
  justify-content: center;
}

.secondary-actions .secondary-btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.submit-btn,
.secondary-btn,
.plan-btn,
.act-btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-btn);
  padding: 10px 12px;
  border: none;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-standard);
  min-height: 44px;
}

.submit-btn {
  flex: 1;
  background: #ffffff;
  color: var(--ink-cobalt);
  border: 1.5px solid var(--ink-cobalt);
}

.submit-btn:active {
  background: var(--ink-cobalt-soft);
}

.act-btn {
  background: #ffffff;
  color: var(--ink-cobalt);
  border: 2px solid var(--ink-cobalt);
  font-weight: var(--fw-bold);
}

.act-btn:active {
  background: var(--ink-cobalt-soft);
}

.plan-btn {
  background: #ffffff;
  color: var(--ink-cobalt);
  border: 1.5px solid var(--rule-line-strong);
}

.plan-btn:active {
  background: var(--bg-canvas);
}

.secondary-btn {
  min-width: 90px;
  background: #ffffff;
  color: var(--fg-secondary);
  border: 1.5px solid var(--rule-line);
}

.secondary-btn:active {
  background: var(--bg-canvas);
}
.submit-btn:disabled,
.secondary-btn:disabled,
.plan-btn:disabled,
.act-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Loading ──────────────────────────────────────────── */

.loading {
  display: none;
  text-align: center;
  padding: 8px 0 2px;
}

.spinner {
  border: 3px solid var(--rule-line);
  border-top: 3px solid var(--ink-cobalt);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 1s linear infinite;
  margin: 0 auto 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ─── Message ──────────────────────────────────────────── */

.message {
  padding: 9px 10px;
  border-radius: var(--radius-input);
  margin-top: 8px;
  display: none;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
}

.message.success,
.message.error {
  background: var(--bg-surface);
  color: var(--fg-primary);
  border: 1px solid var(--rule-line);
}

/* ─── AI Comments section ──────────────────────────────── */

.ai-comments-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--rule-line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-comments-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.ai-comments-range {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  order: 10;
  width: 100%;
}

.ai-comments-range input[type="date"] {
  width: auto;
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
}

.ai-refresh-btn {
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  color: var(--fg-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.ai-refresh-btn:active {
  background: var(--surface-hover);
}

.ai-comments-header h2 {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  margin: 0;
  flex-shrink: 0;
}

.ai-status-banner {
  font-family: var(--font-ui);
  font-size: 12px;
  border-radius: 10px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: var(--warn);
  border: 1px solid var(--rule-line);
  transition: opacity var(--duration-slow) var(--ease-standard);
}

.ai-status-banner[hidden] {
  display: none;
}

.ai-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.ai-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-pressure-encouragement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #b9dec8;
  border-radius: 12px;
  background: #f1fbf5;
  color: #245b3a;
}

.ai-pressure-encouragement.is-high {
  border-color: #f0c6b8;
  background: #fff6f2;
  color: #7a3d2c;
}

.ai-pressure-encouragement.is-long-term {
  border-color: #c8d3ea;
  background: #f5f7fc;
  color: var(--ink-cobalt-deep);
}

.ai-pressure-encouragement-icon {
  line-height: 1.4;
}

.ai-pressure-encouragement-title {
  margin-bottom: 3px;
  font-weight: 650;
}

.ai-pressure-encouragement-message {
  font-size: 13px;
  line-height: 1.55;
}

.ai-comments-empty {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0;
}

/* ─── AI comment card (quote style) ────────────────────── */

.ai-comment-card {
  border: 1px solid var(--rule-line);
  border-left: 3px solid var(--ink-cobalt);
  background: #ffffff;
  padding: 10px 12px;
  border-radius: 0 var(--radius-tight) var(--radius-tight) 0;
  transition: background 120ms ease;
}

.ai-comment-card.is-pending {
  border-left-color: var(--warn);
}

.ai-comment-card-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 4px;
  font-weight: 600;
}

.ai-comment-card[data-record-type="act"] .ai-comment-card-badge,
.ai-comment-card-badge.type-act {
  background: #ffffff;
  color: var(--ink-cobalt);
  border: 1px solid var(--ink-cobalt);
}

.ai-comment-card[data-record-type="subplan"] .ai-comment-card-badge,
.ai-comment-card-badge.type-subplan {
  background: #ffffff;
  color: var(--warn);
  border: 1px solid var(--warn);
}

.ai-comment-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-comment-card-dod {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.ai-comment-card-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--fg-muted);
  margin: 2px 0 4px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-comment-card-sub::before {
  content: "↳ ";
  color: var(--fg-disabled);
}

.ai-comment-card-act {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--fg-primary);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 4px 0 0;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-comment-card-body {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  text-wrap: pretty;
  border-top: none;
  padding-top: 6px;
  margin-top: 6px;
}

.ai-comment-knowledge {
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid var(--rule-line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink-cobalt) 4%, #fff);
  color: var(--fg-muted);
  font-family: var(--font-ui);
  font-size: 11px;
}

.ai-comment-knowledge summary {
  cursor: pointer;
  color: var(--ink-cobalt);
  font-weight: 600;
}

.ai-comment-knowledge div {
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.ai-comment-knowledge.is-empty div {
  color: var(--fg-muted);
  font-style: italic;
}

.ai-comment-correct-btn {
  background: transparent;
  border: 1px solid var(--rule-line);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.ai-comment-correct-btn:hover {
  color: var(--fg-primary);
  border-color: var(--fg-muted);
}

.ai-comment-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--rule-line);
}

.ai-comment-correct-form {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed var(--rule-line);
  border-radius: 4px;
  background: var(--bg-surface, transparent);
}
.ai-comment-correct-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px;
  border: 1px solid var(--rule-line);
  border-radius: 3px;
  resize: vertical;
  box-sizing: border-box;
}
.ai-comment-correct-time-row {
  margin-top: 6px;
}
.ai-comment-correct-time-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-comment-correct-time {
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--rule-line);
  border-radius: 3px;
  padding: 2px 4px;
  flex: 1;
}
.ai-comment-correct-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 6px;
}
.ai-comment-correct-cancel,
.ai-comment-correct-submit {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--rule-line);
}
.ai-comment-correct-submit {
  background: var(--fg-primary, #111);
  color: var(--bg-primary, #fff);
  border-color: var(--fg-primary, #111);
}
.ai-comment-correct-submit:disabled {
  opacity: 0.5;
  cursor: progress;
}
.ai-comment-correct-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 6px;
}

.ai-comment-card-body em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-cobalt);
  display: block;
  margin-top: 6px;
}

.ai-comment-card.is-pending .ai-comment-card-body {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--fg-muted);
  font-size: 13px;
}

/* ─── Checklist ────────────────────────────────────────── */

.checklist-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.health-reminders-section {
  margin-top: 16px;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.todo-section {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-input);
  background: var(--bg-surface);
}

.todo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.todo-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--fg-primary);
}

.todo-note {
  margin: 3px 0 0;
  color: var(--fg-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.4;
}

.todo-add-row {
  display: flex;
  gap: 8px;
}

.todo-add-row input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.todo-add-row button {
  width: auto;
  min-width: 64px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: var(--ink-cobalt);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.todo-add-row button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--bg-canvas);
  color: var(--fg-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
}

.todo-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--ink-cobalt);
  -webkit-appearance: checkbox;
  appearance: auto;
}

.todo-item-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.todo-empty {
  margin: 10px 0 0;
  color: var(--fg-muted);
  font-family: var(--font-ui);
  font-size: 13px;
}

.health-reminders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.health-reminders-title {
  font-family: var(--font-ui);
  font-size: 14px;
  margin: 0;
  color: #333;
}

.health-reminders-add-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #1f6feb;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.health-reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
}

.health-reminder-info {
  font-size: 13px;
  color: #444;
  flex: 1;
  min-width: 0;
}

.health-reminder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Explicit enable marker — color-coded pill */
.health-reminder-state {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.health-reminder-state:active {
  transform: scale(0.96);
}

.health-reminder-state.on {
  color: #0a7a36;
  background: #e3f8ea;
  border: 1px solid #abe6c0;
}

.health-reminder-state.off {
  color: #8a8f98;
  background: #f0f1f3;
  border: 1px solid #dcdfe4;
}

/* Dim disabled rows so the off-state reads at a glance */
.health-reminder-row.disabled .health-reminder-info {
  color: #9aa0a6;
  text-decoration: line-through;
  text-decoration-color: #c9ccd1;
}

.health-reminder-edit-btn,
.health-reminder-del-btn {
  border: 1px solid #d0d7de;
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  padding: 2px 8px;
  cursor: pointer;
  color: #444;
}

.health-reminder-del-btn {
  color: #cf222e;
  border-color: #f1c0c4;
}

.health-reminders-empty {
  font-size: 13px;
  color: #999;
}

.health-reminder-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Without this, `display: flex` above overrides the [hidden] attribute and the
   modal stays permanently visible (covering the list, blocking cancel). */
.health-reminder-modal-overlay[hidden] {
  display: none;
}

.health-reminder-modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: min(90vw, 360px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-reminder-modal h3 {
  margin: 0;
  font-size: 16px;
}

.health-reminder-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #555;
}

.health-reminder-field input {
  padding: 8px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  font-size: 14px;
}

.health-reminder-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.health-reminder-modal-actions button {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

#healthReminderModalCancel {
  background: #eaeef2;
  color: #444;
}

#healthReminderModalConfirm {
  background: #1f6feb;
  color: #fff;
}

.checklist-section h2 {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
}

.checklist-top-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.checklist-top-row .form-group {
  flex: 1;
}

.checklist-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.checklist-clear-btn,
.checklist-add-btn {
  width: auto;
  min-width: 44px;
  border: 1px solid var(--rule-line);
  background: #ffffff;
  color: var(--fg-secondary);
  border-radius: 10px;
  padding: 6px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-standard);
}

.checklist-add-btn {
  background: var(--ink-cobalt);
  color: #fff;
  border-color: var(--ink-cobalt);
  font-weight: var(--fw-semibold);
  font-size: 16px;
  padding: 6px 14px;
}

.checklist-clear-btn:hover { background: var(--bg-canvas); }
.checklist-add-btn:hover { opacity: 0.85; }

.checklist-name-actions {
  display: flex;
  gap: 8px;
}
.checklist-name-actions[hidden] {
  display: none;
}

.checklist-rename-btn,
.checklist-delete-btn {
  border: 1px solid var(--rule-line);
  background: var(--bg-canvas);
  border-radius: 8px;
  padding: 4px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.checklist-rename-btn { color: var(--ink-cobalt); }
.checklist-delete-btn { color: var(--ink-red, #d32f2f); }
.checklist-rename-btn:hover,
.checklist-delete-btn:hover { background: var(--rule-line); }

.checklist-steps-card {
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-input);
  background: var(--bg-surface);
  padding: 8px;
}

.checklist-steps-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Swipe-to-reveal step row ──────────────────────────── */

.checklist-step-wrapper {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--rule-line);
  background: var(--bg-canvas);
}

.checklist-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  background: var(--bg-canvas);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg-primary);
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
  touch-action: pan-y;
}

.checklist-step-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--ink-cobalt);
  -webkit-appearance: checkbox;
  appearance: auto;
}

.checklist-step-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.checklist-step-item.done .checklist-step-text {
  color: var(--fg-muted);
  text-decoration: line-through;
}

.checklist-step-arrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.checklist-arrow-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--fg-muted);
  line-height: 1;
  border-radius: 4px;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.checklist-arrow-btn:hover { background: var(--rule-line); }
.checklist-arrow-btn:disabled { opacity: 0.2; pointer-events: none; }

/* Hidden action buttons revealed on swipe */
.checklist-step-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  z-index: 0;
}

.checklist-step-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  border: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: #fff;
  cursor: pointer;
}

.checklist-step-action-btn.edit { background: var(--ink-cobalt); }
.checklist-step-action-btn.delete { background: var(--ink-red, #d32f2f); }

/* Inline edit input */
.checklist-step-edit-input {
  flex: 1;
  border: 1px solid var(--ink-cobalt);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
  background: #fff;
}

/* Add step row */
.checklist-add-step-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px dashed var(--rule-line);
  margin-top: 4px;
}

.checklist-add-step-input {
  flex: 1;
  border: 1px solid var(--rule-line);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
}
.checklist-add-step-input:focus {
  border-color: var(--ink-cobalt);
}

.checklist-add-step-confirm {
  background: var(--ink-cobalt);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.checklist-empty-hint {
  color: var(--fg-secondary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 4px;
}

/* ── Checklist modal ───────────────────────────────────── */

.checklist-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.checklist-modal-overlay[hidden] {
  display: none;
}

.checklist-modal {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.checklist-modal h3 {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  margin-bottom: 14px;
}

.checklist-modal .form-group {
  margin-bottom: 12px;
}

.checklist-modal label {
  display: block;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--fg-secondary);
  margin-bottom: 4px;
}

.checklist-modal input {
  width: 100%;
  border: 1px solid var(--rule-line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.checklist-modal input:focus {
  border-color: var(--ink-cobalt);
}

.checklist-modal-buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.checklist-modal-cancel,
.checklist-modal-confirm {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.checklist-modal-cancel {
  background: var(--bg-canvas);
  color: var(--fg-secondary);
}

.checklist-modal-confirm {
  background: var(--ink-cobalt);
  color: #fff;
}

/* ─── DOD Creator ──────────────────────────────────────── */

.dod-top-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
}

.dod-top-row .form-group {
  flex: 1;
  margin: 0;
}

/* Active/archive segmented filter for the DOD picker. */
.dod-filter {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-btn);
  overflow: hidden;
  background: #ffffff;
}
.dod-filter-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  padding: 0 12px;
  min-height: 38px;
  border: none;
  background: transparent;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-standard);
}
.dod-filter-btn + .dod-filter-btn {
  border-left: 1px solid var(--rule-line);
}
.dod-filter-btn.active {
  background: var(--ink-cobalt);
  color: var(--fg-on-cobalt);
}

.dod-card {
  border: 1.5px solid var(--ink-cobalt);
  border-radius: var(--radius-card);
  padding: 8px;
  margin-bottom: 8px;
  background: var(--bg-surface);
}

.dod-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.dod-suggestions .dod-card h4 {
  margin: 0 0 6px 0;
}
.dod-suggestions .dod-card .dod-card-desc {
  margin: 0 0 6px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.dod-suggestions .dod-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.dod-acceptance {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-card);
  background: var(--bg-canvas);
}

.dod-acceptance[hidden] { display: none; }

.dod-acceptance-heading,
.dod-acceptance-actions,
.dod-condition-row,
.dod-candidate-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dod-acceptance-heading {
  justify-content: space-between;
  align-items: flex-start;
}

.dod-acceptance-heading h3,
.dod-effective-work h4 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
}

.dod-acceptance-status,
.dod-acceptance-hint {
  margin: 3px 0 0;
  color: var(--fg-secondary);
  font-size: 12px;
}

.dod-acceptance-status[data-status="converged"] { color: var(--good); }
.dod-acceptance-status[data-status="in_progress"] { color: var(--ink-cobalt); }

.dod-condition-candidates,
.dod-acceptance-list,
.dod-effective-work {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.dod-condition-candidates[hidden],
.dod-effective-work[hidden] { display: none; }

.dod-candidate-row,
.dod-condition-row {
  padding: 8px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-btn);
  background: #fff;
}

.dod-candidate-row textarea,
.dod-condition-text {
  flex: 1;
  min-width: 0;
}

.dod-candidate-row {
  align-items: flex-start;
}

.dod-candidate-row textarea {
  width: 100%;
  min-height: 72px;
  overflow-y: hidden;
  resize: vertical;
  font-weight: var(--fw-regular);
}

.dod-candidate-row input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  margin: 10px 0 0;
  flex: 0 0 18px;
  appearance: auto;
  -webkit-appearance: checkbox;
  accent-color: var(--ink-cobalt);
}

.dod-condition-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

.dod-condition-row.is-complete .dod-condition-text {
  color: var(--fg-secondary);
  text-decoration: line-through;
}

.dod-condition-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dod-condition-controls button {
  padding: 5px 7px;
  min-height: 30px;
  font-size: 11px;
}

.dod-effective-work-item {
  padding-left: 10px;
  border-left: 2px solid var(--good);
  font-size: 12px;
  color: var(--fg-secondary);
}

.dod-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill.gen {
  background: var(--ink-cobalt-soft);
  color: var(--ink-cobalt);
}

.pill.proj {
  background: var(--bg-canvas);
  color: var(--fg-secondary);
  border: 1px solid var(--rule-line-strong);
}

.pill.done {
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid #c9d9ce;
}

.dod-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.dod-reason {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-secondary);
  padding-left: 10px;
  border-left: 2px solid var(--rule-line);
  margin-bottom: 12px;
}

.dod-reason b {
  color: var(--fg-primary);
}

.dod-actions {
  display: flex;
  gap: 8px;
}

.dod-actions .btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-btn);
  padding: 9px 12px;
  border: none;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-standard);
  min-height: 38px;
  flex: 1;
}

.dod-actions .btn.primary {
  background: var(--ink-cobalt);
  color: var(--fg-on-cobalt);
}

.dod-actions .btn.primary:active {
  background: var(--ink-cobalt-deep);
}

.dod-actions .btn.secondary {
  background: #ffffff;
  color: var(--fg-secondary);
  border: 1px solid var(--rule-line);
}

.dod-actions .btn.secondary:active {
  background: var(--bg-canvas);
}

.new-dod-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  border: 1.5px dashed var(--rule-line-strong);
  border-radius: var(--radius-card);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--fg-secondary);
  width: 100%;
  cursor: pointer;
  margin-bottom: 14px;
}

.new-dod-btn:active {
  background: var(--bg-canvas);
}

.dod-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-line);
}

.dod-section-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.dod-section-title h2 {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  margin: 0;
}

.dod-section[hidden] {
  display: none;
}

.dod-section-count {
  margin-left: auto;
  color: var(--fg-secondary);
  font-family: var(--font-ui);
  font-size: 11px;
}

.dod-subplans-list,
.dod-closure-content {
  display: grid;
  gap: 8px;
}

.dod-subplan-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-btn);
  background: var(--bg-surface);
}

.dod-subplan-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink-cobalt-soft);
  color: var(--ink-cobalt);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: var(--fw-semibold);
}

.dod-subplan-body {
  min-width: 0;
}

.dod-subplan-body p,
.dod-closure-summary p,
.dod-closure-steps p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.dod-subplan-body p {
  color: var(--fg-primary);
  font-size: 13px;
  line-height: 1.5;
}

.dod-subplan-body small,
.dod-closure-summary small {
  color: var(--fg-secondary);
  font-size: 11px;
}

.dod-closure-content {
  padding: 12px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-card);
  background: var(--bg-canvas);
}

.dod-closure-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.dod-closure-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dod-closure-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--warn-soft);
  color: var(--warn);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: var(--fw-semibold);
}

.dod-closure-status[data-readiness="ready"],
.dod-closure-status[data-readiness="closed"] {
  background: var(--good-soft);
  color: var(--good);
}

.dod-closure-status[data-readiness="nearly_ready"] {
  background: var(--ink-cobalt-soft);
  color: var(--ink-cobalt);
}

.dod-closure-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 26px;
}

.dod-closure-steps li {
  padding: 8px 10px;
  border-left: 2px solid var(--ink-cobalt);
  background: var(--bg-surface);
}

.dod-closure-steps strong {
  font-family: var(--font-ui);
  font-size: 13px;
}

.dod-closure-steps p,
.dod-closure-blockers,
.dod-closure-knowledge,
.dod-closure-done {
  color: var(--fg-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.dod-closure-blockers summary,
.dod-closure-knowledge summary {
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: var(--fw-semibold);
}

.dod-closure-blockers ul,
.dod-closure-knowledge ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.dod-closure-done {
  margin: 0;
  color: var(--good);
}

/* ─── Responsive (iPhone 14: 390×844) ──────────────────── */

@media (max-width: 430px) {
  .header-brand-left h1 {
    font-size: 17px;
  }

  .form-group.time-inline label,
  .form-group.select-inline label {
    width: 68px;
    font-size: 12px;
  }

  .form-group.time-inline input[type="datetime-local"],
  .form-group.select-inline select,
  .form-group.time-range input[type="datetime-local"] {
    font-size: 14px;
    padding: 8px;
  }

  .dod-top-row {
    flex-direction: column;
    gap: 6px;
  }

  .dod-acceptance-heading,
  .dod-condition-row {
    align-items: stretch;
    flex-direction: column;
  }

  .dod-acceptance-actions .btn {
    flex: 1;
  }

  .checklist-top-row {
    flex-direction: column;
    gap: 6px;
  }

  .checklist-actions {
    display: flex;
    gap: 6px;
  }

  .checklist-clear-btn,
  .checklist-add-btn {
    flex: 1;
  }

  .dod-smart-row {
    grid-template-columns: 48px 1fr;
    gap: 4px;
  }

  .dod-smart-row .btn {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .dod-smart-modal-panel {
    width: calc(100vw - 16px);
    padding: 12px;
    max-height: calc(100dvh - 32px);
  }

  .talk-history {
    max-height: 50vh;
  }

  .review-abc-chat {
    max-height: 40vh;
  }

  .ai-comment-card-body {
    font-size: 13px;
    line-height: 1.5;
  }

  .ai-comment-card-act {
    font-size: 12px;
  }

  .ai-comment-card-sub {
    font-size: 11px;
  }

  .ai-comment-card-dod {
    font-size: 11px;
  }
}

/* Safe area insets for notched iPhones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .form-container {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .header {
    padding-top: calc(10px + env(safe-area-inset-top));
  }
}

/* ─── Auth Gate ────────────────────────────────────────── */

.auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background: var(--bg-surface);
}

.auth-gate-inner {
  text-align: center;
  max-width: 280px;
}

.auth-gate-logo {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.auth-gate-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  letter-spacing: -0.005em;
  margin-bottom: 24px;
}

.auth-gate-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-gate-loading .spinner {
  margin: 0;
}

.auth-gate-text {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--fg-secondary);
  line-height: 1.5;
  margin: 0;
}

.auth-gate-failed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-gate[hidden] {
  display: none !important;
}

.auth-gate-loading[hidden] {
  display: none !important;
}

.auth-gate-failed[hidden] {
  display: none !important;
}

.auth-gate-error-icon {
  font-size: 32px;
  line-height: 1;
  color: var(--warn);
}

.auth-gate-retry-btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  background: #ffffff;
  color: var(--ink-cobalt);
  border: 2px solid var(--ink-cobalt);
  border-radius: var(--radius-btn);
  padding: 10px 32px;
  min-height: 44px;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-standard);
}

.auth-gate-retry-btn:active {
  background: var(--ink-cobalt-soft);
}

.auth-gate-hint {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--fg-muted);
  margin: 0;
}

#appMain[hidden] {
  display: none !important;
}

/* ─── Auth ────────────────────────────────────────────── */

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.user-name {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.auth-message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ─── V2: Talk panel ──────────────────────────────────────────── */
.talk-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px 0;
}
.talk-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.5;
}
.talk-bubble p { margin: 0; }
.talk-ai {
  background: var(--surface-secondary, #f3f3f5);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.talk-user {
  background: var(--accent-primary, #4a6cf7);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.talk-stage-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-secondary, #e8ecff);
  color: var(--accent-primary, #4a6cf7);
  margin-bottom: 4px;
}
.talk-header {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}
.talk-input-area {
  margin-top: 12px;
}
.talk-input-area textarea {
  width: 100%;
  resize: vertical;
}
.talk-done-section {
  text-align: center;
  padding: 16px;
}
.talk-commitment {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 15px;
}

/* ─── Talk record header (echoes ACT/PLAN context) ─────── */

.talk-record-header {
  background: var(--ink-cobalt-soft);
  border-left: 3px solid var(--ink-cobalt);
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 4px;
}

.talk-record-type {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-cobalt);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.talk-record-kr {
  font-weight: 600;
  margin-bottom: 6px;
}

.talk-record-ai {
  font-size: 13px;
  color: #555;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

/* ─── Review panel ─────────────────────────────────────── */

.review-step {
  margin-bottom: 16px;
}

.review-step[hidden] {
  display: none !important;
}

.review-step-title {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  margin-bottom: 10px;
}

.review-sub-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-secondary);
  margin: 10px 0 6px;
}

.review-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--fg-primary);
  cursor: pointer;
}

.review-check-label input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--ink-cobalt);
}

.review-physio-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-physio-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--fg-primary);
}

.review-physio-label {
  grid-column: 1;
  grid-row: 1;
}

.review-physio-row input[type="number"] {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 100%;
  padding: 6px 8px;
  font-family: var(--font-ui);
  font-size: 14px;
}

.review-physio-hint {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
  color: var(--fg-secondary);
}

.review-recognition-card {
  background: var(--bg-canvas);
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-input);
  padding: 12px;
  margin-bottom: 8px;
}

.review-recognition-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
}

.review-recognition-row:last-child {
  margin-bottom: 0;
}

.review-recognition-label {
  color: var(--fg-muted);
  flex-shrink: 0;
  min-width: 80px;
}

.review-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.review-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--rule-line);
  color: var(--fg-secondary);
}

.review-chip.expert {
  background: var(--ink-cobalt-soft);
  border-color: var(--ink-cobalt);
  color: var(--ink-cobalt);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-standard);
}

.review-chip.expert.selected {
  background: var(--ink-cobalt);
  color: var(--fg-on-cobalt);
}

.review-chip.star {
  font-weight: var(--fw-semibold);
}

.review-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--rule-line);
  color: var(--fg-primary);
}

.review-expert-panel {
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-input);
  padding: 12px;
  margin-bottom: 10px;
}

.review-expert-panel-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--ink-cobalt);
  margin-bottom: 8px;
}

.review-expert-panel label {
  display: block;
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.review-expert-panel .submit-btn {
  width: 100%;
  margin-top: 8px;
}

.review-step .form-actions {
  margin-top: 10px;
}

.review-expert-result {
  background: var(--bg-canvas);
  border-left: 3px solid var(--ink-cobalt);
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: 4px;
}

.review-expert-result .breakthrough {
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  margin-bottom: 4px;
}

.review-expert-result .method {
  font-size: 13px;
  color: var(--fg-secondary);
}

.review-terminal-banner {
  background: var(--bg-canvas);
  border: 1px solid var(--rule-line-strong);
  border-radius: var(--radius-input);
  padding: 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--fg-primary);
  text-align: center;
}

.review-terminal-banner[hidden] {
  display: none !important;
}

.review-success-banner {
  background: var(--ink-cobalt-soft);
  border: 1px solid var(--ink-cobalt);
  border-radius: var(--radius-input);
  padding: 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-cobalt);
  text-align: center;
}

.review-success-banner[hidden] {
  display: none !important;
}

.ai-comment-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: 4px;
  font-size: 11px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--rule-line);
  color: var(--fg-secondary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.ai-comment-time-pill:hover {
  border-color: var(--fg-muted);
}
.ai-comment-time-pill.is-editing {
  cursor: default;
  background: rgba(0, 100, 200, 0.12);
}
.ai-comment-pill-input {
  font-size: 12px;
  padding: 1px 4px;
  border: 1px solid rgba(0, 100, 200, 0.4);
  border-radius: 4px;
  background: #fff;
}
.ai-comment-pill-btn {
  border: none;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.ai-comment-pill-btn:hover {
  color: #06f;
}
.ai-comment-pill-status {
  font-size: 11px;
  color: #c33;
}

/* SMART filling assistant modal */
.dod-smart-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dod-smart-modal[hidden] { display: none; }
.dod-smart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* Dialogue recognition belongs to the text editor, not to the page action row. */
.key-result-editor {
  position: relative;
}
.key-result-editor textarea {
  padding-bottom: 42px;
}
.recognition-triggers {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
}
.dialogue-recognize-trigger,
.table-recognize-trigger {
  min-width: auto;
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
}
.dialogue-recognize-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialogue-recognize-modal[hidden] { display: none; }
.dialogue-recognize-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.dialogue-recognize-panel {
  position: relative;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--bg-surface);
  box-shadow: var(--shadow-3);
}
.dialogue-recognize-header,
.dialogue-recognize-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dialogue-recognize-header {
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-line);
}
.dialogue-recognize-header h3 { margin: 0; font-size: 16px; }
.table-recognize-help { margin: 0 0 12px; color: var(--fg-secondary); font-size: 13px; }
.dialogue-recognize-panel label { display: block; margin: 12px 0 6px; }
.dialogue-recognize-panel textarea { width: 100%; resize: vertical; }
.dialogue-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.dialogue-image-preview figure { position: relative; margin: 0; }
.dialogue-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.dialogue-image-remove:hover { background: rgba(0, 0, 0, 0.75); }
.dialogue-image-preview img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-tight);
}
.dialogue-image-preview figcaption {
  overflow: hidden;
  margin-top: 3px;
  color: var(--fg-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dialogue-recognize-status { margin-top: 8px; font-size: 13px; }
.dialogue-recognize-status[data-type="error"] { color: var(--ink-red, #b42318); }
.dialogue-recognize-status[data-type="success"] { color: var(--ink-green, #087443); }
.dialogue-recognize-footer { justify-content: flex-end; margin-top: 12px; }
.dod-smart-modal-panel {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-3);
  max-width: 860px;
  width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px;
}
.dod-smart-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule-line);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.dod-smart-modal-header h3 { margin: 0; font-size: 16px; }
.dod-smart-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dod-smart-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 6px;
  align-items: start;
}
.dod-smart-row[data-row="orig"] {
  background: var(--ink-cobalt-soft);
  padding: 8px;
  border-radius: var(--radius-tight);
}
.dod-smart-label {
  font-size: 12px;
  color: var(--fg-secondary);
  padding-top: 6px;
  white-space: nowrap;
}
.dod-smart-row textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--rule-line-strong);
  border-radius: var(--radius-tight);
  background: var(--bg-surface);
}
.dod-smart-row textarea.smart-adopted {
  background: #e8f5e9;
  border-color: #81c784;
}
button.smart-ack.smart-ack--done {
  opacity: 0.45;
  pointer-events: none;
}

/* ── Step 1 ABC chat ─────────────────────────────────────── */
.review-abc-chat { max-height: 320px; overflow-y: auto; padding: 8px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 8px; }
.review-abc-msg { margin: 6px 0; padding: 6px 10px; border-radius: 6px; }
.review-abc-msg.ai { background: #f0f4ff; }
.review-abc-msg.user { background: #e8f5e9; text-align: right; }
.review-abc-input { display: flex; gap: 8px; align-items: flex-start; }
.review-abc-input textarea { flex: 1; }

/* ─── Journal Panel ───────────────────────────────────────────── */

.journal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.journal-date-picker {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-tight);
  background: var(--bg-surface);
  color: var(--fg-primary);
}

.journal-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.journal-date-range .journal-date-picker {
  min-width: 0;
}

.journal-date-sep {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.journal-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journal-card {
  border: 1px solid var(--rule-line);
  border-left: 3px solid var(--ink-cobalt);
  background: #ffffff;
  padding: 10px 12px;
  border-radius: 0 var(--radius-tight) var(--radius-tight) 0;
  transition: border-color 120ms ease;
}

.journal-card--plan {
  border-left-color: var(--warn);
}

.journal-card--dirty {
  border-left-color: #ff9f43;
}

.journal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.journal-card-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.journal-card-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.journal-card-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  flex-shrink: 0;
}

.journal-card-badge.type-act {
  background: #ffffff;
  color: var(--ink-cobalt);
  border: 1px solid var(--ink-cobalt);
}

.journal-card-badge.type-plan {
  background: #ffffff;
  color: var(--warn);
  border: 1px solid var(--warn);
}

.journal-card-title {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--fg-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-card-dirty-tag {
  font-size: 10px;
  color: #ff9f43;
  background: rgba(255, 159, 67, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.journal-card-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}

.journal-card-arrow {
  font-size: 12px;
  color: var(--fg-muted);
}

.journal-btn-pin {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  filter: grayscale(1);
  opacity: 0.45;
  transition: opacity 0.15s, filter 0.15s;
}

.journal-btn-pin:hover {
  opacity: 0.8;
}

.journal-btn-pin.is-pinned {
  filter: none;
  opacity: 1;
}

.journal-btn-pin:disabled {
  cursor: default;
  opacity: 0.3;
}

.journal-card-pinned-tag {
  font-size: 11px;
  flex-shrink: 0;
}

.journal-card--pinned {
  background: rgba(255, 209, 102, 0.08);
}

.journal-card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Edit form inside expanded card ──── */

.journal-card-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-line);
}

.journal-card-form .form-group {
  margin-bottom: 8px;
}

.journal-card-form label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 3px;
}

.journal-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--rule-line);
  border-radius: var(--radius-tight);
  background: var(--bg-surface);
  color: var(--fg-primary);
}

.journal-input:focus {
  outline: none;
  border-color: var(--ink-cobalt);
}

textarea.journal-input {
  resize: vertical;
  min-height: 40px;
}

.journal-time-row {
  display: flex;
  gap: 10px;
}

.journal-time-row .form-group {
  flex: 1;
}

.journal-subplan-row {
  display: flex;
  gap: 6px;
}

.journal-subplan-row select {
  flex: 1;
}

.journal-new-sp-form {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.journal-new-sp-form input {
  flex: 1;
}

.journal-btn-inline {
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.3);
  color: var(--ink-cobalt);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-tight);
  cursor: pointer;
  white-space: nowrap;
}

.journal-btn-inline:hover {
  background: rgba(74, 158, 255, 0.2);
}

.journal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.journal-autosave-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-disabled);
  margin-right: auto;
}

.journal-btn-save {
  background: var(--ink-cobalt);
  color: #ffffff;
  border: none;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: var(--radius-tight);
  cursor: pointer;
}

.journal-btn-save:hover {
  opacity: 0.9;
}

.journal-btn-delete {
  background: transparent;
  border: 1px solid var(--rule-line);
  color: var(--fg-muted);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: var(--radius-tight);
  cursor: pointer;
}

.journal-btn-delete:hover {
  color: var(--danger, #e74c3c);
  border-color: var(--danger, #e74c3c);
}

.journal-delete-confirm {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  align-items: center;
  gap: 4px;
}

.journal-delete-confirm[hidden] {
  display: none;
}

.journal-delete-confirm:not([hidden]) {
  display: inline-flex;
}

.journal-btn-delete-yes {
  background: var(--danger, #e74c3c);
  color: #ffffff;
  border: none;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-tight);
  cursor: pointer;
}

.journal-btn-delete-no {
  background: transparent;
  border: 1px solid var(--rule-line);
  color: var(--fg-muted);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-tight);
  cursor: pointer;
}

.journal-empty {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--fg-muted);
  text-align: center;
  padding: 40px 0;
}

/* ─── X 推送 tab ─────────────────────────────────────────────── */
.tweets-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tweets-feed { display: flex; flex-direction: column; gap: 12px; }
.tweet-card { border: 1px solid var(--border, #e3e3e3); border-radius: 10px; padding: 12px 14px; background: #fff; }
.tweet-meta { display: flex; justify-content: space-between; font-size: 13px; color: #888; margin-bottom: 6px; }
.tweet-user { font-weight: 600; color: #1d9bf0; }
.tweet-text { white-space: pre-wrap; line-height: 1.5; word-break: break-word; }
.tweet-footer { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: #888; }
.tweet-link { color: #1d9bf0; text-decoration: none; }
.tweets-empty, .tweets-status { color: #888; padding: 16px 0; }

/* ─── X 推送 controls ───────────────────────────────────────── */
.tweets-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tweets-select { padding: 4px 8px; border: 1px solid var(--rule-line, #ddd); border-radius: 8px; background: #fff; font-size: 13px; }
.tweets-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #555; white-space: nowrap; }

/* ─── Journal 防沉迷条目 ─────────────────────────────────────────── */
.journal-rest-summary {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--bg-secondary, #f5f6f7);
  color: var(--text-secondary, #646a73);
  font-size: 13px;
}
.journal-rest-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-secondary, #646a73);
  cursor: pointer;
  border-left: 2px solid var(--border-color, #dee0e3);
  margin: 2px 0 2px 6px;
}
.journal-rest-event--open { background: var(--bg-secondary, #f5f6f7); }
.journal-rest-time { font-variant-numeric: tabular-nums; }
.journal-rest-label { flex: 1; }
.journal-rest-tier { padding: 0 6px; border-radius: 8px; font-size: 11px; }
.journal-rest-tier.tier-low { background: #e8f5e9; color: #2e7d32; }
.journal-rest-tier.tier-mid { background: #fff8e1; color: #b26a00; }
.journal-rest-tier.tier-high { background: #ffebee; color: #c62828; }
.journal-rest-detail {
  padding: 4px 12px 8px 44px;
  font-size: 12px;
  color: var(--text-secondary, #646a73);
}

/* 防沉迷提醒 toast（app 外壳层，浮于任意页面顶部） */
.rest-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  margin: 8px auto;
  max-width: 480px;
  background: #2b2b2b;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s, transform 0.25s;
}
.rest-toast--show {
  opacity: 1;
  transform: translateY(0);
}

/* 日志页防沉迷折叠分组（与 act/plan 记录区分离） */
.journal-rest-section {
  margin-bottom: 12px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  overflow: hidden;
}
.journal-rest-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary, #f5f7fa);
  cursor: pointer;
  font-size: 13px;
}
.journal-rest-section-title {
  font-weight: 600;
}
.journal-rest-section-summary {
  flex: 1;
  color: var(--text-secondary, #646a73);
}
.journal-rest-section-body {
  padding: 4px 8px;
}
