/* ============================================================
   INSPIRATIONS — the page (inspirations/index), its cards (inspirations/_inspiration),
   the gallery and Reflect
   A board of cards across the page's width (CSS columns: masonry without a script), the
   words set in Newsreader, larger the shorter they are. Pinned sits in its own section
   above; Prioritized splits the page into Unsorted and a numbered ranking.
   ============================================================ */
.insp-page { max-width: 1120px; margin: 0 auto; padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem; box-sizing: border-box; }
.insp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1.25rem; }
.insp-head-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; min-width: 0; }
.insp-title { margin: 0; color: var(--text-1); font-size: var(--fs-22); font-weight: 700; letter-spacing: -0.01em; }
.insp-count { color: var(--text-3); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.insp-head-actions { display: flex; gap: 8px; }
/* Clear of the Filters button in the page's top-right corner (layouts/_dashboard_button),
   which Reflect ran 8px under — as the calendar's toolbar keeps clear of it. A phone has
   no corner button; its filters are in the header. */
@media (min-width: 820px) {
  .insp-head-actions { margin-right: 46px; }
}
.insp-head-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.insp-head-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.insp-head-btn.is-violet { color: #b69cf0; }
.insp-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: var(--fs-12);
  text-decoration: none;
}
.insp-filter-chip:hover { border-color: var(--border-strong); color: var(--text-1); }
.insp-filter-chip.is-active, .insp-head .insp-filter-chip { border-color: rgba(96, 165, 250, 0.45); background: rgba(96, 165, 250, 0.1); color: #93c5fd; }
.insp-filter-chip i { font-size: var(--fs-10); }

.insp-section { margin-bottom: 0.75rem; }
.insp-section-label { display: flex; align-items: center; gap: 6px; margin: 0 0 0.6rem; color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.insp-section-label i { color: var(--gold-bright); }

/* The board: as many columns as fit a card of about 300px, up to three. */
.insp-grid { margin: 0; padding: 0; list-style: none; columns: 3 290px; column-gap: 1rem; }
.insp-grid.is-narrow { max-width: 460px; columns: 1; margin: 0 auto; }
.insp-iotd-row { columns: 1; max-width: 520px; margin-bottom: 1.25rem; }
.inspiration-card {
  display: inline-block;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 1rem;
  vertical-align: top;
  break-inside: avoid;
  list-style: none;
}
.inspiration-card.is-dimmed { opacity: 0.35; }
.inspiration-card-body {
  position: relative;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  background-color: var(--surface-card);
  background-image: var(--sheen);
  box-shadow: inset 0 1px 0 var(--inset-light), 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.inspiration-card:hover .inspiration-card-body { border-color: var(--border-strong); }
/* Pinned cards keep the ground every card has: their pin and their place at the head of
   the board say it. The gold top edge they had made pinned, favourite and the day's line
   three kinds of gold card, and most of a board gold. Gold is the favourite's and the day's. */
/* An affirmation is a different kind of thing, not a more important one: its own violet
   edge and a label, on the same ground. */
.inspiration-card.is-affirmation .inspiration-card-body { border-left: 3px solid #8a63d2; background-color: #15111d; }
.insp-card-content { flex: 1; min-width: 0; }
.insp-card-image { display: block; }
.insp-card-image img { display: block; width: 100%; height: auto; }
.insp-card-text { display: flex; flex-direction: column; gap: 0.65rem; padding: 1.1rem 1.15rem 1rem; }
.insp-card-kind { display: inline-flex; align-items: center; gap: 6px; color: #b69cf0; font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
/* A favorite, like an affirmation, is a kind of its own: a gold edge, a warm ground and
   a label. Both at once keep both labels; the gold edge wins. */
.inspiration-card.is-starred .inspiration-card-body { border-left: 3px solid var(--gold-bright); background-color: #1a170f; }
.insp-card-kinds { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.insp-card-kind.is-favorite { color: var(--gold-bright); }

/* The words: the serif, larger the shorter the line. */
.insp-quote {
  display: block;
  margin: 0;
  color: var(--text-1);
  font-family: Newsreader, Georgia, 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  text-wrap: pretty;
  font-optical-sizing: auto;
}
a.insp-quote:hover { color: #fff; }
.insp-quote.is-short { font-size: 23px; line-height: 1.3; }
.insp-quote.is-medium { font-size: 19px; }
.insp-quote.is-long { font-size: 16px; line-height: 1.5; }
.inspiration-card.is-affirmation .insp-quote { font-style: italic; }
/* Its label, now that a pinned card leads the board rather than a section of its own. */
.insp-card-kind.is-pinned { color: var(--text-2); }
/* The review moving authors out of tags (inspirations/authors). */
.insp-authors-intro { max-width: 640px; margin: -4px 0 20px; color: var(--text-3); font-size: var(--fs-13); line-height: 1.6; }
.insp-authors-list { display: flex; flex-direction: column; gap: 8px; max-width: 720px; margin: 0; padding: 0; list-style: none; }
.insp-authors-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}
.insp-authors-pick { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.insp-authors-pick input { accent-color: var(--accent); }
.insp-authors-tag { color: var(--text-1); font-size: var(--fs-13); font-weight: 600; }
.insp-authors-count { color: var(--text-3); font-size: var(--fs-12); }
.insp-authors-to { display: flex; align-items: center; gap: 8px; }
.insp-authors-dash { color: var(--text-3); }
.insp-authors-sample { grid-column: 1 / -1; margin: 0; color: var(--text-3); font-family: Newsreader, Georgia, serif; font-size: var(--fs-14); line-height: 1.45; }
.insp-authors-actions { display: flex; justify-content: flex-end; gap: 8px; max-width: 720px; margin-top: 16px; }
.insp-head-btn.is-primary { border-color: transparent; background: var(--accent); color: #04140a; font-weight: 600; }
@media (max-width: 640px) { .insp-authors-row { grid-template-columns: 1fr; } }

/* Who said it, under the quote like a book's epigraph (InspirationsHelper#inspiration_author). */
.insp-author { margin: 8px 0 0; color: var(--text-3); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.insp-author-link { color: inherit; text-decoration: none; }
.insp-author-link:hover { color: var(--text-1); }
.inspiration-card.is-affirmation .insp-author { color: color-mix(in srgb, #b69cf0 70%, var(--text-3)); }
.home-insp-author { margin-top: 6px; }
.insp-reflect-author { margin: 14px 0 0; color: var(--text-3); font-size: var(--fs-12); font-weight: 600; letter-spacing: 0.12em; text-align: center; text-transform: uppercase; }
/* An author reads as the plain chips beside it: no small capitals, no leading dash. */
.insp-filter-chip.is-author { font-style: italic; }
/* The form's author line: a dash and a quiet field under the words. */
.insp-form-author { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.insp-form-author-dash { color: var(--text-3); }
.insp-form-author-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-13);
}
.insp-form-author-input:focus { border-color: rgba(255, 255, 255, 0.14); outline: none; background: rgba(255, 255, 255, 0.06); }
/* The form's words, in the card's serif, in a box that grows with them (inspirations/_form). */
.task-form-input-title.insp-form-quote {
  display: block;
  width: 100%;
  min-height: 3.2em;
  resize: none;
  overflow: hidden;
  font-family: Newsreader, Georgia, 'Times New Roman', serif !important;
  font-size: 18px !important;
  line-height: 1.45;
}

/* Tags — often who said it — as quiet links that filter the page. */
.insp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
/* A tag is quiet text in the author's grey, so the quote leads. It still filters the page
   (everything with it): it brightens and underlines under the pointer. The pills it wore
   had borders and grounds that outweighed the author line. */
.insp-tags { gap: 2px 10px; }
.insp-tag { padding: 0; border: none; color: var(--text-3); font-size: var(--fs-12); text-decoration: none; transition: color var(--dur-fast); }
a.insp-tag:hover { color: var(--text-1); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.insp-card-foot, .insp-iotd-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.insp-saved { color: var(--text-3); font-size: var(--fs-12); font-weight: 600; letter-spacing: 0.03em; }

/* Star, pin and delete: on hover where there is hover, always where there isn't. */
.inspiration-card .card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity var(--dur-base);
}
.inspiration-card:hover .card-actions, .inspiration-card:focus-within .card-actions { opacity: 1; }
/* "⋯" is a touch screen's alone: with hover, every action shows on hover anyway. */
.inspiration-card .card-action-more { display: none; }
@media (hover: none) {
  .inspiration-card .card-actions { position: static; justify-content: flex-end; opacity: 1; padding: 0 0.6rem 0.6rem; margin-top: -0.35rem; width: 100%; }
  .inspiration-card-body { flex-wrap: wrap; }
  /* Always showing, under the card rather than over its words: so the star alone, the
     rest (pin, send, delete) behind "⋯", not three buttons and a red bin on every card.
     The same faint ground on every card, where the overlay's near-black showed only on
     a favourite's warmer one. */
  .inspiration-card .card-action-more { display: inline-flex; }
  .inspiration-card:not(.actions-open) .card-actions .is-extra { display: none; }
  .inspiration-card .card-action-btn { background: rgba(255, 255, 255, 0.06); }
  /* Over the gold hover a tap leaves behind (the hover rule is further down). */
  .inspiration-card.actions-open .card-actions .card-action-more { color: var(--text-1); background: rgba(255, 255, 255, 0.12); }
}
.insp-inline-form { display: inline; margin: 0; }
.inspiration-card .card-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(10, 10, 12, 0.75);
  color: var(--text-2);
  font-size: var(--fs-11);
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.inspiration-card .card-action-btn.is-on { color: var(--gold-bright); }
.inspiration-card .card-action-btn:hover { background: rgba(251, 191, 36, 0.25); color: var(--gold-bright); }
.inspiration-card .card-action-btn.is-danger { color: var(--danger); }
.inspiration-card .card-action-btn.is-danger:hover { background: var(--danger-soft); color: var(--danger-bright); }

/* Inspiration of the Day: the board's first tile, in a bright neutral frame. Gold is a
   favourite's alone: in gold too, a couple of favourites near the top made the head of the
   board one gold block, with the day's line no longer standing out from it. */
.inspiration-card.is-iotd { list-style: none; }
.inspiration-panel.is-featured {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  background-color: var(--surface-card);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 55%), var(--sheen);
}
.inspiration-panel-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 12px 16px 0;
  color: var(--text-2);
  font-size: var(--fs-10);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.inspiration-panel-header i { color: var(--text-1); font-size: var(--fs-12); }
/* Marks a stand-in line: the day's own inspiration never generated, so an earlier one
   is showing and says which day it came from. */
.inspiration-panel-header .iotd-stale-date { margin-left: auto; color: var(--text-3); font-size: var(--fs-10); font-weight: 500; letter-spacing: 0; text-transform: none; }
.inspiration-panel-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 10px 16px 14px; }
.iotd-save-btn {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast);
}
.iotd-save-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* Shared with you: a connection's card, who sent it, and Save or Dismiss
   (inspirations/_incoming_share). Blue, the colour of people in the app. */
.insp-section-label.is-shared i { color: var(--blue); }
.inspiration-card.is-shared .inspiration-card-body { border-color: rgba(77, 159, 255, 0.35); box-shadow: inset 0 2px 0 rgba(77, 159, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.4); }
.insp-share-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 0.15rem; padding-top: 0.7rem; border-top: 1px solid var(--hairline); }
.insp-share-from { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: var(--fs-12); }
.insp-share-answer { display: inline-flex; align-items: center; gap: 6px; }
.insp-share-dismiss, .insp-share-save {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.insp-share-dismiss { border: 1px solid transparent; background: none; color: var(--text-3); }
.insp-share-dismiss:hover { color: var(--text-1); }
.insp-share-save { border: 1px solid rgba(77, 159, 255, 0.45); background: rgba(77, 159, 255, 0.12); color: #93c5fd; }
.insp-share-save:hover { background: rgba(77, 159, 255, 0.22); color: #fff; }

/* Send to a connection: the dialog a card's paper plane opens (inspirations/_share_dialog). */
.insp-share-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  background-image: var(--sheen);
  color: var(--text-1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.insp-share-dialog::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); }
.insp-share-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 0 16px; }
.insp-share-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-2); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.insp-share-title i { color: var(--blue); }
.insp-share-close { width: 28px; height: 28px; border: none; border-radius: 50%; background: none; color: var(--text-3); cursor: pointer; }
.insp-share-close:hover { background: var(--hairline); color: var(--text-1); }
.insp-share-preview {
  margin: 10px 16px 4px;
  padding-left: 12px;
  border-left: 2px solid var(--border-strong);
  color: var(--text-2);
  font-family: Newsreader, Georgia, serif;
  font-size: 16px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.insp-share-form { margin: 0; }
.insp-share-people { max-height: 280px; overflow-y: auto; margin: 8px 0 0; padding: 0 8px; list-style: none; }
.insp-share-person {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-13);
  text-align: left;
  cursor: pointer;
}
.insp-share-person:hover, .insp-share-person:focus-visible { background: var(--hairline); outline: none; }
.insp-share-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-share-go { color: var(--text-3); font-size: var(--fs-11); opacity: 0; transition: opacity var(--dur-fast); }
.insp-share-person:hover .insp-share-go, .insp-share-person:focus-visible .insp-share-go { opacity: 1; color: var(--blue); }
.insp-share-hint { margin: 6px 16px 14px; color: var(--text-3); font-size: var(--fs-11); }

/* The gallery: its tag filter. The heading and Save are shared/gallery's. */
.insp-gallery .gallery-head { margin-bottom: 1rem; }
.insp-gallery-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.25rem; }

/* ---- Inspiration form ---- */
/* Laid out like the task form, so the flags are icon cards in the footer. Each is a
   label bound to a hidden checkbox by `for`, the same wiring .mark-completed-btn
   uses — the state rides along in the form post and the active look is CSS off
   :checked, so none of it needs JavaScript. The input sits before its label so the
   adjacent-sibling selector holds; Rails' hidden 0-field ahead of it does not move
   that relationship. */
.insp-flag-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
/* Same look as .task-type-card, its own name. A document-wide click handler in
   task_form_button.js owns .task-type-card and preventDefault()s every click on it,
   which on a <label for> cancels the very toggle the label exists to do — the card
   lit on hover and the checkbox underneath never changed. The rule form
   (.rule-footer-card) and the area form hit the same trap and took the same way out.
   Geometry is the task footer's icon-only card: 40px square. */
.insp-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.insp-flag i {
  font-size: var(--fs-14);
  color: #555;
  transition: color var(--dur-fast);
}
.insp-flag:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

/* Hover previews the colour the flag will take, the way Priority previews its own
   yellow on the task form, so hovering and the set state read as the same thing.
   The :checked rules below outrank these, so a set flag keeps its full colour
   while hovered. */
.insp-flag[data-flag="favorite"]:hover {
  border-color: rgba(234, 179, 8, 0.45);
  background: rgba(234, 179, 8, 0.1);
}
.insp-flag[data-flag="favorite"]:hover i { color: var(--gold); }
.insp-flag[data-flag="pinned"]:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06); }
.insp-flag[data-flag="pinned"]:hover i { color: var(--text-1); }
.insp-flag[data-flag="affirmation"]:hover {
  border-color: rgba(138, 99, 210, 0.45);
  background: rgba(138, 99, 210, 0.1);
}
.insp-flag[data-flag="affirmation"]:hover i { color: #b69ae4; }

/* Gold is the favourite's alone, here as on the card. A pinned card wears a faint
   silver edge, so Pin when on is white and silver rather than a second gold. */
.insp-flag-input:checked + .insp-flag[data-flag="favorite"] {
  border-color: var(--gold);
  background: rgba(234, 179, 8, 0.15);
}
.insp-flag-input:checked + .insp-flag[data-flag="favorite"] i {
  color: var(--gold-bright);
  text-shadow: 0 0 6px rgba(234, 179, 8, 0.4);
}
.insp-flag-input:checked + .insp-flag[data-flag="pinned"] {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.09);
}
.insp-flag-input:checked + .insp-flag[data-flag="pinned"] i,
.insp-flag-input:checked + .insp-flag[data-flag="pinned"] .insp-flag-label { color: #fff; }

/* The same purple that grounds an affirmation card. */
.insp-flag-input:checked + .insp-flag[data-flag="affirmation"] {
  border-color: #8a63d2;
  background: rgba(138, 99, 210, 0.18);
}
.insp-flag-input:checked + .insp-flag[data-flag="affirmation"] i {
  color: #b69ae4;
  text-shadow: 0 0 6px rgba(138, 99, 210, 0.4);
}

/* The input is off-screen, so the ring is drawn on the card — without it these
   three controls are invisible to anyone tabbing through the form. */
.insp-flag-input:focus-visible + .insp-flag {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.25);
}

.insp-form-errors {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger-bright);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-13);
}
.insp-form-errors ul { margin: 0.4rem 0 0 1rem; padding: 0; }

.insp-form-image img {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

/* A file input cannot be styled, so the real one is hidden inside a label that
   can be, and its onchange writes the filename into the span. */
.insp-file-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.insp-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-size: var(--fs-12);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.insp-file-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-1);
}
.insp-file-input:focus-visible + i {
  color: var(--blue);
}
.insp-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Drag affordances ---- */
.inspiration-ghost { opacity: 0.4; }
#left-inspirations .inspiration-card,
#ranked-inspirations .inspiration-card,
#pinned-inspirations .inspiration-card { cursor: grab; }
#left-inspirations .inspiration-card:active,
#ranked-inspirations .inspiration-card:active,
#pinned-inspirations .inspiration-card:active { cursor: grabbing; }

/* ---- Prioritized: Unsorted beside the numbered ranking ---- */
.insp-rank-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 1.5rem; }
.insp-rank-grid.is-single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.insp-rank-reveal { margin-bottom: 0.75rem; }
.insp-rank-reveal[hidden], .insp-rank-col[hidden] { display: none; }
.insp-rank-head { display: flex; align-items: center; gap: 8px; margin-bottom: 0.6rem; color: var(--text-2); font-size: var(--fs-13); font-weight: 600; }
.insp-rank-head i { color: var(--text-3); }
.insp-rank-hide { margin-left: auto; padding: 2px 6px; border: none; border-radius: 4px; background: none; color: var(--text-3); cursor: pointer; }
.insp-rank-hide:hover { background: var(--surface-2); color: var(--text-1); }
.insp-list { min-height: 3rem; margin: 0; padding: 0; list-style: none; }
.insp-list .inspiration-card { display: block; }
/* The ranking numbers itself: 1, 2, 3 down the side of each card. */
#ranked-inspirations { counter-reset: insp-rank; }
#ranked-inspirations > .inspiration-card { counter-increment: insp-rank; }
#ranked-inspirations > .inspiration-card .inspiration-card-body::before {
  content: counter(insp-rank);
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: center;
  width: 34px;
  padding-top: 1.1rem;
  border-right: 1px solid var(--border-panel);
  color: var(--gold-bright);
  font-family: Newsreader, Georgia, serif;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.insp-rank-controls { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 4px; border-right: 1px solid var(--border-panel); }
.insp-rank-btn { padding: 4px 6px; border: none; border-radius: 4px; background: none; color: var(--text-3); font-size: var(--fs-11); line-height: 1; cursor: pointer; }
.insp-rank-btn:hover { background: var(--surface-2); color: var(--text-1); }
/* "Rank →" on an Unsorted card: a real button, not a stray arrow. */
.insp-rank-add {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-11);
  font-weight: 600;
  cursor: pointer;
}
.insp-rank-add:hover { border-color: var(--gold); color: var(--gold-bright); }
.insp-list .insp-card-text { padding-bottom: 2.4rem; }
.inspiration-dropzone { padding: 0.5rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.inspiration-dropzone-hint { padding: 1.25rem 1rem; color: var(--text-3); font-size: var(--fs-13); text-align: center; pointer-events: none; list-style: none; }

/* ---- Reflect: one at a time, full screen ---- */
.insp-reflect {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: auto 1fr;
  align-items: center;
  background: radial-gradient(120% 90% at 50% 20%, #15151b, #07070a 70%);
}
.insp-reflect[hidden] { display: none; }
.insp-reflect-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.insp-reflect-count { color: var(--text-3); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.insp-reflect-tools { display: flex; gap: 6px; }
.insp-reflect-btn, .insp-reflect-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: var(--fs-14);
  cursor: pointer;
}
.insp-reflect-btn:hover, .insp-reflect-nav:hover { border-color: var(--border-strong); color: var(--text-1); }
.insp-reflect-nav { justify-self: center; }
/* Placed in the middle column outright: on a phone the arrows are hidden, which takes them
   out of the grid, and the stage then auto-placed into the first, 0px-wide column — the
   quote set four words to a line in a 150px strip. */
.insp-reflect-stage {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1rem 12vh;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.insp-reflect-stage.is-in { opacity: 1; transform: none; }
.insp-reflect-quote { margin: 0; color: #f4f4f5; font-family: Newsreader, Georgia, serif; font-weight: 400; line-height: 1.3; text-wrap: balance; }
.insp-reflect-quote.is-short { font-size: clamp(32px, 5vw, 56px); }
.insp-reflect-quote.is-medium { font-size: clamp(26px, 3.6vw, 42px); }
.insp-reflect-quote.is-long { font-size: clamp(20px, 2.6vw, 30px); line-height: 1.45; }
.insp-reflect-tags { color: var(--text-3); font-size: var(--fs-14); letter-spacing: 0.02em; }
.insp-reflect-kind { color: #b69cf0; font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.insp-reflect-kind.is-favorite { color: var(--gold-bright); }
.insp-reflect-image { max-width: min(560px, 90vw); max-height: 50vh; border-radius: var(--radius-lg); object-fit: contain; }

/* ---- A phone ---- */
@media (max-width: 819px) {
  .insp-rank-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 640px) {
  .insp-page { padding: 1rem 12px 2.5rem; }
  .insp-grid { columns: 1; }
  .insp-quote.is-short { font-size: 21px; }
  .insp-reflect { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .insp-reflect-nav { display: none; }
}

/* ---- Inspirations: a board read row by row, flags that say what they are ---- */
/* The board as a grid of 2px rows, each card spanning its height (inspiration_columns
   controller, _layoutBoards), so it reads left to right in its own order and stays packed.
   Up to three columns, as before. Without the script it falls back to the CSS columns. */
.insp-grid.is-rowwise {
  display: grid; columns: auto;
  grid-template-columns: repeat(auto-fill, minmax(max(290px, calc((100% - 2rem) / 3)), 1fr));
  grid-auto-rows: 2px; column-gap: 1rem; row-gap: 0;
}
.insp-grid.is-rowwise > .inspiration-card { margin-bottom: 0; }
.insp-grid.is-rowwise > .inspiration-card > :first-child { margin-bottom: 1rem; }

/* The form's flags name themselves: a feather alone didn't say "affirmation". */
.insp-flag { width: auto; gap: 7px; padding: 8px 11px; }
.insp-flag-label { color: var(--text-3); font-size: var(--fs-12); transition: color var(--dur-fast); }
.insp-flag-input:checked + .insp-flag .insp-flag-label { color: var(--text-1); }


/* ---- A pinned card: a faint silver edge along its top ----
   Not gold (the favourite's) and not a label alone: a lit top edge says it's held up. */
.inspiration-card.is-pinned .inspiration-card-body {
  border-top-color: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), inset 0 1px 0 var(--inset-light), 0 1px 2px rgba(0, 0, 0, 0.4);
}
/* The Pinned heading's pin in the same silver, not gold (the favourite's). */
.insp-section-label .fa-thumbtack { color: var(--text-2); }

/* ---- A card's actions in its bottom-right corner, on hover ----
   Where there is hover. They used to sit on a frosted strip across the card's top edge,
   which blurred the quote's first line — on a one-line quote, the whole of it, just as
   you'd moved to it. The foot (author, tags) leaves this corner empty. Each button has
   its own ground, so a long author name running under one still reads. */
@media (hover: hover) {
  .inspiration-card .card-actions {
    top: auto; left: auto; right: 0.6rem; bottom: 0.6rem; justify-content: flex-end; gap: 0.2rem;
    z-index: 2;
    transform: translateY(3px);
    transition: opacity var(--dur-base), transform var(--dur-base);
  }
  .inspiration-card:hover .card-actions, .inspiration-card:focus-within .card-actions { transform: none; }
  .inspiration-card .card-actions .card-action-btn { width: 26px; height: 26px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
  .inspiration-card .card-actions .card-action-btn:not(:hover) { background: color-mix(in srgb, var(--surface-card, #111114) 88%, transparent); }
}

/* ---- The form's image, picked and not yet saved: a thumbnail with an × ---- */
.insp-form-preview { position: relative; align-self: flex-start; margin-bottom: 8px; }
.insp-form-preview[hidden], .insp-form-image[hidden] { display: none; }
.insp-form-preview img { display: block; max-width: 220px; max-height: 150px; border: 1px solid var(--border); border-radius: var(--radius-md); object-fit: cover; }
.insp-form-preview-remove {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0;
  border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: var(--fs-12); cursor: pointer;
}
.insp-form-preview-remove:hover { background: rgba(0, 0, 0, 0.9); }

/* ---- Reflect: a quote's picture filling the screen behind its words, dimmed ---- */
.insp-reflect-backdrop {
  position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none;
  background-size: cover; background-position: center;
  transition: opacity 0.5s ease;
}
.insp-reflect-backdrop.is-on { opacity: 1; }
.insp-reflect-backdrop::after { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 80% at 50% 45%, rgba(6, 6, 9, 0.62), rgba(6, 6, 9, 0.9)); }
.insp-reflect > :not(.insp-reflect-backdrop) { position: relative; z-index: 1; }
.insp-reflect.has-backdrop .insp-reflect-quote { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7); }
.insp-reflect.has-backdrop .insp-reflect-author { color: rgba(255, 255, 255, 0.72); }

/* ---- A phone: the day's line first, the pinned in a sideways row ---- */
.insp-phone-lead { display: none; }
@media (max-width: 640px) {
  .insp-phone-lead { display: block; margin-bottom: 1rem; }
  .insp-phone-lead .insp-iotd-row { max-width: none; margin-bottom: 1rem; }
  .insp-phone-lead .insp-section-label { margin: 0 0 8px; }
  .insp-pinned-strip {
    display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 10px;
    margin: 0 -12px; padding: 0 12px 4px; list-style: none; scroll-padding-inline: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .insp-pinned-strip::-webkit-scrollbar { display: none; }
  .insp-pinned-strip > .inspiration-card { margin: 0; scroll-snap-align: start; }
  .insp-pinned-strip > .inspiration-card .inspiration-card-body { height: 100%; }
  /* The board below doesn't repeat them. */
  .insp-phone-lead ~ #left-inspirations > .is-iotd,
  .insp-phone-lead:has(.insp-pinned-strip) ~ #left-inspirations > .is-pinned { display: none; }
}

/* The day's inspiration: Save as a quiet text button and Saved with a green tick, the
   galleries' pair, rather than a filled pill. */
.iotd-save-btn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; color: var(--text-2); font-size: var(--fs-12); font-weight: 500; }
.iotd-save-btn:hover { background: var(--surface-2); color: var(--text-1); }
.insp-saved { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); letter-spacing: 0; font-weight: 500; }
.insp-saved i { color: var(--accent); }
/* The board's columns fill evenly rather than leaving a tall gap under the first. */
.insp-grid { column-fill: balance; }
.insp-grid > li { break-inside: avoid; }

/* Nothing saved yet: the day's line is the board's only card, so it takes the full width
   under the welcome rather than a third of a row. */
.insp-grid.is-lone-iotd { columns: 1; }
.insp-grid.is-lone-iotd > .inspiration-card { width: 100%; }
.empty-panel ~ .insp-iotd-row { max-width: none; }
.empty-panel ~ .insp-iotd-row > .inspiration-card { width: 100%; }
.insp-grid.is-lone-iotd.is-rowwise { grid-template-columns: minmax(0, 1fr); }
