/* Pokémon Reborn: a reading record of messages, notes and scripts. The shared
   theme owns tokens, type roles, the header, controls and code colors. */
.reborn-main { width: min(58rem, calc(100% - 2 * var(--gutter, 1.5rem))); margin: 0 auto; padding: clamp(1.75rem, 4vw, 3rem) 0 4rem; }
.page-head h1 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
.page-head .lede { margin: .6rem 0 0; }
.task-meta { margin: .5rem 0 0; color: var(--muted); font: var(--text-ui)/1.55 var(--ui, var(--serif)); }
.provenance { max-width: var(--measure); margin: 2.5rem 0 0; color: var(--muted); font: var(--text-ui)/1.55 var(--ui, var(--serif)); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Overview */
.run-facts { margin: 1.75rem 0 0; }
.sections { margin: 1.75rem 0 0; border-top: 1px solid var(--line-strong); }
.sections > li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .2rem 1.5rem; align-items: baseline; }
.sections a { font: 700 1.2rem/1.3 var(--display); }
.sections p { margin: 0; font-size: 1rem; }

/* Reasoning */
.reborn-main > .table-scroll { margin-top: 1.5rem; }
.task-table { width: 100%; }
.task-table th[scope="row"] { font: 600 var(--text-ui)/1.4 var(--ui, var(--serif)); white-space: nowrap; }
.task-table td { font-size: var(--text-ui); }
.day-index { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin: 1.1rem 0 0; font: var(--text-ui)/1.6 var(--ui, var(--serif)); }
.day h2 { margin: 2.4rem 0 .4rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line-strong); font: 700 1.12rem/1.3 var(--display); }
.messages { margin: 0; padding: 0; list-style: none; }
.message { display: grid; grid-template-columns: 5.25rem minmax(0, var(--measure, 43rem)); gap: 0 1.25rem; padding: .65rem 0; scroll-margin-top: 1rem; }
.message-time { padding-top: .2rem; color: var(--muted); font: var(--text-ui)/1.5 var(--mono); text-decoration: none; }
.message-time:hover { color: var(--ink); text-decoration: underline; }
.message:target { background: var(--surface-blue); box-shadow: -.6rem 0 0 var(--surface-blue), .6rem 0 0 var(--surface-blue); }
.message:target .message-time { color: var(--blue-dark); }
.message-text { font: 1.0625rem/1.6 var(--reading); overflow-wrap: anywhere; }
.message-text p, .message-text ul, .message-text ol { margin: 0 0 .55rem; }
.message-text ul, .message-text ol { padding-left: 1.25rem; }
.message-text > :last-child { margin-bottom: 0; }
.message-text code, .note-prose code { font-size: .84em; }
.task-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font: var(--text-ui)/1.5 var(--ui, var(--serif)); }

/* Notes and scripts: one native disclosure per file. */
.listing-tools { margin: 1.6rem 0 0; }
.listing-tools .ui-field--search { flex: 0 1 26rem; }
.listing-count { margin: 0; color: var(--muted); font: var(--text-ui)/1.5 var(--ui, var(--serif)); }
.listing-group > h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2.4rem 0 0; padding-bottom: .45rem; border-bottom: 1px solid var(--line-strong); font: 700 1.12rem/1.3 var(--display); }
.listing-group > h2 a { color: inherit; text-decoration-color: transparent; }
.listing-group > h2 a:hover { text-decoration-color: currentColor; }
.group-date { color: var(--muted); font: 400 var(--text-ui)/1.4 var(--ui, var(--serif)); white-space: nowrap; }
.listings { margin: 0; padding: 0; list-style: none; }
.listings > li { border-bottom: 1px solid var(--line); }
.listing { border-top: 0; scroll-margin-top: 1rem; }
.listing > summary { display: grid; grid-template-columns: 1rem minmax(0, 1fr) auto; gap: .1rem .75rem; align-items: baseline; padding: .6rem 0; color: var(--ink); font-size: var(--text-ui); list-style: none; }
.listing > summary::-webkit-details-marker { display: none; }
.listing > summary::before { content: ""; width: .4rem; height: .4rem; margin-left: .15rem; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: translateY(-.1rem) rotate(-45deg); transition: transform .15s ease; }
.listing[open] > summary::before { transform: translateY(-.2rem) rotate(45deg); }
.listing > summary:hover .listing-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.listing-name { font: 600 .9rem/1.45 var(--mono); overflow-wrap: anywhere; }
.listing-meta { color: var(--muted); font: var(--text-meta)/1.5 var(--ui, var(--serif)); white-space: nowrap; text-align: right; }
.listing-summary { grid-column: 2 / -1; color: var(--muted-strong); font: var(--text-ui)/1.45 var(--ui, var(--serif)); }
.listing-body { padding: .2rem 0 1.25rem 1.75rem; }
.listing-body > .note-body { max-width: var(--measure); }
.listing-fallback, .listing-status { margin: 0 0 .5rem; color: var(--muted); font: var(--text-ui)/1.5 var(--ui, var(--serif)); }

/* Note text keeps the author's line breaks and tables. */
.note-name { font-family: var(--mono); font-size: clamp(1.2rem, 2.6vw, 1.55rem); font-weight: 600; overflow-wrap: anywhere; }
.note-page .note-body { margin-top: 1.75rem; }
/* Every note sits in the same quiet box as a JSON listing: the code-block
   border and surface, with prose type inside. */
.note-prose { box-sizing: border-box; max-width: var(--measure); padding: .8rem 1rem; border: 1px solid var(--line); background: var(--surface); font-size: 1.0625rem; line-height: 1.6; overflow-wrap: anywhere; }
.note-prose > :first-child { margin-top: 0; }
.note-prose > :last-child { margin-bottom: 0; }
.note-prose :is(h2, h3, h4, h5, h6) { margin: 1.6rem 0 .45rem; font-size: 1.1rem; line-height: 1.3; }
.note-prose :is(ul, ol) { padding-left: 1.3rem; }
.note-prose li + li { margin-top: .25rem; }
.note-prose .table-scroll { margin: .8rem 0 1rem; }
.note-prose table { font: var(--text-ui)/1.45 var(--ui, var(--serif)); }
.note-text p { white-space: pre-line; }
.note-body > :is(.ui-code, .note-prose), .note-prose .ui-code { margin: .75rem 0; }
.note-prose .ui-code { background: var(--paper); }

@media (max-width: 42rem) {
  .sections > li { grid-template-columns: 1fr; }
  .message { grid-template-columns: 1fr; padding: .7rem 0; }
  .message-time { padding-top: 0; }
  .listing > summary { grid-template-columns: 1rem minmax(0, 1fr); }
  .listing-meta { grid-column: 2; text-align: left; white-space: normal; }
  .listing-body { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .listing > summary::before { transition: none; } }
@media print {
  .listing-tools, .task-pager, .day-index, .listing-fallback { display: none !important; }
  .message:target { background: none; box-shadow: none; }
}
