/* Page Optimizer. Every class here starts with opt- so it never collides with the shared stylesheets. */
.opt-skipbox { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.opt-skipbox > div:first-child { flex: 1 1 320px; min-width: 0; }
.opt-skipbox p { margin: 2px 0 0; }
.opt-check { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.opt-check input { width: 18px; height: 18px; }
.opt-check em { font-style: normal; color: var(--muted); }

.opt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-top: 6px; }
.opt-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.opt-tile:hover { border-color: var(--accent); }
.opt-tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt-tile b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.opt-tile span { color: var(--muted); font-size: .82rem; }

.opt-toggle { all: unset; cursor: pointer; display: block; width: 100%; border-radius: 6px; }
.opt-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.opt-toggle .opt-caret { display: inline-block; transition: transform .15s; color: var(--muted); font-size: .75em; margin-right: 6px; }
.opt-toggle[aria-expanded="true"] .opt-caret { transform: rotate(90deg); }
.opt-url { font-family: var(--mono); font-size: .84rem; word-break: break-all; }
.opt-skipped { margin-left: 6px; font-size: .7rem; padding: 1px 8px; border-radius: 99px; background: var(--unk-bg); color: var(--unk-fg); font-weight: 700; white-space: nowrap; }

.opt-up { color: var(--cov-fg); font-weight: 650; }
.opt-down { color: var(--can-fg); font-weight: 650; }
.opt-flat { color: var(--muted); }
.opt-sub { display: block; color: var(--muted); font-size: .76rem; font-weight: 400; }
.opt-t-dropping { color: var(--can-fg); background: var(--can-bg); }
.opt-t-lost { color: var(--can-fg); background: var(--can-bg); }
.opt-t-improving { color: var(--cov-fg); background: var(--cov-bg); }
.opt-t-new { color: var(--gen-fg); background: var(--gen-bg); }
.opt-t-steady { color: var(--unk-fg); background: var(--unk-bg); }

/* Detail panel */
.opt-detail { display: grid; gap: 20px; min-width: 0; }
.opt-detail > * { min-width: 0; }
.opt-detail h4 { margin: 0 0 6px; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.opt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; }
.opt-head a { word-break: break-all; font-weight: 650; }
.opt-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 900px) { .opt-two { grid-template-columns: minmax(0, 1fr); } }
.opt-scroll { overflow-x: auto; max-width: 100%; }
.opt-scroll .mini td, .opt-scroll .mini th { white-space: nowrap; }
.opt-scroll .mini td.opt-q { white-space: normal; min-width: 150px; word-break: break-word; }
.opt-note { color: var(--muted); font-size: .86rem; margin: 0 0 8px; }
.opt-suggest { display: grid; gap: 10px; }
.opt-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.opt-line p { margin: 0; word-break: break-word; }
.opt-line .opt-len { display: block; font-size: .76rem; color: var(--muted); margin-top: 2px; }
.opt-line .opt-len.long { color: var(--can-fg); font-weight: 650; }
.opt-outline { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.opt-outline li { word-break: break-word; }
.opt-outline small { display: block; color: var(--muted); }
.opt-compare { width: 100%; border-collapse: collapse; font-size: .88rem; }
.opt-compare th, .opt-compare td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); word-break: break-word; }
.opt-compare th { color: var(--muted); font-weight: 600; width: 96px; }
.opt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-loading { color: var(--muted); padding: 8px 0; }

@media (max-width: 640px) {
  .opt-line { grid-template-columns: minmax(0, 1fr); }
  .opt-line .btn { justify-self: start; }
  .opt-actions .btn { flex: 1; }
  .opt-compare th { width: 70px; }
}

/* v0.68.0: dates like the dashboard, plain numbers, keyword roles, AI writing */
.pp { display: grid; gap: 8px; margin-top: 10px; }
.pp-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.pp-row .field { flex: 0 1 300px; min-width: 0; }
.pp-desc { margin: 0; }
.opt-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.opt-fig { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.opt-fig b { font-size: 1.35rem; }
.opt-fig-l { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.opt-block { display: grid; gap: 8px; }
.opt-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.opt-block-head h4, .opt-block-head h5 { margin: 0; }
.opt-role, .opt-stand { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; border: 1px solid var(--line); background: var(--surface-2); }
.opt-role.r-primary { background: var(--cov-bg); color: var(--cov-fg); border-color: var(--cov-bd); }
.opt-role.r-secondary { background: var(--gen-bg); color: var(--gen-fg); border-color: var(--gen-bd); }
.opt-role.r-question { background: var(--mis-bg); color: var(--mis-fg); border-color: var(--mis-bd); }
.opt-stand.s-top3, .opt-stand.s-page1 { background: var(--cov-bg); color: var(--cov-fg); border-color: var(--cov-bd); }
.opt-stand.s-close { background: var(--gap-bg); color: var(--gap-fg); border-color: var(--gap-bd); }
.opt-other > summary, .opt-allq > summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 36px; display: inline-flex; align-items: center; }
.opt-ai { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.opt-written { display: grid; gap: 14px; }
.opt-written h5 { margin: 0; font-size: .95rem; }
.opt-choices { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.opt-choices li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.opt-choices li { display: list-item; }
.opt-choices li > div { display: inline-grid; gap: 2px; width: calc(100% - 90px); vertical-align: top; }
.opt-choices li > .btn { float: right; }
.opt-choices p { margin: 0; }
.opt-choices-one { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .opt-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt-choices li > div { width: 100%; }
  .opt-choices li > .btn { float: none; margin-top: 4px; }
}
