/* ArchiveTrace Web (Standalone) — layout adapter on top of plugin-ui.css
   (= plugin main.css) + ligo-ui.css (shared Ligo chooser / profile / auth). */

#app-root { min-height: 100vh; }
.st-view { display: none; }
.st-view:not([hidden]) { display: block; }
.ligo-screen { padding: 0; }
.ligo-panel { margin-top: 10vh; }
.st-auth-switch { display: flex; gap: 8px; margin: 16px 0 4px; }
.st-auth-switch .st-tab { border: 1px solid #2b3244; border-radius: 8px; padding: 8px 14px; background: none; color: #9ba3b4; cursor: pointer; }
.st-auth-switch .st-tab.is-active { color: #fff; background: #4f7cff; border-color: #4f7cff; }
.st-auth-back-btn { display: inline-block; margin-bottom: 12px; background: none; border: none; cursor: pointer; padding: 0; color: #9ba3b4; }
.ligo-brand-mark { width: 25px; height: 25px; object-fit: contain; margin-right: 2px; }

body {
  height: auto;
  min-height: 100vh;
  display: block;
  overflow: auto;
  padding: 0;
}

#view-app.st-view:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

#view-app .workspace { flex: 1; min-height: 0; }
#view-tools.ligo-screen { padding: 24px; min-height: 100vh; }
.ligo-app-switcher-link-active { border-color: rgba(34, 197, 94, 0.7); background: rgba(34, 197, 94, 0.12); cursor: default; }
.ligo-app-switcher-link-locked { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.4); }
.ligo-app-switcher-link-locked:hover { border-color: transparent; background: transparent; }

.app-header .ligo-panel-chrome-actions { margin-left: 0; }
.header-actions { align-items: center; }

#global-status {
    position: fixed;
    z-index: 3000;
    right: 18px;
    bottom: 18px;
    max-width: min(420px, 86vw);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(91, 127, 194, 0.45);
    background: rgba(8, 13, 22, 0.94);
    color: #eef4ff;
    font-size: 13px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}
#global-status.is-error { border-color: #c44; color: #ffd6d6; }

.ligo-panel-chrome-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    transform: none;
    background: transparent;
    border: 1px solid rgba(91, 127, 194, 0.32);
    box-shadow: none;
    font-weight: 500;
}
.ligo-panel-chrome-btn:hover:not(:disabled) { transform: none; background: rgba(255,255,255,0.06); }
.ligo-panel-profile-item {
    min-height: 0;
    padding: 9px 10px;
    border: 0;
    background: transparent;
    transform: none;
    box-shadow: none;
    font-weight: 500;
    text-align: left;
}
.ligo-panel-profile-item:hover:not(:disabled) { transform: none; background: rgba(255,255,255,0.06); }
.ligo-panel-profile-item--danger { color: #ff8f8f; }
.st-tab { transform: none; }
.st-tab:hover:not(:disabled) { transform: none; }
.st-auth-back-btn:hover:not(:disabled) { transform: none; }

.ct-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 12, 0.62);
}
.ct-modal[hidden] { display: none !important; }
.ct-modal-card {
  width: min(460px, calc(100% - 32px));
  padding: 16px 18px 18px;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: #12161c;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.ct-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.ct-modal-header h3 { margin: 0; font-size: 15px; }
.ct-modal-close {
  border: 0;
  background: transparent;
  color: #9ba3b4;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ct-modal-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.ct-modal-options label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #8aa;
}
.ct-modal-options select {
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: #0d1018;
  color: #eef1ff;
}
.ct-modal-actions { display: flex; justify-content: flex-end; }

label.attach-stills-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
  color: #86c99a;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
}
label.attach-stills-label:hover {
  color: #22c55e;
}
#stills-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


#view-app.st-view:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
#view-app .container {
  flex: 1;
  min-height: 0;
  padding: 12px;
}
.tabs-navigation .ligo-panel-chrome-actions {
  margin-left: auto;
  align-self: center;
}
body.app-initializing #view-app .container { opacity: 0; }
body.app-ready #view-app .container { opacity: 1; }
.archive-drop-area.is-busy { opacity: 0.7; pointer-events: none; }

.archive-export-markers-card { width: min(440px, 92vw); }
.archive-export-markers-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 8px;
}
.archive-export-markers-section-header h4 {
  margin: 0;
  font-size: 0.85em;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.archive-export-markers-count {
  font-size: 0.8em;
  color: var(--text-muted);
  background: var(--bg-dark);
  padding: 2px 8px;
  border-radius: 10px;
}
.archive-export-markers-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px;
}
.archive-export-markers-options label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.archive-export-markers-options select {
  background: var(--bg-dark);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13px;
}
.archive-export-markers-options select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Select Database modal — same chrome as ShotTrace */
#select-database-modal.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}
#select-database-modal.modal.is-open { display: flex; }
#select-database-modal .modal-content {
  width: min(520px, 92vw);
  background: var(--bg-card, #151b28);
  border: 1px solid var(--border-medium, #2b3244);
  border-radius: 10px;
  padding: 0;
}
#select-database-modal .modal-header,
#select-database-modal .modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
}
#select-database-modal .modal-header h3 { margin: 0; }
#select-database-modal .modal-body { padding: 0 16px 14px; }
#select-database-modal .modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
}
.save-inline-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.save-project-browser {
  min-height: 140px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border-medium, #2b3244);
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 10px;
}
.save-project-browser .save-project-item,
.save-project-browser .empty-folder-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
}
.save-project-browser .save-project-item:hover { background: var(--bg-light, #1d2433); color: var(--text-primary); }
.save-project-browser .save-project-item.selected { background: rgba(0, 152, 121, 0.18); color: var(--text-primary); }
.save-project-browser .item-name { flex: 1; }
.save-project-browser .item-meta { font-size: 0.78em; color: var(--text-muted); }
.save-new-name-group { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.save-new-name-group input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: var(--bg-dark);
  color: var(--text-primary);
}
.save-selected-project { display: flex; gap: 8px; align-items: center; color: var(--text-secondary); font-size: 0.9em; }

/* Duplicate Conflict modal — same chrome as select-database-modal, stacked above it. */
#duplicate-conflict-modal.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1210;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}
#duplicate-conflict-modal.modal.is-open { display: flex; }
#duplicate-conflict-modal .modal-content {
  width: min(460px, 92vw);
  background: var(--bg-card, #151b28);
  border: 1px solid var(--border-medium, #2b3244);
  border-radius: 10px;
  padding: 0;
}
#duplicate-conflict-modal .modal-header,
#duplicate-conflict-modal .modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
}
#duplicate-conflict-modal .modal-header h3 { margin: 0; color: var(--text-primary); }
#duplicate-conflict-modal .modal-body { padding: 0 16px 14px; }
#duplicate-conflict-modal .modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
}
