@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/onest-400.ttf") format("truetype");
}
@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/onest-500.ttf") format("truetype");
}
@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/onest-600.ttf") format("truetype");
}
@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/onest-700.ttf") format("truetype");
}
:root {
  /* базовые */
  --bg: #f7f4ef; /* фон страницы */
  --surface: #ffffff; /* карточки, поля ввода */
  --surface-2: #fffdf9; /* невыбранная карточка задачи */
  --seg: #ece6dc; /* фон сегмент-контрола, фон за экраном входа */
  --ink: #1f2a2e; /* основной текст = основной цвет кнопок */
  --ink-2: #3f4649; /* вторичный текст в карточках */
  --muted: #63686a; /* подписи, метаданные */
  --line: #e4ded3; /* границы, разделители */
  --line-strong: #c9bfae; /* пунктир, обводка быстрых ответов */

  /* бренд */
  --primary: #1f2a2e; /* кнопки, отправка */
  --on-primary: #ffffff;
  --accent: #f0973a; /* янтарь: непрочитанное, «Новый ответ», логотип, AI-пульс */
  --on-accent: #1f2a2e;
  --accent-text: #b4621a; /* янтарный текст (метка «AI», ссылки) */

  /* типы задач */
  --need: #3c5a8a;
  --need-bg: #e8f0fb; /* «Ищу» (в приложении: #315c93 на #e8f0fb) */
  --offer: #b4621a;
  --offer-bg: #f4e7d6; /* «Продаю» */

  /* статусы / проверки */
  --ok: #2f6b4f;
  --ok-bg: #e7efe9; /* ✓ подтверждено, «Ответил», задача активна (точка) */
  --warn: #8a5a14;
  --warn-bg: #fbf0dc; /* ? не подтверждено, «Ждём ответ», «Укажите: …» */
  --warn-line: #ecd29f;
  --neutral-bg: #efebe4; /* «Не связывались» */
  --closed-dot: #9aa59d;
  --clarify-dot: #c9902c;
  --danger: #973a2b;
  --danger-bg: #fdf1ee;
  --danger-line: #e5b9b0;
  --error: #a2392b; /* ошибки валидации */

  --backdrop: rgba(31, 42, 46, 0.38);
  --focus: #b6a169;

  /* радиусы */
  --r-chip: 6px;
  --r-check: 8px;
  --r-btn: 12px;
  --r-card: 14px;
  --r-card-lg: 16px;
  --r-sheet: 20px;
  --r-pill: 999px;

  --font: "Onest", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
:root {
  --green: var(--primary);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  min-height: 44px;
  line-height: 1.35;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:hover:not(:disabled) {
  border-color: var(--line-strong);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.danger {
  color: var(--danger);
}
.muted,
small {
  color: var(--muted);
}
p {
  margin: 10px 0;
}
h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.025em;
}
h1 {
  font-size: 28px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 17px;
}
a {
  color: var(--accent-text);
}
pre {
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  padding: 14px;
  border-radius: 10px;
  font-size: 13px;
}
label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin: 12px 0 6px;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  max-width: 100%;
}
input,
textarea {
  width: 100%;
  font-size: 16px;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.iconButton {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  font-size: 23px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
}
.brand b {
  font-size: 20px;
  letter-spacing: -0.03em;
}
.brandPill {
  background: var(--accent);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
}
.brandMark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  position: relative;
  flex: none;
}
.brandMark:before,
.brandMark:after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--ink);
  position: absolute;
  top: 11px;
  border-radius: 50%;
}
.brandMark:before {
  left: 6px;
}
.brandMark:after {
  right: 6px;
}
.brandMark i {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 14px;
  height: 2px;
  background: var(--ink);
}
#appHeader {
  height: 65px;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accountPill {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 99px;
  padding: 4px 14px 4px 4px;
  max-width: 50%;
  font-size: 14px;
}
.accountPill #who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 13px;
  font-weight: 600;
}
.accountPill .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
#error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-line);
  padding: 12px 18px;
  position: fixed;
  z-index: 50;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 94vw);
  border-radius: 12px;
  box-shadow: 0 4px 20px #0002;
}
.authPage {
  background: var(--seg);
}
#loginPanel {
  width: min(440px, 100%);
  min-height: 100dvh;
  margin: auto;
  background: var(--bg);
}
.authHero {
  padding: 28px 20px 24px;
  background: var(--primary);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.authHero .brandMark {
  width: 34px;
  height: 34px;
}
.authHero .brandMark:before,
.authHero .brandMark:after {
  top: 13px;
}
.authHero .brandMark:before {
  left: 7px;
}
.authHero .brandMark:after {
  right: 7px;
}
.authHero .brandMark i {
  top: 16px;
}
.authHero .brandPill {
  color: white;
  background: #ffffff18;
}
.authHero h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  text-wrap: balance;
}
.authIllustration {
  height: 150px;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  position: relative;
}
.authIllustration svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 150px;
}
.authIllustration path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 5 5;
  animation: flow 1s linear infinite;
}
.authIllustration .exampleNeed,
.authIllustration .exampleOffer {
  position: absolute;
  width: 118px;
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 4px 14px #0002;
}
.exampleNeed {
  left: 0;
  top: 16px;
}
.exampleOffer {
  right: 0;
  top: 72px;
}
.authIllustration small {
  display: block;
  font-size: 10px;
  margin-bottom: 3px;
  letter-spacing: 0.06em;
}
.exampleNeed small {
  color: var(--need);
}
.exampleOffer small {
  color: var(--offer);
}
.aiOrb {
  position: absolute;
  left: calc(50% - 23px);
  top: 52px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 0 0 7px #f0973a30;
  animation: pulse 2.4s ease-in-out infinite;
}
.authSteps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: -14px;
  font-size: 13px;
}
.authSteps span {
  padding: 5px 9px;
  background: #ffffff15;
  border-radius: 99px;
}
.authContent {
  padding: 24px 20px 28px;
}
.segments {
  display: flex;
  gap: 4px;
  background: var(--seg);
  border-radius: 12px;
  padding: 4px;
}
.segments button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 9px;
  min-height: 36px;
  font-size: 14px;
}
.segments [aria-selected="true"] {
  background: white;
  box-shadow: 0 1px 3px #0002;
  color: var(--ink);
  font-weight: 600;
}
#authTabs button {
  min-height: 40px;
  font-size: 15px;
}
#authForm {
  margin-top: 16px;
}
#authForm label {
  margin: 14px 0 5px;
}
#authForm input {
  height: 50px;
  margin-top: 5px;
}
.passwordWrap {
  position: relative;
}
.passwordWrap input {
  padding-right: 90px;
}
.passwordWrap button {
  position: absolute;
  right: 4px;
  top: 8px;
  border: 0;
  background: transparent;
  min-height: 40px;
  font-size: 12px;
  padding: 4px 10px;
}
.textButton {
  border: 0;
  background: transparent;
  color: var(--accent-text);
  padding: 5px 0;
  min-height: 36px;
  font-size: 14px;
}
.forgot {
  display: block;
  margin-left: auto;
  margin-top: 8px;
}
#authSubmit {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
}
.fieldError {
  color: var(--error);
  font-size: 13px;
  margin: 5px 0;
}
.fieldError:empty {
  display: none;
}
input[aria-invalid="true"] {
  border-color: var(--error);
}
.successNotice {
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 12px;
  padding: 14px;
}
#authTitle {
  margin: 14px 0 6px;
}
#authHelp {
  font-size: 14px;
}
.panel {
  max-width: 700px;
  margin: 30px auto;
  padding: 24px;
}
.invitationPanel {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 16px;
  margin: 12px auto;
  width: calc(100% - 24px);
}
#app {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  height: calc(100dvh - 65px);
  overflow: hidden;
}
#taskSidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.asideTitle {
  padding: 20px 16px 12px;
}
.asideTitle h1 {
  margin: 0 0 16px;
}
#tasks {
  overflow: auto;
  flex: 1;
  padding: 0 16px 20px;
}
.task {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  margin: 0 0 10px;
  background: var(--surface-2);
  display: block;
}
.task.active {
  background: white;
  border-color: var(--ink);
}
.task.closed {
  opacity: 0.64;
}
.taskTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.kindChip {
  display: inline-block;
  color: var(--need);
  background: var(--need-bg);
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 8px;
}
.kindChip.offer {
  color: var(--offer);
  background: var(--offer-bg);
}
.kindChip.inquiry {
  color: var(--ok);
  background: var(--ok-bg);
}
.taskTitle {
  display: block;
  margin: 8px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.task small {
  font-size: 13px;
  line-height: 1.4;
  display: block;
}
.statusDot:before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 7px;
}
.statusDot.draft:before,
.statusDot.paused:before {
  background: var(--clarify-dot);
}
.statusDot.closed:before {
  background: var(--closed-dot);
}
.badge {
  background: var(--accent);
  color: var(--ink);
  font-size: 11px;
  border-radius: 99px;
  padding: 3px 8px;
  white-space: nowrap;
}
.asideFooter {
  border-top: 1px solid var(--line);
  padding: 12px 16px 20px;
}
.asideFooter #newTask {
  width: 100%;
  height: 52px;
  font-size: 16px;
}
.asideFooter small {
  display: block;
  text-align: center;
  line-height: 1.4;
  font-size: 12px;
  margin: 6px 8px 0;
}
#confirmCurrent {
  margin-bottom: 12px;
  width: 100%;
}
#activityNotice {
  font-size: 13px;
  background: var(--warn-bg);
  padding: 10px;
  border-radius: 10px;
}
.chat {
  width: 100%;
  max-width: 780px;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chatHeading {
  padding: 16px 16px 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.taskHeadingText {
  flex: 1;
  min-width: 0;
}
.chatHeading h2 {
  font-size: 20px;
  margin: 8px 0 4px;
  overflow-wrap: anywhere;
}
.mobileBack {
  display: none;
}
#taskActions {
  position: relative;
}
.taskMenu {
  position: absolute;
  right: 0;
  top: 50px;
  z-index: 10;
  width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 12px 35px #0002;
  border-radius: 14px;
}
.taskMenu button {
  display: block;
  border: 0;
  width: 100%;
  text-align: left;
  background: transparent;
}
.taskMenu button:hover {
  background: var(--bg);
}
.conditionChips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
}
.conditionChips button {
  padding: 5px 11px;
  min-height: 30px;
  font-size: 13px;
  border-radius: 99px;
}
.conditionChips .missing {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}
.taskTabs {
  display: flex;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.taskTabs button {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 10px 2px;
  min-height: 44px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.taskTabs button[aria-selected="true"] {
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
}
.taskTabs span {
  margin-left: 5px;
  font-size: 11px;
  background: var(--seg);
  padding: 1px 5px;
  border-radius: 99px;
}
.taskTabs span.badge {
  background: var(--accent);
}
#timeline {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#welcome {
  padding: 32px 8px;
  max-width: 550px;
  margin: auto;
}
#welcome h1 {
  font-size: 26px;
}
.welcomeAI {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  font-size: 16px;
  font-weight: 700;
}
.quickReplies {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.quickReplies button {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
  font-size: 13px;
  padding: 8px 12px;
  min-height: 38px;
}
#compose {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
#inputLabel {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin: 0 4px 6px;
}
#inputLabel::first-letter {
  color: var(--accent-text);
}
.composeRow {
  display: flex;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px;
  align-items: flex-end;
}
.composeRow:focus-within {
  outline: 2px solid var(--focus);
}
#input {
  border: 0;
  outline: 0 !important;
  background: transparent;
  resize: none;
  max-height: 144px;
  min-height: 38px;
  line-height: 1.4;
  padding: 7px 8px;
}
#sendMessage {
  height: 40px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  flex: none;
  font-size: 24px;
}
#closedNotice {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  font-size: 13px;
}
.bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px 16px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
  margin: 0 0 14px;
  max-width: 92%;
  font-size: 14px;
}
.bubble small {
  display: block;
  font-size: 11px;
  margin-bottom: 5px;
}
.bubble.user {
  background: var(--primary);
  color: white;
  margin-left: auto;
  border-color: var(--primary);
}
.bubble.user small {
  color: #ffffffaa;
}
.bubble.system {
  background: var(--neutral-bg);
  font-size: 13px;
}
.bubble.outcome {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  max-width: 100%;
  font-weight: 600;
  font-size: 16px;
}
.bubble.outcome small {
  color: var(--accent-text);
}
.bubble.newPosition {
  border-color: var(--ok);
  background: var(--ok-bg);
}
#resultSummary {
  padding: 16px 18px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  white-space: pre-line;
}
.result {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: white;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.partnerHead {
  display: flex;
  align-items: center;
  gap: 12px;
}
.partnerHead > div {
  flex: 1;
  min-width: 0;
}
.partnerHead h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}
.partnerHead small {
  font-size: 12px;
}
.partnerHead .avatar {
  background: var(--tone-bg, var(--ok-bg));
  color: var(--tone-ink, var(--ok));
}
.partnerStatus {
  font-size: 11px;
  border-radius: 99px;
  background: var(--neutral-bg);
  padding: 4px 8px;
  max-width: 130px;
  text-align: center;
}
.partnerStatus.waiting {
  background: var(--warn-bg);
  color: var(--warn);
}
.partnerStatus.answered {
  background: var(--ok-bg);
  color: var(--ok);
}
.partnerStatus.new {
  background: var(--accent);
}
.partnerReason {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.checks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}
.check {
  font-size: 12px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 8px;
  padding: 4px 8px;
}
.check.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.partnerButtons {
  display: flex;
  gap: 8px;
}
.partnerButtons .primary {
  flex: 1;
}
.tone0 {
  --tone-bg: #e3efe5;
  --tone-ink: #325f48;
}
.tone1 {
  --tone-bg: #e8eefb;
  --tone-ink: #315779;
}
.tone2 {
  --tone-bg: #fbf1e4;
  --tone-ink: #74522c;
}
.tone3 {
  --tone-bg: #f1e8f5;
  --tone-ink: #785884;
}
.tone4 {
  --tone-bg: #e4f1f0;
  --tone-ink: #36716b;
}
.tone5 {
  --tone-bg: #f7e8e3;
  --tone-ink: #975342;
}
.resultDetails {
  margin-top: 12px;
  font-size: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.resultDetails:empty {
  display: none;
}
.threadPreview {
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0;
  text-align: left;
}
.threadPreview p {
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}
.reply {
  white-space: pre-wrap;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 13px;
  margin: 10px 12% 10px 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.reply small {
  display: block;
  font-size: 11px;
  margin-bottom: 3px;
}
.reply.ownReply {
  margin-right: 0;
  margin-left: 12%;
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.reply.ownReply small {
  color: #ffffffaa;
}
.reply time {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  margin-top: 5px;
}
.reply.ownReply time {
  color: #ffffff99;
}
#progress {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface-2);
  font-size: 14px;
}
.thinking:before {
  content: "";
  display: inline-block;
  background: var(--accent);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 1.2s ease-in-out infinite;
}
.reviewCard {
  border: 1px solid var(--warn-line);
  background: var(--surface-2);
  padding: 18px;
  border-radius: 16px;
  margin: 16px 0;
}
.reviewCard h3 {
  margin: 0 0 12px;
}
.reviewCard dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  font-size: 14px;
}
.reviewCard dt {
  color: var(--muted);
}
.reviewCard dd {
  margin: 0;
  text-align: right;
}
.reviewCard .primary {
  width: 100%;
  margin-top: 12px;
}
.deleteConfirm {
  padding: 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: 14px;
  margin: 8px 16px;
  font-size: 14px;
}
.orderCard {
  background: var(--surface-2);
  border: 1px solid var(--warn-line);
  border-radius: 14px;
  padding: 18px;
  margin: 14px 0;
}
.orderCard h3 {
  font-size: 18px;
  margin: 0 0 10px;
}
.orderCard p {
  font-size: 14px;
}
.orderCard.published {
  background: var(--ok-bg);
  border-color: var(--line);
}
.orderSubmitRow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.orderSubmitRow small {
  font-size: 12px;
  line-height: 1.5;
}
.mailNotice {
  background: var(--warn-bg);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.emptyState {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink);
  padding: 20px;
  width: min(520px, calc(100vw - 32px));
  max-height: 92dvh;
  overflow: auto;
  box-shadow: 0 24px 80px #0002;
}
dialog::backdrop {
  background: var(--backdrop);
}
.asideHead,
.messageDialogHead {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.asideHead h2,
.messageDialogHead h2 {
  font-size: 20px;
  margin: 0;
}
.asideHead button,
.messageDialogHead button {
  flex: none;
  min-width: 44px;
}
.accountIdentity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 20px;
}
.accountIdentity p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0;
  overflow-wrap: anywhere;
}
.accountIdentity > div {
  min-width: 0;
}
.accountRows {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.accountRows button {
  text-align: left;
  border: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 4px;
}
.accountRows #pushButton:after {
  content: "›";
  float: right;
  font-size: 20px;
  color: var(--muted);
}
#partnerPanel[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#partnerContext {
  flex: none;
  font-size: 13px;
}
#partnerContext p {
  margin: 0 0 10px;
}
#partnerMessages {
  overflow: auto;
  min-height: 60px;
  max-height: 40dvh;
  flex: 1;
  padding-right: 4px;
}
#partnerForm {
  flex: none;
}
#partnerBody {
  resize: vertical;
  max-height: 140px;
}
#partnerUnavailable,
#partnerError,
#companyContactError {
  font-size: 13px;
  color: var(--danger);
}
#partnerStatus {
  color: var(--ok);
  font-size: 13px;
}
#partnerError:empty,
#partnerStatus:empty {
  display: none;
}
.messageDialogActions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 10px 0 0;
}
.messageDialogActions .primary {
  flex: 1;
}
.desktopMessageHint {
  font-size: 11px;
  display: block;
  margin-top: 8px;
}
.contactRoute {
  background: var(--warn-bg);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
}
#companyContactForm > button {
  width: 100%;
}
#companyContactData pre {
  max-height: 40dvh;
  overflow: auto;
}
.partnerQuestions {
  margin: 8px 0;
}
.partnerQuestions button {
  font-size: 12px;
  padding: 6px 10px;
  min-height: 34px;
}
#pushStatus {
  color: var(--ok);
}
@keyframes pulse {
  50% {
    opacity: 0.6;
  }
}
@keyframes flow {
  to {
    stroke-dashoffset: -20;
  }
}
@media (min-width: 860px) {
  .chat {
    padding-top: 0;
  }
  #appHeader .brand {
    height: 44px;
  }
}
@media (max-width: 859px) {
  body:has(#app:not([hidden])) {
    height: var(--visible-height, 100dvh);
    overflow: hidden;
  }
  #appHeader {
    height: 65px;
  }
  body:has(#app:not(.tasksOpen):not([hidden])) #appHeader {
    display: none;
  }
  #app {
    display: block;
    height: calc(var(--visible-height, 100dvh) - 65px);
  }
  #app:not(.tasksOpen) {
    height: var(--visible-height, 100dvh);
  }
  #taskSidebar {
    height: 100%;
    border: 0;
  }
  #app.tasksOpen .chat {
    display: none;
  }
  #app:not(.tasksOpen) #taskSidebar {
    display: none;
  }
  .chat {
    height: 100%;
    max-width: none;
  }
  .mobileBack {
    display: block;
    background: transparent;
    border: 0;
  }
  .chatHeading {
    padding: 12px 12px 8px;
    gap: 6px;
  }
  .chatHeading h2 {
    font-size: 19px;
    margin-top: 6px;
  }
  .conditionChips {
    padding: 2px 16px 12px;
  }
  .taskTabs {
    gap: 16px;
  }
  .taskTabs button {
    font-size: 13px;
  }
  #timeline {
    padding: 14px 16px;
  }
  #compose {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }
  .asideFooter {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .partnerHead {
    gap: 10px;
  }
  .partnerStatus {
    max-width: 98px;
  }
  .partnerButtons button {
    font-size: 13px;
    padding: 10px 12px;
  }
  .result {
    padding: 14px;
  }
  .bubble {
    max-width: 95%;
  }
  .authHero {
    gap: 22px;
  }
  .authContent {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  dialog[open] {
    position: fixed;
    top: auto;
    bottom: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: calc(var(--visible-height, 100dvh) * 0.92);
    border-radius: 20px 20px 0 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }
  #partnerPanel[open] {
    max-height: calc(var(--visible-height, 100dvh) * 0.94);
  }
  #partnerMessages {
    max-height: 35dvh;
  }
  #partnerBody {
    max-height: 100px;
  }
  .desktopMessageHint {
    display: none;
  }
  #closedNotice {
    align-items: flex-start;
  }
  .panel {
    margin: 16px auto;
  }
  .accountPill {
    max-width: 56%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
#adminPanel {
  width: min(1100px, 96vw);
  max-height: 92dvh;
}
.adminToolbar,
.adminTabs,
.adminFilters,
.setupNotice {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.adminTabs {
  justify-content: flex-start;
  margin: 20px 0 12px;
  flex-wrap: wrap;
}
.adminToolbar p {
  margin: 0;
}
.metricGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f8f2;
  padding: 16px;
}
.metric strong {
  display: block;
  font-size: 32px;
  line-height: 1.3;
  margin: 5px 0;
}
.metric small {
  font-size: 13px;
  color: var(--ink);
}
.metric span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.adminFilters label:first-child {
  flex: 1;
}
.adminUser {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.adminUser h3 {
  margin: 0;
  font-size: 17px;
}
.adminUser p {
  margin: 5px 0;
}
.adminUser button {
  flex: none;
}
.adminUser details {
  margin-top: 8px;
}
.operationsGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.operationsGrid .result {
  margin: 0;
}
.setupNotice {
  padding: 16px;
  background: #fff6dc;
  border-radius: 10px;
  margin-top: 14px;
}
.setupNotice p {
  font-size: 13px;
  margin: 5px 0 0;
}
.setupNotice button {
  flex: none;
}
#accountSetupForm label span {
  display: block;
  font-size: 12px;
  font-weight: 400;
}
#companySearch {
  display: flex;
  align-items: end;
  gap: 10px;
}
#companySearch label {
  flex: 1;
}
#companySearch button {
  margin-bottom: 10px;
}
@media (max-width: 700px) {
  .metricGrid {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    padding: 12px;
  }
  .metric strong {
    font-size: 25px;
  }
  .operationsGrid {
    grid-template-columns: 1fr;
  }
  .setupNotice {
    flex-direction: column;
    align-items: stretch;
  }
  .adminFilters {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }
  .adminUser {
    flex-direction: column;
    gap: 10px;
  }
}

#profilePanel {
  width: min(800px, calc(100vw - 32px));
}
#companyForm {
  display: grid;
  gap: 16px;
}
#companyForm label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}
#companyForm textarea,
#companyForm input {
  width: 100%;
  box-sizing: border-box;
  font-weight: 400;
}
#companyForm textarea {
  resize: vertical;
}
.companyGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.companyStatus {
  display: grid;
  gap: 5px;
  border-radius: 12px;
  padding: 16px;
  background: #eaf1ff;
  color: #203f72;
  margin: 14px 0;
}
.companyStatus strong {
  font-size: 19px;
}
.companyStatus.indexed {
  background: #e4f4ec;
  color: #155b3f;
}
.companyStatus.failed {
  background: #fff1e6;
  color: #854113;
}
.prefillNote {
  border-left: 3px solid #7ba995;
  padding-left: 12px;
  font-size: 14px;
}
.companyActions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  bottom: -1px;
  background: white;
  padding: 14px 0 4px;
}
#companySaved {
  color: #176540;
  font-size: 14px;
}
@media (max-width: 600px) {
  .companyGrid {
    grid-template-columns: 1fr;
  }
}
.supplierContactAction {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.supplierContactAction small {
  color: var(--muted);
}
/* Existing administration and company forms use the same design tokens. */
.metric {
  background: var(--surface-2);
}
.setupNotice {
  background: var(--warn-bg);
}
.companyActions {
  background: var(--bg);
}
.companyStatus {
  background: var(--need-bg);
  color: var(--need);
}
.companyStatus.indexed {
  background: var(--ok-bg);
  color: var(--ok);
}
.companyStatus.failed {
  background: var(--warn-bg);
  color: var(--warn);
}
.prefillNote {
  border-color: var(--accent);
}
@media (max-width: 859px) {
  #adminPanel[open],
  #profilePanel[open] {
    width: 100%;
    max-height: calc(var(--visible-height, 100dvh) * 0.94);
  }
  .adminTabs {
    gap: 6px;
  }
  .adminTabs button {
    font-size: 13px;
  }
}
.messageDialogHead > div {
  flex: 1;
  min-width: 0;
}
.messageDialogHead .avatar {
  background: var(--tone-bg, var(--seg));
  color: var(--tone-ink, var(--ink));
}
#partnerContext {
  max-height: 24dvh;
  overflow: auto;
}
#partnerContext details {
  font-size: 13px;
}
#partnerContext summary {
  padding: 4px 0;
  min-height: 32px;
}
#companyContactData {
  overflow: auto;
  min-height: 0;
  max-height: 65dvh;
  font-size: 14px;
}
.reviewCard {
  border: 1.5px solid var(--primary);
}
#termsSummary .reviewCard {
  border: 1px solid var(--line);
  margin-top: 0;
}
.reviewCard dd {
  overflow-wrap: anywhere;
  min-width: 0;
}
.reviewCard dl {
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
}
#progress.thinking {
  border-style: dashed;
  border-color: var(--line-strong);
}
@media (max-width: 859px) {
  .taskMenu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 80px #1f2a2e38;
  }
  .taskMenu button {
    min-height: 50px;
  }
}

/* Public invitation: understand the request before creating an account. */
.invitationEntry {
  display: grid;
  gap: 7px;
  margin: 0 20px;
  width: calc(100% - 40px);
  background: transparent;
  color: var(--ink);
  text-align: left;
  line-height: 1.45;
}
.invitationEntry span:not([aria-hidden]) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.entranceLink {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  min-height: 52px;
  padding: 14px 22px;
  background: var(--accent);
  color: var(--ink);
  border: 1px solid #df872e;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: 0 4px 0 #b4621a24;
}
.entranceLink:hover {
  background: #ffa84c;
}
.entranceLink:focus-visible,
.authHowLink:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 4px;
}
.authFree {
  margin: -8px 0 0;
  color: #c6eed2;
  font-size: 14px;
  font-weight: 600;
}
.authHero .authSteps {
  margin-top: 0;
}
.authHowLink {
  align-self: center;
  color: #fff;
  font-size: 14px;
  text-underline-offset: 4px;
  margin-top: -8px;
}
#authContent {
  scroll-margin-top: 16px;
}
#authSubmit {
  font-weight: 700;
  min-height: 50px;
}
.publicLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding: 18px 20px;
  font-size: 14px;
}
.invitationPanel .publicLinks {
  padding: 16px 0 0;
}
.invitationPanel {
  max-width: 700px;
}
#invitationSummary {
  font-size: 22px;
  font-weight: 650;
  padding: 18px;
  background: var(--bg);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
#invitationHelp,
#invitationEvidence {
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.invitationAuth .authHero,
.invitationAuth .invitationEntry {
  display: none;
}
#loginPanel.invitationAuth {
  min-height: auto;
  border-radius: 16px;
  margin-bottom: 32px;
}
#invitationCode {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.aboutPage {
  background: var(--seg);
}
.aboutContent {
  max-width: 840px;
  margin: 0 auto;
  padding: 32px 24px;
}
.aboutNav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}
.aboutNav .brand {
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
}
.aboutNav .entranceLink {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  gap: 16px;
}
.freeBadge {
  display: inline-flex;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 9px;
  background: #deecdf;
  color: #234d32;
  font-size: 14px;
  font-weight: 600;
}
.freeDetails {
  max-width: 640px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
  margin: 16px 0 36px;
}
.entryHint {
  flex: 1 1 180px;
  max-width: 260px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.aboutContent h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin: 14px 0 20px;
}
.aboutLead {
  font-size: 18px;
  line-height: 1.65;
  max-width: 700px;
}
.aboutActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 24px 0 0;
}
.actionLink {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}
.aboutCard {
  padding: 24px;
  margin: 18px 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.aboutCard h2 {
  margin-top: 0;
}
.aboutCard li {
  margin-bottom: 10px;
}
.howItWorks {
  margin: 36px 0;
  scroll-margin-top: 24px;
}
.flowSteps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
  margin: 20px 0;
}
.flowStep {
  position: relative;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.flowStep:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 28px;
  right: -19px;
  width: 20px;
  text-align: center;
  color: var(--accent-text);
  font-size: 22px;
  font-weight: 700;
  z-index: 1;
}
.flowNumber {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
}
.flowStep h3 {
  font-size: 17px;
  margin: 18px 0 10px;
}
.flowStep p,
.flowFollowup {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}
.flowExample {
  margin-top: 8px;
  padding: 10px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.5;
}
.flowExample b {
  display: block;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.needExample {
  background: #e3eef3;
  color: #225269;
}
.offerExample {
  background: #e6efdf;
  color: #3c5927;
}
.flowMatch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 20px 0 12px;
  font-size: 9px;
  font-weight: 600;
}
.flowMatch b {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 18px;
  box-shadow: 0 0 0 5px #f0973a26;
}
.flowStep small {
  font-size: 12px;
  color: var(--muted);
}
.flowReply {
  background: #f8e4c9;
  border-radius: 12px 12px 12px 2px;
  padding: 13px;
  margin-top: 22px;
  font-size: 13px;
  line-height: 1.5;
}
.flowFollowup {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}
.invitationExplainer .actionLink {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 600px) {
  .aboutContent {
    padding: 24px 16px;
  }
  .aboutCard {
    padding: 20px 16px;
  }
  .aboutActions .entranceLink {
    width: 100%;
    text-align: center;
  }
  .aboutNav {
    margin-bottom: 28px;
    gap: 8px;
  }
  .aboutNav .entranceLink {
    gap: 8px;
  }
  .entryHint {
    max-width: none;
    text-align: center;
  }
  .flowSteps {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .flowStep {
    padding: 20px;
  }
  .flowStep:not(:last-child)::after {
    content: "↓";
    top: auto;
    bottom: -27px;
    right: calc(50% - 10px);
  }
  .flowMatch {
    max-width: 240px;
    font-size: 11px;
  }
}
