/*
 * printIQ Insights shell: the top bar on every page (mark, menu, bell, person menu) and the
 * "See it as" strip. Each page keeps its own body. printIQ's look: the IQ menu bar fill,
 * Roboto, printIQ green as the one accent. Every class starts piq- so nothing here
 * touches a page's own styles.
 */

:root {
  --piq-bar-h: 52px;
  --piq-bar-bg: #2E2D35;
  --piq-bar-ink: #F9FAFA;
  --piq-bar-muted: rgba(249, 250, 250, .62);
  --piq-bar-hover: rgba(255, 255, 255, .08);
  --piq-bar-edge: rgba(255, 255, 255, .12);
  --piq-bar-go: #02C386;
  --piq-bar-go-deep: #02A874;
  --piq-bar-rule: #28A03C;
  --piq-pop-bg: #FFFFFF;
  --piq-pop-ink: #16202B;
  --piq-pop-muted: #5B6774;
  --piq-pop-line: #E3E9EF;
  --piq-viewas-bg: #C62828;     /* See it as: red, so nobody forgets they are someone else */
  --piq-shell-font: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Until the shell knows who is signed in, the page waits out of sight (the shell lifts this). */
html.piq-guard body { visibility: hidden; }

#piq-bar {
  position: relative;
  z-index: 65;                 /* above the pages' own sticky bars (60 at most), below their overlays (70 and up) */
  box-sizing: border-box;
  height: var(--piq-bar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: var(--piq-bar-bg);
  border-bottom: 2px solid var(--piq-bar-rule);
  color: var(--piq-bar-ink);
  font: 600 14px/1 var(--piq-shell-font);
  -webkit-font-smoothing: antialiased;
}
#piq-bar *, #piq-viewas * { box-sizing: border-box; }
#piq-bar a { color: inherit; text-decoration: none; }
#piq-bar button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.piq-mark { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-right: 10px; }
.piq-mark img { height: 28px; width: auto; display: block; }
.piq-mark span { font-weight: 800; font-size: 15px; letter-spacing: -.01em; padding-left: 10px; border-left: 1px solid var(--piq-bar-edge); white-space: nowrap; }

.piq-menu { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.piq-menu a { padding: 9px 12px; border-radius: 7px; color: var(--piq-bar-muted); white-space: nowrap; transition: background .15s, color .15s; }
.piq-menu a:hover { color: var(--piq-bar-ink); background: var(--piq-bar-hover); }
.piq-menu a[aria-current="page"] { color: #FFFFFF; background: var(--piq-bar-go); }
.piq-menu .piq-sep { width: 1px; height: 20px; background: var(--piq-bar-edge); margin: 0 6px; flex: 0 0 auto; }

.piq-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.piq-icon { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.piq-icon:hover, .piq-icon[aria-expanded="true"] { background: var(--piq-bar-hover); }
.piq-icon svg { width: 20px; height: 20px; }
.piq-count { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--piq-bar-go); color: #FFFFFF; font: 800 10px/16px var(--piq-shell-font); text-align: center; }
.piq-count[hidden] { display: none; }

.piq-person { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 20px; }
.piq-person:hover, .piq-person[aria-expanded="true"] { background: var(--piq-bar-hover); }
.piq-initials { width: 30px; height: 30px; border-radius: 50%; background: var(--piq-bar-go); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.piq-person-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.piq-burger { display: none; }

.piq-pop {
  position: absolute;
  top: calc(var(--piq-bar-h) - 4px);
  right: 12px;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--piq-pop-bg);
  color: var(--piq-pop-ink);
  border: 1px solid var(--piq-pop-line);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(22, 32, 43, .18);
  padding: 8px;
  font: 400 14px/1.45 var(--piq-shell-font);
}
.piq-pop[hidden] { display: none; }
.piq-pop h3 { margin: 6px 8px 8px; font-size: 13px; font-weight: 800; }
.piq-pop p { margin: 8px; color: var(--piq-pop-muted); }
.piq-pop .piq-who { padding: 8px 8px 10px; border-bottom: 1px solid var(--piq-pop-line); margin-bottom: 6px; }
.piq-pop .piq-who b { display: block; font-weight: 800; }
.piq-pop .piq-who small { display: block; color: var(--piq-pop-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.piq-pop .piq-role { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 10px; background: #E6F8F1; color: #016B4A; font-size: 12px; font-weight: 700; }
.piq-pop a, .piq-pop button { display: block; width: 100%; text-align: left; padding: 9px 8px; border-radius: 7px; color: var(--piq-pop-ink) !important; font-weight: 600; }
.piq-pop a:hover, .piq-pop button:hover { background: #F2F5F9; }
.piq-pop .piq-menu-list a[aria-current="page"] { color: #016B4A !important; background: #E6F8F1; }

/* See it as: a red bar, impossible to miss, on every page while it lasts. */
#piq-viewas {
  position: relative;
  z-index: 64;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: var(--piq-viewas-bg);
  color: #FFFFFF;
  font: 600 13.5px/1.35 var(--piq-shell-font);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .18);
}
#piq-viewas[hidden] { display: none; }
#piq-viewas b { font-weight: 900; }
.piq-viewas-eye { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .18); align-items: center; justify-content: center; flex: 0 0 auto; }
.piq-viewas-eye svg { width: 15px; height: 15px; }
.piq-viewas-text { min-width: 0; }
.piq-viewas-more { opacity: .88; font-weight: 600; }
.piq-viewas-left { margin-left: auto; flex: 0 0 auto; font-weight: 800; font-size: 12.5px; opacity: .9; white-space: nowrap; }
#piq-viewas button { flex: 0 0 auto; font: 800 12.5px/1 var(--piq-shell-font); padding: 8px 12px; border-radius: 7px; border: 0; background: #FFFFFF; color: var(--piq-viewas-bg); cursor: pointer; white-space: nowrap; }
#piq-viewas button:hover { background: #FFE9E7; }

/* A one-line note under the bar. */
#piq-notice {
  position: relative;
  z-index: 63;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: #FFF4DB;
  color: #6B4A00;
  border-bottom: 1px solid #F3DFAE;
  font: 600 13.5px/1.35 var(--piq-shell-font);
}
#piq-notice button { margin-left: auto; border: 0; background: none; color: inherit; font: 800 18px/1 var(--piq-shell-font); cursor: pointer; padding: 0 4px; }

/* Narrow screens: the menu folds into the menu button. */
@media (max-width: 1020px) {
  .piq-menu { display: none; }
  .piq-burger { display: inline-flex; }
  .piq-person-name { display: none; }
}
@media (max-width: 640px) {
  .piq-viewas-more { display: none; }
  #piq-viewas { gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
  .piq-viewas-left { margin-left: 0; }
  #piq-viewas button { margin-left: auto; }
}
@media (max-width: 420px) {
  #piq-bar { padding: 0 10px; gap: 2px; }
  .piq-mark span { display: none; }
}

/* Paper never shows the shell. */
@media print {
  #piq-bar, #piq-viewas, #piq-notice, .piq-pop, .piq-dialog { display: none !important; }
}

/* The See it as picker (shell/see-it-as.js): a dialog over the page. */
.piq-dialog { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 72px 16px 16px; background: rgba(22, 32, 43, .45); font: 400 14px/1.45 var(--piq-shell-font); color: var(--piq-pop-ink); }
.piq-dialog[hidden] { display: none; }
.piq-dialog-card { width: min(460px, 100%); max-height: calc(100vh - 100px); display: flex; flex-direction: column; background: #FFFFFF; border-radius: 14px; box-shadow: 0 24px 60px rgba(22, 32, 43, .3); overflow: hidden; }
.piq-dialog-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--piq-pop-line); }
.piq-dialog-head h2 { margin: 0 0 4px; font-size: 17px; font-weight: 900; }
.piq-dialog-head p { margin: 0 0 12px; color: var(--piq-pop-muted); font-size: 13px; }
.piq-dialog-head input { width: 100%; box-sizing: border-box; font: 600 14px/1.2 var(--piq-shell-font); padding: 10px 12px; border: 1px solid var(--piq-pop-line); border-radius: 9px; outline: none; }
.piq-dialog-head input:focus { border-color: var(--piq-bar-go); box-shadow: 0 0 0 3px rgba(2, 195, 134, .18); }
.piq-dialog-list { overflow: auto; padding: 6px; }
.piq-dialog-list button { display: flex; width: 100%; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 0; border-radius: 9px; background: none; cursor: pointer; font: inherit; color: inherit; }
.piq-dialog-list button:hover, .piq-dialog-list button:focus-visible { background: #F2F5F9; outline: none; }
.piq-dialog-list .piq-initials { flex: 0 0 auto; }
.piq-dialog-list b { display: block; font-weight: 800; }
.piq-dialog-list small { display: block; color: var(--piq-pop-muted); font-size: 12.5px; }
.piq-dialog-empty { padding: 18px 14px; color: var(--piq-pop-muted); }
.piq-dialog-foot { display: flex; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--piq-pop-line); }
.piq-dialog-foot button { font: 800 13px/1 var(--piq-shell-font); padding: 10px 14px; border-radius: 8px; border: 1px solid var(--piq-pop-line); background: #FFFFFF; cursor: pointer; }
.piq-dialog-err { margin: 8px 14px; color: #C62828; font-weight: 700; font-size: 13px; }
