/* ==================================================================
   ORIGAMI x PYRAMID - PROJECT PIPELINE
   Both logos are white on transparent, so the shell is dark by
   design. Accents come from the two brands: Origami teal and the
   Pyramid navy-to-sky gradient.
   ================================================================== */

:root {
  --bg:        #0B111C;
  --panel:     #131C2B;
  --panel-2:   #182334;
  --panel-3:   #1F2C40;
  --line:      #26344A;
  --line-soft: #1D293B;

  --text:      #E9EFF7;
  --text-2:    #B4C3D6;
  --muted:     #7D8FA8;

  --teal:      #1996AD;
  --teal-lite: #2FBAD4;
  --navy:      #08237B;
  --blue:      #4CA5D6;
  --sky:       #BFE9F5;

  --red:       #E5484D;
  --amber:     #F5A524;
  --green:     #2FBF87;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 18px 40px rgba(0,0,0,.42);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(25,150,173,.13), transparent 60%),
    radial-gradient(800px 480px at 92% -12%, rgba(76,165,214,.10), transparent 62%);
  z-index: 0;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--teal-lite); }

.hidden { display: none !important; }

/* ---------------- login ---------------- */

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 38px 34px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 26px;
}
.lockup img { display: block; }
.lockup .lg-origami { height: 26px; }
.lockup .lg-pyramid { height: 30px; }
.lockup .x {
  color: var(--muted);
  font-size: 17px;
  font-weight: 300;
  letter-spacing: .04em;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.login-card p.blurb {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.login-card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(25,150,173,.16);
}

.login-error {
  margin-top: 12px;
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s, transform .06s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal), #1478A8);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--teal-lite), var(--teal)); }

.btn-full { width: 100%; padding: 13px; margin-top: 16px; }

.btn-ghost {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }

.btn-danger { background: transparent; border-color: rgba(229,72,77,.4); color: #F08A8D; }
.btn-danger:hover { background: rgba(229,72,77,.12); }

.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------------- app shell ---------------- */

.app { position: relative; z-index: 1; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 24px;
  background: rgba(11,17,28,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar .lockup { margin: 0; gap: 14px; }
.topbar .lockup .lg-origami { height: 19px; }
.topbar .lockup .lg-pyramid { height: 22px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-2);
}
.role-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-lite); }
.role-pill.pyramid .dot { background: var(--blue); }

/* ---------------- toolbar ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px 24px 0;
  max-width: 1560px;
  margin: 0 auto;
}

.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 11px; padding: 4px; }
.tab {
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text-2); }
.tab.active { background: var(--panel-3); color: var(--text); }
.tab .count {
  display: inline-block;
  margin-left: 7px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  color: var(--text-2);
}

.search {
  flex: 1;
  min-width: 190px;
  max-width: 340px;
  position: relative;
}
.search input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 14px 10px 36px;
  outline: none;
}
.search input:focus { border-color: var(--teal); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .5; }

.toolbar select {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 13px;
  outline: none;
  cursor: pointer;
}
.toolbar select:focus { border-color: var(--teal); }

.spacer { flex: 1; }

/* ---------------- staff filter ----------------
   A native select cannot hold images, so this one is built by hand
   to match the others while showing everyone's face. */

.stafffilter { position: relative; }
.stafffilter > button {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 6px 11px 6px 8px;
  min-height: 41px;
  color: var(--text);
  white-space: nowrap;
}
.stafffilter > button:hover { border-color: var(--line); }
.stafffilter > button:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.stafffilter > button .caret { opacity: .55; margin-left: 2px; }
.stafffilter > button .avatar,
.stafffilter > button .avatar-i { width: 24px; height: 24px; }
.stafffilter > button .anyone {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-3); color: var(--muted); flex-shrink: 0;
}

.staffpanel {
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  /* The filter sits at the right end of the toolbar, so the panel
     opens leftwards and cannot run off the edge of the screen. */
  right: 0;
  left: auto;
  width: 232px;
  max-width: calc(100vw - 28px);
  max-height: min(470px, calc(100vh - 140px));
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 5px;
  animation: pop .13s cubic-bezier(.2,.8,.3,1);
}
.staffpanel button {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: background .13s, color .13s;
}
.staffpanel button:hover { background: var(--panel-3); color: var(--text); }
.staffpanel button:focus-visible { outline: 2px solid var(--teal-lite); outline-offset: -2px; }
.staffpanel button.on { background: var(--panel-3); color: var(--text); }
.staffpanel button .avatar,
.staffpanel button .avatar-i { width: 26px; height: 26px; }
.staffpanel button .anyone {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-3); color: var(--muted); flex-shrink: 0;
}
.staffpanel .nm { font-size: 13.5px; font-weight: 500; }
.staffpanel .tick { margin-left: auto; color: var(--teal-lite); opacity: 0; flex-shrink: 0; }
.staffpanel button.on .tick { opacity: 1; }
.staffpanel .divider { height: 1px; background: var(--line-soft); margin: 5px 4px; }

@media (max-width: 860px) {
  .stafffilter { flex: 1 1 30%; min-width: 0; }
  .stafffilter > button { width: 100%; }
  /* Panel keeps its own width and stays anchored to the trigger's
     right edge, so a narrow filter never drags it off screen. */
}

/* ---------------- filter chips ---------------- */

.lightfilter { display: flex; gap: 5px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 11px; padding: 4px; }
.lightfilter button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.lightfilter button:hover { color: var(--text-2); }
.lightfilter button.active { background: var(--panel-3); color: var(--text); }
.lightfilter .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-red { background: var(--red); }
.dot-amber { background: var(--amber); }
.dot-green { background: var(--green); }
.dot-all { background: linear-gradient(135deg, var(--red) 33%, var(--amber) 33% 66%, var(--green) 66%); }

/* ---------------- grid ---------------- */

.grid-wrap { max-width: 1560px; margin: 0 auto; padding: 22px 24px 80px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .16s, transform .16s, box-shadow .16s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.34);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(150deg, #142445, #0E1A2E);
  overflow: hidden;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #2E4467;
}

.card-light {
  position: absolute;
  top: 11px;
  left: 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(8,13,22,.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.09);
}
.card-light.red   { color: #FF9A9C; }
.card-light.amber { color: #FFCB6B; }
.card-light.green { color: #6FE0B4; }

/* The status pill is a button, so the light can be changed straight
   from the pipeline without opening the project. */
button.card-light { cursor: pointer; transition: border-color .14s, background .14s; }
button.card-light:hover { border-color: rgba(255,255,255,.3); background: rgba(8,13,22,.92); }
button.card-light:focus-visible { outline: 2px solid var(--teal-lite); outline-offset: 2px; }
button.card-light .caret { opacity: .55; margin-left: 1px; }

.card-targets { position: absolute; top: 11px; right: 11px; display: flex; gap: 5px; }
.tbadge {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: rgba(8,13,22,.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.09);
  color: var(--sky);
}

.card-flag {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(245,165,36,0), rgba(180,110,10,.94));
  color: #FFDFA8;
  display: flex; align-items: center; gap: 7px;
}

.card-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card-title { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.card-loc { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--panel-3);
  color: var(--text-2);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.chip.sector { background: rgba(25,150,173,.14); border-color: rgba(25,150,173,.3); color: #7FD8E8; font-weight: 500; }
.chip.more { color: var(--muted); }

.card-foot {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-3);
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.avatar-i {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  flex-shrink: 0;
}
.who span { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quality { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.quality .pct { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ring { width: 22px; height: 22px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--teal-lite); transition: stroke-dashoffset .4s; }

.pubtags { display: flex; gap: 5px; }
.pubtag {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px;
  background: rgba(47,191,135,.14); color: #6FE0B4; border: 1px solid rgba(47,191,135,.26);
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty svg { opacity: .35; margin-bottom: 14px; }

/* ---------------- drawer ---------------- */

.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,8,14,.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  animation: fade .18s forwards;
}
@keyframes fade { to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(760px, 100vw);
  z-index: 61;
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px rgba(0,0,0,.5);
  transform: translateX(100%);
  animation: slide .24s cubic-bezier(.22,.8,.3,1) forwards;
}
@keyframes slide { to { transform: translateX(0); } }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.drawer-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.iconbtn {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.iconbtn:hover { background: var(--panel-3); color: var(--text); }

.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot {
  flex-shrink: 0;
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel-2);
  display: flex; align-items: center; gap: 10px;
}

/* ---------------- form ---------------- */

.section { margin-bottom: 28px; }
.section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.section-head h3 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal-lite);
}
.section-head .rule { flex: 1; height: 1px; background: var(--line-soft); }
.section-head .opt { font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field label .req { color: var(--teal-lite); }
.field .hint {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
  line-height: 1.45;
}

.field input[type=text],
.field input[type=url],
.field input[type=date],
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 82px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(25,150,173,.14);
}
.field input::placeholder, .field textarea::placeholder { color: #4E6180; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .row { grid-template-columns: 1fr; } }

/* traffic light picker */
.lights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.lightopt {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 13px 12px;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.lightopt .top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.lightopt .top .dot { width: 10px; height: 10px; border-radius: 50%; }
.lightopt .sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.lightopt:hover { border-color: var(--line); background: var(--panel-2); }
.lightopt.sel[data-light=red]   { border-color: rgba(229,72,77,.6);  background: rgba(229,72,77,.1); }
.lightopt.sel[data-light=amber] { border-color: rgba(245,165,36,.6); background: rgba(245,165,36,.1); }
.lightopt.sel[data-light=green] { border-color: rgba(47,191,135,.6); background: rgba(47,191,135,.1); }

/* toggle cards for web / social */
.targets { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.target {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 13px;
  display: flex; align-items: center; gap: 11px;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.target .ic { color: var(--muted); display: grid; place-items: center; }
.target .t { font-size: 13.5px; font-weight: 600; }
.target .s { font-size: 11.5px; color: var(--muted); }
.target.sel { border-color: rgba(25,150,173,.6); background: rgba(25,150,173,.11); }
.target.sel .ic { color: var(--teal-lite); }

/* multi-select pills */
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.pick {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: all .13s;
}
.pick:hover { border-color: var(--muted); color: var(--text); }
.pick.sel { background: rgba(25,150,173,.16); border-color: var(--teal); color: #8FE0EE; font-weight: 500; }

.pickgroup { margin-bottom: 12px; }
.pickgroup .glabel {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin-bottom: 7px; font-weight: 600;
}

/* staff picker */
.staffpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
.staff {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  text-align: left;
  transition: all .13s;
  min-width: 0;
}
.staff:hover { border-color: var(--muted); }
.staff.sel { border-color: var(--teal); background: rgba(25,150,173,.13); }
.staff img, .staff .avatar-i { width: 32px; height: 32px; }
.staff .nm { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Job titles are long, so let them run to two lines rather than
   truncating "Senior Architectural Technician" into nonsense. */
.staff .rl { font-size: 10.5px; line-height: 1.3; color: var(--muted); }

/* cover uploader */
.cover-drop {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cover-drop:hover { border-color: var(--teal); background: rgba(25,150,173,.05); }
.cover-preview { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.cover-preview img { width: 100%; display: block; aspect-ratio: 16/10; object-fit: cover; }
.cover-preview button {
  position: absolute; top: 9px; right: 9px;
  background: rgba(8,13,22,.85);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-2);
}

/* ---------------- detail view ---------------- */

.detail-hero { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); margin-bottom: 20px; }
.detail-hero img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }

.statebar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin-bottom: 20px;
}
.state {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px;
  border-radius: 100px;
  font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.state.red   { color: #FF9A9C; border-color: rgba(229,72,77,.35); background: rgba(229,72,77,.1); }
.state.amber { color: #FFCB6B; border-color: rgba(245,165,36,.35); background: rgba(245,165,36,.1); }
.state.green { color: #6FE0B4; border-color: rgba(47,191,135,.35); background: rgba(47,191,135,.1); }
.state .dot { width: 8px; height: 8px; border-radius: 50%; }

.callout {
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 18px;
  border: 1px solid;
}
.callout.warn { background: rgba(245,165,36,.09); border-color: rgba(245,165,36,.3); color: #FFD79A; }
.callout.info { background: rgba(25,150,173,.09); border-color: rgba(25,150,173,.3); color: #9FDDE9; }
.callout strong { display: block; margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; font-size: 13.5px; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; color: var(--text); }
.dl dd.none { color: #4E6180; font-style: italic; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 10px; } }

.prose { font-size: 13.5px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; }

.missing-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.missing-list .chip { background: rgba(245,165,36,.11); border-color: rgba(245,165,36,.3); color: #FFD79A; }

.drivebtn {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.drivebtn:hover { border-color: var(--teal); background: rgba(25,150,173,.07); }
.drivebtn .t { font-size: 13.5px; font-weight: 600; }
.drivebtn .s { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.activity { font-size: 12.5px; color: var(--muted); }
.activity li { margin-bottom: 6px; list-style: none; }
.activity ul { padding: 0; margin: 0; }
.activity b { color: var(--text-2); font-weight: 600; }

/* ---------------- how to use ---------------- */

.help { max-width: 62ch; }
.help-sec { position: relative; padding-left: 40px; margin-bottom: 30px; }
.help-sec:last-child { margin-bottom: 6px; }
.help-n {
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
}
.help-sec h3 {
  margin: 0 0 9px;
  font-size: 16px; font-weight: 600; letter-spacing: -.01em;
  color: var(--text);
}
.help-sec p {
  margin: 0 0 10px;
  font-size: 13.5px; line-height: 1.65; color: var(--text-2);
}
.help-sec ul { margin: 10px 0 0; padding-left: 17px; }
.help-sec li {
  font-size: 13.5px; line-height: 1.6; color: var(--text-2);
  margin-bottom: 7px;
}
.help-sec li::marker { color: var(--teal-lite); }

/* ---------------- traffic light popover ---------------- */

.menu-scrim { position: fixed; inset: 0; z-index: 70; }

.lightmenu {
  position: fixed;
  z-index: 71;
  width: 262px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  animation: pop .13s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(-5px); } }

.lightmenu .mtitle {
  font-size: 10.5px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 10px 7px;
}
.lightmenu button.opt {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  transition: background .13s;
}
.lightmenu button.opt:hover { background: var(--panel-3); }
.lightmenu button.opt:focus-visible { outline: 2px solid var(--teal-lite); outline-offset: -2px; }
.lightmenu button.opt .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.lightmenu button.opt .t { font-size: 13.5px; font-weight: 600; }
.lightmenu button.opt .s { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-top: 1px; }
.lightmenu button.opt.cur { background: var(--panel-3); }
.lightmenu button.opt.cur .t::after {
  content: 'Current';
  font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-left: 8px;
}

.lightmenu .noteline { padding: 4px 10px 8px; }
.lightmenu .noteline input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12.5px;
  outline: none;
}
.lightmenu .noteline input:focus { border-color: var(--teal); }
.lightmenu .noteline .lbl { font-size: 11px; color: var(--muted); margin-bottom: 5px; display: block; }

/* ---------------- confirm dialog ---------------- */

.modal-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4,8,14,.66);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 22px;
  animation: fade .16s forwards;
}
.modal {
  width: 100%;
  max-width: 430px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  animation: pop .16s cubic-bezier(.2,.8,.3,1);
}
.modal .ic {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(47,191,135,.14);
  border: 1px solid rgba(47,191,135,.3);
  color: #6FE0B4;
  margin-bottom: 15px;
}
.modal h3 { margin: 0 0 8px; font-size: 17.5px; font-weight: 600; letter-spacing: -.01em; }
.modal p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.modal p:last-of-type { margin-bottom: 0; }
.modal .proj {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 13px; margin-bottom: 14px;
}
.modal .heads-up {
  background: rgba(245,165,36,.09);
  border: 1px solid rgba(245,165,36,.3);
  color: #FFD79A;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 12.5px; line-height: 1.55;
  margin: 14px 0 0;
}
.modal-actions { display: flex; gap: 9px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: rise .2s cubic-bezier(.2,.8,.3,1);
}
.toast.err { border-color: rgba(229,72,77,.5); color: #FF9A9C; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

@media (max-width: 860px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar .lockup { gap: 10px; min-width: 0; flex-shrink: 1; }
  .topbar .lockup .lg-origami { height: 15px; }
  .topbar .lockup .lg-pyramid { height: 18px; }
  .topbar-right { gap: 8px; flex-shrink: 0; }
  .role-pill { display: none; }

  .toolbar { padding: 14px 14px 0; gap: 10px; }
  .tabs { flex: 1; }
  .tab { flex: 1; text-align: center; }
  .lightfilter { width: 100%; }
  .lightfilter button { flex: 1; justify-content: center; padding: 8px 4px; }
  .search { max-width: none; flex-basis: 100%; }
  .toolbar select { flex: 1 1 30%; min-width: 0; }

  .grid-wrap { padding: 16px 14px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .card-cover { aspect-ratio: 16 / 9; }
  .drawer-body { padding: 16px; }
  .drawer-foot { padding: 12px 16px; flex-wrap: wrap; }
  .drawer-foot .btn { flex: 1 1 auto; }
  .detail-hero img { aspect-ratio: 3 / 2; }
}

@media (max-width: 470px) {
  #addBtn .lbl { display: none; }
  #addBtn { padding: 10px 12px; }
  .staffpick { grid-template-columns: 1fr 1fr; }
  .lights { grid-template-columns: 1fr; }
  .targets { grid-template-columns: 1fr; }
}
