.ag-page {
  --ag-ink: #32231e;
  --ag-sub: #705f53;
  --ag-paper: #fffaf4;
  --ag-rule: #e7dcd2;
  max-width: 980px;
  margin: auto;
  color: var(--ag-ink);
  overflow-wrap: anywhere;
}

.ag-directory { max-width: 880px; }
.ag-history-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ag-count { display: inline-flex; align-items: center; gap: 7px; color: var(--ag-sub); font-size: 13px; font-weight: 650; }
.ag-count img { flex: none; object-fit: contain; }
.ag-history-bar a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid var(--ag-rule);
  border-radius: 12px;
  background: #fffdf9;
  color: var(--ag-ink);
  font-size: 13px;
  font-weight: 650;
}
.ag-history-bar a:hover { border-color: #d0b09a; background: #fff3e7; }
.ag-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.ag-card {
  --ag-card-base: #ffeadf;
  --ag-portrait-base: #ffd7bb;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 19px;
  background-color: var(--ag-card-base);
  color: var(--ag-ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ag-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 0;
  width: 42px;
  height: 28px;
  background-color: currentColor;
  opacity: .08;
  -webkit-mask: url('/assets/soda/agents-checks.webp') right bottom / contain no-repeat;
  mask: url('/assets/soda/agents-checks.webp') right bottom / contain no-repeat;
}
.ag-card:nth-child(4n + 2) { --ag-card-base: #e8f2fc; --ag-portrait-base: #c5e0f7; }
.ag-card:nth-child(4n + 3) { --ag-card-base: #e9f6e9; --ag-portrait-base: #c9e7cf; }
.ag-card:nth-child(4n) { --ag-card-base: #f1eaf9; --ag-portrait-base: #e1d0ef; }
.ag-card:focus-visible, .ag-back:focus-visible, .ag-controls button:focus-visible {
  outline: 2px solid #965216;
  outline-offset: 2px;
}
@media (hover: hover) {
  .ag-card:hover { transform: translateY(-2px); box-shadow: 0 3px 0 #4a332421; }
}
.ag-portrait {
  display: inline-grid;
  position: relative;
  flex: none;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 2px solid #fffaf3;
  border-radius: 16px;
  background: var(--ag-portrait-base,#f4d9bd);
  color: #624431;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.1;
}
.ag-portrait-initial { grid-area: 1 / 1; align-self: center; justify-self: center; }
.ag-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; visibility: hidden; }
.ag-portrait.has-image img { visibility: visible; }
.ag-portrait.has-image .ag-portrait-initial { visibility: hidden; }
.ag-card .ag-portrait { width: 68px; height: 68px; border-radius: 17px; }
.ag-info { display: grid; min-width: 0; gap: 3px; }
.ag-card-name { display: flex; align-items: center; min-width: 0; gap: 4px; }
.ag-card-name h2, .ag-description {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-card-name h2 { font-size: 18px; line-height: 1.35; font-weight: 780; }
.ag-description { color: #55483e; font-size: 13px; line-height: 1.45; }
.ag-audience { color: #69584c; font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.ag-hot, .ag-open { display: grid; flex: none; place-items: center; }
.ag-hot { color: #c23d25; }
.ag-hot svg { fill: #ff6845; }
.ag-state { border: 1px solid var(--ag-rule); border-radius: 16px; padding: 24px; background: #fffdf9; color: var(--ag-sub); font-size: 14px; }
.ag-state strong { color: var(--ag-ink); font-size: 17px; }
.ag-state > div { display: flex; align-items: center; gap: 12px; }

.ag-chat {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  height: calc(100dvh - 58px);
  max-height: 920px;
  min-height: 270px;
  max-width: 820px;
  overflow: hidden;
  border: 1px solid var(--ag-rule);
  border-radius: 20px;
  background: var(--ag-paper);
}
.ag-channel {
  --ag-name-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--ag-rule);
  background: #fffcf8;
}
.ag-channel h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--ag-name-size);
  font-weight: 740;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-channel .ag-portrait { width: var(--ag-name-size); height: var(--ag-name-size); border: 0; border-radius: 5px; font-size: .75rem; }
.ag-back { flex: 0 0 36px; align-self: stretch; display: grid; place-items: center; border-radius: 8px; color: var(--ag-ink); }
.ag-back:hover { background: #ffeadc; }
.ag-back svg { transform: rotate(180deg); }
.ag-channel-actions { display:flex; align-items:center; gap:10px; flex:none; margin-left:auto; }
.ag-channel-history,.ag-new-chat { display:inline-flex; align-items:center; justify-content:center; gap:4px; min-height:34px; font-size:13px; font-weight:650; white-space:nowrap; }
.ag-channel-history { color:var(--ag-sub); }
.ag-new-chat { padding:0 9px; border:0; border-radius:10px; background:#ffe7d6; color:#743e2b; }
.ag-new-chat:hover { background:#ffddc6; }
.ag-new-chat:disabled { opacity:.65; }
@media (max-width:520px) {
  .ag-channel-actions { gap:3px; }
  .ag-channel-history { width:34px; }
  .ag-channel-history span { display:none; }
}
.ag-read-only { margin:0; padding:13px 12px max(13px,env(safe-area-inset-bottom)); text-align:center; border-top:1px solid var(--ag-rule); color:var(--ag-sub); font-size:13px; }
.ag-log { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 22px clamp(16px,3vw,32px); }
.ag-line { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 21px; }
.ag-line.mine { align-items: flex-end; }
.ag-line.mine > p {
  max-width: 84%;
  margin: 0;
  padding: 10px 15px;
  border-radius: 18px 18px 5px 18px;
  background: #ffe8d7;
  color: var(--ag-ink);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ag-welcome { max-width: 360px; margin: clamp(24px,11dvh,100px) auto; text-align: center; }
.ag-welcome h2 { margin: 12px 0 6px; font-size: 20px; }
.ag-welcome p { margin: 0; color: var(--ag-sub); font-size: 14px; line-height: 1.65; white-space: pre-line; }

.ag-compose { padding: 9px clamp(12px,2vw,24px); background: var(--ag-paper); }
.ag-controls {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 2px 4px 2px 17px;
  border: 1px solid #dfd5cb;
  border-radius: 26px;
  background: #fff;
}
.ag-controls:focus-within { border-color: #ab735d; }
.ag-controls textarea {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 44px;
  max-height: 144px;
  max-height: min(144px,30dvh);
  padding: 10px 0;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ag-ink);
  font-size: 16px;
  line-height: 24px;
  field-sizing: content;
  overflow-y: auto;
}
.ag-controls textarea:focus { outline: none; }
.ag-controls textarea::placeholder { color: #82756e; }
.ag-attach, .ag-send { display: grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.ag-attach { color: var(--ag-ink); }
.ag-send { border: 4px solid transparent; background: #402824 padding-box; color: #fff; }
.ag-send svg { transform: rotate(-90deg); }
.ag-attach:disabled, .ag-send:disabled { opacity: .45; }
@media (hover: hover) {
  .ag-attach:not(:disabled):hover { background: #fff1e8; }
  .ag-send:not(:disabled):hover { background-color: #713e30; }
}
.ag-status { margin: 0 0 7px; color: #80493d; font-size: 12px; }
.ag-status:empty { display: none; }
.ag-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ag-files { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; padding-top: 3px; }
.ag-files[hidden] { display: none; }
.ag-thumbnail { display: inline-flex; position: relative; }
.ag-thumbnail img, .ag-sent-images img { width: 56px; height: 56px; object-fit: cover; border: 1px solid #ddd2c8; border-radius: 9px; background: #fff0e3; }
.ag-thumbnail .ag-remove-photo { position: absolute; top: -3px; right: -4px; display: grid; place-items: center; width: 23px; height: 23px; padding: 0; border: 1px solid white; border-radius: 50%; background: #473630; color: white; }
.ag-photo { display:grid; padding:0; border:0; border-radius:9px; overflow:hidden; background:transparent; cursor:zoom-in; }
.ag-picture-record .ag-sent-images { flex-wrap:wrap; }
.ag-picture-record .ag-sent-images img { width:76px; height:76px; }
.ag-unavailable { color:#765d4f; font-size:12px; }
.ag-image-view { max-height:70dvh; overflow:auto; overscroll-behavior:contain; }
.ag-image-zoom { display:block; margin:auto; padding:0; max-width:100%; border:0; background:transparent; cursor:zoom-in; }
.ag-image-zoom img { display:block; width:auto; height:auto; max-width:100%; }
.ag-image-zoom[aria-pressed=true], .ag-image-zoom[aria-pressed=true] img { max-width:none; cursor:zoom-out; }
.ag-file-note { margin: 6px 0 0; color: var(--ag-sub); font-size: 11px; line-height: 1.5; }
.ag-sent-images { display: flex; gap: 4px; }
.ag-picture-record { display: grid; gap: 4px; max-width: 86%; padding: 8px 11px; border-left: 2px solid #e5b694; border-radius: 4px 10px 10px 4px; background: #fff1e8; color: #705747; }
.ag-picture-record strong { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ag-picture-record span { font-size: 13px; line-height: 1.55; white-space: pre-line; }

.ag-reply {
  display: flow-root;
  min-width: 0;
  max-width: min(100%,42rem);
  padding: 14px 17px;
  border-radius: 19px 19px 19px 6px;
  background: #f8f0f6;
  color: var(--ag-ink);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.ag-reply > .ag-portrait {
  float: left;
  width: 34px;
  height: 34px;
  margin: 0 9px 4px 0;
  border-width: 1px;
  border-radius: 11px;
  font-size: 17px;
}
.ag-reply :where(p,h3,h4,ul,ol,blockquote,pre) { margin: 0; }
.ag-reply > :not(.ag-portrait) + * { margin-top: 10px; }
.ag-reply strong { font-weight: 700; }
.ag-reply pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-reply ul, .ag-reply ol { padding-inline-start: 1.4em; }
.ag-reply li + li { margin-top: 4px; }
.ag-reply blockquote { padding-inline-start: 11px; border-inline-start: 3px solid #d7b7cf; color: #624c5b; }
.ag-reply .ag-reply-heading { font-size: 16px; line-height: 1.5; color: #402c39; }
.ag-reply > :not(.ag-portrait) + .ag-reply-heading { clear: both; padding-top: 10px; border-top: 1px solid #e8dce4; }
.ag-reply.ag-with-options { width: 100%; padding: 0; background: transparent; }
.ag-with-options > .ag-portrait { width: 30px; height: 30px; }
.ag-with-options > .ag-portrait + .ag-reply-heading { padding-top: 3px; }
.ag-with-options > :not(.ag-portrait) + .ag-reply-heading { border-color: var(--ag-rule); }
.ag-copy-hint { clear: both; color: #716255; font-size: 12px; text-align: right; }
.ag-reply > .ag-copy-hint + .ag-reply-option { margin-top: 5px; }
.ag-reply-option {
  --ag-chip: #ffe3c9;
  --ag-chip-ink: #874526;
  --ag-chip-rule: #eac8a9;
  clear: both;
  padding: 10px 13px 12px;
  border: 1px solid #e1d6c9;
  border-radius: 16px;
  background: #fffdf9;
}
.ag-reply-option[data-ag-option=B] { --ag-chip: #eadef3; --ag-chip-ink: #684776; --ag-chip-rule: #d5bcdf; }
.ag-reply-option[data-ag-option=C] { --ag-chip: #d9ebd5; --ag-chip-ink: #3e6642; --ag-chip-rule: #b9d2b6; }
.ag-option-bar, .ag-option-heading { display: flex; align-items: center; min-width: 0; gap: 7px; }
.ag-option-bar { justify-content: space-between; }
.ag-option-heading { color: #392a20; font-size: 15px; line-height: 1.45; }
.ag-option-letter {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  border: 1px solid var(--ag-chip-rule);
  border-radius: 7px;
  background: var(--ag-chip);
  color: var(--ag-chip-ink);
  font-size: 13px;
  font-weight: 700;
}
.ag-option-name { font-weight: 720; overflow-wrap: anywhere; }
.ag-option-bar [data-ag-copy-all], .ag-bubbles [data-ag-copy-part] {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
}
.ag-option-bar [data-ag-copy-all] {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 4px;
  border-radius: 7px;
  color: #705f53;
  font-size: 12px;
  font-weight: 650;
}
.ag-bubbles {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  margin: 4px 0 0;
  padding-left: 8px;
}
.ag-bubbles [data-ag-copy-part] {
  max-width: 100%;
  min-height: 38px;
  padding: 0;
  border-radius: 9px;
  text-align: left;
}
.ag-bubble-text {
  min-width: 0;
  padding: 6px 11px;
  border: 1px solid var(--ag-chip-rule);
  border-radius: 12px 12px 3px 12px;
  background: var(--ag-chip);
  color: #382b24;
  font-size: 15px;
  font-weight: 480;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ag-copy-symbol { position: relative; width: 15px; height: 16px; flex: none; color: #826f60; }
.ag-copy-symbol::before, .ag-copy-symbol::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 10px;
  box-sizing: border-box;
  border: 1.3px solid currentColor;
  border-radius: 2px;
}
.ag-copy-symbol::before { top: 2px; left: 1px; }
.ag-copy-symbol::after { top: 5px; left: 5px; background: #fffdf9; }
[data-copied=true] .ag-copy-symbol::before {
  left: 4px; top: 1px; width: 6px; height: 11px;
  border-width: 0 2px 2px 0;
  border-radius: 0;
  transform: rotate(43deg);
  color: #417348;
}
[data-copied=true] .ag-copy-symbol::after { content: none; }
.ag-option-bar [data-copied=true] { color: #416e47; }
.ag-reply-option button:focus-visible { outline: 2px solid #95502e; outline-offset: 2px; }
@media (hover: hover) {
  .ag-bubbles button:hover .ag-bubble-text { border-color: var(--ag-chip-ink); }
  .ag-option-bar button:hover { background: #f6eee4; }
}
.ag-reply-option > * + :not(.ag-bubbles) { margin-top: 8px; }
.ag-reply-option > .ag-reply-note { padding-top: 8px; border-top: 1px solid #eee6dd; }
.ag-reply .ag-reply-quote { font-size: 16px; font-weight: 560; line-height: 1.65; }
.ag-reply .ag-reply-note { color: #685963; font-size: 13px; line-height: 1.65; }
.ag-reply .ag-note-label { font-weight: 650; }
.ag-manual-copy {
  display: block;
  width: 100%;
  min-height: 100px;
  margin-top: 10px;
  padding: 12px;
  resize: vertical;
  border: 1px solid #dbcbba;
  border-radius: 10px;
  background: #fffaf4;
  font-size: 16px;
  line-height: 1.6;
}
.ag-clipboard-proxy { position: fixed; top: 0; left: -9999px; font-size: 16px; }
@media (max-width: 700px) {
  .ag-directory { max-width: 520px; }
  .ag-history-bar { margin-bottom: 10px; }
  .ag-grid { grid-template-columns: 1fr; gap: 10px; }
  .ag-card { gap: 10px; padding: 9px 12px; border-radius: 16px; }
  .ag-card .ag-portrait { width: clamp(52px,16vw,64px); height: clamp(52px,16vw,64px); }
  .ag-card-name h2 { font-size: 17px; }
  .agent-conversation .rail { display: none; }
  .agent-conversation .work, .agent-conversation #main { padding: 0; }
  .ag-chat { min-height: 0; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .ag-channel { min-height: 38px; padding: 0 8px 0 2px; gap: 6px; }
  .ag-log { padding: 17px 12px; }
  .ag-reply { padding: 13px 14px; }
  .ag-compose { padding-bottom: max(9px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .ag-card { transition: none; }
  .ag-card:hover { transform: none; }
}
