/* Chronicle */
.gm-chronicle { max-width: 600px; margin: 0 auto; }

.ch-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 10px; }
.ch-theme { display: inline-block; padding: 3px 9px; border: 2px solid var(--ink); border-radius: 4px; background: var(--hl);
  font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ch-theme.mix { background: var(--paper); }
.ch-lv { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--quiet); }
.ch-lv-d { display: inline-flex; gap: 3px; }
.ch-lv-d i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--quiet); }
.ch-lv-d i.on { background: var(--ink); border-color: var(--ink); }
.ch-lede { margin: 0 0 10px; font-size: 18px; line-height: 1.35; }
.ch-tries { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 16px; min-height: 22px; }
.ch-pips { display: inline-flex; gap: 5px; }
.ch-pips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.ch-pips i.used { background: var(--ink); }
.ch-left { font-size: 14px; color: var(--quiet); }
.ch-left:empty { display: none; }
.ch-hist { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; gap: 10px; }
.ch-hist li { display: flex; gap: 2px; }
.ch-hist i { width: 12px; height: 12px; border: 1.5px solid var(--quiet); border-radius: 2px; background: var(--paper); }
.ch-hist i.ok { background: var(--cite); border-color: var(--cite); }

.ch-board { position: relative; }
.ch-end { margin: 0 0 6px 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--quiet); }
.ch-list + .ch-end { margin: 6px 0 0 2px; }
.ch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.ch-card { position: relative; display: grid; grid-template-columns: 1.4em 40px minmax(0, 1fr) auto; align-items: center; gap: 6px;
  min-height: var(--ch-h, 64px); padding: 8px 8px 8px 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper);
  user-select: none; -webkit-user-select: none; transition: transform .22s var(--ease), box-shadow .15s var(--ease);
  box-sizing: border-box; }
.ch-list.dragging .ch-card { transition: transform .18s var(--ease); }
.ch-card.lift { z-index: 5; transition: none !important; box-shadow: 0 12px 28px rgba(0,0,0,.2); background: var(--wash); cursor: grabbing; }
@media (pointer: fine) { .ch-card:not(.locked):not(.ans) { cursor: grab; } }

.ch-n { font-size: 13px; font-weight: 700; color: var(--quiet); font-variant-numeric: tabular-nums; text-align: center; }
.ch-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.ch-k { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--quiet); }
.ch-t { font-weight: 700; font-size: 16px; line-height: 1.25; color: inherit; overflow-wrap: anywhere; }
.ch-t i { font-style: italic; }
.ch-ico { width: 20px; height: 20px; fill: currentColor; display: block; }

.ch-grip, .ch-mv button { display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--ink);
  cursor: pointer; border-radius: 6px; padding: 0; }
.ch-grip { width: 40px; height: 44px; touch-action: none; cursor: grab; }
.ch-grip:hover, .ch-mv button:hover:not([disabled]) { background: var(--wash); }
.ch-mv { display: flex; flex-direction: column; gap: 2px; }
.ch-mv button { width: 40px; height: 30px; border: 1.5px solid var(--faint); }
.ch-mv button[disabled] { opacity: .25; cursor: default; }
.ch-grip:focus-visible, .ch-mv button:focus-visible, .ch-t:focus-visible { outline: 3px solid var(--cite); outline-offset: 1px; }

.ch-lock { display: inline-flex; justify-content: center; color: #fff; }
.ch-ok { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; padding: 0 6px; }

.ch-card.locked { background: var(--cite); border-color: var(--cite); color: #fff; }
.ch-card.locked .ch-n, .ch-card.locked .ch-k { color: rgba(255,255,255,.8); }

.ch-acts { display: flex; justify-content: center; margin: 22px 0 8px; }
.ch-acts .ch-go { min-width: 200px; }

/* Answer */
.ch-list.done { gap: 26px; }
.ch-card.ans { grid-template-columns: 3.3em minmax(0, 1fr) auto; gap: 8px; padding: 10px 10px 10px 12px; user-select: text; -webkit-user-select: text; }
.ch-yr { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.ch-card.ans .ch-t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ch-card.ans .ch-t:hover { text-decoration-thickness: 2px; }
.ch-card.ans .ch-k { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
.ch-card.ans:not(.locked) .ch-k { color: var(--ink); }
.ch-ok.miss { background: var(--hl); color: var(--ink); border-radius: 3px; padding: 3px 6px; text-transform: none; letter-spacing: 0; font-size: 13px; }
.ch-gap { position: absolute; left: 22px; top: -23px; font-size: 12px; font-weight: 600; color: var(--quiet); padding-left: 14px; line-height: 18px; }
.ch-gap::before { content: ""; position: absolute; left: 0; top: -2px; bottom: -2px; border-left: 2px dotted var(--faint); }
.ch-note { margin: 4px 0 0; font-size: 14px; color: var(--quiet); text-align: center; }
.ch-reveal:empty { display: none; }
.ch-dlg-s { font-size: 15px; color: var(--quiet); }

/* Motion */
.ch-card.shake { animation: ch-shake .4s; }
@keyframes ch-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.ch-card.pop { animation: ch-pop .45s var(--ease); }
@keyframes ch-pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
.ch-card.rise { animation: ch-rise .45s var(--ease) both; }
@keyframes ch-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
  .ch-lede { font-size: 16px; }
  .ch-card { grid-template-columns: 1em 34px minmax(0, 1fr) auto; gap: 4px; padding: 6px 6px 6px 6px; }
  .ch-grip { width: 34px; }
  .ch-t { font-size: 15px; }
  .ch-mv button { width: 38px; height: 32px; }
  .ch-ok { font-size: 11px; padding: 0 2px; }
  .ch-card.ans { grid-template-columns: 2.9em minmax(0, 1fr) auto; gap: 6px; }
  .ch-yr { font-size: 17px; }
  .ch-card.ans .ch-ok { white-space: normal; text-align: right; max-width: 5.5em; }
  .ch-hist { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ch-card, .ch-list.dragging .ch-card { transition: none; }
  .ch-card.shake, .ch-card.pop, .ch-card.rise { animation: none; }
}
