/* Kickbytes quote chat. Themeable through --kb-* custom properties (set them on :root or .kbq). */
.kbq {
  --ink: var(--kb-ink, #0b0b0c);
  --paper: var(--kb-paper, #f4f2ec);
  --accent: var(--kb-accent, #ff4a1c);
  --bot: #17171a;
  --edge: #2b2b30;
  --mute: #8b8b93;
  --mono: var(--kb-font-mono, ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace);
  --sans: var(--kb-font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
  --display: var(--kb-font-display, var(--sans));
  --spring: cubic-bezier(.2, .9, .25, 1.25);
  --out: cubic-bezier(.16, 1, .3, 1);
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.45;
  box-sizing: border-box;
}
.kbq *, .kbq *::before, .kbq *::after { box-sizing: inherit; }
.kbq button, .kbq input, .kbq textarea { font: inherit; color: inherit; }

.kbq__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding: 0 10px 10px 0; /* room for the hard shadows */
}
@media (max-width: 880px) { .kbq__grid { grid-template-columns: 1fr; } }

/* ---------- chat panel ---------- */
.kbq__chat {
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 10px 10px 0 var(--accent);
  display: flex;
  flex-direction: column;
  height: min(700px, 82vh);
  min-height: 460px;
  overflow: hidden;
}
.kbq__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--edge);
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: lowercase;
}
.kbq__head b { color: var(--accent); font-weight: 600; }
.kbq__status { display: inline-flex; align-items: center; gap: 8px; color: var(--mute); }
.kbq__dot { width: 8px; height: 8px; background: #3ddc84; border-radius: 50%; animation: kbq-pulse 2.2s infinite; }
.kbq__chat[data-mode="offline"] .kbq__dot { background: #f5b83d; animation: none; }
@keyframes kbq-pulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(61,220,132,0); } }

.kbq__log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 16px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background-image: radial-gradient(#26262b 1px, transparent 1px);
  background-size: 18px 18px;
  scrollbar-width: thin; scrollbar-color: #3a3a40 transparent;
}
.kbq__msg {
  max-width: 86%; padding: 10px 14px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere;
  animation: kbq-in .5s var(--spring) both;
}
.kbq__msg--bot { align-self: flex-start; background: var(--bot); border: 1px solid var(--edge); border-radius: 14px 14px 14px 3px; }
.kbq__msg--user { align-self: flex-end; background: var(--paper); color: var(--ink); border-radius: 14px 14px 3px 14px; font-weight: 500; }
.kbq__msg--err { align-self: center; color: #ff8a73; font-family: var(--mono); font-size: 12px; }
@keyframes kbq-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.kbq__typing { align-self: flex-start; display: flex; gap: 6px; padding: 14px 16px; background: var(--bot); border: 1px solid var(--edge); border-radius: 14px 14px 14px 3px; animation: kbq-in .35s var(--spring) both; }
.kbq__typing i { width: 7px; height: 7px; background: var(--mute); animation: kbq-bit 1s infinite var(--out); }
.kbq__typing i:nth-child(2) { animation-delay: .15s; }
.kbq__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes kbq-bit { 0%, 100% { transform: rotate(0) scale(1); background: var(--mute); } 40% { transform: rotate(90deg) scale(1.3) translateY(-3px); background: var(--accent); } }

.kbq__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 4px; min-height: 8px; }
.kbq__chip {
  border: 1.5px solid #44444c; background: transparent; color: var(--paper);
  padding: 7px 13px; font-size: 13.5px; border-radius: 999px; cursor: pointer;
  transition: transform .15s var(--out), box-shadow .15s var(--out), background .15s, color .15s, border-color .15s;
  animation: kbq-in .45s var(--spring) both; animation-delay: calc(var(--i, 0) * 55ms);
}
.kbq__chip:hover, .kbq__chip:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--paper); outline: none; }
.kbq__chip:active { transform: translate(0, 0); box-shadow: 0 0 0 var(--paper); }

.kbq__bar { display: flex; gap: 8px; padding: 12px 16px 16px; }
.kbq__input { flex: 1; min-width: 0; background: #101013; border: 1.5px solid var(--edge); border-radius: 4px; padding: 12px 14px; color: var(--paper); transition: border-color .15s; }
.kbq__input::placeholder { color: #66666e; }
.kbq__logging { margin: -6px 0 0; padding: 0 16px 12px; font-family: var(--mono); font-size: 10px; line-height: 1.5; color: #8a8a93; }
.kbq__input:focus { outline: none; border-color: var(--accent); }
.kbq__send { width: 48px; border: 0; border-radius: 4px; background: var(--accent); color: var(--ink); font-weight: 800; font-size: 18px; cursor: pointer; transition: transform .12s var(--out), box-shadow .12s var(--out); box-shadow: 3px 3px 0 var(--paper); }
.kbq__send:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--paper); }
.kbq__send:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--paper); }
.kbq__send:disabled { opacity: .45; cursor: default; }

/* ---------- offer ticket ---------- */
.kbq__ticket { position: sticky; top: 24px; filter: drop-shadow(10px 10px 0 var(--ink)); }
.kbq__paper {
  background: var(--paper); color: var(--ink); padding: 22px 22px 26px; position: relative;
  border: 2px solid var(--ink);
  /* perforated bottom edge */
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, #0000 98%, #000) 0 100% / 22px 100% repeat-x, linear-gradient(#000, #000);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  mask: radial-gradient(circle 7px at 50% 100%, #0000 98%, #000) 0 100% / 22px 100% repeat-x, linear-gradient(#000, #000);
  padding-bottom: 34px;
}
.kbq__paper.is-printing { animation: kbq-print .9s var(--out) both; }
@keyframes kbq-print { from { clip-path: inset(0 0 100% 0); transform: translateY(-8px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.kbq__tkhead { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.kbq__tkhead b { font-size: 13px; }
.kbq__empty { margin: 18px 0 4px; padding: 22px 16px; border: 2px dashed #b9b6ab; font-family: var(--mono); font-size: 12.5px; color: #6f6c62; text-align: center; }

.kbq__lines { list-style: none; margin: 14px 0 0; padding: 0; }
.kbq__line { display: flex; gap: 10px; align-items: baseline; font-size: 14px; padding: 5px 0; animation: kbq-line .5s var(--out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.kbq__line::after { content: ""; order: 1; flex: 1; border-bottom: 1.5px dotted #a9a69a; transform: translateY(-3px); }
.kbq__line span:first-child { order: 0; }
.kbq__line span:last-child { order: 2; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.kbq__line.is-new { background: linear-gradient(90deg, rgba(255,74,28,.22), transparent); }
@keyframes kbq-line { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

.kbq__totals { margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--ink); position: relative; }
.kbq__total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 0; }
.kbq__total small { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.kbq__amount { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; font-size: clamp(28px, 4.2vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; }
.kbq__amount s { font-size: .5em; font-weight: 500; color: #8a867b; margin-right: 8px; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.kbq__amount.is-flash { animation: kbq-flash .8s var(--out); }
@keyframes kbq-flash { 0% { color: var(--accent); transform: scale(1.06); } 100% { color: inherit; transform: none; } }
.kbq__vat { margin-top: 6px; font-family: var(--mono); font-size: 11px; color: #6f6c62; }
.kbq__savings { margin-top: 12px; padding: 10px 12px; border: 1.5px solid var(--ink); background: rgba(11,11,12,.04); font-size: 13px; }
.kbq__savings > small { display: block; margin-bottom: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.kbq__savings ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.kbq__savings li { display: flex; justify-content: space-between; gap: 10px; }
.kbq__savings li b, .kbq__savetotal b { font-family: var(--mono); font-weight: 700; color: var(--accent); white-space: nowrap; }
.kbq__savetotal { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 7px; border-top: 1.5px dashed var(--ink); font-weight: 800; }
.kbq__compare { margin-top: 8px; padding: 7px 9px; border-left: 3px solid var(--accent); background: rgba(11,11,12,.05); font-size: 12px; line-height: 1.4; }
/* free website scan */
.kbq__chip--scan { border-style: dashed; }
.kbq__scanform { align-self: stretch; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--edge); border-left: 3px solid var(--accent); background: var(--bot); color: var(--paper); animation: kbq-in .3s ease both; }
.kbq__scanrow { display: flex; gap: 6px; }
.kbq__scanrow input { flex: 1; min-width: 0; padding: 9px 10px; border: 2px solid var(--paper); background: var(--paper); color: var(--ink); font: inherit; border-radius: 0; }
.kbq__scanrow button { padding: 9px 16px; border: 2px solid var(--paper); background: var(--accent); color: var(--ink); font: 800 14px var(--sans); cursor: pointer; box-shadow: 3px 3px 0 var(--paper); border-radius: 0; }
.kbq__scanrow button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--paper); }
.kbq__scanrow button:disabled { opacity: .6; cursor: wait; }
.kbq__scanform small { font-size: 11px; line-height: 1.4; opacity: .7; }
.kbq__scanwait { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; border: 1px dashed var(--mute); color: var(--paper); }
.kbq__scanwait i { width: 14px; height: 14px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: kbq-spin .8s linear infinite; flex: none; }
@keyframes kbq-spin { to { transform: rotate(360deg); } }
.kbq__scan { align-self: stretch; display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; background: var(--paper); color: var(--ink); border-radius: 6px; box-shadow: 5px 5px 0 var(--accent); animation: kbq-in .4s ease both; }
.kbq__scanshot { border: 3px solid #0b0b0c; border-radius: 12px; overflow: hidden; background: #eee; aspect-ratio: 9 / 16; display: grid; place-items: center; font-size: 10px; text-align: center; }
.kbq__scanshot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.kbq__scanhost { font-family: var(--mono); font-size: 12px; font-weight: 700; margin-bottom: 8px; word-break: break-all; }
.kbq__rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kbq__ring { --c: #0b0b0c; display: grid; justify-items: center; gap: 3px; }
.kbq__ring.is-mid { --c: #b7791f; }
.kbq__ring.is-bad { --c: var(--accent); }
.kbq__ring b { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-size: 15px; background: radial-gradient(closest-side, #fff 74%, transparent 76%), conic-gradient(var(--c) calc(var(--v) * 1%), #e4e1d8 0); }
.kbq__ring small { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.kbq__scanmetrics { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12px; }
.kbq__scanmetrics li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #aaa; padding-bottom: 2px; }
.kbq__scanissues { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12px; line-height: 1.35; }
.kbq__scanissues li:not(.kbq__scanissues-h) { padding-left: 14px; position: relative; }
.kbq__scanissues li:not(.kbq__scanissues-h)::before { content: ''; position: absolute; left: 0; top: .45em; width: 7px; height: 7px; background: var(--accent); }
.kbq__scanissues-h { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.kbq__scansrc { margin-top: 8px; font-size: 10px; opacity: .6; }
@media (max-width: 520px) { .kbq__scan { grid-template-columns: 1fr; } .kbq__scanshot { max-width: 120px; aspect-ratio: 9 / 14; } }
.kbq__wishes { margin-top: 14px; padding: 10px 12px; border: 1.5px dashed var(--ink); font-size: 13px; line-height: 1.4; }
.kbq__wishes small { display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.kbq__wishes ul { margin: 0; padding-left: 16px; }
.kbq__wishes p { margin: 6px 0 0; font-weight: 700; color: var(--accent); }
.kbq__lanes { margin-top: 14px; }
.kbq__lanes > small { display: block; margin-bottom: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #4d4a42; }
.kbq__lanerow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kbq__lane { display: grid; gap: 2px; text-align: left; padding: 8px 9px; background: transparent; border: 1.5px solid currentColor; border-radius: 0; color: inherit; font: inherit; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kbq__lane b { font-size: 12px; }
.kbq__lane span { font-family: var(--mono); font-size: 10px; color: #4d4a42; }
.kbq__lane em { font-style: normal; font-weight: 800; font-size: 14px; }
.kbq__lane:hover:not(.is-on) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--accent); }
.kbq__lane.is-on { background: #0b0b0c; color: #f4f2ec; cursor: default; }
.kbq__lane.is-on span { color: inherit; opacity: .75; }

/* Planning heat map: button on the ticket + dialog (the dialog lives on <body>, so it carries its own tokens). */
.kbq__planbtn { display: inline-flex; align-items: center; gap: 9px; margin-top: 12px; padding: 7px 10px; background: transparent; border: 1.5px solid currentColor; border-radius: 0; color: inherit; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kbq__planbtn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--accent); }
.kbq__planico { display: inline-grid; grid-template-columns: repeat(4, 6px); gap: 2px; }
.kbq__planico i { width: 6px; height: 6px; background: var(--accent); }
.kbq__planico i:nth-child(1) { opacity: .2; } .kbq__planico i:nth-child(2) { opacity: .45; } .kbq__planico i:nth-child(3) { opacity: .75; } .kbq__planico i:nth-child(4) { opacity: 1; }

.kbp-dlg { --ink: var(--kb-ink, #0b0b0c); --paper: var(--kb-paper, #f4f2ec); --accent: var(--kb-accent, #ff4a1c); --mono: var(--kb-font-mono, ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace); --sans: var(--kb-font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif); --display: var(--kb-font-display, var(--sans)); position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 16px; background: rgba(11, 11, 12, .6); font-family: var(--sans); }
.kbp-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--accent); }
.kbp-card h2 { margin: 0 0 6px; font-family: var(--display); font-size: 24px; line-height: 1.1; }
.kbp-card p { margin: 0 0 14px; font-size: 14px; line-height: 1.45; }
.kbp-x { float: right; margin: -6px -6px 0 12px; padding: 6px 10px; background: transparent; border: 1.5px solid var(--ink); color: var(--ink); font-family: var(--mono); font-size: 11px; text-transform: uppercase; cursor: pointer; }
.kbp-wrap { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; }
.kbp-rows { display: grid; grid-template-rows: 16px repeat(7, 1fr); gap: 3px; font: 10px/1 var(--mono); color: #4d4a42; text-transform: uppercase; }
.kbp-rows span { display: flex; align-items: center; }
.kbp-cols { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(18px, 1fr); gap: 3px; min-width: 288px; }
.kbp-col { display: grid; grid-template-rows: 16px repeat(7, 1fr); gap: 3px; }
.kbp-m { font: 10px/16px var(--mono); color: #4d4a42; white-space: nowrap; overflow: visible; text-transform: uppercase; }
.kbp-cell { aspect-ratio: 1; min-height: 18px; border: 1px solid rgba(11, 11, 12, .16); }
.kbp-cell[data-l="0"] { background: color-mix(in srgb, var(--accent) 14%, var(--paper)); }
.kbp-cell[data-l="1"] { background: color-mix(in srgb, var(--accent) 38%, var(--paper)); }
.kbp-cell[data-l="2"] { background: color-mix(in srgb, var(--accent) 62%, var(--paper)); }
.kbp-cell[data-l="3"] { background: color-mix(in srgb, var(--accent) 82%, var(--paper)); }
.kbp-cell[data-l="4"] { background: var(--accent); border-color: var(--ink); }
.kbp-cell[data-l="c"] { background: repeating-linear-gradient(135deg, #d7d5cf 0 3px, #e6e4de 3px 6px); }
.kbp-cell[data-l="p"] { background: transparent; border-style: dashed; opacity: .3; }
.kbp-cell.is-today { outline: 2px solid var(--ink); outline-offset: 1px; }
.kbp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 12px 0 4px; font: 10px/1 var(--mono); text-transform: uppercase; color: #4d4a42; }
.kbp-legend .kbp-cell { width: 16px; min-height: 16px; aspect-ratio: auto; height: 16px; }
.kbp-next { margin-top: 12px; padding: 10px 12px; border: 1.5px solid var(--ink); font-size: 14px; }
.kbp-next b { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 45%, transparent) 58%); }
.kbp-foot { margin: 10px 0 0; font-size: 12px; color: #4d4a42; }
@media (prefers-reduced-motion: no-preference) { .kbp-card { animation: kbp-in .22s cubic-bezier(.2, .9, .3, 1.2); } @keyframes kbp-in { from { transform: translate(6px, 6px) scale(.98); opacity: 0; } } }
.kbq__meta { margin-top: 10px; font-family: var(--mono); font-size: 11px; color: #4d4a42; display: grid; gap: 3px; }

.kbq__stamp {
  position: absolute; right: 6px; top: -34px;
  border: 3px solid var(--accent); color: var(--accent); padding: 4px 10px; border-radius: 4px;
  font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: .02em; text-transform: uppercase;
  transform: rotate(-12deg); background: rgba(244,242,236,.9);
  animation: kbq-stamp .55s var(--spring) both;
}
.kbq__savings { position: relative; }
.kbq__savings .kbq__stamp { top: -20px; right: 10px; font-size: 18px; padding: 2px 8px; }
@keyframes kbq-stamp { from { opacity: 0; transform: rotate(-30deg) scale(2.6); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }

.kbq__cta {
  width: 100%; margin-top: 16px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 4px; cursor: pointer;
  background: var(--accent); color: var(--ink); font-weight: 800; font-size: 16px; letter-spacing: .01em;
  box-shadow: 5px 5px 0 var(--ink); transition: transform .12s var(--out), box-shadow .12s var(--out);
}
.kbq__cta:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.kbq__cta:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--ink); }

.kbq__form { display: grid; gap: 10px; margin-top: 16px; animation: kbq-in .5s var(--out) both; }
.kbq__form h4 { margin: 0; font-family: var(--display); font-size: 18px; }
.kbq__form input[type=text], .kbq__form input[type=email], .kbq__form input[type=tel], .kbq__form textarea {
  width: 100%; padding: 10px 12px; background: #fff; border: 2px solid var(--ink); border-radius: 3px; font-size: 15px;
}
.kbq__form input:focus, .kbq__form textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.kbq__form label.kbq__consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; }
.kbq__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.kbq__done { margin-top: 16px; padding: 18px; border: 3px solid var(--ink); text-align: center; font-family: var(--display); font-weight: 800; font-size: 20px; animation: kbq-stamp .6s var(--spring) both; transform-origin: center; }
.kbq__restart { margin-top: 14px; background: none; border: 0; padding: 0; font-family: var(--mono); font-size: 11px; text-decoration: underline; cursor: pointer; color: #6f6c62; }

@media (prefers-reduced-motion: reduce) {
  .kbq *, .kbq *::before, .kbq *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

.kbq__line--gift span:first-child { font-weight: 700; }
.kbq__line--gift span:last-child { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
