/* GoSEQ Support (support.goseq.app) and Isaac's console. Loaded after /style.css, whose tokens, type, header, form
   fields and footer it reuses; everything here is prefixed so nothing collides with the landing page. */
:root {
  --st-open: #1D5FB8; --st-open-bg: #E3EDFB; --st-pending: #A45A00; --st-pending-bg: #FFF1DC;
  --st-waiting: #6B3FC4; --st-waiting-bg: #EFE8FC; --st-resolved: #137347; --st-resolved-bg: #E1F3E9;
  --st-closed: #6B625D; --st-closed-bg: #EFEBE6; --urgent: #B42318; --urgent-bg: #FDE8E6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --st-open: #8DBAF5; --st-open-bg: #1E3350; --st-pending: #F2B35C; --st-pending-bg: #3A2A12;
    --st-waiting: #C4A8FF; --st-waiting-bg: #2D2346; --st-resolved: #4CD39A; --st-resolved-bg: #173427;
    --st-closed: #A99F99; --st-closed-bg: #272322; --urgent: #FF8A7E; --urgent-bg: #3D1A17;
  }
}
:root[data-theme="dark"] {
  --st-open: #8DBAF5; --st-open-bg: #1E3350; --st-pending: #F2B35C; --st-pending-bg: #3A2A12;
  --st-waiting: #C4A8FF; --st-waiting-bg: #2D2346; --st-resolved: #4CD39A; --st-resolved-bg: #173427;
  --st-closed: #A99F99; --st-closed-bg: #272322; --urgent: #FF8A7E; --urgent-bg: #3D1A17;
}
.wrap { padding-left: 16px; padding-right: 16px; }
@media (min-width: 768px) { .wrap { padding-left: 36px; padding-right: 36px; } }
.sp-narrow { max-width: 860px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand small { margin-left: 2px; font-weight: 600; color: var(--muted); }
.top .status { white-space: nowrap; }
@media (max-width: 400px) { .top .status { display: none; } }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
textarea, select { width: 100%; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--field-line); border-radius: 10px; }
textarea { min-height: 140px; padding: 12px 14px; resize: vertical; }
select { min-height: 50px; padding: 0 40px 0 14px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
[aria-invalid="true"] { border-color: var(--bad) !important; }
.linkbtn { padding: 10px 2px; min-height: 44px; font: 600 15px var(--font); color: var(--accent); background: none; border: 0; cursor: pointer; }
.linkbtn:hover { color: var(--accent-hover); }

/* ---------- hero + search ---------- */
.sp-hero { padding-top: 20px; padding-bottom: 36px; }
@media (min-width: 900px) { .sp-hero { padding-top: 48px; padding-bottom: 56px; } }
.sp-h1 { margin: 0 0 18px; font-size: clamp(44px, 8vw, 84px); line-height: .95; letter-spacing: -.05em; font-weight: 800; }
.sp-h1 em { font-style: normal; color: var(--accent); }
.sp-lede { margin: 0 0 28px; max-width: 34em; font-size: clamp(17px, 1.8vw, 19px); line-height: 1.5; color: var(--muted); }
.sp-search { position: relative; max-width: 640px; }
.sp-search .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.sp-search input { min-height: 58px; padding: 0 16px 0 48px; font-size: 17px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.sp-search input::-webkit-search-cancel-button { cursor: pointer; }
.sp-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.sp-topics a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); font-size: 14.5px; font-weight: 600; text-decoration: none; }
.sp-topics a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- your requests ---------- */
.sp-mine { padding-bottom: 36px; }
.sp-mine h2, .sp-faq-head h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.02em; }
.sp-list { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sp-list li + li { border-top: 1px solid var(--line); }
.sp-list a, .sp-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; font: inherit; color: inherit; text-align: left;
  text-decoration: none; background: none; border: 0; cursor: pointer; }
.sp-list a:hover, .sp-list button:hover { background: var(--surface-2); }
.sp-list .grow { flex: 1; min-width: 0; }
.sp-list b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-list small { display: block; font-size: 13.5px; color: var(--muted); }
.sp-new { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; vertical-align: 1px; }

/* ---------- status pill (Freshdesk-style colours) ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 4px 11px 4px 9px; border-radius: 99px; font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap;
  color: var(--st-open); background: var(--st-open-bg); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.s-pending { color: var(--st-pending); background: var(--st-pending-bg); }
.pill.s-waiting { color: var(--st-waiting); background: var(--st-waiting-bg); }
.pill.s-resolved { color: var(--st-resolved); background: var(--st-resolved-bg); }
.pill.s-closed { color: var(--st-closed); background: var(--st-closed-bg); }

/* ---------- help articles ---------- */
.sp-faq { padding-top: 8px; padding-bottom: 72px; }
.sp-faq-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sp-count { margin: 0; font-size: 14px; color: var(--muted); }
.faq-topic { padding: 22px 0 6px; scroll-margin-top: 16px; }
.faq-topic h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.faq { border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.faq summary { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 14px 2px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; line-height: 1.35; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; margin-left: auto; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-3px) rotate(45deg); }
.faq[open] summary::after { transform: translateY(2px) rotate(-135deg); border-color: var(--accent); }
.faq summary:hover { color: var(--accent); }
.faq-a { padding: 0 2px 18px; max-width: 42em; color: var(--muted); font-size: 16px; line-height: 1.6; }
.faq-a p { margin: 0 0 10px; }
.faq-a b { color: var(--text); font-weight: 650; }
.faq-a a { color: var(--accent); font-weight: 600; }
.sp-none { padding: 28px 0; font-size: 16px; color: var(--muted); }

/* ---------- contact ---------- */
.sp-contact { padding: 72px 0 88px; background: var(--surface); border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.sp-contact-grid { display: grid; gap: 36px; }
@media (min-width: 900px) { .sp-contact-grid { grid-template-columns: 5fr 7fr; gap: 72px; align-items: start; } }
.sp-contact h2 { margin: 0 0 14px; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.02; letter-spacing: -.04em; font-weight: 800; }
.sp-contact-intro > p { margin: 0 0 22px; max-width: 30em; font-size: 17px; color: var(--muted); }
.sp-how { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.sp-how li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; font-size: 15px; color: var(--muted); line-height: 1.45; }
.sp-how li span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14px; }
.sp-how b { display: block; color: var(--text); }
.sp-form { position: relative; padding: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; }
.sp-form .row2 { display: grid; gap: 12px; }
@media (min-width: 560px) { .sp-form .row2 { grid-template-columns: 1.4fr 1fr; } }
.sp-form .f { margin-bottom: 14px; }
.sp-form input, .sp-form select, .sp-form textarea { background: var(--surface); }
.sp-safety { display: flex; gap: 10px; margin: -4px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--urgent-bg); color: var(--text); font-size: 14.5px; line-height: 1.45; }
.sp-safety b { color: var(--urgent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- a request: the conversation ---------- */
body[data-view="ticket"] .sp-home { display: none; }
body:not([data-view="ticket"]) #ticket { display: none; }
.tk { padding-top: 12px; padding-bottom: 64px; }
.tk-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tk-back:hover { color: var(--accent); }
.tk-head { padding: 12px 0 20px; border-bottom: 1px solid var(--line); }
.tk-ref { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tk-subject:focus { outline: none; }
.tk-subject { margin: 0 0 12px; font-size: clamp(26px, 4vw, 36px); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; overflow-wrap: anywhere; }
.tk-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tk-note { margin: 0; font-size: 15px; color: var(--muted); }

.chat { margin: 0; padding: 24px 0 8px; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.msg-row { display: flex; gap: 10px; align-items: flex-end; max-width: 100%; }
.msg-row.me { flex-direction: row-reverse; }
.av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, #FF9152, #F0513E 55%, #B8264A); }
.av svg { width: 32px; height: 32px; border-radius: 10px; display: block; }
.av.isaac { border-radius: 50%; background: var(--text); color: var(--bg); }
.msg-col { min-width: 0; max-width: min(560px, calc(100% - 42px)); display: grid; gap: 4px; }
.me .msg-col { justify-items: end; }
.meta { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.meta .ai { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.bubble { padding: 12px 15px; border-radius: 18px 18px 18px 6px; background: var(--surface); border: 1px solid var(--line); font-size: 16px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-row.ours { flex-direction: row-reverse; } .ours .msg-col { justify-items: end; } .ours .bubble { border-radius: 18px 18px 6px 18px; }
.me .bubble { border-radius: 18px 18px 6px 18px; background: var(--accent); border-color: transparent; color: var(--on-accent); }
.me .bubble a { color: inherit; }
.isaac-row .bubble { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.bubble a { color: var(--accent); font-weight: 600; }
.bubble.typing { justify-self: start; display: inline-flex; gap: 5px; align-items: center; min-height: 46px; padding: 0 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .35; }
.dot:nth-child(2) { opacity: .6; } .dot:nth-child(3) { opacity: .85; }
.tw::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -3px; background: currentColor; opacity: .6; }
.sys { align-self: center; max-width: 90%; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); text-align: center; }
.sys::before, .sys::after { content: ""; flex: 1 1 24px; min-width: 16px; height: 1px; background: var(--line); }
.chat-empty { padding: 36px 0; text-align: center; color: var(--muted); }

.composer { position: sticky; bottom: 0; margin-top: 14px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--bg) 18px); }
.composer-box { display: flex; gap: 10px; align-items: flex-end; padding: 8px 8px 8px 14px; border: 1px solid var(--field-line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.composer-box:focus-within { border-color: var(--accent); }
.composer textarea { min-height: 44px; max-height: 40vh; padding: 10px 0; border: 0; background: none; resize: none; box-shadow: none !important; }
.send { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; border: 0; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.send:hover { background: var(--accent-hover); }
.send[disabled] { opacity: .5; cursor: default; }
.tk-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; font-size: 13.5px; color: var(--muted); }
.tk-closed { margin: 18px 0 0; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); font-size: 15px; }
.tk-closed a { color: var(--accent); font-weight: 700; }
.tk-err { margin: 8px 0 0; font-size: 14.5px; font-weight: 600; color: var(--bad); }

/* ---------- Isaac's console ---------- */
.ad-gate { max-width: 440px; margin: 8vh auto; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
@media (max-width: 480px) { .ad-gate { margin: 5vh 16px; padding: 22px 18px; } }
.ad-gate h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.ad-gate p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.ad-gate .ad-gate-links { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 0; }
.ad-gate input + label { margin-top: 14px; }
#g-code { font-size: 22px; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; }
.ad { display: grid; gap: 0; min-height: calc(100vh - 90px); border-top: 1px solid var(--line); }
@media (min-width: 980px) { .ad { grid-template-columns: 400px minmax(0, 1fr); } .ad-list-pane { border-right: 1px solid var(--line); } #p-back { display: none; } }
@media (max-width: 979px) { .ad[data-open] .ad-list-pane { display: none; } .ad:not([data-open]) .ad-ticket-pane { display: none; } }
.ad-list-pane { padding: 16px; }
.ad-filters { display: grid; gap: 8px; margin-bottom: 12px; }
.ad-filters .r { display: flex; gap: 8px; }
.ad-filters select, .ad-filters input { min-height: 44px; font-size: 15px; }
.ad-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14.5px; font-weight: 600; margin: 0; color: var(--text); }
.ad-check input { width: 20px; min-height: 0; height: 20px; accent-color: var(--accent); }
.ad-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.ad-rows { margin: 0; padding: 0; list-style: none; }
.ad-rows button { display: grid; gap: 4px; width: 100%; padding: 12px; margin-bottom: 6px; text-align: left; font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.ad-rows button:hover, .ad-rows button[aria-current="true"] { border-color: var(--accent); }
.ad-rows .t1 { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ad-rows .t1 .grow { flex: 1; }
.ad-rows b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-rows small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); color: var(--muted); }
.prio.p-high { background: var(--st-pending-bg); color: var(--st-pending); } .prio.p-urgent { background: var(--urgent-bg); color: var(--urgent); }
.flag { color: var(--urgent); font-weight: 800; }
.ad-ticket-pane { padding: 16px; min-width: 0; }
.ad-empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.ad-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 14px 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.ad-facts dt { color: var(--muted); font-weight: 600; } .ad-facts dd { margin: 0; overflow-wrap: anywhere; }
.ad-reason { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--urgent-bg); font-size: 14.5px; }
.ad-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.ad-controls select { width: auto; min-height: 44px; font-size: 15px; }
.abtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  font: 600 14.5px var(--font); color: var(--text); cursor: pointer; }
.abtn:hover { border-color: var(--accent); }
.abtn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.abtn.danger { color: var(--bad); }
.abtn[disabled] { opacity: .55; cursor: progress; }
.ad-reply { margin-top: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.ad-reply textarea { min-height: 120px; }
.ad-reply .r { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.ad-reply .r select { width: auto; min-height: 44px; font-size: 15px; }
.ad-reply .grow { flex: 1; }

/* ---------- motion (none of it with reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes sp-in { from { opacity: 0; transform: translateY(8px); } }
  @keyframes sp-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
  @keyframes sp-caret { 50% { opacity: 0; } }
  .chat > li.new { animation: sp-in .32s var(--ease) both; }
  .bubble.typing .dot { opacity: .35; animation: sp-dot 1.2s ease-in-out infinite; }
  .bubble.typing .dot:nth-child(2) { animation-delay: .15s; } .bubble.typing .dot:nth-child(3) { animation-delay: .3s; }
  .tw::after { animation: sp-caret .9s steps(1) infinite; }
  .faq summary::after { transition: transform .25s var(--ease), border-color .2s; }
  :root { interpolate-size: allow-keywords; }
  .faq::details-content { height: 0; overflow: clip; transition: height .3s var(--ease), content-visibility .3s allow-discrete; }
  .faq[open]::details-content { height: auto; }
  .pill { transition: background-color .3s, color .3s; }
}
