/* SiteRev client portal: legibility and small-screen workflow. Loaded last. */
:root { --sr-focus: #075ebd; }

#app-view,
.main-layout,
.preview-area,
.website-frame,
.comments-view,
.news-view,
.files-view { min-width: 0; }

.portal-nav-item {
  min-height: 44px;
  font-size: .83rem;
  line-height: 1.25;
}
.portal-nav-item.active {
  background: #e9f3ff;
  color: #075ebd;
  box-shadow: inset 3px 0 #0a70d8;
}
.portal-nav-label,
.project-progress-kicker { color: #657184; }
.portal-nav-count.subtle { color: #4f5b6a; }

.topbar-action-btn,
.device-btn,
.mode-toggle-btn,
.preview-fullscreen-btn,
.preview-refresh-btn,
.preview-load-actions button,
.preview-load-actions a,
.sidebar-close,
.mobile-sidebar-toggle,
.device-filter-select,
.c-action,
.comments-primary-btn,
.comments-secondary-btn,
.task-action-btn,
.comments-tab,
.news-tab,
.news-primary-btn,
.news-secondary-btn,
.filter-chip,
.chip-btn,
.close-btn,
.btn-submit,
.btn-cancel {
  min-height: 44px;
}
.topbar-action-btn,
.device-btn,
.mode-toggle-btn,
.preview-fullscreen-btn,
.preview-refresh-btn,
.sidebar-close,
.c-action,
.close-btn {
  min-width: 44px;
}
.device-btn,
.mode-toggle-btn { line-height: 1.2; }
.filter-chip,
.comments-tab,
.news-tab { font-size: .78rem; }
.c-card-text,
.task-summary-text,
.news-card p { line-height: 1.55; }
.c-card-meta-row,
.c-card-footer,
.task-summary-footer { color: #586579; }
.c-card.is-done { opacity: 1; }

#login-screen .login-box { width: min(100%, 440px); }
#login-screen .login-header h2 { line-height: 1.2; }
#login-screen .login-form input { min-height: 48px; font-size: 16px; }
#login-screen .btn-forgot-pass { min-height: 44px; padding-inline: 10px; }

.modal-bg .modal-box {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
.modal-bg .field input,
.modal-bg .field select,
.modal-bg .field textarea,
.modal-bg .form-control { min-height: 44px; }
.modal-bg textarea { line-height: 1.5; }
.modal-bg .modal-actions {
  flex-wrap: wrap;
  gap: 9px;
}
.modal-bg .modal-actions > button { flex: 1 1 160px; }

#comment-sync-warning:not(.hidden):not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  width: calc(100% - var(--portal-nav-width));
  margin-left: var(--portal-nav-width);
  padding: 10px 18px;
  color: #5c3b08;
  border-bottom: 1px solid #ebd39a;
  background: #fff5db;
  font-size: 13px;
  line-height: 1.45;
}
#comment-sync-warning button,
#comment-sync-warning a {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border: 1px solid #c99b48;
  border-radius: 7px;
  background: #fff;
  color: #5c3b08;
  font: inherit;
  font-weight: 700;
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--sr-focus);
  outline-offset: 3px;
}

@media (max-width: 1000px) {
  .portal-nav-scroll { padding: 5px 6px; }
  .portal-nav-item {
    min-height: 62px;
    padding: 7px 5px;
    gap: 4px;
    font-size: 12px;
    line-height: 1.2;
  }
  .portal-nav-count {
    top: 4px;
    right: 5px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }
  #comment-sync-warning:not(.hidden):not([hidden]) {
    width: 100%;
    margin-left: 0;
    padding-inline: 12px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    visibility: hidden;
  }
  .main-layout.sidebar-open .sidebar,
  .sidebar.mobile-open {
    visibility: visible;
  }
  .sidebar-close {
    width: 44px;
    height: 44px;
  }
  .mobile-sidebar-toggle {
    min-height: 48px;
    padding: 0 14px;
  }
  .sidebar-filter {
    margin-inline: 10px;
    padding: 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .filter-chip {
    flex: 0 0 auto;
    padding-inline: 12px;
    scroll-snap-align: start;
  }
  .device-filter-select { width: 100%; }
  .comments-page,
  .news-page,
  .files-page { max-width: 100%; }
  .comments-primary-btn,
  .news-primary-btn { width: 100%; }
}

@media (max-width: 600px) {
  .topbar {
    height: auto;
    min-height: 0;
    padding: 7px 8px;
    gap: 7px;
  }
  .topbar-left,
  .topbar-right { min-width: 0; }
  .topbar-center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
  }
  .toolbar-pill-group {
    max-width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    padding: 2px;
  }
  .topbar-center .device-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
  .topbar-center .mode-toggle-btn {
    width: auto;
    min-width: 80px;
    height: 44px;
    padding-inline: 6px;
    font-size: 11px;
  }
  .topbar-center .preview-fullscreen-btn,
  .topbar-center .preview-refresh-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
  .topbar-right .siterev-agency-link:not(.hidden),
  .topbar-right .btn-logout-btn {
    width: 44px;
    height: 44px;
  }
  .portal-nav-section:first-child { gap: 2px; }
  .portal-nav-item { min-height: 60px; font-size: 11px; }
  .project-progress-bar { min-width: 0; }
  .project-steps { min-width: 0; }
  .modal-bg { padding: 8px; }
  .modal-bg .modal-box {
    max-width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }
  .modal-bg .modal-actions > button { flex-basis: 100%; }
}

@media (max-width: 420px) {
  .topbar-center .toolbar-pill-group {
    flex: 0 0 100%;
    width: 100%;
  }
  .topbar-center .preview-fullscreen-btn,
  .topbar-center .preview-refresh-btn { flex-basis: 44px; }
  .topbar-center .preview-refresh-btn { display: inline-flex !important; }
  .portal-nav-item { font-size: 10.5px; }
  .portal-nav-item span {
    overflow-wrap: anywhere;
  }
  #comment-sync-warning:not(.hidden):not([hidden]) { display: grid; }
  #comment-sync-warning button,
  #comment-sync-warning a { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-nav-item,
  .topbar-action-btn,
  .c-card,
  .filter-chip,
  .modal-bg .modal-box { transition-duration: .01ms; }
  .empty-anim,
  .preview-load-status i { animation-duration: .01ms; }
}

/* Retry control for notes that failed to save. */
.files-view .vault-notes-header {
  align-items: center;
  flex-wrap: wrap;
}
#notes-save-status {
  color: #5f6b79;
  line-height: 1.4;
}
#btn-retry-notes-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #c99b48;
  border-radius: 7px;
  background: #fff8e6;
  color: #65400c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
#btn-retry-notes-save.hidden,
#btn-retry-notes-save[hidden] { display: none !important; }

@media (max-width: 420px) {
  /* Put preview tools beside logout so the inspected page keeps more height. */
  body:has(.siterev-agency-link.hidden) .topbar { position: relative; }
  body:has(.siterev-agency-link.hidden) .topbar-center .preview-fullscreen-btn,
  body:has(.siterev-agency-link.hidden) .topbar-center .preview-refresh-btn {
    position: absolute;
    top: 7px;
    height: 44px;
  }
  body:has(.siterev-agency-link.hidden) .topbar-center .preview-fullscreen-btn { right: 104px; }
  body:has(.siterev-agency-link.hidden) .topbar-center .preview-refresh-btn { right: 56px; }
  body:has(.siterev-agency-link.hidden) .topbar-center .toolbar-pill-group {
    flex-basis: 100%;
  }
}

/* Annotation geometry must stay inside the inspected page. */
.select-overlay { overflow: hidden; }
