/* Full ncs-ui adopter: shell, buttons, cards, panels, chips, tables and modals come
   from the house sheet. What is left here is tool-specific, on house tokens.
   Rules that must beat a house rule are prefixed .ncs on purpose.
   Shared pieces (toolbar, filters, crumb, toast, spinner, Feedback, Requests)
   are copied from ncs-projects/public/styles.css. */
html { background: var(--ground); }
::selection { background: var(--signal-edge); }
.hidden { display: none !important; }

.ncs main.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 22px 70px; }
.ncs header .who { margin-left: auto; }
.ncs header .theme-toggle { margin-left: 4px; }
/* The current page in the header links. Green fill, near-black text. */
.ncs header a.btn.ghost.on { background: var(--signal); color: var(--signal-on); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.ncs .toolbar input[type="search"] { flex: 1 1 260px; max-width: 380px; }
.ncs .toolbar select { width: auto; }
.filters { display: flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; flex-wrap: wrap; }
.ncs .filters button { border: 0; background: none; cursor: pointer; padding: 6px 10px; font-size: 12px; font-weight: 700;
  color: var(--ink-soft); border-radius: var(--r-sm); }
.ncs .filters button:hover { color: var(--ink); background: var(--surface-3); }
/* Selected = green FILL carrying near-black text, never white on green. */
.ncs .filters button.on { background: var(--signal); color: var(--signal-on); font-weight: 900; }
.ncs .filters button .n { opacity: .7; margin-left: 4px; font-weight: 700; }
.ncs .cards { margin-bottom: 16px; }

.crumb { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.crumb a { color: var(--signal-ink); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.title-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: baseline; margin-bottom: 14px; }
.title-row h2 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: -.02em; color: var(--ink); }
.title-row .client { color: var(--muted); font-weight: 700; font-size: 13px; }
.title-row .links { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.ncs .panel + .panel { margin-top: 14px; }

.working { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; padding: 30px 4px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--signal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700;
  transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.broken { background: var(--s-broken); color: #fff; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; }
.kv .k { color: var(--muted); padding-top: 2px; }
.kv .v2 { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

/* ── My Day: the nudge list ─────────────────────────────────────────────── */
.nudge { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.nudge:last-child { border-bottom: 0; }
.nudge .icon { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--line); }
.nudge.hot .icon { background: var(--s-broken-wash); border-color: var(--s-broken-edge); }
.nudge.warm .icon { background: var(--s-pending-wash); border-color: var(--s-pending-edge); }
.nudge .body { flex: 1; min-width: 0; }
.nudge .t { font-weight: 800; color: var(--ink); font-size: 14px; }
.nudge .c { font-size: 12px; font-weight: 700; color: var(--signal-ink); text-decoration: none; }
.nudge .c:hover { text-decoration: underline; }
.nudge .d { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.nudge .m { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.nudge .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.ncs .nudge .acts select { width: auto; padding: 4px 6px; font-size: 12px; }

/* ── pipeline + client ──────────────────────────────────────────────────── */
.opp-name { font-weight: 800; color: var(--ink); }
.opp-sub { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.opp-sub a, .opp-name a { color: inherit; text-decoration: none; }
.opp-sub a:hover, .opp-name a:hover { color: var(--signal-ink); text-decoration: underline; }
.age.broken { color: var(--s-broken); font-weight: 800; }
.age.pending { color: var(--s-pending); font-weight: 800; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .k { font-size: 15px; text-align: center; }
.timeline .w { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.timeline .p { color: var(--ink-soft); margin-top: 3px; overflow-wrap: anywhere; }

/* ── settings ──────────────────────────────────────────────────────────── */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; }
.set-grid label { display: block; font-size: 12.5px; color: var(--ink-soft); font-weight: 700; margin-bottom: 4px; }
.ncs .set-grid input, .ncs .set-grid select { width: 100%; }
.set-grid .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

@media (max-width: 640px) {
  .ncs main.wrap { padding: 14px 16px 60px; }
  .ncs header .who { display: none; }
  .title-row .links { margin-left: 0; }
  .col-hide-sm { display: none; }
  .nudge { flex-wrap: wrap; }
  .nudge .body { flex: 1 1 calc(100% - 46px); }
  .nudge .acts { margin-left: 46px; }
  .ncs .cards { grid-template-columns: 1fr 1fr; }
}

/* Feedback button + feature-request assistant (ported from Launchpad). */
.fb-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.fb-launch { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; font-size: 12.5px;
  border-radius: 999px; padding: 9px 15px; box-shadow: var(--shadow); cursor: pointer; font-family: inherit; }
.fb-launch:hover { border-color: var(--signal); }
.fb-launch:focus-visible, .fb-menu button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.fb-menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; display: flex; flex-direction: column; gap: 2px; width: 290px; max-width: calc(100vw - 36px); }
.fb-menu.hidden { display: none; }
.fb-menu button { display: flex; gap: 11px; align-items: flex-start; text-align: left; border: 0; background: none; color: var(--ink);
  padding: 10px 11px; border-radius: var(--radius-sm); cursor: pointer; font-size: 18px; font-family: inherit; }
.fb-menu button:hover { background: var(--signal-wash); }
.fb-menu b { display: block; font-size: 13px; font-weight: 800; }
.fb-menu em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 1px; }
@media print { .fb-wrap { display: none; } }

.ncs .modal.req-modal { max-width: 560px; width: calc(100vw - 32px); }
.req-intro { margin: 0 0 12px; color: var(--ink-soft); font-size: 13.5px; }
.req-chat { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; margin-bottom: 12px; padding-right: 2px; }
.req-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.req-msg.user { align-self: flex-end; background: var(--signal-wash); border: 1px solid var(--signal-edge); border-bottom-right-radius: 4px; }
.req-msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.req-msg.summary { border-color: var(--signal); border-left-width: 3px; }
.req-msg.thinking { color: var(--muted); font-style: italic; }
.ncs .req-input { min-height: 72px; width: 100%; box-sizing: border-box; }
.req-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.req-actions .spacer { flex: 1; }
.req-confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.req-confirm .muted { font-size: 12.5px; }
.req-sent { background: var(--s-live-wash); border: 1px solid var(--s-live-edge); border-radius: var(--radius-sm); padding: 12px 14px; }
.req-sent b { color: var(--s-live); }
.req-sent p { margin: 4px 0 10px; font-size: 13px; color: var(--ink-soft); }
.req-err { margin-top: 10px; color: var(--s-broken); background: var(--s-broken-wash); border: 1px solid var(--s-broken-edge); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 12.5px; font-weight: 600; }
.req-mine { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.req-mine-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.req-mine-row a { color: var(--signal-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* Requests page (request owners only). */
.req-row { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.req-row:last-child { border-bottom: 0; }
.req-row .grow { flex: 1; min-width: 240px; }
.req-row .rname { font-weight: 800; }
.req-row .rsub { font-size: 12.5px; color: var(--muted); }
.req-verdict { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.req-neg { margin: 6px 0 0; font-size: 12.5px; color: var(--s-broken); font-weight: 600; }
.req-detail { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.req-detail .lbl { display: block; margin-top: 10px; }
.req-detail p, .req-detail ul { margin: 4px 0 0; font-size: 13px; line-height: 1.55; }
.req-detail ul { padding-left: 18px; }
.ncs .prompt-text { width: 100%; box-sizing: border-box; min-height: 46vh; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
