/* CML local review layer. It does not alter the proposal content or its original H1 scale. */
#cml-review-root,
#cml-review-root * {
  box-sizing: border-box;
}

#cml-review-root {
  --cml-review-navy: #001430;
  --cml-review-teal: #0cb8b6;
  --cml-review-deep-teal: #007775;
  --cml-review-ink: #163044;
  --cml-review-muted: #526571;
  --cml-review-line: #dbe6e6;
  --cml-review-wash: #eff8f7;
  --cml-review-white: #fff;
  --cml-review-warn: #8a5b00;
  color: var(--cml-review-ink);
  font: 400 16px/1.6 Lato, Arial, sans-serif;
}

#cml-review-root button,
#cml-review-root input,
#cml-review-root select,
#cml-review-root textarea {
  font: inherit;
}

#cml-review-root button,
#cml-review-root input,
#cml-review-root select,
#cml-review-root textarea {
  outline-offset: 3px;
}

#cml-review-root button:focus-visible,
#cml-review-root input:focus-visible,
#cml-review-root select:focus-visible,
#cml-review-root textarea:focus-visible {
  outline: 3px solid var(--cml-review-teal);
  outline-offset: 3px;
}

.cml-review-toolbar {
  position: fixed;
  z-index: 80;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px max(16px, calc((100vw - 1200px) / 2));
  color: #fff;
  background: var(--cml-review-navy);
  border-top: 3px solid var(--cml-review-teal);
  box-shadow: 0 -8px 28px rgba(0, 20, 48, .16);
}

.cml-review-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
}

.cml-review-toolbar-title {
  margin-right: auto;
  color: #d9eeee;
  font: 700 13px/1.3 Roboto, Arial, sans-serif;
  white-space: nowrap;
}

.cml-review-button,
.cml-review-small-button,
.cml-review-icon-button,
.cml-review-reopen,
.cml-review-menu-button {
  min-height: 40px;
  border: 1px solid #6f959b;
  border-radius: 5px;
  padding: 8px 12px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
}

.cml-review-button:hover,
.cml-review-small-button:hover,
.cml-review-icon-button:hover,
.cml-review-menu-button:hover,
.cml-review-reopen:hover {
  border-color: var(--cml-review-teal);
  background: #12304b;
}

.cml-review-button.cml-review-primary {
  border-color: var(--cml-review-teal);
  background: var(--cml-review-deep-teal);
}

.cml-review-button.cml-review-primary:hover {
  background: #005e5d;
}

.cml-review-button.cml-review-secondary {
  color: var(--cml-review-navy);
  border-color: var(--cml-review-line);
  background: #fff;
}

.cml-review-button.cml-review-close {
  color: #d9eeee;
}

.cml-review-status,
.cml-review-notice,
.cml-review-selection-bar {
  max-width: 1200px;
  margin: 4px auto 0;
}

.cml-review-notice,
.cml-review-status {
  color: #c7dddd;
  font-size: 13px;
  line-height: 1.35;
}

.cml-review-notice {
  margin-top: 8px;
}

.cml-review-status {
  min-height: 1.35em;
}

.cml-review-status-error {
  color: #ffd89b;
}

.cml-review-status-success {
  color: #91eee3;
}

.cml-review-selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  color: #e6ffff;
  font-size: 13px;
}

.cml-review-selection-hint {
  flex: 1 1 auto;
}

.cml-review-page-note {
  flex: 0 0 auto;
}

.cml-review-export-menu {
  position: absolute;
  right: max(16px, calc((100vw - 1200px) / 2));
  bottom: calc(100% - 4px);
  display: flex;
  min-width: 170px;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--cml-review-line);
  border-radius: 7px 7px 0 0;
  background: var(--cml-review-navy);
  box-shadow: 0 -8px 20px rgba(0, 20, 48, .2);
}

.cml-review-menu-button {
  width: 100%;
  text-align: left;
}

.cml-review-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cml-review-reopen {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  border-color: var(--cml-review-teal);
  background: var(--cml-review-navy);
  box-shadow: 0 5px 20px rgba(0, 20, 48, .22);
}

.cml-review-panel {
  position: fixed;
  z-index: 75;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(430px, 100vw);
  flex-direction: column;
  overflow: hidden;
  padding: 22px;
  border-left: 1px solid var(--cml-review-line);
  color: var(--cml-review-ink);
  background: #fff;
  box-shadow: -12px 0 36px rgba(0, 20, 48, .18);
}

.cml-review-panel[hidden],
.cml-review-toolbar[hidden],
.cml-review-editor-overlay[hidden],
.cml-review-selection-bar[hidden],
.cml-review-reopen[hidden],
.cml-review-author-other[hidden] {
  display: none;
}

.cml-review-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.cml-review-panel h2,
.cml-review-editor h2 {
  margin: 0;
  color: var(--cml-review-navy);
  font: 700 25px/1.2 Roboto, Arial, sans-serif;
}

.cml-review-icon-button {
  min-height: 36px;
  padding: 7px 10px;
  color: var(--cml-review-navy);
  border-color: var(--cml-review-line);
  background: #fff;
}

.cml-review-panel-notice,
.cml-review-help,
.cml-review-reference,
.cml-review-note-meta,
.cml-review-note-route {
  color: var(--cml-review-muted);
  font-size: 13px;
  line-height: 1.45;
}

.cml-review-panel-notice {
  margin: 0 0 16px;
  padding: 12px;
  border-left: 3px solid var(--cml-review-teal);
  background: var(--cml-review-wash);
}

.cml-review-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 15px;
}

.cml-review-filter,
.cml-review-input,
.cml-review-textarea {
  width: 100%;
  border: 1px solid #b5c8ca;
  border-radius: 5px;
  padding: 9px 10px;
  color: var(--cml-review-ink);
  background: #fff;
}

.cml-review-list {
  flex: 1 1 auto;
  overflow: auto;
  margin: 0;
  padding: 0 5px 16px 22px;
}

.cml-review-note-card {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--cml-review-line);
  border-left: 3px solid var(--cml-review-teal);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.cml-review-note-card:hover,
.cml-review-note-card.is-highlighted {
  background: var(--cml-review-wash);
  border-color: var(--cml-review-teal);
}

.cml-review-note-title {
  margin: 0 0 6px;
  color: var(--cml-review-navy);
  font: 700 16px/1.3 Roboto, Arial, sans-serif;
}

.cml-review-note-meta,
.cml-review-note-route {
  margin: 0 0 8px;
}

.cml-review-note-body {
  margin: 0 0 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cml-review-missing {
  margin: 9px 0 4px;
  color: var(--cml-review-warn);
  font-size: 13px;
  font-weight: 700;
}

.cml-review-empty {
  padding: 18px 6px;
  color: var(--cml-review-muted);
  font-size: 13px;
}

.cml-review-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cml-review-small-button {
  min-height: 34px;
  padding: 6px 8px;
  color: var(--cml-review-navy);
  border-color: var(--cml-review-line);
  background: #fff;
  font-size: 12px;
}

.cml-review-small-button.cml-review-danger {
  color: #8b2a25;
}

.cml-review-panel > .cml-review-help {
  flex: 0 0 auto;
  margin: 8px 0 0;
}

.cml-review-editor-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: rgba(0, 20, 48, .68);
}

.cml-review-editor {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border-top: 4px solid var(--cml-review-teal);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 15px 50px rgba(0, 20, 48, .3);
}

.cml-review-reference {
  margin: 10px 0 22px;
  overflow-wrap: anywhere;
}

.cml-review-field {
  margin-bottom: 17px;
}

.cml-review-field > label {
  display: block;
  margin-bottom: 7px;
  color: var(--cml-review-navy);
  font-size: 13px;
  font-weight: 700;
}

.cml-review-field .cml-review-help {
  margin: 6px 0 0;
}

.cml-review-textarea {
  min-height: 145px;
  resize: vertical;
}

.cml-review-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.cml-review-marker-layer {
  position: fixed;
  z-index: 70;
  inset: 0;
  pointer-events: none;
}

.cml-review-marker-box {
  position: fixed;
  min-width: 18px;
  min-height: 18px;
  border: 2px solid rgba(12, 184, 182, .82);
  border-radius: 4px;
  pointer-events: none;
  transition: border-color .15s, box-shadow .15s;
}

.cml-review-marker-box.is-resolved {
  border-color: rgba(82, 101, 113, .72);
}

.cml-review-marker-box.is-missing {
  border-style: dashed;
  border-color: #c88c23;
}

.cml-review-marker-box.is-highlighted {
  border-color: #f2ae2c;
  box-shadow: 0 0 0 4px rgba(242, 174, 44, .25);
}

.cml-review-marker {
  position: absolute;
  top: -12px;
  right: -12px;
  min-width: 25px;
  min-height: 25px;
  padding: 3px 6px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--cml-review-deep-teal);
  box-shadow: 0 2px 7px rgba(0, 20, 48, .28);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
}

.cml-review-marker.is-resolved {
  color: #fff;
  background: var(--cml-review-muted);
}

body.cml-review-active .mobile-actions {
  bottom: 76px;
}

@media (max-width: 760px) {
  .cml-review-toolbar {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  }

  .cml-review-toolbar-inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .cml-review-toolbar-title {
    display: none;
  }

  .cml-review-button {
    min-height: 44px;
    padding: 7px 5px;
    font-size: 12px;
  }

  .cml-review-notice,
  .cml-review-status {
    font-size: 12px;
  }

  .cml-review-selection-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .cml-review-page-note {
    width: 100%;
  }

  .cml-review-export-menu {
    right: 12px;
    bottom: calc(100% - 2px);
  }

  .cml-review-panel {
    top: 0;
    width: 100vw;
    padding: 18px;
  }

  .cml-review-editor-overlay {
    align-items: start;
    padding: 12px;
  }

  .cml-review-editor {
    max-height: calc(100vh - 24px);
    padding: 22px 18px;
  }

  .cml-review-editor-actions {
    flex-direction: column-reverse;
  }

  .cml-review-editor-actions .cml-review-button {
    width: 100%;
  }

  body.cml-review-active .mobile-actions {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cml-review-marker-box {
    transition: none;
  }
}

@media print {
  #cml-review-root,
  .cml-review-marker-layer {
    display: none !important;
  }

  body.cml-review-active .mobile-actions {
    bottom: 0;
  }
}
