/* The Research Log page. Built on Hazel's own tokens (style.css), so it reads as
   part of Coach Hazel. Sized for this audience: 18px body, big targets. */
.log-body { height: auto; min-height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.log-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.log-back { color: var(--hazel); font-weight: 600; text-decoration: none; font-size: 17px; }
.log-back::before { content: "← "; }
.log-back:hover { text-decoration: underline; }
.log-pdf, .log-btn {
  font: 600 16px var(--ui); border-radius: 12px; cursor: pointer;
  padding: 10px 16px; border: 1.5px solid var(--hazel); background: var(--hazel); color: #fff;
  min-height: 44px;
}
.log-pdf { background: var(--panel); color: var(--hazel); }
.log-btn--ghost { background: var(--panel); color: var(--hazel); }
.log-btn--small { padding: 6px 12px; font-size: 15px; min-height: 38px; }
.log-btn--quiet { background: none; border-color: transparent; color: var(--ink-soft); font-weight: 500; }
.log-btn:disabled, .log-pdf:disabled { opacity: 0.5; cursor: not-allowed; }
.log-btn:focus-visible, .log-pdf:focus-visible, .log-chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.log-main { max-width: 860px; margin: 0 auto; padding: 24px 20px 80px; }
.log-title { font-family: var(--font); color: var(--hazel-deep); font-size: 34px; margin: 4px 0 4px; font-weight: 600; }
.log-subtitle { color: var(--ink-soft); margin: 0 0 20px; }
.log-error { background: #fdecea; border: 1px solid #f2b8b0; color: #8a2a1c; padding: 10px 14px; border-radius: 12px; }
.log-note { background: var(--student); padding: 10px 14px; border-radius: 12px; margin: 0 0 10px; font-size: 16px; }
.log-empty { color: var(--ink-soft); font-style: italic; }

.log-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 24px; }
.log-filter-label { font: 500 13px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.log-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.log-chip {
  font: 500 16px var(--ui); padding: 8px 14px; min-height: 40px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--panel); color: var(--ink);
}
.log-chip[aria-pressed="true"] { background: var(--hazel); border-color: var(--hazel); color: #fff; }

.log-section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 20px; }
.log-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.log-section h2 { font-family: var(--font); color: var(--hazel-deep); font-size: 24px; margin: 0; font-weight: 600; }

/* Goal cards */
.goal-cards { display: grid; gap: 16px; }
.goal-card { border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fbfdfc; }
.goal-card.is-active { border-color: var(--hazel); box-shadow: inset 4px 0 0 var(--hazel); }
.goal-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.goal-card h3 { font-family: var(--font); font-size: 22px; margin: 0; color: var(--ink); font-weight: 600; }
.goal-badge { font: 500 12px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .06em; background: var(--hazel); color: #fff; padding: 4px 10px; border-radius: 999px; }
.goal-facts { margin: 10px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 16px; }
.goal-facts dt { color: var(--ink-soft); }
.goal-facts dd { margin: 0; }
.small-goal { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--student); }
.small-goal-label { font: 500 12px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--hazel-deep); }
.small-goal-text { font-size: 18px; margin: 4px 0 8px; font-weight: 500; }
.small-goal-done { margin: 10px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 15px; }
.small-goal-done li::marker { content: "✓  "; color: var(--hazel); }
.goal-actions, .entry-actions, .entry-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.goal-ask { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.goal-ask input { flex: 1 1 240px; }

.log-body input[type="text"], .log-body textarea, .log-body select {
  font: 17px var(--ui); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
.log-body textarea { resize: vertical; line-height: 1.5; }
.form-row { display: grid; gap: 4px; margin-bottom: 10px; font-size: 15px; font-weight: 600; color: var(--hazel-deep); }
.form-row small { font-weight: 400; color: var(--ink-soft); }
.goal-form { border: 1.5px dashed var(--hazel); border-radius: 14px; padding: 16px; margin-bottom: 16px; }

/* To-dos */
.todo-group-head { font: 500 13px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--hazel-deep); margin: 14px 0 6px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.todo:first-child { border-top: 0; }
.todo input[type="checkbox"] { width: 24px; height: 24px; margin-top: 3px; accent-color: var(--hazel); flex: none; cursor: pointer; }
.todo-body { flex: 1 1 200px; min-width: 0; }
.todo-text { overflow-wrap: anywhere; }
.todo-tags { font-size: 14px; color: var(--ink-soft); }
.todo-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.todo-note { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; padding-left: 36px; }
.todo-note input { flex: 1 1 220px; }
.todo-list--done .todo-text { text-decoration: line-through; color: var(--ink-soft); }
.todo-done summary { cursor: pointer; margin-top: 14px; color: var(--ink-soft); font-weight: 600; }
.log-inline-form { display: flex; gap: 8px; margin-top: 12px; }
.log-inline-form input { flex: 1; }

/* Entries */
.entries { list-style: none; margin: 0; padding: 0; }
.entry { padding: 14px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.entry-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.entry-type { font: 500 12px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; background: var(--sidebar); color: var(--hazel-deep); }
.entry-type--win { background: #fff3c4; color: #6b5300; }
.entry-type--product { background: #fde3f1; color: #8a0f52; }
.entry-summary { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-next { margin: 6px 0 0; font-size: 16px; }
.entry-next b { color: var(--hazel-deep); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 14px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.tag-picks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; font-size: 16px; }
.tag-picks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tag-picks input { width: 20px; height: 20px; accent-color: var(--hazel); }
.tag-picks-label { flex-basis: 100%; font-size: 14px; color: var(--ink-soft); }
.entry-form { display: grid; gap: 10px; margin-bottom: 16px; }

@media (max-width: 560px) {
  .log-main { padding: 16px 16px 60px; }
  .log-title { font-size: 28px; }
  .log-section { padding: 16px; }
  .goal-facts { grid-template-columns: 1fr; gap: 0; }
  .goal-facts dd { margin-bottom: 6px; }
  .log-inline-form { flex-wrap: wrap; }
  .todo-note { padding-left: 0; }
}

@media print {
  .log-top, .log-filter, .log-btn, .goal-ask, .todo-tools, .entry-actions, .log-inline-form { display: none !important; }
  .log-section { border: 0; padding: 0; }
}
.small-goal > .small-goal-label:not(:first-child) { display: block; margin-top: 14px; }
/* A component's own display (grid, flex) would otherwise beat the hidden attribute. */
.log-body [hidden] { display: none !important; }

/* Header: brand, Talk to Hazel, and the Home | Research Log tabs */
.log-brand { font-family: var(--font); font-weight: 600; font-size: 22px; color: var(--hazel-deep); text-decoration: none; }
.log-talk { font-weight: 600; color: #fff; background: var(--hazel); padding: 9px 16px; border-radius: 12px; text-decoration: none; font-size: 16px; }
.log-tabs { display: flex; gap: 4px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.log-tab { padding: 12px 16px; font-weight: 600; font-size: 16px; color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent; }
.log-tab:hover { color: var(--ink); }
.log-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--hazel); }
.log-top { position: static; }
.log-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.log-welcome { background: #fff8d6; border: 1.5px solid #e9d36a; border-radius: var(--radius); padding: 18px 20px; margin: 0 0 20px; }
.log-welcome h2 { font-family: var(--font); color: var(--hazel-deep); font-size: 22px; margin: 0 0 6px; }
.log-welcome p { margin: 0 0 12px; }
.log-welcome .goal-actions { margin-top: 0; }
#historyDraft { margin: 0 0 20px; }

.goal-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.log-btn--danger { background: var(--panel); color: #8a2a1c; border-color: #d9a59c; margin-left: auto; }
.log-btn--link { display: inline-flex; align-items: center; text-decoration: none; }
.add-choice h3 { margin: 0 0 6px; font-family: var(--font); color: var(--hazel-deep); }
.add-choice__options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.add-choice__option { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.add-choice__option p { font-size: 16px; color: var(--ink-soft); margin: 4px 0 12px; }
@media (max-width: 560px) { .add-choice__options { grid-template-columns: 1fr; } .log-btn--danger { margin-left: 0; } }
