/* The reading log. tool.css comes first. The form and the log sit side by side in the grey panel, and only the
   .rl-print sheet shows on paper. */
.rl { padding-bottom: 128px; }
.rl-panel { display: flex; align-items: flex-start; gap: 24px; padding: 40px 56px; }

/* ---------- The form ---------- */
.rl-form { width: 460px; flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; padding: 28px; border-radius: 24px; background: #FFFFFF; }
.rl-form h2, .rl-wide, .rl-rating, .rl-error { grid-column: 1 / -1; }
.rl-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; border: 0; }
.rl-field label, .rl-field legend { padding: 0; font-size: 15px; line-height: 20px; font-weight: 700; }
.rl-field input, .rl-field textarea { width: 100%; height: 52px; padding: 0 14px; border: 1.5px solid var(--hairline); border-radius: 14px; background: #FFFFFF; font: inherit; font-size: 17px; line-height: 24px; color: var(--ink); }
.rl-field textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.rl-field input::placeholder, .rl-field textarea::placeholder { color: var(--pencil); opacity: 1; }
.rl-field input:focus, .rl-field textarea:focus { border-color: var(--ink); outline: none; }
.rl-field input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.rl-field input[type="number"]::-webkit-inner-spin-button, .rl-field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#title { border-color: var(--ink); font-weight: 600; }
.rl-rating legend { float: left; width: 100%; margin-bottom: 8px; }
.rl-stars { clear: both; display: flex; gap: 2px; }
.rl-star { position: relative; display: flex; padding: 6px; border-radius: 10px; cursor: pointer; }
.rl-star input { position: absolute; opacity: 0; pointer-events: none; }
.rl-star svg { fill: #FFFFFF; transition: fill .12s; }
.rl-stars .on svg { fill: var(--lilac); }
.rl-star:has(input:focus-visible) { outline: 2px solid var(--violet); outline-offset: 0; }
.rl-error { font-size: 15px; line-height: 20px; font-weight: 600; color: #B42318; }
.rl-error[hidden] { display: none; }
.rl-actions { display: flex; gap: 10px; padding-top: 4px; }
.rl-actions .big { flex: 1; }
.rl-actions [hidden] { display: none; }

/* ---------- The log ---------- */
.rl-log { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding: 28px; border-radius: 24px; background: #FFFFFF; box-shadow: 0 1px 0 #0000000A, 0 12px 32px #00000014; }
.rl-log-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.rl-totals { font-size: 15px; line-height: 20px; font-weight: 600; }
.rl-empty { padding: 28px 20px; border: 1.5px dashed var(--hairline); border-radius: 16px; font-size: 16px; line-height: 23px; color: var(--graphite); text-align: center; }
.rl-empty[hidden] { display: none; }
.rl-list { display: flex; flex-direction: column; list-style: none; }
.rl-list:empty { display: none; }
.rl-book { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--hairline); }
.rl-book:first-child { border-top: 0; padding-top: 0; }
.rl-book > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rl-book b { font-size: 18px; line-height: 24px; font-weight: 800; overflow-wrap: anywhere; }
.rl-meta { font-size: 15px; line-height: 21px; color: var(--graphite); }
.rl-now { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 10px; background: var(--lilac-soft); font-size: 13px; line-height: 20px; font-weight: 700; color: var(--ink); }
.rl-stars-text { color: var(--violet); letter-spacing: .05em; }
.rl-note { margin-top: 4px; padding-left: 12px; border-left: 3px solid var(--lilac); font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.rl-row-actions { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rl-link, .rl-row-actions button, .rl-undo button { font-size: 15px; line-height: 20px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rl-row-actions button { color: var(--graphite); }
.rl-undo { font-size: 15px; line-height: 20px; color: var(--graphite); }
.rl-undo[hidden] { display: none; }
.rl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.rl-tools .outline { height: 46px; padding: 0 20px; font-size: 16px; }
.rl-tools .rl-link { margin-left: auto; }
.rl-link:focus-visible, .rl-row-actions button:focus-visible, .rl-undo button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }

.rl-print { display: none; }

@media (max-width: 1100px) {
  .rl-panel { flex-direction: column; align-items: stretch; padding: 32px; }
  .rl-form { width: auto; }
}
@media (max-width: 760px) {
  .tool.rl .panel { margin-top: 24px; border-radius: 28px; background: var(--canvas); }
  .rl-panel { gap: 12px; padding: 12px; }
  .rl-form { gap: 16px 10px; padding: 20px 16px; border-radius: 20px; }
  .rl-log { padding: 20px 16px; border-radius: 20px; }
  .rl-field input, .rl-field textarea { font-size: 16px; }
  .rl-field input[type="date"] { padding: 0 10px; }
  .rl-book { flex-direction: column; gap: 8px; }
  .rl-row-actions { flex-direction: row; align-items: center; gap: 18px; }
  .rl-tools .outline { flex: 1 0 auto; }
  .rl-tools .rl-link { margin-left: 0; }
  .rl { padding-bottom: 88px; }
}

/* ---------- On paper: only the sheet ---------- */
@media print {
  @page { size: auto; margin: 14mm; }
  body > *:not(main), main > *:not(.rl-print) { display: none !important; }
  main.rl { padding: 0; }
  .rl-print { display: block !important; color: #000; }
  .rl-print h2 { margin: 0 0 10px; font-size: 20pt; font-weight: 800; }
  .rl-print table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9.5pt; line-height: 1.3; }
  .rl-print th, .rl-print td { padding: 5px 6px; border: 0.75pt solid #000; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
  .rl-print th { font-weight: 700; background: none; }
  .rl-print th:nth-child(1) { width: 20%; } .rl-print th:nth-child(2) { width: 14%; }
  .rl-print th:nth-child(3), .rl-print th:nth-child(4) { width: 10%; }
  .rl-print th:nth-child(5) { width: 6%; } .rl-print th:nth-child(6) { width: 9%; }
  .rl-print tbody td { height: 26pt; }
  .rl-print tr { break-inside: avoid; }
  .rl-print p { margin-top: 8px; font-size: 8pt; color: #555; }
}
