/* FryLabs Logistics. Same palette, type and shapes as logistics.frylabs.co.uk,
   so a client who has seen the site recognises this page as ours. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f6f9f9;
  --ink: #0b1417;
  --body: #44535a;
  --muted: #6b7c84;
  --faint: #93a3aa;
  --line: #e3eaec;
  --line-2: #cbd7da;
  --brand: #0d9488;
  --brand-deep: #0b6f66;
  --brand-wash: #ecfbf8;
  --brand-line: #a7ded6;
  --wait: #b45309;
  --wait-wash: #fffaf2;
  --wait-line: #f5d5a8;
  --danger: #b42318;
  --danger-wash: #fef4f2;
  --shadow-sm: 0 1px 2px rgba(11, 20, 23, .05), 0 8px 20px -14px rgba(11, 20, 23, .25);
  --shadow-md: 0 1px 3px rgba(11, 20, 23, .06), 0 18px 40px -26px rgba(11, 20, 23, .4);
  --shadow-lg: 0 2px 6px rgba(11, 20, 23, .06), 0 40px 80px -44px rgba(11, 20, 23, .45);
  --r: 14px;
  --pad: clamp(1.05rem, 4vw, 2.25rem);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 86px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font-family: var(--sans); font-size: 16.5px; line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.15; font-weight: 650; letter-spacing: -.022em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--brand-deep); }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 940px; margin: 0 auto; padding-inline: var(--pad); }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.05rem; border-radius: 10px; font-weight: 600; font-size: .94rem;
  text-decoration: none; border: 1px solid transparent; white-space: nowrap; cursor: pointer;
  background: none; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(11,20,23,.1), 0 10px 22px -14px rgba(13,148,136,.9); }
.btn-primary:hover:not(:disabled) { background: var(--brand-deep); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-deep); }
.btn-quiet { color: var(--muted); padding: .4rem .6rem; font-size: .87rem; font-weight: 550; border-radius: 8px; }
.btn-quiet:hover:not(:disabled) { background: var(--bg-alt); color: var(--ink); }
.btn-quiet.danger:hover:not(:disabled) { background: var(--danger-wash); color: var(--danger); }
.btn-sm { padding: .42rem .8rem; font-size: .88rem; }

/* ----------------------------------------------------------------- header */
.site-head {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px); border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-head.stuck { border-bottom-color: var(--line); box-shadow: 0 1px 12px rgba(11,20,23,.05); }
.head-in { display: flex; align-items: center; gap: 1rem; height: 66px; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 680; color: var(--ink); letter-spacing: -.01em; }
.brand .mark { width: 26px; height: 26px; }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); display: inline-flex; align-items: center; gap: .55rem; }
.brand em::before { content: ''; width: 1px; height: 1.15em; background: var(--line-2); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.head-actions .who { font-size: .85rem; color: var(--muted); }

/* ------------------------------------------------------------------- hero */
.hero { padding-block: clamp(2rem, 5vw, 3.4rem) clamp(1.4rem, 3vw, 2rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono);
  font-size: .71rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-deep); font-weight: 500;
}
.hero h1 { font-size: clamp(1.85rem, 4.2vw, 2.7rem); margin-top: .7rem; }
.hero .lede { margin-top: .9rem; font-size: 1.06rem; color: var(--muted); max-width: 66ch; }
.hero .intro { margin-top: 1.1rem; max-width: 70ch; }
.hero .intro p + p { margin-top: .7rem; }

.tally { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }
.tally .stat {
  display: inline-flex; align-items: baseline; gap: .45rem; padding: .42rem .8rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-alt); font-size: .89rem;
}
.tally .stat b { font-size: 1rem; color: var(--ink); font-weight: 680; }
.tally .stat.wait { background: var(--wait-wash); border-color: var(--wait-line); color: var(--wait); }
.tally .stat.wait b { color: var(--wait); }

/* -------------------------------------------------------------- new banner */
.new-banner {
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  margin-top: 1.4rem; padding: .8rem 1rem; border-radius: 12px;
  background: var(--brand-wash); border: 1px solid var(--brand-line); color: var(--brand-deep);
  font-size: .93rem; font-weight: 550;
}
.new-banner .btn { margin-left: auto; }

/* ---------------------------------------------------------------- toolbar */
.toolbar {
  position: sticky; top: 66px; z-index: 30; background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px); padding-block: .7rem; border-bottom: 1px solid var(--line);
  margin-bottom: 1.6rem;
}
.toolbar-in { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 200px; min-width: 160px; }
.search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.toolbar .search input {
  width: 100%; padding: .55rem .8rem .55rem 2.2rem; border-radius: 10px;
  border: 1px solid var(--line-2); background: #fff; font-size: .93rem;
}
.toolbar .search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,148,136,.13); }
.filters { display: flex; gap: .25rem; padding: .2rem; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 11px; }
.filters button {
  border: 0; background: none; padding: .4rem .78rem; border-radius: 8px; cursor: pointer;
  font-size: .88rem; font-weight: 550; color: var(--muted);
}
.filters button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.filters .count { color: var(--faint); font-weight: 500; }

/* ----------------------------------------------------------------- thread */
.threads { display: grid; gap: 1.1rem; padding-bottom: 2rem; }
.thread {
  border: 1px solid var(--line); border-radius: var(--r); background: #fff;
  box-shadow: var(--shadow-sm); overflow: hidden; scroll-margin-top: 130px;
}
.thread.is-waiting { border-color: var(--wait-line); }
.thread.is-hidden { opacity: .6; }
.thread.flash { animation: flash 1.6s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px rgba(13,148,136,.28); } 100% { box-shadow: var(--shadow-sm); } }

.q-head { padding: 1.05rem var(--card-pad, 1.25rem) 1.05rem; display: grid; gap: .55rem; }
.q-top { display: flex; align-items: flex-start; gap: .8rem; }
.q-num {
  flex: none; font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .04em;
  color: var(--brand-deep); background: var(--brand-wash); border: 1px solid var(--brand-line);
  border-radius: 7px; padding: .2rem .45rem; margin-top: .18rem; text-decoration: none;
}
.q-num:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.q-body { font-size: 1.09rem; color: var(--ink); font-weight: 600; letter-spacing: -.012em; line-height: 1.45; flex: 1; }
/* The question is the first paragraph. Everything after it is the context the
   sender gave, and reads as context rather than as more question. */
.q-body p + p, .q-body ul, .q-body ol, .q-body blockquote {
  margin-top: .55rem; font-size: .95rem; font-weight: 450; color: var(--body);
  letter-spacing: 0; line-height: 1.6;
}
.q-body ul, .q-body ol { padding-left: 1.25rem; display: grid; gap: .25rem; }
.q-body ul { list-style: disc; }
.q-body ol { list-style: decimal; }
.q-body strong { font-weight: 700; color: var(--ink); }
.badge {
  flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .58rem;
  border-radius: 999px; font-size: .76rem; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--line-2); color: var(--muted); background: #fff; white-space: nowrap;
}
.badge.answered { color: var(--brand-deep); background: var(--brand-wash); border-color: var(--brand-line); }
.badge.waiting { color: var(--wait); background: var(--wait-wash); border-color: var(--wait-line); }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .84rem; color: var(--muted); padding-left: 2.35rem; }
.q-meta .sep { color: var(--line-2); }
.topic { display: inline-flex; padding: .1rem .5rem; border-radius: 6px; background: var(--bg-alt); border: 1px solid var(--line); font-size: .78rem; font-weight: 550; color: var(--body); }
.new-flag { color: var(--brand-deep); font-weight: 650; }

.entries { border-top: 1px solid var(--line); background: var(--bg-alt); }
.entry { padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; font-size: .84rem; color: var(--muted); }
.entry-who { display: inline-flex; align-items: center; gap: .45rem; font-weight: 650; color: var(--ink); font-size: .89rem; }
.avatar { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: .68rem; font-weight: 700; letter-spacing: .01em; }
.avatar.us { background: var(--brand); color: #fff; }
.avatar.them { background: #fff; border: 1px solid var(--line-2); color: var(--muted); }
.entry.answer { background: #fff; }
.entry.question { background: var(--bg-alt); }
.entry.draft { background: repeating-linear-gradient(135deg, #fffdf7, #fffdf7 12px, #fffaf0 12px, #fffaf0 24px); }
.entry-actions { margin-left: auto; display: flex; gap: .15rem; }

/* rich text inside an answer */
.rt { color: var(--body); }
.rt > * + * { margin-top: .75rem; }
.rt h4 { font-size: 1rem; }
.rt ul, .rt ol { padding-left: 1.25rem; display: grid; gap: .3rem; }
.rt ul { list-style: disc; }
.rt ol { list-style: decimal; }
.rt code { font-family: var(--mono); font-size: .88em; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 5px; padding: .08em .35em; }
.rt pre { background: var(--ink); color: #dbe6e9; padding: .85rem 1rem; border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: .86rem; line-height: 1.5; }
.rt pre code { background: none; border: 0; padding: 0; color: inherit; }
.rt blockquote { border-left: 3px solid var(--brand-line); padding-left: .9rem; color: var(--muted); }
.rt strong { color: var(--ink); font-weight: 650; }
.rt a { text-decoration: underline; text-underline-offset: 2px; }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin-top: .9rem; }
.shot { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; position: relative; }
.shot button.open { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: zoom-in; }
.shot img { width: 100%; height: 132px; object-fit: cover; object-position: top center; }
.shot figcaption { padding: .42rem .6rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--bg-alt); }
.shot .remove { position: absolute; top: .35rem; right: .35rem; background: rgba(11,20,23,.72); color: #fff; border: 0; border-radius: 7px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; }
.file-row { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 550; }
.file-row small { color: var(--muted); font-weight: 400; }

/* thread footer */
.thread-foot { padding: .7rem 1.25rem; border-top: 1px solid var(--line); background: #fff; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------- composer */
.composer { display: grid; gap: .7rem; }
.field { display: grid; gap: .35rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--muted); }
textarea, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; padding: .68rem .85rem; border-radius: 10px; border: 1px solid var(--line-2);
  background: #fff; font-size: .96rem; line-height: 1.55; resize: vertical;
}
textarea:focus, input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,148,136,.13); }
textarea { min-height: 110px; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 620px) { .two-up { grid-template-columns: 1fr; } }
.composer-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.composer-actions .spacer { margin-left: auto; }
.drop-note { font-size: .82rem; color: var(--muted); }
.dropping { outline: 2px dashed var(--brand); outline-offset: 3px; border-radius: 10px; }
.pending-files { display: flex; flex-wrap: wrap; gap: .4rem; }
.pending-files span { font-size: .8rem; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 7px; padding: .2rem .5rem; }

/* ask panel */
.ask-panel { border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow-md); padding: 1.25rem; margin-bottom: 2.5rem; scroll-margin-top: 130px; }
.ask-panel h2 { font-size: 1.15rem; margin-bottom: .25rem; }
.ask-panel .lede { color: var(--muted); font-size: .93rem; margin-bottom: 1rem; }

/* ----------------------------------------------------------------- states */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--bg-alt); }
.empty h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.loading { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.error-card { border: 1px solid var(--danger); background: var(--danger-wash); color: var(--danger); border-radius: var(--r); padding: 1.1rem 1.25rem; }
.form-error { color: var(--danger); font-size: .88rem; font-weight: 550; }

/* ---------------------------------------------------------------- dialogs */
dialog {
  border: 0; border-radius: var(--r); padding: 0; width: min(680px, calc(100vw - 2rem));
  box-shadow: var(--shadow-lg); color: var(--body); background: #fff;
}
dialog::backdrop { background: rgba(11,20,23,.45); backdrop-filter: blur(2px); }
.dlg-head { padding: 1.1rem 1.25rem .35rem; }
.dlg-head h3 { font-size: 1.12rem; }
.dlg-head p { color: var(--muted); font-size: .9rem; margin-top: .3rem; }
.dlg-body { padding: 1rem 1.25rem; display: grid; gap: .8rem; max-height: min(62vh, 640px); overflow-y: auto; }
.dlg-foot { padding: .9rem 1.25rem 1.1rem; display: flex; gap: .5rem; justify-content: flex-end; border-top: 1px solid var(--line); background: var(--bg-alt); border-radius: 0 0 var(--r) var(--r); }
.dlg-foot .spacer { margin-right: auto; }

/* lightbox */
#lightbox { width: min(1180px, calc(100vw - 2rem)); background: none; box-shadow: none; }
#lightbox::backdrop { background: rgba(11,20,23,.86); }
.lb-in { display: grid; gap: .7rem; justify-items: center; }
.lb-in img { max-height: 82vh; width: auto; border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); }
.lb-bar { display: flex; align-items: center; gap: .7rem; color: #e9f1f2; font-size: .9rem; }
.lb-bar .btn-ghost { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); color: #fff; }
.lb-bar .btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }

/* parsed question list in the bulk dialog */
.parsed { display: grid; gap: .5rem; }
.parsed-item { display: flex; gap: .55rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-alt); }
.parsed-item textarea { min-height: 62px; background: #fff; }
.parsed-item .n { font-family: var(--mono); font-size: .78rem; color: var(--muted); padding-top: .55rem; }

/* ------------------------------------------------------------ boards (admin) */
.boards { display: grid; gap: .8rem; padding-bottom: 3rem; }
.board-card { border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow-sm); padding: 1.05rem 1.2rem; display: grid; gap: .6rem; }
.board-card h3 { font-size: 1.08rem; }
.board-card .row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.board-card .link {
  font-family: var(--mono); font-size: .8rem; color: var(--muted); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 8px; padding: .3rem .55rem; overflow-x: auto;
  white-space: nowrap; max-width: 100%; flex: 1 1 260px;
}
.board-card .actions { margin-left: auto; display: flex; gap: .3rem; flex-wrap: wrap; }

/* login */
.login-card { max-width: 420px; margin: clamp(2rem, 8vh, 5rem) auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow-md); padding: 1.5rem; display: grid; gap: .9rem; }

/* ------------------------------------------------------------------- toast */
#toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1.5rem);
  background: var(--ink); color: #fff; padding: .65rem 1.05rem; border-radius: 10px;
  font-size: .9rem; font-weight: 550; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 90; max-width: calc(100vw - 2rem);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ footer */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-alt); padding-block: 1.6rem; margin-top: 2rem; }
.foot-in { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .86rem; color: var(--muted); }
.foot-in .brand { font-size: .95rem; }

/* ------------------------------------------------------------------- print */
@media print {
  .site-head, .toolbar, .ask-panel, .thread-foot, .new-banner, .site-foot, .entry-actions, .head-actions { display: none !important; }
  body { font-size: 11pt; }
  .thread { break-inside: avoid; box-shadow: none; border-color: #ccc; }
  .shot img { height: auto; }
}

/* On a phone the answered label drops under the question rather than
   squeezing it into a column three words wide. */
@media (max-width: 620px) {
  .q-top { flex-wrap: wrap; }
  .q-body { flex: 1 1 70%; }
  .q-top .badge { order: 3; margin-left: 2.35rem; }
  .thread-foot { gap: .3rem; }
  .entry, .q-head { padding-inline: .9rem; }
}
