/* The support screens' own pieces, on top of the shared styles (style.css). */

/* chips that say something (not filters): coloured by what they mean */
.chip.bad, .chip.warn, .chip.info, .chip.ok { height: 22px; padding: 0 8px; font-size: 11.5px; cursor: default; gap: 4px; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
a.chip { cursor: pointer; text-decoration: none; }
.chip svg { width: 12px; height: 12px; }
.flags { display: flex; gap: 4px; flex-wrap: wrap; }

/* tables */
.cc { font: 500 10.5px var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; vertical-align: 1px; }
.tbl td .sub2 { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.tbl tr.dim td { opacity: .55; }
.tbl td.wrap { white-space: normal; max-width: 340px; }
.tbl .clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* the stage tabs above the orders */
.stagebar { display: flex; gap: 6px; flex-wrap: wrap; }
.stagebar .chip b { font: 500 11.5px var(--mono); color: var(--faint); }
.stagebar .chip.on b { color: var(--fg); }

/* a record's page: header, facts, and the timeline */
.rec-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.rec-head h1 { font-size: 20px; }
.rec-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12.5px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; padding: 14px 16px; font-size: 13px; }
.facts dt { color: var(--muted); font-size: 12px; padding-top: 2px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.form2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 16px; }
.form2 .wide { grid-column: 1 / -1; }
textarea.input { height: auto; padding: 8px 10px; line-height: 1.45; resize: vertical; }
textarea.input.code { font: 12.5px/1.55 var(--mono); }

.tl { display: grid; gap: 0; padding: 6px 16px 14px; }
.tl .it { display: grid; grid-template-columns: 92px 18px minmax(0, 1fr); gap: 8px; padding: 7px 0; position: relative; }
.tl .it .when { font-size: 11.5px; color: var(--faint); padding-top: 2px; text-align: right; }
.tl .it .dot { width: 10px; height: 10px; border-radius: 50%; margin: 5px auto 0; background: var(--c, var(--faint)); box-shadow: 0 0 0 3px var(--panel); position: relative; z-index: 1; }
.tl .it::before { content: ""; position: absolute; left: calc(92px + 8px + 8px); top: 0; bottom: 0; width: 2px; background: var(--line-soft); }
.tl .it:first-child::before { top: 12px; }
.tl .it:last-child::before { bottom: calc(100% - 12px); }
.tl .it .what { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl .it .who { font-size: 11.5px; color: var(--faint); display: flex; gap: 8px; }
.tl .it.change .what { color: var(--muted); font-size: 12.5px; }
.tl .it .x { opacity: 0; }
.tl .it:hover .x { opacity: 1; }

/* bars: a small chart of days */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 12px 16px 6px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-width: 4px; height: 100%; position: relative; }
.bars .b i { display: block; border-radius: 2px 2px 0 0; background: var(--c); min-height: 0; }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: pre; background: var(--raised); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; font-size: 11.5px; color: var(--fg); z-index: 3; pointer-events: none; }
.bars-x { display: flex; justify-content: space-between; padding: 0 16px 10px; font-size: 11px; color: var(--faint); }
.legend2 { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend2 i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 5px; }

/* the overview's tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 12px 14px; display: grid; gap: 4px; cursor: pointer; text-align: left; color: var(--fg); }
.tile:hover { border-color: var(--faint); }
.tile .v { font: 500 24px/1.15 var(--mono); letter-spacing: -.02em; }
.tile .k { font-size: 12.5px; color: var(--muted); }
.tile .d { font-size: 11.5px; color: var(--faint); }
.tile.bad .v { color: var(--bad); }
.tile.warn .v { color: var(--warn); }
.tile.ok .v { color: var(--ok); }

/* chat transcripts */
.chatlog { display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; }
.cm { display: flex; flex-direction: column; gap: 4px; max-width: 78%; }
.cm .b { padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.45; }
.cm.visitor { align-self: flex-start; }
.cm.visitor .b { background: var(--raised); border-bottom-left-radius: 4px; }
.cm.bot, .cm.agent { align-self: flex-end; align-items: flex-end; }
.cm.bot .b { background: var(--info-soft); border-bottom-right-radius: 4px; }
.cm.agent .b { background: var(--accent-soft); border: 1px solid var(--accent-line); border-bottom-right-radius: 4px; }
.cm .by { font-size: 11px; color: var(--faint); display: flex; gap: 6px; flex-wrap: wrap; }
.cm.system { align-self: center; max-width: 90%; }
.cm.system .b { background: none; color: var(--faint); font-size: 12px; padding: 2px; text-align: center; }
.cm .tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.cm .tools .chip { height: 20px; font: 11px var(--mono); }
.cards { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pcard { width: 150px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); text-decoration: none; color: var(--fg); font-size: 12px; }
.pcard img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--raised); }
.pcard span { display: block; padding: 6px 8px; }
.pcard em { font-style: normal; color: var(--muted); display: block; padding: 0 8px 7px; }

/* the bot's settings */
.botgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.botgrid .sticky { position: sticky; top: 16px; }
.skill { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; background: var(--bg); }
.preview { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; height: 560px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.preview .ph { padding: 14px 16px; color: #fff; display: flex; gap: 10px; align-items: center; }
.preview .ph .av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.preview .ph .av img { width: 100%; height: 100%; object-fit: cover; }
.preview .ph b { display: block; }
.preview .ph small { opacity: .75; font-size: 11.5px; }
.preview .pb { flex: 1; overflow-y: auto; }
.preview .po { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; }
.preview .po button { border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 5px 10px; font-size: 12.5px; color: var(--fg); cursor: pointer; }
.preview .pi { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line-soft); }
.preview .pi input { flex: 1; }
.swatch { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.pass { color: var(--ok); }
.fail { color: var(--bad); }

@media (max-width: 1100px) { .botgrid { grid-template-columns: minmax(0, 1fr); } .botgrid .sticky { position: static; } }
@media (max-width: 760px) { .form2 { grid-template-columns: minmax(0, 1fr); } .tl .it { grid-template-columns: 64px 18px minmax(0, 1fr); } .tl .it::before { left: calc(64px + 16px); } }

/* an issue's order, above its timeline: two columns of facts, one on phones */
.order-facts { display: grid; grid-template-columns: 1fr 1fr; }
.order-facts .facts + .facts { border-left: 1px solid var(--line-soft); }
@media (max-width: 760px) { .order-facts { grid-template-columns: 1fr; } .order-facts .facts + .facts { border-left: 0; border-top: 1px solid var(--line-soft); } }
