/* SILTTRACKER screen notes — UI layer (brand: navy #0B1A2B, gold #F2B825, Archivo) */

:root {
  --stn-navy: #0B1A2B;
  --stn-panel: #0F2238;
  --stn-panel-2: #142C47;
  --stn-line: #1E3450;
  --stn-line-2: #2A4664;
  --stn-gold: #F2B825;
  --stn-gold-2: #FFD866;
  --stn-ink: #FFFFFF;
  --stn-muted: #9FB0C2;
  --stn-dim: #6F8299;
  --stn-green: #5FCB92;
  --stn-red: #E0574B;
  --stn-font: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --stn-drawer-w: 440px;
}

/* ---- per-card button -------------------------------------------------- */

.stn-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--stn-line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--stn-muted);
  font: 600 12px/1 var(--stn-font);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.stn-btn:hover { background: rgba(242, 184, 37, 0.12); border-color: var(--stn-gold); color: var(--stn-gold-2); }
.stn-btn:active { transform: translateY(1px); }
.stn-btn .stn-ico { width: 15px; height: 15px; }
/* Card headers are only 390px wide; keep the button compact so titles don't wrap. */
.stn-btn .stn-btn-label { display: none; }
.stn-btn:not(.stn-has-open):not(.stn-all-resolved) .stn-count { display: none; }
.stn-btn.stn-has-open { background: var(--stn-gold); border-color: var(--stn-gold); color: #12161A; }
.stn-btn.stn-has-open:hover { background: var(--stn-gold-2); }
.stn-btn.stn-all-resolved { border-color: rgba(95, 203, 146, 0.5); color: var(--stn-green); }
.stn-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: rgba(0, 0, 0, 0.25); font: 700 11px/1 var(--stn-font);
}
.stn-has-open .stn-count { background: rgba(0, 0, 0, 0.18); }
.stn-all-resolved .stn-count { background: rgba(95, 203, 146, 0.15); }

.stn-card { border-radius: 8px; transition: box-shadow 0.25s; }
.stn-card-open { box-shadow: 0 0 0 3px rgba(242, 184, 37, 0.55); }
.stn-flash { animation: stn-flash 1.6s ease-out; }
@keyframes stn-flash {
  0%   { box-shadow: 0 0 0 6px rgba(242, 184, 37, 0.9); }
  100% { box-shadow: 0 0 0 3px rgba(242, 184, 37, 0); }
}
.stn-card-open.stn-flash { animation: none; }

/* ---- floating toolbar -------------------------------------------------- */

.stn-toolbar {
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
  display: flex; gap: 8px; padding: 8px;
  background: rgba(11, 26, 43, 0.92); backdrop-filter: blur(8px);
  border: 1px solid var(--stn-line-2); border-radius: 12px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  font-family: var(--stn-font);
  transition: right 0.25s ease;
}
body.stn-drawer-visible .stn-toolbar { right: calc(var(--stn-drawer-w) + 20px); }
.stn-tb-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--stn-ink); font: 600 13px/1 var(--stn-font); cursor: pointer; text-decoration: none;
}
.stn-tb-btn:hover { background: var(--stn-panel-2); border-color: var(--stn-line-2); color: var(--stn-gold-2); }
.stn-tb-btn .stn-ico { width: 17px; height: 17px; }
.stn-tb-icon { padding: 0 9px; }
.stn-tb-count {
  font: 600 11px/1 var(--stn-font); color: var(--stn-navy); background: var(--stn-gold);
  padding: 4px 7px; border-radius: 999px; letter-spacing: 0.02em;
}
.stn-tb-count:empty { display: none; }

/* ---- drawer ------------------------------------------------------------ */

.stn-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2147483001;
  width: var(--stn-drawer-w); max-width: 100vw;
  display: flex; flex-direction: column;
  background: var(--stn-panel); color: var(--stn-ink);
  border-left: 1px solid var(--stn-line-2);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.8);
  font-family: var(--stn-font);
  transform: translateX(100%); transition: transform 0.25s ease;
}
.stn-drawer.stn-open { transform: translateX(0); }

.stn-drawer-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--stn-line); flex: none; }
.stn-drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px; scrollbar-width: thin; scrollbar-color: var(--stn-line-2) transparent; }
.stn-drawer-foot { flex: none; border-top: 1px solid var(--stn-line); padding: 14px 20px 18px; background: var(--stn-navy); }
.stn-drawer-foot:empty { display: none; }

.stn-head-row { display: flex; align-items: center; gap: 8px; }
.stn-badge {
  font: 700 11px/1 var(--stn-font); letter-spacing: 0.06em; color: var(--stn-gold);
  background: rgba(255, 194, 26, 0.12); padding: 5px 8px; border-radius: 4px; white-space: nowrap;
}
.stn-badge-neutral { color: var(--stn-muted); background: rgba(159, 176, 194, 0.12); }
.stn-tag {
  font: 600 10px/1 var(--stn-font); letter-spacing: 0.06em; color: var(--stn-muted);
  border: 1px solid var(--stn-line-2); padding: 4px 7px; border-radius: 4px; text-transform: uppercase; white-space: nowrap;
}
.stn-x {
  margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--stn-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.stn-x:hover { background: var(--stn-panel-2); color: var(--stn-ink); border-color: var(--stn-line-2); }
.stn-x .stn-ico { width: 18px; height: 18px; }
.stn-title { margin: 12px 0 2px; font: 700 20px/1.2 var(--stn-font); letter-spacing: -0.01em; }
.stn-section { font: 500 12px/1.4 var(--stn-font); color: var(--stn-muted); }
.stn-head-actions { display: flex; gap: 14px; margin-top: 10px; }

.stn-filters { display: flex; gap: 6px; margin-top: 14px; }
.stn-chip {
  border: 1px solid var(--stn-line-2); background: transparent; color: var(--stn-muted);
  font: 600 12px/1 var(--stn-font); padding: 7px 10px; border-radius: 999px; cursor: pointer;
}
.stn-chip b { color: var(--stn-ink); font-weight: 700; margin-left: 2px; }
.stn-chip:hover { border-color: var(--stn-gold); color: var(--stn-gold-2); }
.stn-chip-on { background: var(--stn-gold); border-color: var(--stn-gold); color: #12161A; }
.stn-chip-on b { color: #12161A; }

/* notes list */
.stn-list { display: flex; flex-direction: column; gap: 10px; }
.stn-note {
  background: var(--stn-navy); border: 1px solid var(--stn-line); border-radius: 10px; padding: 12px 14px;
  transition: border-color 0.2s;
}
.stn-note:hover { border-color: var(--stn-line-2); }
.stn-note.stn-flash { animation: stn-note-flash 1.6s ease-out; }
@keyframes stn-note-flash { 0% { border-color: var(--stn-gold); box-shadow: 0 0 0 3px rgba(242,184,37,.5); } 100% { box-shadow: none; } }
.stn-note-resolved { opacity: 0.72; }
.stn-note-resolved .stn-note-text { color: var(--stn-muted); }
.stn-note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.stn-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--stn-gold); color: #12161A;
  display: inline-flex; align-items: center; justify-content: center; font: 700 11px/1 var(--stn-font); flex: none;
}
.stn-avatar-sm { width: 22px; height: 22px; font-size: 10px; }
.stn-author { font: 700 13px/1 var(--stn-font); }
.stn-time { font: 500 12px/1 var(--stn-font); color: var(--stn-dim); }
.stn-status { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font: 600 11px/1 var(--stn-font); color: var(--stn-green); }
.stn-status .stn-ico { width: 13px; height: 13px; }
.stn-note-text { font: 500 14px/1.55 var(--stn-font); color: var(--stn-ink); word-wrap: break-word; overflow-wrap: anywhere; }
.stn-note-actions { display: flex; gap: 14px; margin-top: 10px; align-items: center; }

.stn-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none;
  font: 600 12px/1 var(--stn-font); color: var(--stn-muted); cursor: pointer;
}
.stn-link .stn-ico { width: 14px; height: 14px; }
.stn-link:hover { color: var(--stn-gold-2); }
.stn-link-ok:hover { color: var(--stn-green); }
.stn-link-danger:hover { color: var(--stn-red); }

/* composer */
.stn-composer { display: flex; flex-direction: column; gap: 10px; }
.stn-ta, .stn-input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--stn-line-2); border-radius: 10px;
  background: var(--stn-panel); color: var(--stn-ink); font: 500 14px/1.5 var(--stn-font);
  padding: 10px 12px; outline: none; resize: vertical;
}
.stn-ta::placeholder, .stn-input::placeholder { color: var(--stn-dim); }
.stn-ta:focus, .stn-input:focus { border-color: var(--stn-gold); box-shadow: 0 0 0 3px rgba(242, 184, 37, 0.18); }
.stn-composer-row { display: flex; gap: 10px; }
.stn-composer-row .stn-input { flex: 1; height: 40px; padding: 0 12px; }
.stn-btn-primary {
  height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--stn-gold); color: #12161A;
  font: 700 13px/1 var(--stn-font); cursor: pointer; white-space: nowrap;
}
.stn-btn-primary:hover { background: var(--stn-gold-2); }
.stn-btn-primary:disabled { opacity: 0.6; cursor: default; }
.stn-note-editing .stn-btn-primary { height: 34px; }

/* all-notes view */
.stn-group { margin-bottom: 16px; }
.stn-group-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  background: var(--stn-panel-2); border: 1px solid var(--stn-line);
}
.stn-group-head:hover { border-color: var(--stn-gold); }
.stn-group-title { font: 700 13px/1.2 var(--stn-font); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stn-group-n { font: 700 11px/1 var(--stn-font); color: var(--stn-muted); }
.stn-mini {
  display: flex; gap: 10px; padding: 10px 10px; margin-top: 4px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent;
}
.stn-mini:hover { background: var(--stn-navy); border-color: var(--stn-line); }
.stn-mini-body { min-width: 0; flex: 1; }
.stn-mini-meta { font: 500 11px/1.3 var(--stn-font); color: var(--stn-dim); margin-bottom: 3px; }
.stn-mini-meta b { color: var(--stn-muted); font-weight: 700; }
.stn-status-inline { color: var(--stn-green); }
.stn-mini-text { font: 500 13px/1.4 var(--stn-font); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* misc */
.stn-empty { text-align: center; padding: 40px 10px; color: var(--stn-muted); }
.stn-empty .stn-ico { width: 34px; height: 34px; color: var(--stn-line-2); }
.stn-empty p { margin: 10px 0 0; font: 600 14px/1.4 var(--stn-font); color: var(--stn-ink); }
.stn-empty p.stn-muted { font-weight: 500; color: var(--stn-muted); }
.stn-empty-sm { padding: 18px 10px; }
.stn-empty-sm p { font-weight: 500; }
.stn-muted { color: var(--stn-muted); }

.stn-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); z-index: 2147483002;
  background: var(--stn-ink); color: var(--stn-navy); padding: 10px 16px; border-radius: 999px;
  font: 600 13px/1 var(--stn-font); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.stn-toast.stn-show { opacity: 1; transform: translate(-50%, 0); }
.stn-toast-error { background: var(--stn-red); color: #fff; }

@media (max-width: 900px) {
  :root { --stn-drawer-w: 100vw; }
  body.stn-drawer-visible .stn-toolbar { display: none; }
}

/* Section mode (spec page): the Notes button sits at the right end of each section heading. */
body[data-stn-scan="sections"] h2 > .stn-btn { float: right; margin: 2px 0 0 12px; }
body[data-stn-scan="sections"] .stn-card-open { box-shadow: 0 0 0 3px rgba(242, 184, 37, 0.55); }
