/* ==========================================================================
   PAGE STYLES — moved here from the <style> blocks their templates used to carry,
   in the order and at the end of the cascade where those blocks used to load.
   ========================================================================== */

/* ---- the icon picker's buttons (folders/_form) ---- */
/* Selected state for the icon buttons. The <label>+radio version of this lives in
   .form-swatch; these are buttons driving a hidden field, so they need the class
   applied by hand. */
#modal .form-icon-box.is-selected,
.form-icon-box.is-selected {
  border-color: var(--field-optional-border);
  color: var(--field-optional-border);
  background: rgba(29, 161, 242, 0.12);
}

@media (hover: hover) { /* ---- from calendars/_categories_column.html.erb ---- */
.delete-cancel-cell:hover .fa-solid { color: white; } }
@media (hover: hover) { .add-cell:hover .fa-solid { color: white; } }

/* Pie chart: vibrant slices, focus-on-hover */
/* Highlight overlay sits above the ring's shading/gloss layers so hovering a
   segment (JS toggles the class) is always visibly brighter, regardless of
   what's rendered underneath it. */
#pie-chart-container .pie-highlight {
  opacity: 0;
  fill: #ffffff;
  mix-blend-mode: overlay;
  transition: opacity 0.18s;
  pointer-events: none;
}
#pie-chart-container .pie-highlight.pie-highlight-visible {
  opacity: 0.85;
}
#pie-chart-container .pie-highlight-stroke {
  opacity: 0;
  fill: none;
  stroke: #ffffff;
  stroke-width: 0.6;
  transition: opacity 0.18s;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
}
#pie-chart-container .pie-highlight-stroke.pie-highlight-visible {
  opacity: 0.9;
}
#pie-chart-container g text {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.22));
  letter-spacing: -0.02em;
}

/* Action icons that curve around the outside of a slice on hover: trackers, jump
   down to the area in the list, and edit. Drawn as SVG text in the Font Awesome
   glyph font so each one can sit on — and rotate with — the arc. */
#pie-chart-container .pie-slice-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
#pie-chart-container .pie-slice-actions.pie-slice-actions-visible {
  opacity: 1;
  pointer-events: auto;
}
#pie-chart-container .pie-slice-action {
  cursor: pointer;
}
#pie-chart-container .pie-slice-action-hit {
  fill: transparent;
}
#pie-chart-container .pie-slice-action-glyph {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 4px;
  fill: #f5f5f5;
  pointer-events: none;
  transition: fill 0.15s;
}
#pie-chart-container .pie-slice-action:hover .pie-slice-action-glyph {
  fill: var(--blue);
}
/* Jumping down to the area is also what clicking the slice itself does, so that
   icon lights up blue while the pointer is on the slice, too. */
#pie-chart-container .pie-slice-actions-slice-hover .pie-slice-action-primary .pie-slice-action-glyph {
  fill: var(--blue);
}

/* Category icon hover effects */
.category-header:hover .has-different-icon .area-of-interest-icon {
  display: none !important;
}

.category-header:hover .has-different-icon .category-icon {
  display: inline !important;
}

/* ---- from calendars/_task_schedule.html.erb ---- */

.delete-button, .cancel-button, .add-task-button {
  background: none !important;
  border: none !important;
  color: white;
  cursor: pointer;
  box-shadow: none !important;
  text-shadow: none;
  outline: none !important;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.delete-button:hover, .cancel-button:hover, .add-task-button:hover {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
.delete-cancel-cell {
  cursor: pointer;
  height: 100%;
  padding: 2rem 0;
}
@media (hover: hover) { .delete-cancel-cell:hover {
  background-color: var(--danger);
} }
.add-cell {
  cursor: pointer;
  height: 100%;
  padding: 2rem 0;
}
@media (hover: hover) { .add-cell:hover {
  background-color: var(--blue);
} }

.subtask-row {
  background-color: rgba(255, 255, 255, 0.05) !important;
}
.subtask-row .task-title {
  padding-left: 1rem;
}

/* The date title and the padlock beside it are two handles on one dropdown, so the
   hover lives on .date-title-line, which wraps both. The lit state is a colour change
   only (see .date-title-line:hover in the app's stylesheets) — an opacity change here as
   well meant two properties animating on different clocks under one cursor move. */

.date-day-dropdown {
  position: absolute; top: 100%; left: 50%; z-index: 400; min-width: 170px; padding: 4px 0;
  background: var(--surface-pop); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  opacity: 0;
  /* Centred under the date, open or shut: it fades in place. */
  transform: translateX(-50%);
  transform-origin: top center;
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
  overflow: hidden;
}

.date-day-dropdown::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: var(--surface-pop);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
  border-radius: 2px 0 0 0;
}

.date-day-dropdown.open {
  opacity: 1;
  pointer-events: auto;
}

.date-dropdown-item {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px; cursor: pointer;
  color: var(--text-1); font-size: var(--fs-14); font-weight: normal;
  margin: 2px 5px;
  border-radius: 6px;
  transition: background-color 0.12s ease;
}

.date-dropdown-item:hover {
  background-color: var(--surface-3);
}

.date-dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.date-dropdown-icon i {
  width: auto;
}

.date-dropdown-divider {
  height: 1px;
  margin: 4px 10px;
  background: var(--border-strong);
}

/* ---- from areas_of_interests/edit.html.erb ---- */
.aoi-name-options { display: flex; gap: 8px; }
.aoi-name-option { flex: 1; cursor: pointer; }
.aoi-name-option input[type=radio] { display: none; }
.aoi-name-option span {
  display: block;
  padding: 10px 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #9ca3af;
  font-size: var(--fs-14);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.aoi-name-option:hover span { border-color: rgba(255, 255, 255, 0.25); color: #e0e0e0; }
.aoi-name-option input[type=radio]:checked + span {
  border-color: var(--accent-bright);
  color: var(--text-1);
  background: rgba(34, 197, 94, 0.12);
}
.aoi-section-label {
  font-size: var(--fs-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 6px;
  display: block;
}

/* ---- Owner dashboard (admin/dashboard.html.erb) ---- */
.admin-page { max-width: 1280px; margin: 0 auto; padding: 28px 24px 64px; }
.admin-head-right { display: flex; align-items: center; gap: 16px; }
.admin-today { color: var(--text-3); font-size: var(--fs-13); }
.admin-test-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: var(--fs-13); text-decoration: none; }
.admin-test-toggle:hover { color: var(--text-1); }
.admin-test-knob { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--surface-3, #2a2a30); transition: background var(--dur-fast) ease; }
.admin-test-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: transform var(--dur-fast) ease, background var(--dur-fast) ease; }
.admin-test-toggle.is-on { color: var(--text-2); }
.admin-test-toggle.is-on .admin-test-knob { background: var(--accent, #3b82f6); }
.admin-test-toggle.is-on .admin-test-knob::after { transform: translateX(12px); background: #fff; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.admin-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border-panel); border-radius: var(--radius-md); background: var(--surface-card); }
.admin-stat-value { color: var(--text-1); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.admin-stat-value small { margin-left: 2px; color: var(--text-3); font-size: var(--fs-13); font-weight: 500; }
.admin-stat-value.is-gold { color: var(--gold-bright); }
.admin-stat-label { color: var(--text-2); font-size: var(--fs-12); }
.admin-stat-note { color: var(--text-3); font-size: var(--fs-11); }

.admin-sources { margin: 24px 0 28px; }
.admin-section-title { margin: 0 0 10px; color: var(--text-3); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-source-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.admin-source-list li { display: flex; align-items: baseline; gap: 6px; padding: 7px 12px; border: 1px solid var(--border-panel); border-radius: 999px; background: var(--surface-card); color: var(--text-2); font-size: var(--fs-12); }
.admin-source-list b { color: var(--text-1); font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.admin-source-list small { color: var(--text-3); font-size: var(--fs-11); }
.admin-source-empty { color: var(--text-3); font-size: var(--fs-12); }

/* The table scrolls inside its card both ways, so its heading row can stay put. */
.admin-table-wrap { overflow: auto; max-height: calc(100vh - 120px); border: 1px solid var(--border-panel); border-radius: var(--radius-lg); background: var(--surface-card); }
.admin-table { table-layout: auto; width: 100%; min-width: 1240px; border-collapse: separate; border-spacing: 0; color: var(--text-2); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.admin-table th { position: sticky; top: 0; z-index: 2; padding: 10px 12px; border-bottom: 1px solid var(--border-panel); background: var(--surface-card); color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; white-space: nowrap; user-select: none; }
.admin-table th:hover { color: var(--text-1); }
.admin-table th[data-dir="desc"]::after { content: " ↓"; }
.admin-table th[data-dir="asc"]::after { content: " ↑"; }
.admin-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05)); background: var(--surface-card); white-space: nowrap; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--surface-2); }
.admin-id { width: 1%; color: var(--text-4, #5c5f66); font-size: var(--fs-11); }
.admin-email { color: var(--text-1); }
.admin-table td.admin-email { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.admin-premium { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid rgba(251, 191, 36, 0.45); border-radius: 999px; color: var(--gold-bright); font-size: var(--fs-10); vertical-align: 1px; }
.admin-table .admin-num { text-align: right; color: var(--text-4, #5c5f66); }
.admin-table .admin-num.highlight { color: var(--text-1); font-weight: 600; }
.admin-table .admin-items { border-right: 1px solid var(--border-panel); color: var(--text-2); }
.admin-date { color: var(--text-3); }
.admin-date.is-recent { color: var(--accent-bright); }
.admin-date.is-unseen { opacity: 0.6; }
.admin-total-row td { position: sticky; bottom: 0; z-index: 1; border-top: 1px solid var(--border-panel); border-bottom: none; color: var(--text-2); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
/* The email stays in view while the numbers scroll sideways. */
.admin-table .admin-email { position: sticky; left: 0; z-index: 1; }
.admin-table th.admin-email { z-index: 3; }
@media (max-width: 768px) {
  .admin-page { padding: 20px 14px 96px; }
  .admin-head-right { width: 100%; justify-content: space-between; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-table .admin-id { display: none; }
  .admin-table { min-width: 0; }
  .admin-table td.admin-email { max-width: 170px; }
  .admin-table-wrap { max-height: calc(100vh - 150px); }
}

/* ---- from journals/import.html.erb ---- */
.vm-page { max-width: 680px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }
.vm-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.35rem; }
.vm-title { font-size: var(--fs-20); font-weight: 600; color: #f0f0f0; margin: 0; letter-spacing: -0.01em; }
.vm-sub { color: #636366; font-size: var(--fs-12); margin: 0 0 1.5rem; line-height: 1.5; }

.vm-drop {
  border: 1px dashed #3a3a3c; border-radius: 10px; padding: 2rem 1.5rem;
  text-align: center; cursor: pointer; display: block; transition: border-color .15s, background .15s;
}
.vm-drop:hover { border-color: #0a84ff; background: rgba(10,132,255,0.04); }
.vm-drop.is-dragging {
  border-color: #0a84ff;
  border-style: solid;
  background: rgba(10,132,255,0.10);
}
.vm-drop.is-dragging .vm-drop-main { color: #0a84ff; }
.vm-drop-icon { font-size: var(--fs-20); color: #48484a; margin-bottom: 0.6rem; }
.vm-drop-main { color: #e0e0e0; font-size: var(--fs-14); margin-bottom: 0.25rem; }
.vm-drop-hint { color: #636366; font-size: var(--fs-11); }

.vm-picked { margin-top: 1rem; display: none; }
.vm-picked-row {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0;
  border-bottom: 1px solid #232326; font-size: var(--fs-12); color: #a0a0a5;
}
.vm-picked-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-picked-size { color: #636366; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.vm-picked-auto { color: #30d158; font-size: var(--fs-11); flex-shrink: 0; }
.vm-picked-row input[type="text"], .vm-bulk input[type="text"] {
  background: #1c1c1e; border: 1px solid #3a3a3c; border-radius: 6px;
  color: #e0e0e0; font-size: var(--fs-12); padding: 0.25rem 0.4rem;
  font-family: inherit; width: 7rem; flex-shrink: 0;
}
.vm-picked-row input[type="text"]:focus, .vm-bulk input[type="text"]:focus {
  outline: none; border-color: #0a84ff;
}
.vm-picked-row input[type="time"], .vm-bulk input[type="time"],
.vm-picked-row input[type="date"] {
  background: #1c1c1e; border: 1px solid #3a3a3c; border-radius: 6px;
  color: #e0e0e0; font-size: var(--fs-12); padding: 0.25rem 0.4rem;
  font-family: inherit; flex-shrink: 0; color-scheme: dark;
}
.vm-picked-row input[type="time"]:focus,
.vm-picked-row input[type="date"]:focus { outline: none; border-color: #0a84ff; }

/* A memo row keeps its calendar open: the date is the one thing every memo
   needs, so it should cost a single click rather than open → month → day. */
.vm-picked-row.vm-memo-row { align-items: flex-start; gap: 1rem; padding: 0.7rem 0; }
.vm-memo-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.vm-memo-top { display: flex; align-items: baseline; gap: 0.75rem; min-width: 0; }
.vm-memo-fields { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vm-memo-chosen { color: #e0e0e0; font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.vm-memo-chosen .vm-memo-order { color: #636366; margin-right: 0.35rem; }

.vm-cal { flex-shrink: 0; width: 11.5rem; user-select: none; }
.vm-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.2rem; }
.vm-cal-title { color: #a0a0a5; font-size: var(--fs-11); font-weight: 500; }
.vm-cal-nav {
  background: none; border: none; color: #a0a0a5; cursor: pointer;
  font-size: var(--fs-13); line-height: 1; padding: 0.1rem 0.35rem; border-radius: 4px;
}
.vm-cal-nav:hover:not(:disabled) { color: #0a84ff; background: rgba(10,132,255,0.1); }
.vm-cal-nav:disabled { color: #3a3a3c; cursor: default; }
.vm-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.vm-cal-dow { color: #48484a; font-size: var(--fs-10); text-align: center; padding-bottom: 0.1rem; }
.vm-cal-day {
  background: none; border: none; border-radius: 5px; color: #d0d0d5; cursor: pointer;
  font-size: var(--fs-11); font-variant-numeric: tabular-nums; height: 1.45rem; padding: 0;
}
.vm-cal-day:hover:not(:disabled) { background: rgba(10,132,255,0.15); color: #fff; }
.vm-cal-day.is-today { color: #0a84ff; font-weight: 600; }
.vm-cal-day.is-selected, .vm-cal-day.is-selected:hover { background: #0a84ff; color: #fff; font-weight: 600; }
.vm-cal-day:disabled { color: #3a3a3c; cursor: default; }

.vm-datenote {
  margin-top: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 8px;
  background: rgba(255,159,10,0.08); color: #ff9f0a; font-size: var(--fs-11); line-height: 1.5;
}
.vm-bulk { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: var(--fs-12); color: #636366; }
.vm-bulk input[type="date"] {
  background: #1c1c1e; border: 1px solid #3a3a3c; border-radius: 6px;
  color: #e0e0e0; font-size: var(--fs-12); padding: 0.25rem 0.4rem; font-family: inherit; color-scheme: dark;
}
.vm-bulk button {
  background: none; border: 1px solid #3a3a3c; border-radius: 6px; color: #a0a0a5;
  font-size: var(--fs-11); padding: 0.25rem 0.5rem; cursor: pointer;
}
.vm-bulk button:hover { border-color: #0a84ff; color: #0a84ff; }

.vm-submit {
  margin-top: 1.25rem; width: 100%; background: #0a84ff; border: none; border-radius: 8px;
  padding: 0.7rem; color: #fff; font-size: var(--fs-13); font-weight: 500; cursor: pointer;
}
.vm-submit:disabled { background: #2a2a2d; color: #636366; cursor: default; }
.vm-submit[hidden] { display: none; }
.vm-topbar { margin-bottom: 0.75rem; }

.vm-section { margin-top: 2.5rem; }
.vm-section-h {
  font-size: var(--fs-11); font-weight: 600; color: #636366; text-transform: uppercase;
  letter-spacing: 0.1em; padding-bottom: 0.4rem; border-bottom: 1px solid #2a2a2d; margin-bottom: 0.5rem;
}
.vm-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid #1f1f22; }
.vm-item-name { flex: 1; min-width: 0; color: #e0e0e0; font-size: var(--fs-13); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-item-date { color: #636366; font-size: var(--fs-11); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.vm-badge { font-size: var(--fs-10); text-transform: uppercase; letter-spacing: 0.05em; padding: 0.1rem 0.4rem; border-radius: 4px; flex-shrink: 0; }
.vm-badge.done { color: #30d158; background: rgba(48,209,88,0.12); }
.vm-badge.pending, .vm-badge.processing { color: #ff9f0a; background: rgba(255,159,10,0.12); }
.vm-badge.failed, .vm-badge.empty { color: #ff453a; background: rgba(255,69,58,0.12); }

.vm-flash { border-radius: 8px; padding: 0.65rem 0.85rem; font-size: var(--fs-12); margin-bottom: 1rem; line-height: 1.5; }
.vm-flash.notice { color: #30d158; background: rgba(48,209,88,0.1); }
.vm-flash.alert  { color: #ff453a; background: rgba(255,69,58,0.1); }

/* ---- from journals/show.html.erb ---- */
/* Journal-only pieces. The page frame, cards and buttons are the shared show-page
   set; what's here is the entry itself — the date, the prose and the media. */
.js-date-row { display: flex; align-items: center; gap: 0.9rem; }
.js-day-num {
  font-size: 3.25rem;
  font-weight: 200;
  line-height: 1;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.js-day-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.section-empty-line { margin: 10px 0 0; }
.section-empty-line a { margin-left: 6px; color: var(--text-1); text-decoration: none; }
.section-empty-line a:hover { text-decoration: underline; }
.js-day-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.js-day-label { font-size: var(--fs-13); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }

/* The day's time and place, and its value score, under the date. */
.js-day-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; color: var(--text-3); font-size: var(--fs-12); }

/* The entry is read, not scanned: the serif, a reading measure, generous leading. */
.js-entry {
  max-width: 62ch;
  margin: 0;
  font-family: Newsreader, Georgia, 'Times New Roman', serif;
  font-size: 19px;
  line-height: 1.7;
  color: var(--text-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.js-question {
  max-width: 62ch;
  margin: 0 0 14px;
  color: var(--text-2);
  font-family: Newsreader, Georgia, serif;
  font-size: 17px;
  font-style: italic;
  line-height: 1.45;
}
.js-question::before { content: 'A question · '; color: var(--text-3); font-family: Inter, system-ui, sans-serif; font-size: var(--fs-10); font-style: normal; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* Reading on: the entries either side, by the day they're filed under. */
.js-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* The end with no entry past it keeps its place in the pair as a quiet label, not a dashed
   box that read as a card failing to load. */
.js-pager-end { display: flex; color: var(--text-3); font-size: var(--fs-11); letter-spacing: 0.02em; }
.js-pager-end.is-newer { justify-content: flex-end; }
.js-pager a {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  color: var(--text-2);
  text-decoration: none;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.js-pager a:hover { border-color: var(--border-strong); color: var(--text-1); }
.js-pager a.is-newer { text-align: right; }
.js-pager-label { color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.js-pager-text { overflow: hidden; font-family: Newsreader, Georgia, serif; text-overflow: ellipsis; }
.js-entry.is-empty { color: var(--text-3); font-style: italic; }

/* A journal is read, not acted on: the year in the crumbs reads as the rest of the
   crumbs, and Edit as a quiet button rather than the shared show pages' blue one. */
.show-crumbs a.js-crumb-year { color: var(--text-2); }
.show-crumbs a.js-crumb-year:hover { color: var(--text-1); }
.js-edit-btn { color: var(--text-2); }
.js-edit-btn:hover { color: var(--text-1); border-color: var(--border-strong); }
/* More room for the words themselves. */
.show-page.is-narrow .show-card .js-entry { font-size: 20px; line-height: 1.75; }

.js-image { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius-md); }

/* A day's photos, as a gallery. One photo fills the width; several tile. */
.js-gallery { display: grid; gap: 6px; }
.js-gallery.count-1 { grid-template-columns: 1fr; }
.js-gallery.count-2 { grid-template-columns: repeat(2, 1fr); }
.js-gallery.count-many { grid-template-columns: repeat(3, 1fr); }
.js-photo {
  position: relative;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
}
.js-gallery.count-1 .js-photo { aspect-ratio: 4 / 3; }
.js-gallery.count-2 .js-photo,
.js-gallery.count-many .js-photo { aspect-ratio: 1 / 1; }
.js-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-base); }
.js-photo:hover img { transform: scale(1.02); }
.js-photo-time {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.2rem 0.5rem 0.35rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #f0f0f0;
  font-size: var(--fs-11);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.js-photo:hover .js-photo-time { opacity: 1; }

/* Full-size viewer. The gallery shows thumbnails; the display JPEG is only
   fetched when a photo is actually opened. */
.js-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}
.js-lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; border-radius: var(--radius-sm); }
.js-lightbox-meta { position: absolute; bottom: 1.1rem; color: var(--text-2); font-size: var(--fs-12); }

.js-audio-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  background: var(--recess);
}
.js-audio-icon { flex-shrink: 0; color: var(--text-3); font-size: var(--fs-14); }
.js-audio-wrap audio { flex: 1; min-width: 0; height: 32px; accent-color: var(--blue); color-scheme: dark; }

/* ---- from notes/_heading_collapse.html.erb ---- */
/* The chevron lives in a gutter carved out of the editor itself: the box is
   pulled 26px left and given that much padding back, so the text sits exactly
   where it did while the strip to its left is still inside the editable box
   and therefore still gets the mousedown. A chevron painted outside the box
   would drop its clicks on the document padding instead. */
.ane-content-ta, .ann-content-ta {
  padding-left: 26px; margin-left: -26px; width: calc(100% + 26px);
}
/* The note's own centring (the app's stylesheets, .ane-content-ta: a 580px column) plus the
   gutter, so the text lines up under the date line rather than at the panel's edge. */
.ane-content-ta { padding-left: calc(26px + max(0px, calc((100% - 580px) / 2))); }
.ane-content-ta :is(h1,h2,h3,h4,h5,h6),
.ann-content-ta :is(h1,h2,h3,h4,h5,h6) { position: relative; }
.ane-content-ta :is(h1,h2,h3,h4,h5,h6)::before,
.ann-content-ta :is(h1,h2,h3,h4,h5,h6)::before {
  content: '\25BE';
  position: absolute; left: -24px; top: 0; height: 1.3em;
  width: 20px; display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-14) !important; line-height: 1 !important; color: #48484a !important;
  opacity: 0; transition: opacity .12s ease;
  cursor: pointer; -webkit-user-select: none; user-select: none;
}
/* Arrows are for reaching, so they appear as soon as the pointer is anywhere
   in the note — a chevron that only showed on its own hover would vanish on
   the way to the click. */
.ane-content-ta:hover :is(h1,h2,h3,h4,h5,h6)::before,
.ann-content-ta:hover :is(h1,h2,h3,h4,h5,h6)::before { opacity: 1; }
/* A touch screen has no hover to reach with, and a tap leaves the note "hovered", which
   put an unexplained arrow beside every heading. There, only the heading the caret is in
   shows its arrow (.ane-caret-in, set by notes/_heading_collapse); a folded one keeps its own. */
@media (hover: none) {
  .ane-content-ta:hover :is(h1,h2,h3,h4,h5,h6):not(.ane-caret-in):not(.ane-collapsed)::before,
  .ann-content-ta:hover :is(h1,h2,h3,h4,h5,h6):not(.ane-caret-in):not(.ane-collapsed)::before { opacity: 0; }
  .ane-content-ta .ane-caret-in::before, .ann-content-ta .ane-caret-in::before { opacity: 1; }
}
.ane-content-ta :is(h1,h2,h3,h4,h5,h6).ane-chev-hot::before,
.ann-content-ta :is(h1,h2,h3,h4,h5,h6).ane-chev-hot::before { color: #aeaeb2 !important; }
/* A collapsed section's arrow stays out: it's the only sign the text below is
   folded rather than absent. */
.ane-content-ta :is(h1,h2,h3,h4,h5,h6).ane-collapsed::before,
.ann-content-ta :is(h1,h2,h3,h4,h5,h6).ane-collapsed::before {
  content: '\25B8'; opacity: 1; color: #8e8e93 !important;
}
.ane-content-ta .ane-collapsed-part,
.ann-content-ta .ane-collapsed-part { display: none !important; }

/* ---- from notes/_image_paste.html.erb ---- */
.ane-content-ta img,
.ann-content-ta img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 10px 0;
}
.ane-img-uploading {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  background: #2a2a2c;
  color: #8a8a8c;
  font-size: var(--fs-12);
  user-select: none;
}
.ane-img-uploading.ane-img-failed { background: rgba(166, 41, 52, 0.2); color: #e08a92; }
.ane-img-dragover { outline: 2px dashed #22c55e; outline-offset: 6px; border-radius: 6px; }

/* ---- from layouts/_sidebar.html.erb ---- */
input[type="text"]::placeholder {
  color: #555;
}
a.sidebar-nav-link:hover {
  color: #fff !important;
}
/* The same drawn mark the landing page sets in front of "pex", rather than the
   U+1D538 character: no UI font covers that codepoint, so which outline appeared
   (STIXGeneral on macOS, Cambria Math on Windows, tofu elsewhere) was down to the
   fallback chain. Drawn, the weight is just the path's stroke-width, so the bold
   "you are here" state is one number rather than a synthesised text-stroke. */
a.sidebar-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  color: #fff;
  text-decoration: none;
  transition: background-color var(--dur-fast);
}
a.sidebar-logo-link:hover { background-color: rgba(231, 233, 234, 0.1); }
a.sidebar-logo-link svg { display: block; height: 28px; width: auto; }
/* The bold state is a second drawing, not a heavier stroke-width. The mark's
   apex, its inner slice and the bar closing them are all solved from the weight
   — and the slice is filled geometry, which a stroke-width cannot touch at all.
   CSS can restyle a stroke; it cannot move the geometry that has to travel with
   it, so each weight is rendered and one is shown. */
a.sidebar-logo-link .apex-mark-bold { display: none; }
a.sidebar-logo-link.is-home .apex-mark-rest,
a.sidebar-logo-link:hover .apex-mark-rest { display: none; }
a.sidebar-logo-link.is-home .apex-mark-bold,
a.sidebar-logo-link:hover .apex-mark-bold { display: block; }

/* ---- from posts/show.html.erb ---- */
.post-task-drag-ghost {
  opacity: 0.4;
  background: rgba(107, 163, 214, 0.1);
  border-radius: 4px;
}
.post-task-drag-chosen {
  background: rgba(107, 163, 214, 0.08);
  border-radius: 4px;
}
#post-tasks-list .subtask-drag-handle,
[id^="subtask-children-"] .subtask-drag-handle {
  cursor: grab;
}
#post-tasks-list .subtask-drag-handle:active,
[id^="subtask-children-"] .subtask-drag-handle:active {
  cursor: grabbing;
}

/* ---- from milestones/_form.html.erb ---- */
.milestone-form-label { display: block; margin-bottom: 4px; }
.milestone-form-card {
  background: #1a1a1f;
  border: 1px solid #2e2e36;
  border-radius: 10px;
  padding: 12px;
  margin-top: 6px;
  min-width: 240px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* In the modal it is the whole dialog rather than a card dropped under a day row. */
.milestone-form-card--modal {
  margin-top: 0;
  padding: 0;
  margin: 8px 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  background-image: var(--sheen);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-card);
}

.milestone-form-date {
  color: #777;
  font-weight: 500;
}

.milestone-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.milestone-form-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #ededf0;
  font-size: var(--fs-13);
  font-weight: 600;
}

.milestone-form-close {
  background: none;
  border: none;
  color: #777;
  font-size: var(--fs-13);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.milestone-form-close:hover {
  background: #26262c;
  color: #e0e0e0;
}

.milestone-form-field {
  margin-bottom: 9px;
}

.milestone-form-input {
  width: 100%;
  background: #232329;
  border: 1px solid #35353d;
  border-radius: 6px;
  color: #e0e0e0;
  padding: 6px 9px;
  font-size: var(--fs-13);
  box-sizing: border-box;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.milestone-form-input::placeholder {
  color: #5c5c66;
}

.milestone-form-input:focus {
  outline: none;
  border-color: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.15);
}

.milestone-form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  padding-right: 26px;
}

.milestone-icon-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.milestone-icon-preview-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  font-size: var(--fs-12);
}

.milestone-form-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 12px;
}

.milestone-form-submit {
  background: #4ade80;
  color: #0a1f12;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.milestone-form-submit:hover {
  background: #3fd071;
}

.milestone-form-delete-form {
  display: contents;
}

.milestone-form-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.milestone-form-delete:hover {
  background: rgba(239, 68, 68, 0.22);
}

.milestone-form-cancel {
  background: none;
  border: none;
  color: #888;
  font-size: var(--fs-13);
  cursor: pointer;
  padding: 6px 8px;
  margin-left: auto;
  text-decoration: none;
  transition: color 0.12s ease;
}

.milestone-form-cancel:hover {
  color: #e0e0e0;
}

/* Milestone in the modal: the same card, header, field sizes and footer as every other
   form (inline under a schedule day it stays the compact popup). */

.milestone-form-card--modal .milestone-form-header { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--border-panel); background: var(--recess); }
.milestone-form-card--modal .milestone-form-title { font-size: var(--fs-14); }
.milestone-form-card--modal form { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.milestone-form-card--modal .milestone-form-field { margin: 0 16px; }
.milestone-form-card--modal .milestone-form-input { padding: 10px 12px; border-color: rgba(255, 255, 255, 0.1); border-radius: var(--radius-md); background-color: rgba(255, 255, 255, 0.06); font-size: var(--fs-14); }
.milestone-form-card--modal .milestone-form-select { padding-right: 30px; background-position: right 10px center; }
.milestone-form-card--modal .milestone-icon-preview-wrap { width: 40px; height: 40px; border-radius: var(--radius-md); }
.milestone-form-card--modal .milestone-form-footer { margin-top: 4px; }
/* ---- from notes/_link_editing.html.erb ---- */
/* The link popover lives on <body>, not inside the editor: it must not become
   part of the note's content (everything inside the contenteditable is saved
   verbatim) and it must not be clipped by the editor's own overflow. */
.ane-link-pop {
  position: fixed; z-index: 9999;
  background: #2c2c2e; border: 1px solid #3a3a3c; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 10px; width: 280px;
  font-family: inherit;
}
.ane-link-pop-label { display:block; font-size: var(--fs-10); color: #8e8e93; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.4px; }
.ane-link-pop-field {
  width: 100%; box-sizing: border-box; background: #1c1c1e;
  border: 1px solid #3a3a3c; border-radius: 5px; color: #f2f2f7;
  font-size: var(--fs-12); font-family: inherit; padding: 5px 7px; outline: none;
}
.ane-link-pop-field:focus { border-color: #0a84ff; }
.ane-link-pop-field + .ane-link-pop-label { margin-top: 8px; }
.ane-link-pop-err { font-size: var(--fs-11); color: #ef4444; margin-top: 6px; display: none; }
.ane-link-pop-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.ane-link-pop-spacer { flex: 1; }
.ane-link-pop-btn {
  background: none; border: 1px solid #3a3a3c; border-radius: 5px;
  color: #aeaeb2; font-size: var(--fs-12); padding: 4px 10px; cursor: pointer; font-family: inherit;
}
.ane-link-pop-btn:hover { border-color: #8e8e93; color: #f2f2f7; }
.ane-link-pop-btn.is-primary { background: #0a84ff; border-color: #0a84ff; color: #fff; font-weight: 600; }
.ane-link-pop-btn.is-primary:hover { background: #3a9bff; }
.ane-link-pop-btn.is-remove { border-color: #3d1a1a; color: #ef4444; }
.ane-link-pop-btn.is-remove:hover { background: #3d1a1a; }

/* ---- from notes/_hashtags.html.erb ---- */
/* A #tag typed into a note, in the blue hashtags have everywhere else (.entry-hashtag).
   Painted as a highlight rather than a <span> in the markup, so the note's content is
   left exactly as typed and the caret never trips over an element boundary. */
::highlight(ane-hashtag) { color: #93c5fd; }

/* ---- from categories/_form.html.erb ---- */
.cat-form-card {
  background: var(--surface-1);
  background-image: var(--sheen);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-card);
  overflow: hidden;
  max-width: 680px;
}
.cat-form-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--recess);
  border-bottom: 1px solid var(--border-panel);
}
.cat-form-header-title {
  color: var(--text-1);
  font-weight: 600;
}
.cat-form-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cat-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cat-form-input,
.cat-form-select,
.cat-form-textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 9px 12px;
  color: #e2e8f0;
  font-size: var(--fs-14);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
/* The area picker reads as a picker: the shorthand background above wiped the
   task-form select's caret. */
.cat-form-select.task-form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0aec0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  color: #e2e8f0;
}
.cat-form-parent-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 3px 10px; border: 1px solid var(--border-panel); border-radius: 999px; background: rgba(255, 255, 255, 0.04); color: var(--text-2); font-size: var(--fs-12); font-weight: 500; }
.cat-form-parent-chip i { font-size: 0.9em; }
.cat-form-input:focus,
.cat-form-select:focus,
.cat-form-textarea:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
  background: rgba(255,255,255,0.09);
}
.cat-form-input::placeholder,
.cat-form-textarea::placeholder {
  color: #4a5568;
}
.cat-form-input[type="date"]::-webkit-datetime-edit-month-field,
.cat-form-input[type="date"]::-webkit-datetime-edit-day-field,
.cat-form-input[type="date"]::-webkit-datetime-edit-year-field,
.cat-form-input[type="date"]::-webkit-datetime-edit-text {
  color: #4a5568 !important;
  -webkit-text-fill-color: #4a5568 !important;
  opacity: 1 !important;
}
.cat-form-input[type="date"].has-value::-webkit-datetime-edit-month-field,
.cat-form-input[type="date"].has-value::-webkit-datetime-edit-day-field,
.cat-form-input[type="date"].has-value::-webkit-datetime-edit-year-field,
.cat-form-input[type="date"].has-value::-webkit-datetime-edit-text {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  opacity: 1 !important;
}
.cat-form-select option {
  background: var(--surface-2);
  color: #e2e8f0;
}
.cat-form-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}
.cat-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cat-form-icon-preset {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.15s;
  color: #aaa;
}
.cat-form-icon-preset:hover {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.4);
  color: #e2e8f0;
}
.cat-form-icon-preset:has(input:checked) {
  background: rgba(34,197,94,0.25);
  border-color: var(--accent-bright);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.3);
}
.cat-form-icon-preset input[type="radio"] {
  display: none;
}
.cat-form-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 0;
}
.cat-form-icon-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-form-icon-picker {
  position: relative;
  flex-shrink: 0;
}
.cat-form-icon-picker-btn {
  width: 40px;
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #aaa;
  font-size: var(--fs-16);
  cursor: pointer;
  transition: all 0.15s;
}
.cat-form-icon-picker-btn:hover {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.4);
  color: #e2e8f0;
}
.cat-form-icon-picker-btn[aria-expanded="true"] {
  background: rgba(34,197,94,0.25);
  border-color: var(--accent-bright);
  color: #fff;
}
.cat-form-inline-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: var(--fs-13);
  cursor: help;
}
/* The icon button's panel (categories/_form), opened in place under the name: the
   presets, then a typed icon, then an uploaded image — everything the icon can be, out
   of the form until it's wanted. */
.cat-form-icon-dropdown {
  margin-top: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
}
.cat-form-icon-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 168px;
  overflow-y: auto;
}
.cat-form-icon-current { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.cat-form-icon-current .is-placeholder { opacity: 0.45; }
.cat-form-icon-current-image { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; }
.cat-form-icon-image { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cat-form-icon-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-2);
  font-size: var(--fs-12);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
}
.cat-form-icon-upload:hover { color: var(--text-1); border-color: var(--accent-bright); }
.cat-form-icon-upload-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-form-icon-upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cat-form-icon-dropdown .cat-form-hint { margin: 0; }
.cat-form-icon-image-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #9ca3af;
  font-size: var(--fs-12);
  cursor: pointer;
}

.cat-form-icon-image-remove input { width: auto; }

.cat-form-hint {
  margin: 0.3rem 0 0;
  color: #6b7280;
  font-size: var(--fs-11);
}

.cat-form-icon-dropdown[hidden] {
  display: none;
}
.cat-form-goal-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 9px 14px;
  color: #9ca3ab;
  font-size: var(--fs-14);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-form-goal-toggle-btn:hover {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.35);
  color: #e2e8f0;
}
.cat-form-goal-toggle-btn.active {
  background: rgba(220,53,69,0.1);
  border-color: rgba(220,53,69,0.3);
  color: #f88;
}
.cat-form-goal-fields {
  margin-top: 12px;
}
.cat-form-goal-fields[hidden] {
  display: none;
}
.cat-form-submit-icon {
  background: #22c55e;
  border: none;
  color: #06130a;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 9px;
  font-size: var(--fs-16);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, transform 0.08s;
}
.cat-form-submit-icon:hover {
  background: #4ade80;
}
.cat-form-submit-icon:active {
  transform: scale(0.97);
}
.cat-form-completed-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cat-form-completed-toggle:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
}
.cat-form-completed-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-form-completed-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
  font-size: var(--fs-14);
  font-weight: 600;
}
.cat-form-completed-title i {
  color: #4ade80;
  font-size: var(--fs-14);
}
.cat-form-completed-hint {
  color: #6b7280;
  font-size: var(--fs-12);
}
.cat-form-switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
}
.cat-form-switch-input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.cat-form-switch-track {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  transition: background 0.2s;
}
.cat-form-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #e2e8f0;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.cat-form-switch-input:checked ~ .cat-form-switch-track {
  background: #22c55e;
}
.cat-form-switch-input:checked ~ .cat-form-switch-track .cat-form-switch-thumb {
  transform: translateX(18px);
}
.cat-form-switch-input:focus-visible ~ .cat-form-switch-track {
  box-shadow: 0 0 0 3px rgba(34,197,94,0.35);
}
.cat-form-footer {
  padding: 14px 20px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cat-form-errors {
  background: rgba(220,53,69,0.12);
  color: #f88;
  border: 1px solid rgba(220,53,69,0.3);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: var(--fs-14);
}
.cat-form-errors ul {
  margin: 0.4rem 0 0 1rem;
  padding: 0;
}

/* ---- from premium/show.html.erb ---- */
.prem-status { font-size: var(--fs-13); color: var(--text-2); }
.prem-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 16px; }
.prem-plan {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.prem-plan.is-featured { border-color: var(--accent); }
.prem-plan-name { font-size: var(--fs-12); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.prem-plan-price { font-size: var(--fs-24); font-weight: 600; color: var(--text-1); }
.prem-plan-price small { font-size: var(--fs-13); font-weight: 400; color: var(--text-2); }
.prem-plan-note { font-size: var(--fs-12); color: var(--text-2); min-height: 1.4em; }
.prem-plan form { margin-top: 6px; }
.prem-plan .set-btn { width: 100%; justify-content: center; }
.prem-features { list-style: none; margin: 0; padding: 4px 0; }
.prem-feature { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; }
.prem-feature + .prem-feature { border-top: 1px solid var(--border); }
.prem-feature.is-asked { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.prem-feature i { width: 18px; margin-top: 3px; color: var(--accent); text-align: center; }
.prem-feature-title { font-size: var(--fs-14); color: var(--text-1); }
.prem-feature-blurb { font-size: var(--fs-12); color: var(--text-2); }
.prem-early { display: flex; gap: 10px; margin: 0 16px 16px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--text-2); font-size: var(--fs-13); line-height: 1.5; }
.prem-early i { margin-top: 3px; color: var(--accent); }
.prem-early strong { color: var(--text-1); font-weight: 600; }
.prem-free { padding: 12px 16px; font-size: var(--fs-12); color: var(--text-2); line-height: 1.5; }
/* Arrived from a locked feature (?feature=): the one line saying why, above the plans. */
.prem-asked { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--border-panel); border-radius: var(--radius-lg); background: var(--surface-card); color: var(--text-1); font-size: var(--fs-14); }
.prem-asked i { color: var(--accent); }

/* A gallery item's second line: what a rule or value means, or a question's answer. */
.gallery-item-desc { color: var(--text-2); font-size: var(--fs-13); line-height: 1.45; text-wrap: pretty; }
/* The journal's questions, in the serif its entries are written in. */
.gallery-page.is-journal .gallery-item-title { font-family: Newsreader, Georgia, serif; font-size: 19px; font-weight: 400; line-height: 1.3; }
.gallery-page.is-journal .gallery-item-desc { font-family: Newsreader, Georgia, serif; font-size: 14px; font-style: italic; }
.gallery-page.is-journal .gallery-item.is-done { background-image: none; }
.gallery-page.is-journal .gallery-item.is-done .gallery-item-title { color: var(--text-2); }
.gallery-page.is-journal .gallery-head { align-items: center; margin-bottom: 1.5rem; }
.gallery-page.is-journal .gallery-progress { margin: -0.75rem 0 1.25rem; }

/* The sidebar's More menu links (were inline style strings). Display is left to
   .rail-only, which reveals its own; the rest are .is-block. */
.more-link { color: #fff; font-size: var(--fs-14); padding: 0.5rem 1rem; text-decoration: none; }
.more-link.is-block { display: block; }
.more-link.is-active { font-weight: bold; }
.more-link-count { color: var(--accent-bright); }

/* Repeated inline styles on home, as classes (each was written out per day or per row). */
.mini-day { display: block; padding: 5px 5.2px 6px 4px; border-radius: 5px; text-align: center; text-decoration: none; }
.mini-day.is-tight-top { padding-top: 4px; }
/* A table's invisible first row, setting its column widths: never seen, whatever a page's own
   table rules say (!important, as the inline style it replaced was). The width stays on the cell. */
.col-sizer { height: 0 !important; padding: 0 !important; border: none !important; }
.col-sizer.is-9 { width: 9%; }

/* Quick add: what a new task's title will set, as chips under it (quick_add.js). */
.qa-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.qa-chips[hidden] { display: none; }
/* Under an empty title while it has focus (quick_add.js): what the title can carry. The
   task forms' placeholder grey, a size down. */
.qa-hint { margin-top: 6px; padding-left: 2px; color: #555; font-size: var(--fs-12); text-align: left; }
.qa-hint[hidden] { display: none; }
.qa-hint a { color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.qa-hint a:hover { color: var(--text-1); }
.qa-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 9px; border: 1px solid rgba(107, 140, 255, 0.35); border-radius: 999px; background: rgba(107, 140, 255, 0.1); color: #c7d3ff; font-size: var(--fs-12); line-height: 1.5; }
.qa-chip i { font-size: var(--fs-10); opacity: 0.85; }
.qa-chip.is-priority { border-color: rgba(212, 184, 74, 0.45); background: rgba(212, 184, 74, 0.12); color: #e9d58a; }
.qa-chip.is-repeat { border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.1); color: #86efac; }
.qa-chip-x { display: inline-grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 13px; line-height: 1; opacity: 0.6; cursor: pointer; }
.qa-chip-x:hover { background: rgba(255, 255, 255, 0.12); opacity: 1; }

/* In a form with a tag row, the chips lead it (quick_add.js), and the #tags beside them
   take the chips' shape so the row reads as one set. A tag still being typed shows faint
   and dashed until it's committed (task_tag_input.js). */
.task-tag-pills > .qa-chips:not([hidden]) { display: contents; }
.task-tag-pills.is-showing-qa { display: flex; }
.task-tag-pills.has-qa-chips { gap: 5px; margin-top: 2px; }
.task-tag-pills.has-qa-chips .tag-pill { gap: 6px; padding: 2px 4px 2px 9px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--text-1); line-height: 1.5; }
.task-tag-pills.has-qa-chips .tag-pill::before { content: '#'; margin-right: -3px; opacity: 0.6; }
.task-tag-pills.has-qa-chips .tag-pill-remove { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: inherit; font-size: 13px; opacity: 0.6; }
.task-tag-pills.has-qa-chips .tag-pill-remove:hover { background: rgba(255, 255, 255, 0.12); opacity: 1; }
.task-tag-pills .tag-pill.is-pending { opacity: 0.55; border-style: dashed; }
.task-tag-pills.has-qa-chips .tag-pill.is-pending { padding-right: 9px; }

/* Keyboard shortcuts list ("?", keyboard_shortcuts.js). */
#shortcuts-help { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: rgba(0, 0, 0, 0.6); }
.sk-card { width: 100%; max-width: 640px; max-height: 100%; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-1); background-image: var(--sheen); box-shadow: var(--shadow-card); }
.sk-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border-panel); background: var(--recess); color: var(--text-1); font-size: var(--fs-14); font-weight: 600; }
.sk-close { border: 0; background: none; color: var(--text-3); font-size: 18px; cursor: pointer; }
.sk-close:hover { color: var(--text-1); }
.sk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; padding: 14px 16px 4px; }
.sk-cols h3 { margin: 0 0 6px; color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.sk-cols ul { margin: 0; padding: 0; list-style: none; }
.sk-cols li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--text-2); font-size: var(--fs-13); }
.sk-keys { display: inline-flex; align-items: center; gap: 4px; }
.sk-then { color: var(--text-3); font-size: var(--fs-10); }
.sk-keys kbd { min-width: 20px; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--text-1); font: inherit; font-size: var(--fs-12); text-align: center; }
.sk-foot { margin: 0; padding: 10px 16px 14px; color: var(--text-3); font-size: var(--fs-12); }
.sk-foot a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.sk-foot a:hover { color: var(--text-1); }
@media (max-width: 560px) { .sk-cols { grid-template-columns: 1fr; } }
.set-hint kbd { padding: 0 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 0.95em; }

/* The Undo bar (undo_toast.js): a moment to take back a check-off or a delete. */
.undo-toast { position: fixed; left: 50%; bottom: 24px; z-index: 9000; display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-pop, #26262c); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); color: var(--text-1); font-size: var(--fs-13); opacity: 0; transform: translate(-50%, 12px); transition: opacity 0.18s ease, transform 0.18s ease; }
.undo-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.undo-toast-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-toast-btn { flex: none; padding: 5px 12px; border: 0; border-radius: var(--radius-sm); background: rgba(107, 140, 255, 0.16); color: #c7d3ff; font: inherit; font-weight: 600; cursor: pointer; }
.undo-toast-btn:hover { background: rgba(107, 140, 255, 0.28); }
@media (max-width: 640px) { .undo-toast { bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* ---- Show pages: a habit's record, the day's tick, ⋯, empty starts, the journal page ---- */
.cal-day.is-kept { background: rgba(34, 197, 94, 0.78); color: #04210f; font-weight: 700; }
.cal-day.is-kept:hover { background: rgba(34, 197, 94, 0.9); }
.cal-day.is-missed { background: rgba(229, 72, 77, 0.22); color: #fca5a5; font-weight: 600; }
.cal-day.is-missed:hover { background: rgba(229, 72, 77, 0.32); }
.cal-day.is-upcoming { background: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-bright); }
.cal-day.is-before-start {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 3px, transparent 3px 6px);
  color: var(--text-3); font-weight: 500;
}
.show-cal-swatch.is-kept { background: rgba(34, 197, 94, 0.78); }
.show-cal-swatch.is-missed { background: rgba(229, 72, 77, 0.3); }
.show-done-form { margin: 0; }
.show-done-btn.is-done { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-bright); }
/* Not done yet, it's a plain button like Edit beside it: green is what done looks like,
   and a green "Mark done" read as already done. Hover previews the green. */
.show-done-btn:not(.is-done) { border-color: var(--border); color: var(--text-1); }
.show-done-btn:not(.is-done):hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent-bright); }
.show-empty .show-empty-add { margin-top: 6px; color: var(--text-1); }
.show-empty .show-empty-add i { font-size: inherit; opacity: 1; }
/* The journal entry's neighbours: two matching cards, the missing end a quiet one. */
.js-pager-end { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; border: 1px dashed var(--border-panel); border-radius: var(--radius-md); }
.js-pager-end.is-newer { align-items: flex-end; }
.js-pager-end .js-pager-text { color: var(--text-3); font-style: italic; }
.js-show .show-card .show-section .js-entry { font-size: 21px; line-height: 1.75; }

/* Journal import: what happens to what's dropped, under the drop area. */
.vm-promises { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--text-3); font-size: var(--fs-12); }
.vm-promises li { display: inline-flex; align-items: center; gap: 6px; }
.vm-promises i { font-size: 0.9em; opacity: 0.8; }

/* An entry's page: a short one a size larger (journals/show), and the entries either side
   as cards with two lines of each, to turn to like the next page rather than a link. */
.js-show .show-card .show-section .js-entry.is-short { font-size: 25px; line-height: 1.6; }
.js-pager { margin-top: 24px; gap: 14px; }
.js-pager a { gap: 8px; padding: 16px 18px; background: var(--surface-card); background-image: var(--sheen); }
.js-pager-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 17px; line-height: 1.45; color: var(--text-1); }
.js-pager-end { padding: 16px 18px; }

/* "Go to · press g, then", said once in the heading, its g key drawn like the rows'. */
.sk-lead { margin-left: 6px; color: var(--text-3); font-weight: 500; letter-spacing: 0; text-transform: none; }
.sk-lead kbd { padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); color: var(--text-1); font: inherit; font-size: var(--fs-11); }
/* "New milestone · Wed, Nov 11" on one line in the day's narrow popup. */
.milestone-form-title { white-space: nowrap; }
.milestone-form-title .milestone-form-date { font-size: var(--fs-12); }
.milestone-form-title .milestone-form-date::before { content: "· "; }

/* With goal dates on, the toggle is a quiet link above them: a full-width red bar read as
   a warning. */
.cat-form-goal-toggle-btn.active { padding: 2px 0; border-color: transparent; background: none; color: var(--text-3); font-size: var(--fs-12); }
.cat-form-goal-toggle-btn.active:hover { border-color: transparent; background: none; color: var(--danger-bright); }
/* A section with no colour: its swatch striped "none", not the browser's black. */
.section-color { position: relative; display: inline-block; }
.section-color.is-unset::after {
  content: ''; position: absolute; inset: 4px; border-radius: 6px; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 6px), var(--surface-2);
}
/* Shortcuts: the shared popup header, and Go to's fifteen places in two columns beside
   Do's six, with the tip under Do rather than a long empty block. */
#shortcuts-help .sk-head.task-form-header { margin: 0; }
#shortcuts-help .sk-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
#shortcuts-help .sk-go ul { column-count: 2; column-gap: 28px; }
#shortcuts-help .sk-go li { break-inside: avoid; }
#shortcuts-help section > .sk-foot { margin: 14px 0 0; padding: 0; border: none; line-height: 1.5; }
@media (max-width: 640px) {
  #shortcuts-help .sk-cols { grid-template-columns: 1fr; }
}
#shortcuts-help .sk-card { max-width: 760px; }
#shortcuts-help .sk-close.task-form-close { font-size: var(--fs-13); }
/* New milestone in the popup: the shared round ✕, as every other popup's header has. */
.milestone-form-card--modal .milestone-form-close {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: var(--text-2);
}
.milestone-form-card--modal .milestone-form-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
/* The upsell's "Premium" in gold, not the brand's blue. */
.upsell-premium { color: var(--gold-bright) !important; }
/* A habit's month: kept days the only green, missed ones the softer red the strips use,
   and days to come plain grey numbers rather than green rings. */
.cal-day.is-missed { background: rgba(214, 78, 82, 0.22); color: #f1a3a5; }
.cal-day.is-missed:hover { background: rgba(214, 78, 82, 0.32); }
.cal-day.is-upcoming { box-shadow: none; color: var(--text-3); font-weight: 500; }
.show-cal-swatch.is-missed { background: rgba(214, 78, 82, 0.3); }
.show-cal-swatch.is-upcoming { background: none; color: var(--text-3); font-size: 9px; }
/* The Premium page in Premium's gold: its feature icons, the early-access note, and the
   featured plan. Plans someone already has are shown at full strength with "Included"
   rather than dimmed as if unavailable. */
.prem-feature i, .prem-early i, .prem-asked i { color: var(--gold-bright); }
.prem-feature.is-asked { background: rgba(251, 191, 36, 0.07); }
.prem-early { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); }
.prem-plan.is-featured { border-color: rgba(251, 191, 36, 0.55); }
.prem-plans.is-quiet { opacity: 1; }
.prem-plans.is-quiet .prem-plan.is-featured { border-color: rgba(251, 191, 36, 0.4); }
.prem-plan-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prem-included { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid rgba(251, 191, 36, 0.45); border-radius: 999px; color: var(--gold-bright); font-size: var(--fs-10); letter-spacing: 0.04em; }
.prem-included i { font-size: 0.85em; }

/* A habit's calendar: a missed day is a thin red ring round its number, quieter than a
   filled disc (kept days stay filled); the days still to come step back. */
#task-calendar .cal-day.is-missed { background: none; box-shadow: inset 0 0 0 1.5px rgba(214, 78, 82, 0.6); color: #f1a3a5; }
#task-calendar .cal-day.is-missed:hover { background: rgba(214, 78, 82, 0.12); }
.show-cal-swatch.is-missed { background: none; box-shadow: inset 0 0 0 1.5px rgba(214, 78, 82, 0.6); }
#task-calendar .cal-day.is-upcoming:not(.is-selected) { opacity: 0.45; }
#task-calendar .cal-day.is-upcoming:not(.is-selected):hover { opacity: 1; }

/* iPhone Safari zooms the whole page in when a field under 16px takes focus, and stays
   zoomed, so the note runs off the right edge. Notes' fields are 12–15px; on phones
   they're 16px, which Safari leaves alone. */
@media (max-width: 819px) {
  #ane-content.ane-content-ta, .ann-content-ta,
  #an-search.an-search-input,
  #ane-folder-pick,
  .an-modal-input {
    font-size: 16px !important;
  }
}
