/* Inbox engine. Uses --shy-* tokens directly; classes prefixed ibx-. */

.ibx-muted { color: var(--shy-text-muted); }
.ibx-error { color: var(--shy-danger); }

.ibx-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--shy-radius);
  background: var(--shy-brand-tint);
  color: var(--shy-text);
  font-size: 0.9rem;
}
.ibx-banner--error { background: var(--shy-danger-tint); color: var(--shy-danger); }
.ibx-banner--warn { background: var(--shy-warning-tint); color: var(--shy-warning); }

.ibx-search { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1rem; }
.ibx-search input[type="search"] {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--shy-border-strong);
  border-radius: var(--shy-radius);
  background: var(--shy-surface);
  color: var(--shy-text);
  font: inherit;
}
.ibx-check { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.88rem; color: var(--shy-text-muted); }

.ibx-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1rem; }
.ibx-tab {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--shy-border);
  border-radius: 999px;
  background: var(--shy-surface);
  color: var(--shy-text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.ibx-tab.is-active { border-color: var(--shy-brand); background: var(--shy-brand-tint); color: var(--shy-brand); font-weight: 600; }
.ibx-tab__count { color: var(--shy-text-faint); font-weight: 400; }
.ibx-tab--alert { border-color: var(--shy-warning); color: var(--shy-warning); }

.ibx-list { list-style: none; margin: 0; padding: 0; }
.ibx-list li + li { border-top: 1px solid var(--shy-border); }

.ibx-row {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) auto;
  grid-template-areas: "who subject meta" "who snippet meta";
  gap: 0.1rem 0.9rem;
  padding: 0.7rem 0.25rem;
  color: var(--shy-text);
  text-decoration: none;
}
.ibx-row:hover { background: var(--shy-surface-alt); }
.ibx-row__who { grid-area: who; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibx-row__subject { grid-area: subject; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibx-row__snippet { grid-area: snippet; overflow: hidden; color: var(--shy-text-muted); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }
.ibx-row__meta { grid-area: meta; display: flex; align-items: center; gap: 0.35rem; color: var(--shy-text-faint); font-size: 0.78rem; white-space: nowrap; }

@media (max-width: 700px) {
  /* Phones: the pills and time get their own line, wrapping as needed. */
  .ibx-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "who" "subject" "snippet" "meta"; }
  .ibx-row__meta { flex-wrap: wrap; white-space: normal; margin-top: 0.2rem; }
}

.ibx-pill {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--shy-surface-sunken);
  color: var(--shy-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}
.ibx-pill--brand { background: var(--shy-brand-tint); color: var(--shy-brand); }
.ibx-pill--warn { background: var(--shy-warning-tint); color: var(--shy-warning); }

/* --- a conversation --------------------------------------------------------- */

.ibx-thread { max-width: 56rem; }

.ibx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: -0.5rem 0 1rem; font-size: 0.85rem; }
.ibx-assign { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.ibx-assign label { color: var(--shy-text-muted); }
.ibx-assign select {
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--shy-border-strong);
  border-radius: var(--shy-radius-sm);
  background: var(--shy-surface);
  color: var(--shy-text);
  font: inherit;
}

.ibx-move { position: relative; }
.ibx-move summary { cursor: pointer; color: var(--shy-brand); }
.ibx-move__menu {
  position: absolute;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  width: max-content;
  max-width: min(26rem, 90vw);
  margin-top: 0.3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--shy-border);
  border-radius: var(--shy-radius);
  background: var(--shy-surface);
  box-shadow: var(--shy-shadow-md);
}
.ibx-move__menu form { margin: 0; }

.ibx-linkbtn {
  padding: 0;
  border: none;
  background: none;
  color: var(--shy-brand);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.ibx-emails { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.ibx-email {
  margin-bottom: 0.9rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--shy-border);
  border-radius: var(--shy-radius-lg);
  background: var(--shy-surface);
}
.ibx-email--outbound { border-left: 4px solid var(--shy-brand); }

.ibx-email__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; font-size: 0.88rem; }
.ibx-email__time { margin-left: auto; color: var(--shy-text-faint); font-size: 0.78rem; }

/* The email's page follows the app's theme (inbox--email-frame); until its
   frame loads, it's the card's own colour rather than a white flash. */
.ibx-frame {
  display: block;
  width: 100%;
  height: 6rem;
  margin-top: 0.4rem;
  border: 0;
  border-radius: var(--shy-radius-sm);
  background: var(--shy-surface);
}
.ibx-earlier { margin: 1.5rem 0 0.6rem; color: var(--shy-text-muted); font-size: 0.9rem; font-weight: 600; }

.ibx-attachments { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0.6rem 0 0; padding: 0; }
.ibx-attachments a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--shy-border);
  border-radius: var(--shy-radius);
  color: var(--shy-text);
  font-size: 0.82rem;
  text-decoration: none;
}
.ibx-attachments img { width: 3rem; height: 3rem; border-radius: var(--shy-radius-sm); object-fit: cover; }

.ibx-reply {
  padding: 1rem;
  border: 1px solid var(--shy-border);
  border-radius: var(--shy-radius-lg);
  background: var(--shy-surface);
}
.ibx-reply h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }

.ibx-composer .field input[type="text"], .ibx-composer .field input[type="email"] { max-width: none; }
.ibx-composer__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 700px) { .ibx-composer__row { grid-template-columns: minmax(0, 1fr); } }
.engine-inbox trix-editor.ibx-richtext { min-height: 10rem; }

.ibx-review { margin-top: 0.75rem; }
.ibx-quote { margin-top: 0.5rem; padding-left: 0.75rem; border-left: 3px solid var(--shy-border-strong); }
.ibx-sendback { display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.ibx-sendback input, .ibx-rule-form input[type="text"], .ibx-rule-form select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--shy-border-strong);
  border-radius: var(--shy-radius);
  background: var(--shy-surface);
  color: var(--shy-text);
  font: inherit;
}
.ibx-sendback input { flex: 1; min-width: 0; }

/* --- settings pages --------------------------------------------------------- */

.ibx-rule-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ibx-rule-form input[type="text"] { flex: 1 1 12rem; }

.ibx-steps li { margin: 0.5rem 0; }
.ibx-code {
  margin: 0.35rem 0;
  padding: 0.5rem 0.7rem;
  overflow-x: auto;
  border-radius: var(--shy-radius);
  background: var(--shy-surface-sunken);
  font-family: var(--shy-font-mono);
  font-size: 0.85rem;
}

.ibx-details { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; margin: 0 0 0.9rem; }
.ibx-details dt { color: var(--shy-text-muted); }
.ibx-details dd { margin: 0; }

.ibx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }
.ibx-scroll { overflow-x: auto; }

/* --- AI drafts, topics, insights ------------------------------------------ */

.ibx-reply__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.ibx-reply__head h2 { margin: 0; }

.ibx-summary { margin: -0.25rem 0 1rem; color: var(--shy-text-muted); font-size: 0.9rem; }

.ibx-ai {
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--shy-brand);
  border-radius: 0 var(--shy-radius) var(--shy-radius) 0;
  background: var(--shy-brand-tint);
  font-size: 0.85rem;
}
.ibx-ai p { margin: 0.2rem 0; }
.ibx-ai__title { font-weight: 600; }
.ibx-ai__missing { margin: 0.35rem 0; color: var(--shy-warning); }
.ibx-ai__missing ul { margin: 0.25rem 0 0; padding-left: 1.2rem; }

.ibx-spinner {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.35rem;
  vertical-align: -0.1rem;
  border: 2px solid var(--shy-border);
  border-top-color: var(--shy-brand);
  border-radius: 50%;
  animation: ibx-spin 0.7s linear infinite;
}
@keyframes ibx-spin { to { transform: rotate(360deg); } }

.ibx-select {
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--shy-border-strong);
  border-radius: var(--shy-radius);
  background: var(--shy-surface);
  color: var(--shy-text);
  font: inherit;
}

.ibx-intent-form { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.2rem; }
.ibx-intent-form input {
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--shy-border-strong);
  border-radius: var(--shy-radius-sm);
  background: var(--shy-surface);
  color: var(--shy-text);
  font: inherit;
}
.ibx-intent-form input:first-child { font-weight: 600; }
.ibx-intent-form input:last-child { flex: 1 1 14rem; }

.ibx-subhead { margin: 1rem 0 0.4rem; font-size: 0.95rem; }

.ibx-bars { list-style: none; margin: 0; padding: 0; }
.ibx-bars li { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr 3rem; align-items: center; gap: 0.6rem; margin: 0.3rem 0; font-size: 0.88rem; }
.ibx-bar-track { height: 0.55rem; border-radius: 999px; background: var(--shy-surface-sunken); overflow: hidden; }
.ibx-bar-fill { display: block; height: 100%; background: var(--shy-brand); }

/* --- job applications -------------------------------------------------------- */

.ibx-inline { display: inline; }
.ibx-app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1rem; }

.ibx-deck-wrap { max-width: 40rem; margin: 0 auto; }
.ibx-viewtoggle { display: inline-flex; background: var(--shy-surface); margin: -0.4rem 0 1rem; border: 1px solid var(--shy-border); border-radius: 999px; overflow: hidden; font-size: 0.85rem; }
.ibx-viewtoggle__opt { padding: 0.25rem 0.8rem; color: var(--shy-text-muted); text-decoration: none; }
.ibx-viewtoggle__opt + .ibx-viewtoggle__opt { border-left: 1px solid var(--shy-border); }
.ibx-viewtoggle__opt.is-active { background: var(--shy-brand-tint); color: var(--shy-brand); font-weight: 600; }
.ibx-deck__count { margin: 0 0 0.75rem; font-size: 0.88rem; }
.ibx-deck__keys { color: var(--shy-text-faint); }
@media (hover: none) { .ibx-deck__keys { display: none; } }

/* Every card is in the deck; only the top one shows, the next two peek out
   underneath so it reads as a stack. */
.ibx-deck { display: grid; isolation: isolate; }
.ibx-deck > .ibx-app { grid-area: 1 / 1; }
.ibx-deck > .ibx-app:nth-child(n + 4) { display: none; }
.ibx-deck > .ibx-app:nth-child(2) { transform: translateY(10px) scale(0.97); z-index: -1; pointer-events: none; }
.ibx-deck > .ibx-app:nth-child(3) { transform: translateY(20px) scale(0.94); z-index: -2; pointer-events: none; }
.ibx-deck > .ibx-app:nth-child(n + 2) > * { visibility: hidden; }
.ibx-deck > .ibx-app:first-child {
  z-index: 1;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.ibx-deck > .ibx-app.is-dragging { cursor: grabbing; transition: none; }
.ibx-deck > .ibx-app.is-leaving { opacity: 0; pointer-events: none; }

.ibx-app {
  position: relative;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--shy-border);
  border-radius: calc(var(--shy-radius) * 2);
  background: var(--shy-surface);
  box-shadow: var(--shy-shadow);
  color: var(--shy-text);
  overflow-wrap: anywhere;
}
.ibx-app__stamp {
  position: absolute;
  top: 1.25rem;
  padding: 0.2rem 0.6rem;
  border: 3px solid;
  border-radius: var(--shy-radius);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}
.ibx-app__stamp--yes { left: 1.25rem; color: var(--shy-success); opacity: var(--yes, 0); transform: rotate(-12deg); }
.ibx-app__stamp--no { right: 1.25rem; color: var(--shy-danger); opacity: var(--no, 0); transform: rotate(12deg); }

.ibx-app__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.ibx-app__name { margin: 0; font-size: 1.5rem; }
.ibx-app__contact { margin: 0.2rem 0 0; font-size: 0.9rem; }
.ibx-app__when { margin: 0.15rem 0 0; font-size: 0.82rem; }

.ibx-app__filter {
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--shy-radius);
  background: var(--shy-warning-tint);
  color: var(--shy-text);
  font-size: 0.88rem;
}
.ibx-app__filter ul { margin: 0.35rem 0 0; padding-left: 1.2rem; color: var(--shy-text-muted); }

.ibx-app__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin: 1rem 0 0; }
.ibx-app__fact { padding: 0.5rem 0.65rem; border-radius: var(--shy-radius); background: var(--shy-surface-alt); }
.ibx-app__fact dt { color: var(--shy-text-muted); font-size: 0.74rem; line-height: 1.3; }
.ibx-app__fact dd { margin: 0.1rem 0 0; font-weight: 600; }
.ibx-app__fact.is-flag { background: var(--shy-danger-tint); }
.ibx-app__fact.is-flag dd { color: var(--shy-danger); }

.ibx-app__resume { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 1rem 0 0; }
.ibx-app__file { font-size: 0.88rem; color: var(--shy-text-muted); }

.ibx-app__essay { margin: 1.1rem 0 0; }
.ibx-app__essay h3 { margin: 0 0 0.25rem; color: var(--shy-text-muted); font-size: 0.82rem; font-weight: 600; }
.ibx-app__essay p { margin: 0 0 0.5rem; line-height: 1.5; }
.ibx-app__link { margin: 1rem 0 0; font-size: 0.9rem; }
.ibx-app__foot { margin: 1.1rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--shy-border); font-size: 0.84rem; }

.ibx-deck__empty { padding: 3rem 1rem; text-align: center; }
.ibx-deck__actions { display: flex; justify-content: center; align-items: center; gap: 1.25rem; margin: 2rem 0 0; }
.ibx-swipe-btn {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  border: 2px solid var(--shy-border-strong);
  border-radius: 50%;
  background: var(--shy-surface);
  box-shadow: var(--shy-shadow);
  font-size: 1.5rem;
  cursor: pointer;
}
.ibx-swipe-btn--no { border-color: var(--shy-danger); color: var(--shy-danger); }
.ibx-swipe-btn--yes { border-color: var(--shy-success); color: var(--shy-success); }
.ibx-swipe-btn--undo { width: 2.75rem; height: 2.75rem; font-size: 1.1rem; color: var(--shy-text-muted); }
.ibx-swipe-btn:disabled { opacity: 0.35; cursor: default; }
.ibx-swipe-btn:not(:disabled):hover { background: var(--shy-surface-alt); }
.ibx-deck__empty:not([hidden]) ~ .ibx-deck__actions .ibx-swipe-btn--no,
.ibx-deck__empty:not([hidden]) ~ .ibx-deck__actions .ibx-swipe-btn--yes { visibility: hidden; }

.ibx-deck__toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 50;
  margin: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--shy-text);
  color: var(--shy-surface);
  font-size: 0.88rem;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.2s;
  pointer-events: none;
}
.ibx-deck__toast.is-shown { opacity: 1; }

.ibx-app-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.7rem 0.25rem; }
.ibx-app-row .ibx-app-actions { margin: 0; }
.ibx-app-row__main { display: grid; gap: 0.25rem; flex: 1 1 20rem; min-width: 0; color: var(--shy-text); text-decoration: none; }
.ibx-app-row__main:hover .ibx-app-row__name { text-decoration: underline; }
.ibx-app-row__name { font-weight: 600; }
.ibx-app-row__facts { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ibx-app-row__reason { font-size: 0.82rem; }
.ibx-pill--good { background: var(--shy-success-tint); color: var(--shy-success); }
.ibx-app__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem; }
.ibx-app__tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0 0 0.4rem; }
.ibx-app__points { display: grid; gap: 0.35rem; margin: 0.9rem 0 0; padding: 0; list-style: none; font-size: 0.88rem; }

/* The resume pop-up. The document is what scrolls (the shell has no inner
   scroller), so html is what's frozen while it's open -- same as dye's
   video player. */
html:has(.ibx-resume[open]) { overflow: hidden; }
.ibx-resume {
  width: min(56rem, 100vw - 2rem);
  height: min(92vh, 100dvh - 2rem);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--shy-border);
  border-radius: calc(var(--shy-radius) * 2);
  background: var(--shy-surface);
  color: var(--shy-text);
  box-shadow: var(--shy-shadow-md);
  overscroll-behavior: contain;
}
.ibx-resume[open] { display: flex; flex-direction: column; }
.ibx-resume::backdrop { background: rgb(0 0 0 / 0.6); }
.ibx-resume__bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--shy-border); }
.ibx-resume__name { flex: 1; min-width: 0; overflow: hidden; color: var(--shy-text-muted); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }
.ibx-resume__close { padding: 0.2rem 0.55rem; border: 0; background: none; color: var(--shy-text-muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
/* The three viewers set their own display, which would otherwise beat the
   hidden attribute and show all three at once (the empty frame and a broken
   image covered the PDF pages on phones). */
.ibx-resume__body [hidden] { display: none; }
.ibx-resume__body { position: relative; flex: 1; min-height: 0; background: #e9e9ea; }
.ibx-resume__body iframe { width: 100%; height: 100%; border: 0; display: block; background: #e9e9ea; }
.ibx-resume__body img { display: block; max-width: 100%; margin: 0 auto; }
/* Drawn PDFs and images: the viewer does its own pinch zoom (resume
   controller), so the browser may only scroll here, never zoom the screen. */
.ibx-resume__body--zoomable { overflow: auto; touch-action: pan-x pan-y; }
@media (max-width: 600px) {
  .ibx-resume { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
}
/* Block, not grid: a zoomed page wider than the viewer has to overflow to the
   RIGHT so it can be scrolled to; centring would push its left edge out of
   reach. */
.ibx-resume__pages { padding: 0.75rem 0 0; }
.ibx-resume__pages canvas { display: block; margin: 0 auto 0.75rem; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.2); }
.ibx-resume__zoom { display: inline-flex; align-items: center; gap: 0.2rem; color: var(--shy-text-muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.ibx-resume__zoom[hidden] { display: none; }
.ibx-resume__zoom button {
  width: 2rem; height: 2rem; border: 1px solid var(--shy-border); border-radius: var(--shy-radius);
  background: var(--shy-surface); color: var(--shy-text); font-size: 1.1rem; line-height: 1; cursor: pointer;
}

/* --- AI-first replying: the brief and "Tell the AI" ----------------------- */

.ibx-brief {
  margin: 0 0 0.9rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--shy-border);
  border-left: 4px solid var(--shy-warning);
  border-radius: var(--shy-radius);
  background: var(--shy-surface-alt);
  font-size: 0.92rem;
}
.ibx-brief--ready { border-left-color: var(--shy-success); }
.ibx-brief__status { margin: 0; font-weight: 600; }
.ibx-brief--ready .ibx-brief__status { color: var(--shy-success); }
.ibx-brief__questions { margin: 0.4rem 0 0; padding-left: 1.3rem; }
.ibx-brief__questions li + li { margin-top: 0.25rem; }
.ibx-brief__actions { margin: 0.75rem 0 0; padding: 0.55rem 0.75rem; border-radius: var(--shy-radius); background: var(--shy-surface); }
.ibx-brief__label { margin: 0 0 0.25rem; color: var(--shy-text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.ibx-brief__actions ul { margin: 0; padding-left: 1.1rem; }
.ibx-brief__note { margin: 0.6rem 0 0; color: var(--shy-text-muted); }
.ibx-brief__stale { margin: 0 0 0.6rem; padding: 0.4rem 0.6rem; border-radius: var(--shy-radius); background: var(--shy-warning-tint); }
.ibx-brief__sources { margin: 0.6rem 0 0; }
.ibx-brief__sources summary { color: var(--shy-text-muted); font-size: 0.82rem; cursor: pointer; }
.ibx-brief__sources .ibx-ai { margin-top: 0.4rem; }

.ibx-context { margin: 0 0 1.1rem; }
.ibx-context__said { margin: 0 0 0.5rem; padding: 0; list-style: none; font-size: 0.86rem; }
.ibx-context__said li { padding: 0.3rem 0.55rem; border-radius: var(--shy-radius); background: var(--shy-brand-tint); }
.ibx-context__said li + li { margin-top: 0.3rem; }
.ibx-context__label { display: block; margin: 0 0 0.3rem; font-weight: 600; font-size: 0.9rem; }
.ibx-context__row { display: flex; align-items: flex-end; gap: 0.5rem; }
.ibx-context__row textarea {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--shy-border-strong);
  border-radius: var(--shy-radius);
  background: var(--shy-surface);
  color: var(--shy-text);
  font: inherit;
  resize: vertical;
}
.ibx-mic {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--shy-border-strong);
  border-radius: 50%;
  background: var(--shy-surface);
  font-size: 1.1rem;
  cursor: pointer;
}
.ibx-mic.is-recording { border-color: var(--shy-danger); background: var(--shy-danger-tint); animation: ibx-pulse 1.2s ease-in-out infinite; }
.ibx-mic:disabled { opacity: 0.45; cursor: default; }
@keyframes ibx-pulse { 50% { box-shadow: 0 0 0 6px var(--shy-danger-tint); } }
.ibx-context__status { min-height: 1em; margin: 0.3rem 0 0; font-size: 0.82rem; }
/* The "New email" page: header button, and the not-sent-yet note. */
.ibx-new-note { margin: 0 0 1rem; }
@media (max-width: 600px) {
  .ibx-context__row { flex-wrap: wrap; }
  .ibx-context__row textarea { flex-basis: 100%; }
}

/* --- regular customers ------------------------------------------------------ */

.ibx-regular { font-size: 0.92rem; }
.ibx-regular p { margin: 0 0 0.5rem; }
.ibx-regular ul { margin: 0 0 0.6rem; padding-left: 1.2rem; }
.ibx-regular__label { margin: 0.6rem 0 0.2rem !important; color: var(--shy-text-muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.ibx-regular__notes { display: grid; gap: 0.35rem; margin: 0.75rem 0 0.4rem; }
.ibx-regular__notes label { font-weight: 600; font-size: 0.88rem; }
.ibx-regular__notes textarea {
  padding: 0.5rem 0.65rem; border: 1px solid var(--shy-border-strong); border-radius: var(--shy-radius);
  background: var(--shy-surface); color: var(--shy-text); font: inherit;
}
.ibx-regular__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.ibx-regular-fold { margin: 0 0 0.9rem; padding: 0.55rem 0.8rem; border: 1px solid var(--shy-border); border-radius: var(--shy-radius); background: var(--shy-surface); }
.ibx-regular-fold summary { color: var(--shy-success); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.ibx-regular-fold[open] summary { margin-bottom: 0.6rem; }
a.ibx-pill { text-decoration: none; }

/* The editor while the AI rewrites the draft. */
.ibx-editor-wrap { position: relative; }
.ibx-editor-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: var(--shy-radius);
  background: color-mix(in srgb, var(--shy-surface) 72%, transparent);
  color: var(--shy-text);
  font-weight: 600;
  backdrop-filter: blur(1.5px);
}
.ibx-editor-wrap.is-drafting .ibx-editor-overlay { display: flex; }
.ibx-editor-wrap.is-drafting trix-editor { pointer-events: none; }
.ibx-editor-overlay .ibx-spinner { width: 1.4rem; height: 1.4rem; margin: 0; border-width: 3px; }

/* --- Shopify: the order panel and refund cards ---------------------------- */

/* The orders panel is a deferred section's frame (turbo-frame is inline by default). */
.ibx-orders-frame { display: block; }
.ibx-orders { margin: 0 0 1rem; border: 1px solid var(--shy-border); border-radius: var(--shy-radius); background: var(--shy-surface); }
.ibx-crm { margin: 0 0 1rem; padding: 0.6rem 0.9rem; border: 1px solid var(--shy-border); border-radius: var(--shy-radius); background: var(--shy-surface); font-size: 0.92rem; line-height: 1.6; }
.ibx-crm a { color: var(--shy-brand); }
.ibx-orders > summary { padding: 0.6rem 0.9rem; font-weight: 600; cursor: pointer; }
.ibx-orders__body { padding: 0 0.9rem 0.8rem; }
.ibx-orders__meta { margin: 0 0 0.5rem; font-size: 0.82rem; }
.ibx-orders__error { margin: 0 0 0.6rem; }
.ibx-orders__error > .ibx-muted { margin: 0.3rem 0 0; font-size: 0.82rem; overflow-wrap: anywhere; }
.ibx-orders__history { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; }
.ibx-order { margin: 0 0 0.5rem; padding: 0.5rem 0.7rem; border: 1px solid var(--shy-border); border-radius: var(--shy-radius); background: var(--shy-surface-alt); }
.ibx-order > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; cursor: pointer; }
.ibx-order__body { margin-top: 0.5rem; font-size: 0.9rem; }
.ibx-order__body p { margin: 0.35rem 0 0; }
.ibx-order__lines { margin: 0; padding: 0; list-style: none; }
.ibx-order__lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; border-bottom: 1px solid var(--shy-border); }

.ibx-refund { margin: 0.4rem 0 0; padding: 0.6rem 0.75rem; border: 1px solid var(--shy-border); border-left: 4px solid var(--shy-brand); border-radius: var(--shy-radius); background: var(--shy-surface-alt); }
.ibx-refund--done { border-left-color: var(--shy-success); }
.ibx-refund--failed, .ibx-refund--executing { border-left-color: var(--shy-danger); }
.ibx-refund--declined { border-left-color: var(--shy-border-strong); }
.ibx-refund--dry_run, .ibx-refund--handled { border-left-color: var(--shy-success); }
.ibx-refund__head { display: flex; justify-content: space-between; gap: 1rem; }
.ibx-refund__amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.ibx-refund__lines { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; }
.ibx-customorder__link { margin: 0.3rem 0 0; font-size: 0.85rem; overflow-wrap: anywhere; }
.ibx-refund__reason, .ibx-refund__status, .ibx-refund__mode { margin: 0.35rem 0 0; font-size: 0.88rem; }
.ibx-refund__status--good { color: var(--shy-success); font-weight: 600; }
.ibx-refund__warn { margin: 0.4rem 0 0; padding: 0.35rem 0.55rem; border-radius: var(--shy-radius); background: var(--shy-danger-tint); color: var(--shy-danger); font-size: 0.88rem; }
.ibx-refund__said { margin: 0.45rem 0 0; padding: 0.45rem 0.6rem; border-radius: var(--shy-radius); font-size: 0.9rem; font-weight: 600; }
.ibx-refund__said--notice { background: var(--shy-success-tint); color: var(--shy-success); }
.ibx-refund__said--alert { background: var(--shy-warning-tint); color: var(--shy-text); border-left: 3px solid var(--shy-warning); }
/* Landed on by the card's own buttons: keep it clear of the sticky top bar. */
.ibx-refund { scroll-margin-top: 5rem; }
.ibx-autosave { margin-left: auto; font-size: 0.82rem; }
.ibx-autosave--error { color: var(--shy-danger); }
.ibx-refund__buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.55rem; }
.ibx-refund__buttons form { display: inline-flex; align-items: center; gap: 0.5rem; }
.ibx-refund__confirm { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.88rem; color: var(--shy-danger); font-weight: 600; }
.ibx-settings__heading { margin: 1.5rem 0 0.4rem; font-size: 1.05rem; }
.ibx-settings__tests { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.ibx-orders a, .ibx-refund a { color: var(--shy-brand); }
.ibx-setup { margin: 0.4rem 0 1rem; padding: 0.6rem 0.9rem; border: 1px solid var(--shy-border); border-radius: var(--shy-radius); background: var(--shy-surface-alt); font-size: 0.92rem; }
.ibx-setup > summary { font-weight: 600; cursor: pointer; }
.ibx-setup__steps { padding-left: 1.3rem; }
.ibx-setup__steps > li + li { margin-top: 0.6rem; }
.ibx-setup__steps ul { margin: 0.3rem 0; padding-left: 1.1rem; }
.ibx-setup__copy { overflow-wrap: anywhere; user-select: all; }
.ibx-setup__code { margin: 0.4rem 0; padding: 0.5rem 0.7rem; overflow-x: auto; border-radius: var(--shy-radius); background: var(--shy-surface); font-size: 0.85rem; user-select: all; }
.ibx-learned { padding-left: 1.1rem; } .ibx-learned li + li { margin-top: 0.5rem; }
.ibx-refund__addressform { width: 100%; }
.ibx-refund__label { margin: 0.4rem 0 0.2rem; font-size: 0.85rem; }
.ibx-address { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.4rem 0.6rem; margin-bottom: 0.4rem; }
.ibx-address__field { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.8rem; color: var(--shy-text-muted); }
.ibx-address__field--address1 { grid-column: span 2; }
.ibx-address__field input { padding: 0.35rem 0.5rem; border: 1px solid var(--shy-border-strong); border-radius: var(--shy-radius); background: var(--shy-surface); color: var(--shy-text); font: inherit; font-size: 0.9rem; }
.ibx-address__field input.is-changed { border-color: var(--shy-brand); background: var(--shy-brand-tint); }
.ibx-refund__buttons form.ibx-refund__addressform { display: block; width: 100%; }
.ibx-address__field { min-width: 0; }
.ibx-address__field input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 30rem) { .ibx-address { grid-template-columns: 1fr 1fr; } }

/* Interviewing an applicant (interviews/edit, and the summary on their page). */
.ibx-iv { max-width: 48rem; }
.ibx-iv [hidden] { display: none !important; } /* .ibx-tabs and .shy-btn set display */
.ibx-iv__nav button.ibx-tab { font: inherit; cursor: pointer; }
.ibx-iv__step { margin: 0 0 1.5rem; }
.ibx-iv__title { margin: 0 0 0.75rem; font-size: 1.1rem; }
.ibx-iv__say {
  margin: 0 0 1.25rem; padding: 0.75rem 0.9rem; border-left: 3px solid var(--shy-brand);
  border-radius: var(--shy-radius); background: var(--shy-brand-tint); line-height: 1.5;
}
.ibx-iv__say-label, .ibx-iv__guide span {
  display: block; margin-bottom: 0.2rem; color: var(--shy-text-muted);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.ibx-iv__q { display: grid; gap: 0.4rem; margin: 0 0 1.4rem; }
.ibx-iv__ask { font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.ibx-iv__guide {
  margin: 0; padding: 0.5rem 0.7rem; border: 1px dashed var(--shy-border-strong); border-radius: var(--shy-radius);
  color: var(--shy-text-muted); font-size: 0.86rem; line-height: 1.45;
}
.ibx-iv__answer {
  box-sizing: border-box; width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--shy-border-strong); border-radius: var(--shy-radius);
  background: var(--shy-surface); color: var(--shy-text); font: inherit; line-height: 1.45; resize: vertical;
}
.ibx-iv__choices { display: flex; gap: 0.5rem; }
.ibx-iv__choice {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem;
  border: 1px solid var(--shy-border-strong); border-radius: var(--shy-radius); cursor: pointer;
}
.ibx-iv__choice:has(input:checked) { border-color: var(--shy-brand); background: var(--shy-brand-tint); color: var(--shy-brand); font-weight: 600; }
.ibx-iv__notes { padding-top: 1rem; border-top: 1px solid var(--shy-border); }
.ibx-iv__bar {
  position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  padding: 0.75rem 0; border-top: 1px solid var(--shy-border); background: var(--shy-bg);
}
.ibx-iv-summary { margin: 0 0 1rem; }
.ibx-iv-summary__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.ibx-iv-summary__head .ibx-iv__title { margin: 0 auto 0 0; }
.ibx-iv-summary__notes { padding: 0.6rem 0.8rem; border-radius: var(--shy-radius); background: var(--shy-brand-tint); }

/* The interview schedule (bookings/index). */
.ibx-sched-day { margin: 0 0 1.75rem; }
.ibx-sched-day__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin: 0 0 0.75rem; font-size: 1.1rem; }
.ibx-sched-day__title .ibx-muted { font-size: 0.85rem; font-weight: 400; }
.ibx-sched { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; margin: 0 0 0.85rem; padding: 1rem 1.15rem; }
.ibx-sched.is-now, .ibx-sched.is-next { border-color: var(--shy-brand); box-shadow: 0 0 0 2px var(--shy-brand-tint), var(--shy-shadow); }
.ibx-sched.is-over:not(.is-now) { opacity: 0.8; }
.ibx-sched.is-cancelled { opacity: 0.55; }
.ibx-sched.is-cancelled .ibx-sched__time strong { text-decoration: line-through; }
.ibx-sched__time { display: grid; align-content: start; gap: 0.2rem; }
.ibx-sched__time strong { font-size: 1.15rem; }
.ibx-sched__time .ibx-muted { font-size: 0.82rem; }
.ibx-sched__time .ibx-pill { justify-self: start; }
.ibx-sched__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.75rem; }
.ibx-sched__head .ibx-app__name { margin: 0; font-size: 1.2rem; }
.ibx-sched__head .ibx-app__name a { color: inherit; }
.ibx-sched__message { margin: 0.5rem 0; padding: 0.45rem 0.7rem; border-left: 3px solid var(--shy-border-strong); font-size: 0.92rem; }
.ibx-sched__answers { margin: 0.6rem 0 0; }
.ibx-sched__answers summary { cursor: pointer; color: var(--shy-brand); font-size: 0.9rem; font-weight: 600; }
.ibx-sched__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.85rem; }
.ibx-sched__actions .ibx-app__resume { margin: 0; }
@media (max-width: 560px) {
  .ibx-sched { grid-template-columns: 1fr; gap: 0.5rem; }
  .ibx-sched__time { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 0.5rem; }
}
.ibx-iv-summary__booked { margin: 0.6rem 0 0; }

/* The interview page's three views (Interview / Application / Resume), switched
   from the sticky bar: only the pane matching data-view shows. */
.ibx-ivpage { max-width: 48rem; }
.ibx-ivpage__pane { display: none; }
.ibx-ivpage[data-view="interview"] .ibx-ivpage__pane--interview,
.ibx-ivpage[data-view="application"] .ibx-ivpage__pane--application,
.ibx-ivpage[data-view="resume"] .ibx-ivpage__pane--resume { display: block; }
.ibx-ivpage:not([data-view="interview"]) .ibx-ivpage__steps,
.ibx-ivpage:not([data-view="interview"]) .ibx-autosave:empty { display: none; }
.ibx-ivpage .ibx-iv__bar { z-index: 5; }
.ibx-ivpage__views { margin: 0; }
.ibx-ivpage__views button { border: 0; background: none; font: inherit; cursor: pointer; }
.ibx-ivpage__views button.is-active { background: var(--shy-brand-tint); }
.ibx-ivpage__steps { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.ibx-ivref { margin-bottom: 1rem; }
.ibx-ivref .ibx-app__facts { margin-top: 0.75rem; }
.ibx-resume--inline {
  display: flex; flex-direction: column; width: 100%;
  height: max(28rem, calc(100dvh - 11rem)); box-shadow: none;
}
.ibx-ivpage [hidden] { display: none !important; } /* .shy-btn and .ibx-tabs set display */

/* The recording box at the end of the interview, and what it filled in. */
.ibx-iv__rec { display: grid; gap: 0.6rem; margin: 0 0 1.5rem; padding: 1rem 0 0; border-top: 1px solid var(--shy-border); }
.ibx-iv__rec-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.ibx-iv__rec-form .ibx-iv__guide { flex-basis: 100%; }
.ibx-iv__rec-form input[type=file] { max-width: 100%; font: inherit; font-size: 0.9rem; }
.ibx-iv__rec-upload { flex-basis: 100%; display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 0.9rem; }
.ibx-iv__rec-upload progress { flex: 1; max-width: 20rem; }
.ibx-iv__rec-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; padding: 0.7rem 0.85rem; border-radius: var(--shy-radius); background: var(--shy-brand-tint); }
.ibx-iv__rec-error { margin: 0; padding: 0.6rem 0.8rem; border-radius: var(--shy-radius); background: var(--shy-danger-tint, var(--shy-warning-tint)); }
.ibx-iv__spinner { width: 1rem; height: 1rem; border: 2px solid var(--shy-brand); border-right-color: transparent; border-radius: 50%; animation: ibx-spin 0.9s linear infinite; }
@keyframes ibx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ibx-iv__spinner { animation: none; } }
.ibx-iv__audio { width: 100%; max-width: 28rem; }
.ibx-iv__fromrec { justify-self: start; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--shy-brand-tint); color: var(--shy-brand); font-size: 0.72rem; font-weight: 600; }
.ibx-iv__transcript { font-size: 0.95rem; line-height: 1.55; }
.ibx-ivpage[data-view="transcript"] .ibx-ivpage__pane--transcript { display: block; }
/* The interview's Save button: quiet when everything's saved, loud when not. */
.ibx-iv__save { margin-left: auto; min-width: 6.5rem; }
.ibx-iv__save:disabled { opacity: 1; cursor: default; color: var(--shy-success); border-color: var(--shy-border); }
.ibx-iv__save.is-dirty { border-color: var(--shy-warning); color: var(--shy-warning); font-weight: 600; }
.ibx-ivpage .ibx-iv__bar .ibx-autosave { margin-left: 0; }

/* Reply attachments (2026-10-06). Trix's own file button is hidden in the
   reply box: a file in the body can't go out with the email. */
.ibx-composer trix-toolbar [data-trix-button-group="file-tools"] { display: none; }
.ibx-attach__list { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.ibx-attach__list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; padding: 0.15rem 0; }
.ibx-attach input[type="file"] { max-width: 100%; }
