/* v9: precise chart anchors, compact markers, and explicit case-edit overlays. */
.vnext-desktop-side {
  grid-template-columns: 132px 58px minmax(28px, auto);
  gap: 0;
}
.vnext-desktop-side .vnext-marker {
  justify-self: start;
  margin-left: 2px;
}
.vnext-desktop-side .line-flags,
.vnext-desktop-side .hidden-note {
  right: auto;
  left: 0;
  width: 132px;
  justify-content: center;
  text-align: center;
}

.vnext-mobile-line {
  grid-template-columns: 28px minmax(0, 1fr) 12px minmax(0, 1fr);
  gap: 3px;
  min-height: 68px;
}
.vnext-mobile-cell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(20px, auto);
  align-items: center;
  gap: 0;
  min-width: 0;
  padding-block: 15px;
}
.vnext-mobile-cell .vnext-mobile-meta { grid-column: 1; }
.vnext-mobile-cell .yao-glyph { grid-column: 2; }
.vnext-mobile-cell .vnext-marker {
  grid-column: 3;
  justify-self: start;
  margin-left: 1px;
}
.vnext-mobile-flags,
.vnext-mobile-hidden {
  position: absolute;
  left: 0;
  width: calc(100% - 53px);
  color: var(--accent);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.vnext-mobile-flags { top: 2px; }
.vnext-mobile-hidden { bottom: 2px; font-weight: 500; }
.vnext-mobile-arrow { align-self: center; }

.title-dialog label {
  display: flex;
  justify-content: space-between;
  margin: 16px 0 7px;
  font-weight: 700;
}
.title-dialog input,
.case-edit-dialog input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.title-dialog form > div { margin-top: 14px; }

.case-edit-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 12px;
}
.case-edit-dialog::backdrop { background: rgb(14 29 32 / .62); }
.case-edit-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 28px); }
.case-edit-dialog header,
.case-edit-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
}
.case-edit-dialog header { border-bottom: 1px solid var(--line); }
.case-edit-dialog footer { border-top: 1px solid var(--line); }
.case-edit-dialog header div { display: grid; }
.case-edit-dialog header span { color: var(--muted); font-size: 12px; }
.case-edit-dialog header button { border: 0; background: transparent; font-size: 22px; }
.case-edit-body { overflow: auto; padding: 15px 16px; }
.case-edit-body .field { display: block; margin-bottom: 13px; }
.case-edit-body .field > span { margin-bottom: 6px; }
.edit-line-stage { margin-top: 4px; }
.case-edit-dialog footer button { min-width: 120px; }
.case-edit-dialog footer .accent { color: var(--on-brand); background: var(--accent); }

.capture-mode .result-toolbar,
.capture-mode .result-actions { display: none !important; }
.capture-mode { margin: 0 !important; }

@media (max-width: 700px) {
  .case-edit-dialog { width: calc(100vw - 18px); max-height: calc(100dvh - 18px); }
  .case-edit-dialog form { max-height: calc(100dvh - 18px); }
  .case-edit-dialog footer button { min-width: 0; flex: 1; }
}
@media (max-width: 390px) {
  .vnext-mobile-line { grid-template-columns: 25px minmax(0, 1fr) 8px minmax(0, 1fr); gap: 2px; }
  .vnext-mobile-cell { grid-template-columns: minmax(0, 1fr) 28px minmax(18px, auto); }
  .vnext-mobile-flags,.vnext-mobile-hidden { width: calc(100% - 47px); }
}
