/* Monthly report page. Builds on the tokens and components in styles.css. */
.topbar-link {
  margin-left: 18px; margin-right: auto; font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; transition: color .15s ease, background .15s ease; white-space: nowrap;
}
.topbar-link:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.topbar-link.active { color: #cfe0ff; background: var(--accent-soft); }

.app.app-wide { max-width: 1360px; }
.mr-shell { grid-template-columns: 250px minmax(0, 1fr); }

/* Passcode */
.mr-gate { max-width: 420px; margin: 56px auto; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.mr-gate h1 { font-size: 22px; }
.mr-gate p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.mr-gate .btn { align-self: flex-start; }
.mr-gate-error { color: #ffb9c2 !important; min-height: 1.2em; margin: 0; }

.mr-card-meta { grid-template-columns: 1fr; }

/* Section list */
.mr-toc { max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.mr-toc a { display: flex; align-items: center; justify-content: space-between; gap: 8px; line-height: 1.3; }
.mr-toc-group {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2);
  padding: 14px 14px 4px;
}
.mr-toc-count { font-size: 11px; color: var(--muted-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mr-toc-count.done { color: var(--green); font-weight: 700; }
.mr-toc-review { margin-top: 12px; border-top: 1px solid var(--border-soft); padding-top: 12px !important; font-weight: 600; }

/* Fill-in text */
.mr-panel { display: flex; flex-direction: column; gap: 16px; }
.mr-panel > .panel-head { margin-bottom: 0; }
.mr-panel > .section-hint { margin: -6px 0 0; }
.mr-subhead { font-size: 13px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border-soft); color: var(--text); letter-spacing: .01em; }
.mr-para { font-size: 14.5px; line-height: 2.05; color: #c7cee0; max-width: 92ch; }
.mr-note { font-size: 12.5px; color: var(--muted); padding: 10px 12px; background: rgba(255,255,255,0.03); border-radius: 10px; line-height: 1.5; }
.mr-hint { font-size: 12px; color: var(--muted-2); line-height: 1.5; margin-top: 4px; }

.mr-blank {
  display: inline-block; width: auto; max-width: 100%; min-width: 6ch; padding: 1px 7px; margin: 0 2px; font-size: 14px; line-height: 1.5;
  background: var(--amber-soft); border: 1px solid rgba(255,180,84,0.45); border-radius: 6px; color: var(--text); vertical-align: baseline;
}
.mr-blank:focus { border-color: var(--accent); background: rgba(91,140,255,0.1); box-shadow: 0 0 0 2px var(--accent-soft); }
.mr-blank.is-auto, .mr-text.is-auto, .mr-extra-input.is-auto { background: var(--accent-soft); border-color: rgba(91,140,255,0.32); }
.mr-blank.is-auto::placeholder, .mr-text.is-auto::placeholder { color: #cfe0ff; opacity: 1; }
.mr-blank.is-empty::placeholder { color: var(--muted-2); font-size: 12px; }
.mr-blank:not(.is-auto):not(.is-empty) { background: rgba(255,255,255,0.07); border-color: var(--border); }
.mr-blank.is-different, .mr-extra-input.is-different { border-color: var(--red) !important; box-shadow: 0 0 0 2px var(--red-soft); }

.mr-extra { max-width: 340px; }
.mr-text { font-size: 14px; line-height: 1.5; }

/* Tables */
.mr-table-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mr-table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mr-table-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--text); }
.mr-grid-tools { display: flex; align-items: center; gap: 8px; }
.mr-count { font-size: 12px; color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }
.mr-scroll { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 10px; -webkit-overflow-scrolling: touch; }
.mr-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mr-ftable { border-collapse: collapse; width: 100%; font-size: 13px; }
.mr-ftable th, .mr-ftable td { padding: 7px 10px; border-bottom: 1px solid var(--border-soft); text-align: left; color: #c7cee0; vertical-align: middle; line-height: 1.6; }
.mr-ftable th { font-size: 11.5px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,0.03); }
.mr-ftable tr:last-child td { border-bottom: none; }
.mr-ftable .mr-blank { font-size: 13px; margin: 1px 0; }
.mr-total { background: rgba(255,255,255,0.025); font-weight: 600; }

.mr-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.mr-grid th {
  position: sticky; top: 0; background: #161d36; color: var(--muted); font-weight: 600; font-size: 11.5px; text-align: left;
  padding: 8px; white-space: nowrap; border-bottom: 1px solid var(--border); z-index: 1;
}
.mr-grid td { padding: 0; border-bottom: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); min-width: 86px; }
.mr-grid td:has(.mr-cell-long) { min-width: 320px; }
.mr-cell { border: none; border-radius: 0; background: transparent; padding: 6px 8px; font-size: 12.5px; min-width: 100%; }
.mr-cell:focus { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(91,140,255,0.08); }
.mr-cell-long { min-height: 44px; line-height: 1.4; resize: vertical; }
.mr-rowcol { width: 34px; min-width: 34px !important; text-align: center; border-right: none !important; }
.mr-row-del { background: none; border: none; color: var(--muted-2); cursor: pointer; font-size: 17px; line-height: 1; width: 28px; height: 28px; border-radius: 6px; }
.mr-row-del:hover, .mr-row-del:focus-visible { color: var(--red); background: var(--red-soft); }

/* Screenshots */
.mr-image { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px; background: rgba(255,255,255,0.02); display: flex; flex-direction: column; gap: 12px; }
.mr-image:focus-visible, .mr-image:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.mr-image.dragging { border-color: var(--accent); background: var(--accent-soft); }
.mr-image.uploading { opacity: .55; }
.mr-image-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mr-image-caption { font-size: 13px; font-weight: 700; }
.mr-image-actions { display: flex; gap: 8px; }
.mr-image-preview { display: block; max-width: 100%; max-height: 420px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.mr-drop {
  border: 1.5px dashed var(--border); border-radius: 10px; padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; cursor: text;
}
kbd { font-family: inherit; font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: rgba(255,255,255,0.06); color: var(--text); }

/* Moving between sections */
.mr-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }

/* Review */
.mr-review-lead { font-size: 15px; font-weight: 600; }
.mr-review-group { font-size: 13px; }
.mr-review-group ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.mr-link { background: none; border: none; padding: 0; color: #a9c3ff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 880px) {
  .mr-shell { grid-template-columns: 1fr; }
  .mr-toc { max-height: none; }
  .mr-toc-group, .mr-toc-count { display: none; }
  .mr-toc-review { margin-top: 0; border-top: none; padding-top: 10px !important; }
  .mr-extra { max-width: none; }
  .mr-para { line-height: 2.2; }
  .topbar-link { margin-left: 4px; padding: 6px 8px; }
  .mr-blank { min-height: 34px; }
  .mr-cell { min-height: 40px; }
}

@media (max-width: 560px) {
  /* The editor's own buttons need the room; the page title already says where you are. */
  body:has(.mr-shell) .topbar-link { display: none; }
}
