/* The help center. Face, tokens and the pill are in base.css. */

/* ---- Two columns ---- */
.hc { --side: 34.5%; display: grid; grid-template-columns: minmax(300px, var(--side)) 1fr; min-height: 100vh; align-items: start; }
@media (max-width: 820px) { .hc { grid-template-columns: 1fr; align-content: start; } }

/* ---- Left: hero and knowledge base ---- */
/* Stays put while the right side scrolls. The hero gives up height on a
   short screen so the banners stay in view; past that the column scrolls. */
.side { background: var(--black); color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
@media (max-width: 820px) { .side { position: static; height: auto; overflow: visible; } }
.hero {
	position: relative; flex: 1 0 auto; min-height: clamp(200px, 32vh, 300px);
	background: url("img/hero.webp") center / cover no-repeat #2b2d2b;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(.4rem, 1vh, .9rem);
	padding: 2.5rem 1.5rem; text-align: center;
}
.hero a { text-decoration: none; font-weight: 700; }
.back { position: absolute; top: 1.1rem; left: 1.1rem; display: inline-flex; align-items: center; gap: .6rem; font-size: .95rem; }
.ring { width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1rem; }
.title { margin: 0; font-size: clamp(1.5rem, 3.8vh, 2.25rem); font-weight: 700; line-height: 1.15; }
.who { text-decoration: underline !important; font-size: 1rem; }
.search {
	margin-top: .6rem; width: min(340px, 100%); height: clamp(44px, 6.5vh, 60px);
	border: 2px solid #fff; border-radius: 999px; display: flex; align-items: center; padding: 0 1.4rem 0 1.6rem;
}
.search input { flex: 1; min-width: 0; background: none; border: 0; color: #fff; font: inherit; font-size: 1.1rem; }
.search input::placeholder { color: #fff; opacity: .95; }
.search input:focus { outline: none; }
.search button { background: none; border: 0; color: #fff; padding: 0; cursor: pointer; font-size: 1.5rem; display: grid; }

/* Knowledge base, under the hero: a banner per section. The one on the
   right is filled in. */
/* The column scales with the window height so it fits without scrolling
   down to about 600px tall; below that it scrolls. */
.kb { padding: clamp(.75rem, 1.8vh, 1.5rem) 1.5rem clamp(.75rem, 2vh, 2rem); flex: none; }
.kb ul { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(.35rem, .8vh, .6rem); }
.kb li[hidden] { display: none; }
.kb button {
	width: 100%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; color: #fff;
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: clamp(.5rem, 1.3vh, .95rem) 1.15rem; font: inherit; font-weight: 600; font-size: clamp(.95rem, 1.7vh, 1.05rem); text-align: left; cursor: pointer;
	transition: background .15s, border-color .15s;
}
.kb button:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.28); }
.kb button svg { flex: none; font-size: clamp(.95rem, 1.8vh, 1.15rem); color: rgba(255,255,255,.7); border: 1.5px solid currentColor; border-radius: 50%; padding: .25rem; box-sizing: content-box; transition: transform .2s, color .15s, background .15s; }
.kb button:hover svg { transform: translateX(3px); color: #fff; }
.kb button[aria-current="true"] { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.45); }
.kb button[aria-current="true"] svg { background: #fff; color: var(--black); border-color: #fff; }
.kb .nomatch { color: rgba(255,255,255,.75); margin: 1.25rem 0 0; }
.kb .nomatch a { color: #fff; }

/* ---- Right: two chunks ---- */
.view { padding: 0 2rem 4rem 8.5%; max-width: 1180px; }
@media (max-width: 820px) { .view { padding: 0 1.25rem 4rem; } }
.top { padding-top: 3.25rem; min-height: 100vh; display: flex; flex-direction: column; }
.top > * { align-self: stretch; }
.top > .down { align-self: center; }
.bottom { padding-top: 4rem; border-top: 1px solid var(--line); margin-top: 2rem; }
.view h1 { font-size: 3rem; font-weight: 700; margin-bottom: 1.5rem; }
.view h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; }
.view p { font-size: 1.1rem; }
.lead { max-width: 60ch; }
.mono { font-family: var(--font-mono); }

.content { margin: 2.5rem 0 3rem; max-width: 720px; }
.content h2 { font-size: 1.6rem; margin-bottom: 1.25rem; }
.items { margin: 0; display: grid; gap: .9rem; }
.items > div[hidden] { display: none; }
.items dt { font-weight: 700; margin-bottom: .15rem; }
.items dd { margin: 0; color: #333; }
.more { font-size: .95rem; margin: 1.25rem 0 0; }
.more:empty { display: none; }
.more a { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; }
.more a:hover { text-decoration: underline; }
.more svg { font-size: 1.1rem; }

/* Pinned to the bottom of the viewport while the knowledge base is on
   screen; it scrolls away with the section once the request form is there. */
.down {
	position: sticky; bottom: 1.25rem; margin: auto 0 0; align-self: center;
	display: inline-flex; align-items: center; gap: .75rem; padding: .6rem 1.4rem;
	border-radius: 999px; background: rgba(255,255,255,.72); backdrop-filter: blur(2px);
	border: 1px solid rgba(0,0,0,.12); box-shadow: 0 4px 16px rgba(0,0,0,.08);
	text-decoration: none; font-weight: 700; color: var(--ink); white-space: nowrap;
	transition: opacity .2s;
}
.down.gone { opacity: 0; pointer-events: none; }
@media (max-width: 480px) { .down { font-size: .85rem; gap: .5rem; padding: .5rem 1rem; } .down svg { font-size: 1.3rem; } }
.down svg { font-size: 1.6rem; border: 2px solid currentColor; border-radius: 50%; padding: .3rem; box-sizing: content-box; transition: transform .2s; }
.down:hover { color: var(--ink); }
.down:hover svg { transform: translateY(3px); }

.text { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ---- Submit a request / My requests ---- */
.seg { display: inline-flex; border: 2px solid var(--black); border-radius: 999px; padding: 3px; margin-bottom: 2.5rem; }
.seg a { padding: .5rem 1.2rem; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .95rem; }
.seg a[aria-selected="true"] { background: var(--black); color: #fff; }
.seg span:not(:empty) {
	display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; margin-left: .45rem;
	border-radius: 999px; background: var(--black); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1;
	position: relative; vertical-align: middle;
}
.seg a[aria-selected="true"] span:not(:empty) { background: #fff; color: var(--black); }
.seg span.new::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--open); border: 1.5px solid #fff; }
.requests { margin: 0; }
.table { width: 100%; border-collapse: collapse; max-width: 900px; }
.table th { text-align: left; font-size: 1.05rem; padding: .6rem .5rem; }
.table td { padding: .7rem .5rem; font-size: .95rem; color: #444; vertical-align: top; }
.table td a { color: inherit; text-decoration: none; }
.table tr:hover td a { text-decoration: underline; }
.table td.id { white-space: nowrap; }
.chip { display: inline-block; padding: .1rem .5rem; color: #fff; font-size: .85rem; font-weight: 500; border-radius: 2px; white-space: nowrap; }
.chip.solved { background: var(--solved); }
.chip.open { background: var(--open); }
.chip.waiting { background: var(--waiting); }
.empty { color: var(--muted); }
@media (max-width: 640px) {
	.table thead { display: none; }
	.table tr { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
	.table td { padding: 0; }
	.table td.sub { grid-column: 1 / -1; font-weight: 600; color: var(--ink); }
}

/* ---- Request form and thread ---- */
.form { display: grid; gap: 1.4rem; max-width: 640px; }
#manual:focus { outline: none; }
.form .pill, .actions { justify-self: start; }
.head { margin-top: .5rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field small { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
	font: inherit; width: 100%; padding: .7rem .8rem; border: 1px solid #bdbdbd; border-radius: 4px; color: var(--ink); background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--bad); }
.field textarea { min-height: 160px; resize: vertical; }
.field input[type="file"] { padding: .5rem; border-style: dashed; }
.error { color: var(--bad); margin: 0; font-size: .95rem; }
.files { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.files:empty { display: none; }
.files li { position: relative; width: 104px; height: 104px; border: 1px solid var(--line); border-radius: 6px; overflow: visible; background: #fafafa; }
.files img, .files .doc { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.files .doc { display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.files .x {
	position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%;
	background: var(--open); color: #fff; border: 2px solid #fff; padding: 0; cursor: pointer;
	display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.files .x svg { font-size: .8rem; stroke-width: 2.5; }
.files .x:hover { background: #c6412d; }
#new-form.over { outline: 2px dashed var(--ink); outline-offset: 8px; }
.notice { display: inline-block; border: 1px solid var(--solved); color: #2e7d32; padding: .7rem 1rem; border-radius: 4px; margin-bottom: 1.5rem; font-size: .95rem; }

.head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.head h1 { margin: 0; font-size: 2rem; }
.head .close {
	margin-left: auto; width: 34px; height: 34px; border-radius: 50%; background: #f2f2f2;
	display: grid; place-items: center; color: var(--ink); text-decoration: none; font-size: 1.05rem;
	transition: background .15s, color .15s;
}
.head .close:hover { background: var(--ink); color: #fff; }
.head { max-width: 720px; }
.meta { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }
.meta span + span::before { content: "\00B7"; margin: 0 .5rem; }
.thread { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 1rem; max-width: 720px; }
.thread li { border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.2rem; }
.thread .by { font-weight: 700; margin-right: .5rem; }
.thread .at { color: var(--muted); font-size: .85rem; }
.thread p { white-space: pre-wrap; margin: .5rem 0 0; font-size: 1rem; }
.thread .files { margin: .6rem 0 0; color: var(--muted); font-size: .85rem; }
.actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---- Chat ---- */
.chat { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 6; display: grid; justify-items: end; gap: .75rem; }
.bubble { position: relative; width: 60px; height: 60px; border-radius: 50%; background: var(--black); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center; font-size: 1.8rem; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.bubble svg { fill: #fff; stroke: #fff; }
.bubble .dot { display: none; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: #e5533d; border: 2px solid #fff; }
.bubble.fresh .dot { display: block; }
.bubble.fresh::before {
	content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--black);
	animation: ping 2.2s ease-out infinite; z-index: -1;
}
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(1.8); opacity: 0; } }
.panel {
	width: min(380px, calc(100vw - 3rem)); height: min(520px, 70vh);
	display: flex; flex-direction: column; background: #fff; border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0,0,0,.25); overflow: hidden;
}
.panel[hidden] { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; background: var(--black); color: #fff; font-weight: 700; }
.panel-head small { display: block; font-weight: 400; font-size: .75rem; opacity: .75; }
.panel-head .text { color: #fff; font-weight: 500; font-size: .9rem; }
.log { list-style: none; margin: 0; padding: 1rem; overflow-y: auto; flex: 1; display: grid; gap: .6rem; align-content: start; }
.log li { max-width: 85%; padding: .6rem .85rem; border-radius: 14px; font-size: .95rem; line-height: 1.4; }
.log .me { justify-self: end; background: var(--black); color: #fff; border-bottom-right-radius: 4px; }
.log .bot { justify-self: start; background: #f1f1f1; border-bottom-left-radius: 4px; }
.log .bot ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.typing { display: inline-flex; gap: 4px; padding: .2rem 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #888; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.panel-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.panel-form input { flex: 1; min-width: 0; font: inherit; padding: .6rem .8rem; border: 1px solid #bdbdbd; border-radius: 999px; }
.panel-form button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--black); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 1.2rem; }

.concept { margin-top: 5rem; }

/* Stacked on a phone, the column is not fitted to the window: the sizes go
   back to fixed. Last so it wins over the fitted rules above. */
@media (max-width: 820px) {
	.hero { min-height: 460px; flex: none; gap: .9rem; }
	.title { font-size: 2.25rem; }
	.search { height: 60px; }
	.kb { padding: 1.5rem 1.5rem 2rem; }
	.kb ul { gap: .6rem; }
	.kb button { padding: .95rem 1.15rem; font-size: 1.05rem; }
}
