/* e-Falconry agents. Blue accent on a deep navy sidebar. */
:root {
  --brand: #0077fb; --brand-2: #005fd1; --brand-soft: #e8f1ff;
  --bg: #ffffff; --bg-2: #f5f7fa; --bg-3: #eef2f7; --fg: #0f1729; --dim: #5b6577; --line: #e3e8ef;
  --side: #0b1220; --side-2: #111a2c; --side-fg: #c9d3e3; --side-dim: #7d8aa3; --side-line: rgba(255,255,255,.07);
  --accent: var(--brand); --accent-fg: #fff; --sys: #7a8496; --code: #f1f4f8;
  --ok: #138a4b; --warn: #b45309; --bad: #c2271f;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15,23,41,.05), 0 4px 14px rgba(15,23,41,.05);
  --shadow-lg: 0 12px 40px rgba(15,23,41,.18);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--fg); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1521; --bg-2: #141d2c; --bg-3: #1a2436; --fg: #e8edf5; --dim: #97a3b8; --line: #243047;
          --code: #18223a; --sys: #8b97ad; --brand-soft: rgba(0,119,251,.16);
          --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.5); }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--accent); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.app { display: grid; grid-template-columns: 268px 1fr; height: 100dvh; }

/* ------------------------------------------------------------------ sidebar */
.sidebar { background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); color: var(--side-fg);
           display: flex; flex-direction: column; overflow-y: auto; }
.ws { padding: 20px 18px 14px; border-bottom: 1px solid var(--side-line); }
.org-name { color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.01em; margin: 0 0 6px; }
.ws-name { font-weight: 700; font-size: 12px; color: #fff; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.ws-user { color: var(--side-dim); font-size: 12.5px; margin-top: 3px; }
nav { flex: 1; padding: 6px 0 12px; }
.nav-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px;
            color: var(--side-dim); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.nav-head .icon-btn { color: var(--side-dim); font-size: 17px; }
.nav-head .icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin: 1px 10px;
              color: var(--side-fg); text-decoration: none; border-radius: var(--radius-sm); font-size: 14.5px;
              transition: background .12s, color .12s; }
.nav-list a .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-list a svg { opacity: .8; }
.nav-list a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-list a.active { background: rgba(0,119,251,.22); color: #fff; }
.nav-list a.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
                             border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-list .hash { width: 22px; text-align: center; color: var(--side-dim); font-weight: 600; }
.nav-list a.active .hash { color: #8cc0ff; }
.signout { padding: 12px 18px 16px; border-top: 1px solid var(--side-line); }
.signout button { background: none; border: 1px solid rgba(255,255,255,.12); color: var(--side-fg); border-radius: var(--radius-sm);
                  padding: 7px 10px; width: 100%; transition: background .12s; }
.signout button:hover { background: rgba(255,255,255,.06); }
.badge { background: #ef4444; color: #fff; border-radius: 99px; font-size: 11px; line-height: 18px; min-width: 18px;
         padding: 0 6px; text-align: center; font-weight: 700; }
.badge[hidden] { display: none; }
.backdrop { display: none; }

/* ------------------------------------------------------------------ avatars */
.avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
          font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.avatar.big { width: 36px; height: 36px; font-size: 14px; }
.avatar.huge { width: 56px; height: 56px; font-size: 22px; }
img.avatar { object-fit: cover; background: none; box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.sidebar img.avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.icon-btn { background: none; border: 0; line-height: 1; padding: 6px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; }
.icon-btn:hover { background: rgba(127,127,127,.14); }

/* ------------------------------------------------------------------ main + topbar */
.main { display: flex; flex-direction: column; min-width: 0; height: 100dvh; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line);
          background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); min-height: 62px; }
.title-icon:empty { display: none; }
.title-icon .hash.big { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
                        background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 18px; }
.titles { min-width: 0; }
.topbar .title { font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; }
.topbar .subtitle { color: var(--dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { display: none; }
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view[hidden] { display: none; }

/* ------------------------------------------------------------------ messages */
.messages { flex: 1; overflow-y: auto; padding: 10px 14px 8px; }
.msg { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 8px 10px; border-radius: 10px; transition: background .12s; }
.msg:hover { background: var(--bg-2); }
.msg .meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 1px; }
.msg .who { font-weight: 700; font-size: 14.5px; }
.msg .when { color: var(--dim); font-size: 11.5px; }
.msg .foot { color: var(--dim); font-size: 12px; display: flex; align-items: center; gap: 4px; margin-top: 4px; flex-wrap: wrap;
             opacity: .75; transition: opacity .12s; }
.msg:hover .foot { opacity: 1; }
.msg .foot a { color: var(--dim); }
.msg .foot a:hover { color: var(--accent); }
.msg.system { grid-template-columns: 36px 1fr; color: var(--sys); font-size: 13px; padding: 4px 10px; }
.msg.system:hover { background: none; }
.msg.system .body { font-style: normal; background: var(--bg-2); border: 1px dashed var(--line); border-radius: 8px;
                    padding: 5px 10px; display: inline-block; }
.msg.system .body p { margin: 0; }
.body { overflow-wrap: anywhere; line-height: 1.55; }
.body p { margin: 0 0 6px; }
.body p:last-child { margin-bottom: 0; }
.body strong { font-weight: 650; }
.body pre { background: var(--code); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; border: 1px solid var(--line); }
.body code { background: var(--code); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.body pre code { background: none; padding: 0; }
.body table { border-collapse: separate; border-spacing: 0; margin: 8px 0; font-size: 13.5px; display: block; overflow-x: auto;
              border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.body th { background: var(--bg-2); font-weight: 600; }
.body th, .body td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; white-space: nowrap; }
.body tr:last-child td { border-bottom: 0; }
.body ul { margin: 4px 0 6px; padding-left: 20px; }
.body li { margin: 2px 0; }
.mention { background: var(--brand-soft); color: var(--brand); border-radius: 5px; padding: 0 4px; font-weight: 600; }
.day { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 11.5px; font-weight: 600; margin: 16px 10px 6px;
       text-transform: uppercase; letter-spacing: .06em; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rate { background: none; border: 1px solid transparent; border-radius: 6px; padding: 1px 5px; font-size: 13px; opacity: .6;
        transition: opacity .12s, background .12s; }
.rate:hover { opacity: 1; background: var(--bg-3); }
.rate.on { opacity: 1; background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }

/* ------------------------------------------------------------------ live runs */
.live { padding: 0 24px; }
.card { border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); padding: 10px 14px; margin: 6px 0;
        box-shadow: var(--shadow); }
.card .row { display: flex; align-items: center; gap: 10px; }
.card .row .grow { flex: 1; }
.card .status { color: var(--dim); font-size: 12.5px; }
.card .stream { margin-top: 8px; white-space: pre-wrap; font-size: 14px; color: var(--fg); max-height: 240px; overflow-y: auto; }
.card .stream:empty { display: none; }
.card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card .chips:empty { display: none; }
.chip { font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--dim);
        max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sub { margin: 8px 0 0 22px; box-shadow: none; background: var(--bg-2); }
.typing { display: inline-flex; gap: 3px; align-items: center; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); animation: bounce 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.small-btn { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: var(--radius-sm); padding: 5px 11px;
             font-size: 13px; font-weight: 500; transition: background .12s, border-color .12s; }
.small-btn:hover { background: var(--bg-2); border-color: color-mix(in srgb, var(--fg) 20%, var(--line)); }

/* ------------------------------------------------------------------ composer */
.composer { position: relative; padding: 8px 24px calc(14px + env(safe-area-inset-bottom)); }
.composer-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg);
                padding: 6px 6px 6px 14px; box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s; }
.composer-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; padding: 8px 0; font: inherit; color: var(--fg); background: transparent;
                     max-height: 200px; min-height: 22px; }
.composer button#send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--brand); color: #fff;
                        display: grid; place-items: center; transition: background .12s, transform .06s; }
.composer button#send:hover { background: var(--brand-2); }
.composer button#send:active { transform: scale(.96); }
.composer-hint { color: var(--dim); font-size: 11.5px; margin: 6px 4px 0; }
.mention-pop { position: absolute; bottom: calc(100% - 4px); left: 24px; background: var(--bg); border: 1px solid var(--line);
               border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 280px; max-width: calc(100% - 48px); overflow: hidden; z-index: 5; }
.mention-pop div { padding: 8px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.mention-pop div.sel, .mention-pop div:hover { background: var(--brand-soft); }
.mention-pop small { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary { background: var(--brand); color: var(--accent-fg); border: 0; border-radius: var(--radius-sm); padding: 8px 16px; font-weight: 600;
           transition: background .12s; }
.primary:hover { background: var(--brand-2); }

/* ------------------------------------------------------------------ pages */
.page { overflow-y: auto; padding: 22px 24px 40px; gap: 14px; background: var(--bg-2); }
.page h2 { margin: 10px 0 2px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.page h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--bg); box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 6px; display: flex; gap: 10px; align-items: center; font-size: 15.5px; }
.panel p { margin: 4px 0; color: var(--dim); font-size: 14px; }
.kv { font-size: 13px; color: var(--dim); margin: 2px 0; }
.kv b { color: var(--fg); font-weight: 600; }
.bar { height: 8px; background: var(--bg-3); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #3d9bff); border-radius: 99px; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.data th { color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
table.data tbody tr:hover { background: var(--bg-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data.wide { min-width: 620px; }
.panel.scroll { overflow-x: auto; }
.mem, .lesson { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.mem:last-child, .lesson:last-child { border-bottom: 0; }
.mem span, .lesson span { flex: 1; }
.lesson small { color: var(--dim); display: block; font-size: 12px; margin-top: 2px; }
.lesson.proposed { background: color-mix(in srgb, #f59e0b 10%, transparent); border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
                   border-radius: 10px; padding: 9px 10px; margin: 6px 0; }
.add-lesson { display: flex; gap: 6px; margin-top: 8px; }
.add-lesson input { flex: 1; min-width: 0; }
.req { border-left: 4px solid var(--brand); }
.req ul { margin: 4px 0 8px; padding-left: 18px; font-size: 14px; }
.req .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.req .email { margin: 6px 0 8px; }
.req .docs, .req .checks { margin: 6px 0 8px; }
.req .checks li.warn { color: var(--bad); }
.req .docs li { overflow-wrap: anywhere; }
.req .docs a { margin-left: 2px; }
.req .warn { color: var(--bad); font-size: 14px; margin: 4px 0 0; }
.req .email .kv { margin: 2px 0; }
.req .email-body { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 6px 0 0; max-height: 360px; overflow: auto; }
.diff { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: pre-wrap; line-height: 1.5;
        background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 420px; overflow: auto; }
.diff .add { background: color-mix(in srgb, var(--ok) 16%, transparent); display: block; border-radius: 4px; }
.diff .del { background: color-mix(in srgb, var(--bad) 14%, transparent); display: block; text-decoration: line-through; border-radius: 4px; }
.diff .same { display: block; color: var(--dim); }
.pill { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.pill.off { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.pill.skipped { background: var(--bg-3); color: var(--dim); }
.st-done { color: var(--ok); } .st-failed, .st-stopped, .st-declined { color: var(--bad); }
.st-proposed, .st-sent, .st-running, .st-queued { color: var(--warn); }

/* ------------------------------------------------------------------ forms + dialogs */
label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 500; margin: 10px 0; }
input, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
                  color: var(--fg); transition: border-color .12s, box-shadow .12s; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.hint { color: var(--dim); font-size: 12.5px; }
.dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(760px, 94vw); background: var(--bg); color: var(--fg);
          box-shadow: var(--shadow-lg); }
.dialog.small { width: min(440px, 94vw); }
.dialog::backdrop { background: rgba(11,18,32,.55); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 14px 18px; max-height: 70vh; overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--bg-2);
               border-radius: 0 0 16px 16px; }
.dialog-foot button { border-radius: var(--radius-sm); padding: 7px 15px; border: 1px solid var(--line); background: var(--bg); font-weight: 500; }
.dialog-foot .primary { border: 0; background: var(--brand); color: #fff; }
.ev { font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ev pre { white-space: pre-wrap; margin: 6px 0 0; background: var(--code); padding: 8px; border-radius: 8px; max-height: 180px; overflow: auto; }

/* ------------------------------------------------------------------ login */
.login-body { display: grid; place-items: center; min-height: 100dvh; padding: 16px;
              background: radial-gradient(1200px 600px at 20% -10%, rgba(0,119,251,.18), transparent 60%), var(--bg-2); }
.login { width: min(380px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px 26px;
         box-shadow: var(--shadow-lg); }
.login-brand { background: linear-gradient(135deg, var(--side), #13213a); border-radius: 12px; padding: 16px 18px; margin: 0 0 16px;
               display: flex; align-items: center; justify-content: space-between; }
.login-brand b { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.login-brand span { color: #fff; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; opacity: .9; }
.login .primary { width: 100%; padding: 11px; margin-top: 10px; font-size: 15px; border-radius: 10px; }
.error { color: var(--bad); font-size: 14px; }

/* ------------------------------------------------------------------ phone */
@media (max-width: 760px) {
  :root { font-size: 15.5px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); z-index: 30; transform: translateX(-102%);
             visibility: hidden; transition: transform .22s ease, visibility .22s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; visibility: visible; }
  .backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(11,18,32,.5); opacity: 0; pointer-events: none;
              transition: opacity .22s; }
  body.menu-open .backdrop { opacity: 1; pointer-events: auto; }
  .nav-list a { padding: 10px 12px; }
  .menu { display: inline-grid; margin-left: -6px; }
  .menu svg { width: 22px; height: 22px; }
  .topbar { padding: 8px 14px; min-height: 56px; gap: 10px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .title-icon .avatar.big, .title-icon .hash.big { width: 32px; height: 32px; }
  .messages { padding: 6px 4px; }
  .msg { padding: 8px; gap: 10px; }
  .msg:hover { background: none; }
  .msg .foot { opacity: 1; }
  .live { padding: 0 12px; }
  .composer { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  .composer-hint { display: none; }
  .mention-pop { left: 10px; max-width: calc(100% - 20px); }
  .page { padding: 14px 12px 32px; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .rate { padding: 4px 8px; font-size: 15px; }
}

/* composer textarea sits inside .composer-box: no own border or focus ring */
.composer .composer-box textarea, .composer .composer-box textarea:focus {
  border: 0; box-shadow: none; background: transparent; border-radius: 0; padding: 8px 0; }
/* tables in messages hug their content, scroll when wider than the screen */
.body table { width: fit-content; }

/* sidebar agent rows: bigger portraits with the agent's job under its handle */
.avatar.side { width: 34px; height: 34px; font-size: 13px; }
.nav-list a.agent-link { padding: 6px 12px; gap: 11px; }
.nav-list .label.two { display: flex; flex-direction: column; line-height: 1.2; }
.nav-list .label.two .name { font-weight: 600; color: #e9eef7; overflow: hidden; text-overflow: ellipsis; }
.nav-list .label.two .role { font-size: 12px; color: var(--side-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-list a.agent-link.active .role { color: #a9cdff; }
@media (max-width: 760px) {
  .avatar.side { width: 40px; height: 40px; }
  .nav-list a.agent-link { padding: 8px 12px; }
  .nav-list .label.two .name { font-size: 16px; }
  .nav-list .label.two .role { font-size: 13px; }
}

/* ------------------------------------------------------------------ photo zoom */
img.avatar[data-agent], img.avatar[data-person] { cursor: zoom-in; }
.photo-dialog { border: 0; padding: 0; background: transparent; overflow: visible; max-width: none; max-height: none; }
.photo-dialog::backdrop { background: rgba(11,18,32,.78); backdrop-filter: blur(4px); }
.photo-dialog[open] { display: flex; flex-direction: column; align-items: center; gap: 14px; animation: photo-in .16s ease-out; }
.photo-dialog img { width: min(440px, 82vw, 70vh); height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 4px rgba(255,255,255,.92), 0 20px 60px rgba(0,0,0,.45); cursor: zoom-out; }
.photo-cap { display: flex; flex-direction: column; align-items: center; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.photo-cap strong { font-size: 20px; }
.photo-cap span { font-size: 14px; opacity: .85; }
.photo-close { position: fixed; top: 14px; right: 14px; color: #fff; font-size: 28px; background: rgba(255,255,255,.12); border-radius: 50%; width: 42px; height: 42px; }
@keyframes photo-in { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ approve all */
.approve-all { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.approve-all .primary { border: 0; background: var(--brand); color: #fff; border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 600; }
.approve-all .primary:disabled { opacity: .6; }

/* ------------------------------------------------------------------ sub-agents under @chief */
.nav-list .sub-head { margin: 6px 12px 2px 46px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-dim); }
.nav-list li:has(> a.sub) { position: relative; }
.nav-list li:has(> a.sub)::before { content: ""; position: absolute; left: 38px; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.12); }
.nav-list a.agent-link.sub { padding: 4px 12px 4px 50px; gap: 9px; }
.avatar.sub { width: 26px; height: 26px; font-size: 11px; }
.nav-list a.sub .label.two .name { font-size: 13.5px; font-weight: 500; }
.nav-list a.sub .label.two .role { font-size: 11.5px; }
@media (max-width:760px){ .avatar.sub { width: 32px; height: 32px; } .nav-list a.agent-link.sub { padding: 6px 12px 6px 50px; }
  .nav-list a.sub .label.two .name { font-size: 15px; } .nav-list a.sub .label.two .role { font-size: 12.5px; } }

/* ------------------------------------------------------------------ agents' photos in a channel header */
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { width: 32px; height: 32px; margin-left: -10px; box-shadow: 0 0 0 2px var(--bg); }
.avatar-stack .avatar:first-child { margin-left: 0; }
@media (max-width:760px){ .avatar-stack .avatar { width: 28px; height: 28px; margin-left: -9px; } .avatar-stack .avatar:first-child { margin-left: 0; } }

.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll .sub { display: block; color: var(--dim); font-size: 12px; }
#catalog-view .filter { width: 100%; max-width: 320px; margin: 4px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
/* market match (section 15.3): the newest Amazon price beside ours, and the form a person records one with */
#catalog-view .market-cell { min-width: 170px; }
#catalog-view .market-cell .pill { margin-top: 4px; white-space: normal; }
#catalog-view .market-cell.stale { color: var(--dim); }
#catalog-view .link-btn { display: inline-block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--brand);
                          font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
#catalog-view tr.market-row > td { background: var(--bg-2); padding: 0; }
#catalog-view .market-form { position: sticky; left: 0; box-sizing: border-box; width: min(720px, calc(100vw - 340px));
                             padding: 12px; display: grid; gap: 8px; white-space: normal; }
#catalog-view .market-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
#catalog-view .market-fields label { margin: 0; font-size: 12.5px; min-width: 0; }
#catalog-view .market-fields input { min-width: 0; width: 100%; box-sizing: border-box; padding: 7px 9px; }
#catalog-view .market-form .actions { margin: 0; }
#catalog-view .market-form .hint, #catalog-view .market-form .error { margin: 0; }
#catalog-view .market-form .error:empty { display: none; }
#catalog-view .market-form .error { color: var(--bad); }
@media (max-width: 760px) { #catalog-view .market-form { width: calc(100vw - 64px); } }

/* ------------------------------------------------------------------ members and prospects */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0 10px; }
.filters input, .filters select { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit;
                                  background: var(--bg); color: var(--fg); min-width: 0; max-width: 100%; }
.filters input[type=search] { flex: 1 1 200px; max-width: 300px; }
.filters button:disabled { opacity: .5; cursor: default; }
.table-scroll table.data.roomy { min-width: 760px; }
.pill.wait { background: color-mix(in srgb, #f59e0b 16%, transparent); color: var(--warn); }
.notice { border: 1px solid color-mix(in srgb, #f59e0b 35%, transparent); background: color-mix(in srgb, #f59e0b 10%, transparent);
          border-radius: var(--radius-sm); padding: 8px 12px; margin: 0 0 10px; }
.panel p.notice { color: var(--fg); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions .primary { padding: 5px 11px; font-size: 13px; }
.inline-confirm { display: grid; gap: 6px; font-size: 13px; max-width: 420px; }
.inline-confirm label { margin: 0; }
.inline-confirm .error:empty { display: none; }
.panel p.error { color: var(--bad); }
.req.member .facts { margin: 6px 0 8px; }
.req.member .docs li { overflow-wrap: anywhere; }
/* on a phone each row of these tables becomes a short block: nothing to scroll sideways */
@media (max-width: 760px) {
  .table-scroll table.data.stack { min-width: 0; }
  table.data.stack thead { display: none; }
  table.data.stack tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.data.stack tr:last-child { border-bottom: 0; }
  table.data.stack td, table.data.stack td.num { display: block; border: 0; padding: 2px 0; text-align: left; }
  table.data.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--dim); font-size: 12px; }
  table.data.stack td:last-child:not(:empty) { padding-top: 6px; }
  table.data.stack tbody tr:hover { background: none; }
}
table.data.stack td[data-label="Contact"] { white-space: nowrap; }
table.data.stack td[data-label="Contact"] .sub { white-space: normal; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ purchase orders */
ul.po-lines { margin: 4px 0 0; padding-left: 18px; color: var(--dim); font-size: 12.5px; }
ul.po-lines li { overflow-wrap: anywhere; }
td.po-note { max-width: 260px; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 760px) { td.po-note { max-width: none; } }
/* ------------------------------------------------------------------ orders */
#orders-view .back { margin: 0 0 -4px; font-size: 14px; }
#orders-view .back a { color: var(--brand); text-decoration: none; }
#orders-view table.data.orders tr.clickable { cursor: pointer; }
#orders-view td.wrap { overflow-wrap: anywhere; }
#orders-view .order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#orders-view .order-head h2 { margin: 0; }
#orders-view .facts { margin: 8px 0; }
.order-money { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.order-money div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.order-money span { display: block; color: var(--dim); font-size: 12px; }
.order-money b { font-variant-numeric: tabular-nums; }
.ship-to p { color: var(--fg); }
#orders-view .po { border-top: 1px solid var(--line); padding: 8px 0; }
#orders-view .po:first-child { border-top: 0; }
#orders-view .po ul, #orders-view .panel > ul { margin: 4px 0; padding-left: 18px; font-size: 14px; overflow-wrap: anywhere; }
.refund-form { max-width: 480px; }
.refund-form input { max-width: 200px; }
.refund-form .error:empty { display: none; }

/* ------------------------------------------------------------------ recalls (section 17.2) */
td.recall-why { max-width: 320px; overflow-wrap: anywhere; }
#recalls-view td .sub, .req.recall .kv { overflow-wrap: anywhere; }
#recalls-view p.warn { color: var(--bad); margin: 0; }
ul.recall-list { margin: 0; padding-left: 18px; }
ul.recall-list li { margin: 6px 0; overflow-wrap: anywhere; }
ul.recall-list .sub { display: block; color: var(--dim); font-size: 12px; }
.req.recall .facts { margin: 6px 0 8px; }
@media (max-width: 760px) { td.recall-why { max-width: none; } }

/* ------------------------------------------------------------------ prospect outreach (section 15.6) */
ul.outreach-history { margin: 6px 0 0; padding-left: 16px; color: var(--dim); font-size: 12px; }
ul.outreach-history li { margin: 2px 0; overflow-wrap: anywhere; }
.req .email-body.full { max-height: none; }
