/* Since then / 那之後 (decisions.md 2026-10-13). Dark: entry_notes.
   Loaded only when the flag is on (templates/sidebar.html). Pens come in as
   --st-pen from since_then_web.js (five pens by age, light/dark). */

/* Noted line: a soft underline in its newest note's pen, no fill. */
:is(#journalEntryContent, .st-cited-text) span.st-line {
  text-decoration-line: underline;
  text-decoration-color: var(--st-pen, #A8A29C);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  text-decoration-skip-ink: auto;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}
:is(#journalEntryContent, .st-cited-text) span.st-line:focus-visible { outline: 2px solid rgba(139, 92, 246, 0.45); outline-offset: 2px; }
:is(#journalEntryContent, .st-cited-text) span.st-line--active { background: rgba(139, 92, 246, 0.14); }
:is(#journalEntryContent, .st-cited-text) span.st-line--pending { text-decoration-line: none; cursor: text; }
:is(#journalEntryContent, .st-cited-text) span.st-line--flash { background: rgba(139, 92, 246, 0.2); }
:is(#journalEntryContent, .st-cited-text).st-as-written span.st-line {
  text-decoration-line: none;
  cursor: text;
  background: none;
}

/* The window grows to hold the panel; the text column stays where it was. */
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on).st-docked {
  max-width: 1120px !important;
  width: 1120px;
}
@media (min-width: 1440px) {
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on).st-docked { max-width: 1220px !important; width: 1220px; }
}
/* 1024-1279: the window takes the room there is (up to 1120). */
@media (max-width: 1279px) {
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on).st-docked { width: calc(100vw - 32px); max-width: 1120px !important; }
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-row {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-row > :is(#historicalResponseContent, #responseContent) {
  flex: 1 1 auto;
  min-width: 0;
}
/* The text column stays the width it is without the panel (>= 1280). */
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on).st-docked #journalEntryContent { max-width: 654px; }

/* Panel (docked >= 1024) */
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel {
  flex: 0 0 340px;
  width: 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.08));
  color: var(--inspiration-modal-text, #2b2722);
  font-family: 'Avenir Next', Avenir, 'Helvetica Neue', sans-serif;
  text-align: left;
  z-index: 3;
}
@media (min-width: 1440px) {
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel { flex-basis: 400px; width: 400px; }
}
/* 1024-1279: a narrower panel, and the text column gives up its cap and
   narrows instead (1024: ~580 px, ~65 characters), so nothing is covered. */
@media (max-width: 1279px) {
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel { flex-basis: clamp(296px, 29vw, 340px); width: clamp(296px, 29vw, 340px); }
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on).st-docked #journalEntryContent { max-width: none; }
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel[hidden] { display: none; }

/* Drawer (< 1024): the same panel over the right of the entry. */
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel.st-panel--drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88%);
  background: var(--inspiration-modal-bg, #FFFDF9);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.14);
  border-radius: 0 0 20px 0;
}

:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px 10px;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-dots { display: inline-flex; gap: 3px; margin-right: 4px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-dot-sm { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-name { font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', serif; font-size: 17px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-count { font-size: 12.5px; color: var(--inspiration-modal-muted-text, #6f6457); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-spacer { flex: 1 1 auto; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-aswritten,
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-close {
  font: inherit;
  font-size: 12.5px;
  color: var(--inspiration-modal-text, #2b2722);
  background: transparent;
  border: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.12));
  border-radius: 999px;
  padding: 4px 12px;
  min-height: 32px;
  min-width: 44px;
  cursor: pointer;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-close { padding: 4px 9px; display: none; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel--drawer .st-close { display: inline-block; }

:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 16px 16px;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-group { padding: 10px 0 6px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-group + .st-group { border-top: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.06)); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-quote {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--inspiration-modal-muted-text, #6f6457);
  background: none;
  border: none;
  border-left: 2px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.12));
  padding: 0 0 0 10px;
  margin: 0 0 8px;
  cursor: pointer;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-quote-old {
  display: block;
  font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 14.5px;
  color: var(--inspiration-modal-muted-text, #6f6457);
  margin: 0 0 8px;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-rewritten {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--inspiration-modal-muted-text, #6f6457);
  margin: 18px 0 2px;
  font-weight: 500;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-back {
  font: inherit;
  font-size: 12.5px;
  color: var(--inspiration-modal-muted-text, #6f6457);
  background: none;
  border: none;
  padding: 2px 12px 2px 0;
  min-height: 32px;
  min-width: 44px;
  margin: 0 0 4px;
  cursor: pointer;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-quotecard {
  border-left: 2px solid rgba(201, 161, 92, 0.55);
  padding: 2px 0 2px 12px;
  margin-bottom: 12px;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-youwrote { font-size: 12px; color: var(--inspiration-modal-muted-text, #6f6457); margin-bottom: 4px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-quotetext {
  font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 15.5px;
  line-height: 1.55;
  margin: 0;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-empty { font-size: 13px; color: var(--inspiration-modal-muted-text, #6f6457); margin: 8px 0; }

/* Thread: hairline, an ink dot per note, oldest -> newest. */
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-thread {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  position: relative;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-thread::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--inspiration-modal-border, rgba(0, 0, 0, 0.12));
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-note { position: relative; padding: 2px 0 12px; cursor: default; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-dot {
  position: absolute;
  left: -16px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--st-pen, #A8A29C);
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-meta { font-size: 12px; color: var(--inspiration-modal-muted-text, #6f6457); margin-bottom: 3px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-rel { font-weight: 600; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-text {
  font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 15.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 12;
  overflow: hidden;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-text--open { display: block; -webkit-line-clamp: unset; overflow: visible; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-text--muted { color: var(--inspiration-modal-muted-text, #6f6457); font-size: 13.5px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-more,
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-act {
  font: inherit;
  font-size: 12px;
  color: var(--inspiration-modal-muted-text, #6f6457);
  background: none;
  border: none;
  padding: 2px 0;
  margin-right: 12px;
  cursor: pointer;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-act:hover,
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-more:hover { color: var(--inspiration-modal-text, #2b2722); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-act--danger { color: var(--ln-danger); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel--dark .st-act--danger { color: var(--ln-danger); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-actions { margin-top: 2px; opacity: 0.75; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-note:hover .st-actions,
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-note:focus-within .st-actions { opacity: 1; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-confirm { font-size: 12px; margin-right: 10px; }

:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-foot { padding: 10px 16px 14px; border-top: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.06)); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-add {
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: var(--inspiration-modal-muted-text, #6f6457);
  background: transparent;
  border: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.12));
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-composer {
  border: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.12));
  border-radius: 14px;
  padding: 10px 12px;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-composer-meta { font-size: 12px; font-weight: 600; color: #783026; margin-bottom: 4px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel--dark .st-composer-meta { color: #FCBDB1; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-input {
  width: 100%;
  min-height: 72px;
  max-height: 40vh;
  resize: vertical;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 15.5px;
  line-height: 1.55;
  padding: 0;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-composer-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-counter { font-size: 11.5px; color: var(--inspiration-modal-muted-text, #6f6457); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-counter--over,
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-error { color: var(--ln-danger); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel--dark .st-counter--over,
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-panel--dark .st-error { color: var(--ln-danger); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-error { font-size: 12px; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-save,
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-cancel {
  font: inherit;
  font-size: 13.5px;
  border: none;
  border-radius: 999px;
  padding: 6px 18px;
  min-height: 32px;
  min-width: 80px;
  cursor: pointer;
}
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-save { color: #fff; background: #6B4FAF; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-cancel { color: var(--inspiration-modal-muted-text, #6f6457); background: none; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-cancel:hover { color: var(--inspiration-modal-text, #2b2722); }
:is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-save[disabled] { opacity: 0.45; cursor: default; }

/* Edge tab: the closed panel is a slim vertical bookmark on the window's
   right outside edge ("那之後 · N"), as narrow as its label. Placed by
   since_then_web.js (position: fixed, so the card's clipping can't hide it).
   As written: the same tab, muted. */
.st-edge-tab {
  position: fixed;
  z-index: 4;
  writing-mode: vertical-rl;
  font-family: 'Avenir Next', Avenir, 'Helvetica Neue', sans-serif;
  font-size: 12.5px;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--inspiration-modal-text, #2b2722);
  background: var(--inspiration-modal-bg, #FFFDF9);
  border: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.14));
  /* The stripe: this year's ink (--st-ink, set by since_then_web.js). */
  border-left: 2px solid var(--st-ink, currentColor);
  border-radius: 0 10px 10px 0;
  padding: 12px 6px 12px 6px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
}
.st-edge-tab:hover,
.st-edge-tab:focus-visible { padding-left: 9px; outline: none; }
.st-edge-tab:focus-visible { box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.45); }
.st-edge-tab--muted {
  color: var(--inspiration-modal-muted-text, #8a7a63);
  border-left-color: color-mix(in srgb, var(--st-ink, currentColor) 45%, transparent);
}
.st-edge-tab[hidden] { display: none; }

/* Selection bubble: Note · Copy (the app's dark selection card). */
.st-bubble {
  position: fixed;
  z-index: 10050;
  display: inline-flex;
  align-items: center;
  background: rgba(28, 28, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  padding: 2px;
}
.st-bubble-btn {
  font-family: 'Avenir Next', Avenir, 'Helvetica Neue', sans-serif;
  font-size: 14px;
  color: #fff;
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.st-bubble-btn:hover,
.st-bubble-btn:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.st-bubble-sep { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.2); }

/* Touch screens (drawer on a tablet): every panel control is a 44px target.
   A mouse gets the lighter 32px pills (design audit 2026-10-14). */
@media (pointer: coarse) {
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-close,
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-aswritten,
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-back,
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-save,
  :is(#historicalResponseModalContent, #inspirationResponseModalContent, .ml-reader-on) .st-cancel {
    min-height: 44px;
  }
  /* The tab stays slim; its hit area grows to 44px. */
  .st-edge-tab::after { content: ''; position: absolute; top: -6px; bottom: -6px; left: 0; right: -14px; }
}
