
:root {
  --bg: #0c0b08;
  --bg-soft: #17130d;
  --panel: rgba(28, 23, 15, 0.96);
  --panel-2: rgba(39, 29, 16, 0.95);
  --orange: #f58a1f;
  --orange-deep: #c95f0a;
  --cream: #f4dfb1;
  --paper: #ead3a2;
  --green: #9ad442;
  --red: #ef5b4c;
  --muted: #bba985;
  --border: rgba(245, 138, 31, 0.35);
  --shadow: 0 18px 60px rgba(0,0,0,.4);
  --radius: 18px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 80% 10%, rgba(245, 138, 31, .10), transparent 28rem),
    linear-gradient(180deg, #090806, var(--bg));
  color: var(--cream);
  font-family: "Nunito", system-ui, sans-serif;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  min-height: 82px;
  padding: .75rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 9, 6, .92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: .65rem;
  align-items: center;
  text-decoration: none;
}

.brand-paw { font-size: 2rem; }
.brand strong {
  display: block;
  color: var(--orange);
  font-size: 1.45rem;
  letter-spacing: .06em;
}
.brand small { display: block; color: var(--cream); }

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(.7rem, 2.2vw, 2rem);
}

.site-nav a {
  position: relative;
  text-decoration: none;
  font-family: "Comic Neue", cursive;
  font-weight: 700;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -.35rem;
  height: 2px;
  background: var(--orange);
  transition: right .2s ease;
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after { right: 0; }

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--cream);
  padding: .55rem .8rem;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid rgba(154, 212, 66, .6);
  border-radius: 12px;
  padding: .65rem .85rem;
  color: var(--green);
  font-size: .85rem;
  font-weight: 900;
  text-transform: uppercase;
}
.status-dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.hero {
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr);
  align-items: stretch;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 7vw, 7rem) clamp(1.2rem, 5vw, 5rem);
  background:
    linear-gradient(90deg, rgba(9,8,6,.98), rgba(9,8,6,.82)),
    radial-gradient(circle, rgba(245,138,31,.12), transparent 55%);
}

.eyebrow {
  margin: 0 0 .5rem;
  color: var(--orange);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.08;
}

h1 {
  margin-bottom: .6rem;
  font-family: "Comic Neue", cursive;
  font-size: clamp(4rem, 8vw, 8.2rem);
}
h1 span { color: var(--orange); }

.hero h2 {
  max-width: 720px;
  font-size: clamp(1.3rem, 2.7vw, 2.4rem);
  color: #f8cb7f;
}

.hero-text {
  max-width: 700px;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: #ddcfb3;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.6rem 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: .85rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}

.button:hover { transform: translateY(-2px) rotate(-.3deg); filter: brightness(1.08); }
.button-primary {
  background: linear-gradient(180deg, var(--orange), var(--orange-deep));
  color: #170b02;
}
.button-secondary {
  border-color: var(--border);
  background: rgba(255,255,255,.03);
  color: var(--cream);
}

.quote-card {
  max-width: 640px;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--orange);
  background: rgba(245, 138, 31, .08);
  border-radius: 0 12px 12px 0;
}
.quote-card strong { color: var(--orange); }

.hero-art {
  position: relative;
  min-height: 680px;
  background: #120d08;
}

.hero-art > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9,8,6,.7), transparent 30%);
  pointer-events: none;
}

.sticky {
  position: absolute;
  z-index: 2;
  width: 180px;
  padding: 1rem;
  background: #e5a62c;
  color: #1c1204;
  font-family: "Comic Neue", cursive;
  font-weight: 700;
  box-shadow: 0 12px 25px rgba(0,0,0,.35);
}
.sticky-one { right: 5%; top: 5%; transform: rotate(3deg); }
.sticky-two { right: 3%; top: 27%; transform: rotate(5deg); }

.section-shell {
  width: min(1500px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(4rem, 7vw, 7rem) 0;
}

.section-heading { margin-bottom: 1.6rem; }
.section-heading h2,
.split-section h2,
.contact-section h2 {
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  font-family: "Comic Neue", cursive;
}

.card-grid {
  display: grid;
  gap: 1rem;
}
.card-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.panel,
.feature-card,
.photo-card,
.message-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255,255,255,.025), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
}

.panel { padding: clamp(1.2rem, 2.4vw, 2rem); }
.panel h3 { color: #efb65a; font-size: 1.35rem; }

.status-list {
  margin: 0;
}
.status-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.status-list dd { margin: 0; }

.badge {
  display: inline-flex;
  padding: .18rem .55rem;
  border: 1px solid var(--muted);
  border-radius: 6px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}
.badge.online {
  border-color: var(--green);
  color: var(--green);
}
.badge.offline {
  border-color: var(--red);
  color: var(--red);
}

.panel-note { color: var(--muted); font-size: .88rem; }
.mood {
  color: var(--green);
  font-size: 1.45rem;
  font-weight: 900;
  text-transform: uppercase;
}
.meter-label {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  font-size: .9rem;
  font-weight: 900;
}
progress {
  width: 100%;
  height: 1.2rem;
  accent-color: var(--green);
}

.assessment { padding-left: 1.5rem; }
.assessment li { padding: .45rem .2rem; }
.assessment .done::marker { color: var(--green); }
.assessment .failed {
  color: #e9b8ad;
  text-decoration: underline wavy var(--red) 2px;
}
.scribble {
  padding: 1rem;
  border: 2px solid var(--cream);
  border-radius: 50%;
  text-align: center;
  font-family: "Comic Neue", cursive;
  transform: rotate(-2deg);
}

.split-section {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 1rem;
}
.about-card p { font-size: 1.08rem; }
.trait-list {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}
.trait-list li { padding: .55rem 0; }
.trait-list li::before { content: "🐾"; margin-right: .55rem; }

.photo-card {
  padding: 1rem;
  background: var(--paper);
  color: #21170c;
  transform: rotate(1deg);
}
.photo-card img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 8px solid #f8ead0;
}
.photo-card p {
  margin-bottom: .2rem;
  text-align: center;
  font-family: "Comic Neue", cursive;
  font-size: 1.35rem;
  font-weight: 700;
}

.feature-card {
  padding: 1.4rem;
  min-height: 220px;
}
.feature-card > span { font-size: 2rem; }
.feature-card h3 { margin: .8rem 0; color: var(--orange); }

.contact-section {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.message-form { padding: clamp(1.2rem, 3vw, 2.2rem); }
.message-form label { display: block; margin: .7rem 0 .35rem; font-weight: 900; }
.message-form input,
.message-form textarea {
  width: 100%;
  border: 1px solid rgba(33, 23, 12, .4);
  border-radius: 8px;
  padding: .85rem 1rem;
  background: #f3dfb7;
  color: #21170c;
}
.message-form textarea { resize: vertical; }
.message-form .button { margin-top: 1rem; }
#form-result { min-height: 1.5rem; color: var(--green); }

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  border-top: 1px solid var(--border);
  background: #090806;
  color: var(--muted);
}
footer strong { color: var(--orange); }
footer p { margin: .2rem 0 0; }
footer blockquote {
  margin: 0;
  color: var(--cream);
  font-family: "Comic Neue", cursive;
  font-size: 1.2rem;
  text-align: center;
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: auto auto;
  }
  .menu-toggle { display: inline-flex; justify-self: end; }
  .site-nav {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    padding: 1rem 0;
  }
  .site-nav.open { display: flex; }
  .online-pill { display: none; }

  .hero {
    grid-template-columns: 1fr;
  }
  .hero-art { min-height: 560px; order: -1; }
  .hero-art::after {
    background: linear-gradient(180deg, transparent 55%, rgba(9,8,6,.9));
  }

  .card-grid-three,
  .card-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  h1 { font-size: 4.2rem; }
  .hero-art { min-height: 420px; }
  .sticky { display: none; }

  .card-grid-three,
  .card-grid-four,
  .split-section,
  .contact-section { grid-template-columns: 1fr; }

  footer {
    flex-direction: column;
    text-align: center;
  }
}

/* === Kiwi FIA Chat v1.0 === */
.chat-card { width: 100%; overflow: hidden; border: 2px solid rgba(242,157,52,.35); border-radius: 22px; background: var(--panel,#fffaf0); box-shadow: 0 18px 45px rgba(87,53,18,.14); }
.chat-header { display: flex; align-items: center; gap: 13px; padding: 17px 20px; border-bottom: 1px solid rgba(87,53,18,.14); background: rgba(255,180,68,.10); }
.avatar {
  width: 96px;
  height: 96px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
  background: #f39a28;
  border: 2px solid rgba(242,157,52,.55);
  box-shadow: 0 4px 14px rgba(87,53,18,.18);
}

.kiwi-cam img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.chat-header strong, .chat-header span { display: block; }
.chat-header span { margin-top: 3px; color: var(--muted,#6f604f); font-size: .82rem; }
.chat-header i { width: 8px; height: 8px; display: inline-block; margin-right: 6px; border-radius: 50%; background: #77bf45; }
.icon-button { margin-left: auto; border: 1px solid rgba(87,53,18,.18); border-radius: 10px; padding: 8px 12px; background: transparent; color: inherit; cursor: pointer; }
.icon-button:hover { background: rgba(255,180,68,.12); }
.chat-messages { min-height: 360px; max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 24px; }
.message { max-width: 80%; }
.message.user { margin-left: auto; }
.message-name { margin: 0 0 6px 4px; color: #bd6d0b; font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.message.user .message-name { color: var(--muted,#6f604f); text-align: right; }
.bubble { padding: 14px 16px; border: 1px solid rgba(87,53,18,.10); border-radius: 15px; background: rgba(255,180,68,.10); line-height: 1.55; white-space: pre-wrap; }
.message.user .bubble { background: #f39a28; color: #fff; }
.message.thinking .bubble { color: var(--muted,#6f604f); font-style: italic; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; }
.suggestions button { border: 1px solid rgba(87,53,18,.16); border-radius: 999px; padding: 8px 12px; background: rgba(255,180,68,.08); color: inherit; cursor: pointer; }
.suggestions button:hover { border-color: #f39a28; background: rgba(255,180,68,.15); }
.chat-form { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid rgba(87,53,18,.14); }
.chat-form textarea { min-height: 50px; max-height: 160px; flex: 1; resize: none; border: 1px solid rgba(87,53,18,.20); border-radius: 12px; padding: 14px 15px; background: rgba(255,255,255,.78); color: #2b2418; font: inherit; outline: none; }
.chat-form textarea::placeholder {
    color: #8a7356;
    opacity: 1;
}
.chat-form textarea:focus { border-color: #f39a28; box-shadow: 0 0 0 3px rgba(243,154,40,.14); }
.send-button { min-width: 94px; border: 0; border-radius: 12px; padding: 0 20px; background: #f39a28; color: #fff; font-weight: 900; cursor: pointer; }
.send-button:disabled { opacity: .55; cursor: wait; }
.chat-footer { display: flex; justify-content: space-between; gap: 18px; padding: 0 20px 17px; color: var(--muted,#6f604f); font-size: .78rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
@media (max-width: 680px) { .message { max-width: 92%; } .chat-form { flex-direction: column; } .send-button { min-height: 48px; } .chat-footer { flex-direction: column; } }


/* Kiwi chat readability override */
#message-input {
    color: #2b2418 !important;
    -webkit-text-fill-color: #2b2418 !important;
    background-color: #fffdf8 !important;
}

#message-input::placeholder {
    color: #6f604f !important;
    -webkit-text-fill-color: #6f604f !important;
    opacity: 1 !important;
}


/* =========================================================
   Kiwi Mobile Chat Mode v1
   ========================================================= */

.chat-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-actions .icon-button {
  margin-left: 0;
}

.exit-chat-button {
  display: none;
}

@media (max-width: 680px) {
  body.kiwi-mobile-chat-open {
    overflow: hidden;
  }

  body.kiwi-mobile-chat-open .chat-card {
    position: fixed;
    inset: 0;
    z-index: 10000;

    width: 100%;
    height: 100vh;
    height: 100dvh;

    display: flex;
    flex-direction: column;

    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--panel, #fffaf0);
  }

  body.kiwi-mobile-chat-open .chat-header {
    flex: 0 0 auto;
    gap: 10px;
    padding: 10px 12px;
  }

  body.kiwi-mobile-chat-open .avatar {
    width: 78px;
    height: 78px;
    border-radius: 12px;
  }

  body.kiwi-mobile-chat-open .chat-header > div:nth-child(2) {
    min-width: 0;
    flex: 1 1 auto;
  }

  body.kiwi-mobile-chat-open #chat-brain-cell-status {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.kiwi-mobile-chat-open .chat-header-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  body.kiwi-mobile-chat-open .chat-header-actions .icon-button {
    padding: 8px 10px;
    white-space: nowrap;
  }

  body.kiwi-mobile-chat-open .exit-chat-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.kiwi-mobile-chat-open .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    gap: 14px;
    padding: 16px 12px;
  }

  body.kiwi-mobile-chat-open .message {
    max-width: 94%;
  }

  body.kiwi-mobile-chat-open .message.user {
    max-width: 88%;
  }

  body.kiwi-mobile-chat-open .suggestions {
    flex: 0 0 auto;
    flex-wrap: nowrap;

    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    gap: 8px;
    padding: 8px 12px;

    scrollbar-width: none;
  }

  body.kiwi-mobile-chat-open .suggestions::-webkit-scrollbar {
    display: none;
  }

  body.kiwi-mobile-chat-open .suggestions button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.kiwi-mobile-chat-open .chat-form {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: stretch;

    gap: 8px;
    padding: 10px 12px;
  }

  body.kiwi-mobile-chat-open .chat-form textarea {
    min-width: 0;
    min-height: 48px;
    max-height: 110px;
  }

  body.kiwi-mobile-chat-open .send-button {
    min-width: 76px;
    min-height: 48px;
    padding: 0 14px;
  }

  body.kiwi-mobile-chat-open .chat-footer {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: space-between;

    padding: 6px 12px 10px;
    font-size: .7rem;
  }

  body.kiwi-mobile-chat-open .chat-footer span:last-child {
    display: none;
  }
}

/* =========================================================
   Kiwi Mobile Header Status Width Fix
   Allow longer brain-cell status text under header controls.
   ========================================================= */

@media (max-width: 680px) {

  body.kiwi-mobile-chat-open .chat-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "avatar identity actions"
      "status status status";
    align-items: center;
    gap: 8px 10px;
  }

  body.kiwi-mobile-chat-open .kiwi-cam {
    grid-area: avatar;
  }

  body.kiwi-mobile-chat-open .chat-header > div:nth-child(2) {
    grid-area: identity;
    min-width: 0;
  }

  body.kiwi-mobile-chat-open .chat-header-actions {
    grid-area: actions;
    align-self: center;
  }

  body.kiwi-mobile-chat-open #chat-brain-cell-status {
    display: block;
    grid-area: status;
    width: 100%;
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.25;
  }

  body.kiwi-mobile-chat-open .chat-header > div:nth-child(2) > span {
    grid-area: status;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}


/* =========================================================
   Kiwi Fake Production Crash v1
   Entirely visual. No real services are interrupted.
   ========================================================= */

.kiwi-crash-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background:
    radial-gradient(circle at center, #101810 0%, #030503 70%);
  color: #7cff7c;

  font-family:
    "Courier New",
    Courier,
    monospace;
}

.kiwi-crash-overlay[hidden] {
  display: none;
}

body.kiwi-production-crash {
  overflow: hidden !important;
}

body.kiwi-production-crash .kiwi-crash-overlay {
  animation: kiwiCrashFlicker .14s steps(2, end) 3;
}

.kiwi-crash-terminal {
  width: min(900px, 100%);
  min-height: min(620px, 82vh);

  padding: clamp(20px, 4vw, 42px);

  border: 1px solid rgba(124, 255, 124, .45);
  border-radius: 8px;

  background: rgba(0, 10, 0, .92);

  box-shadow:
    0 0 30px rgba(65, 255, 65, .14),
    inset 0 0 40px rgba(65, 255, 65, .04);
}

.kiwi-crash-title {
  padding-bottom: 14px;
  margin-bottom: 22px;

  border-bottom: 1px solid rgba(124, 255, 124, .25);

  color: #b9ffb9;

  font-size: clamp(.85rem, 2vw, 1.05rem);
  font-weight: 900;
  letter-spacing: .16em;
}

.kiwi-crash-output {
  min-height: 330px;
  margin: 0;

  white-space: pre-wrap;
  overflow-wrap: anywhere;

  color: #7cff7c;

  font: inherit;
  font-size: clamp(.85rem, 2.2vw, 1.08rem);
  line-height: 1.65;
}

.kiwi-crash-final {
  display: flex;
  flex-direction: column;
  gap: 10px;

  margin-top: 22px;
  padding: 18px;

  border: 1px solid #ffb347;
  background: rgba(120, 55, 0, .18);

  color: #ffd38a;
  text-align: center;
}

.kiwi-crash-final[hidden] {
  display: none;
}

.kiwi-crash-final strong {
  font-size: clamp(1.1rem, 4vw, 1.7rem);
}

.kiwi-backup-banner {
  position: fixed;
  z-index: 25000;

  left: 50%;
  top: 12px;

  width: min(760px, calc(100% - 24px));

  transform: translateX(-50%);

  padding: 11px 16px;

  border: 2px solid #ffb347;
  border-radius: 10px;

  background: #231607;
  color: #ffd38a;

  font-weight: 900;
  text-align: center;

  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}

.kiwi-backup-banner[hidden] {
  display: none;
}

@keyframes kiwiCrashFlicker {
  0%   { opacity: 1; transform: translateX(0); }
  25%  { opacity: .35; transform: translateX(-5px); }
  50%  { opacity: .8; transform: translateX(4px); }
  75%  { opacity: .2; transform: translateX(-2px); }
  100% { opacity: 1; transform: translateX(0); }
}

@media (max-width: 680px) {
  .kiwi-crash-overlay {
    padding: 10px;
  }

  .kiwi-crash-terminal {
    min-height: calc(100dvh - 20px);
    padding: 18px 15px;
  }

  .kiwi-crash-output {
    min-height: 55vh;
  }
}



/* Kiwi is almost certainly responsible */
.kiwi-crash-cause {
  margin: 18px 0;
  padding: 14px 16px;

  border: 2px solid #ff3b30;
  background: rgba(120, 0, 0, .22);

  color: #ff4d43;

  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1.05rem, 3vw, 1.55rem);
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;

  text-shadow: 0 0 10px rgba(255, 59, 48, .45);
}

.kiwi-crash-cause[hidden] {
  display: none;
}


/* =========================================================
   Kiwi DO NOT PRESS Button
   ========================================================= */

.button-danger {
  border-color: #ff3b30;
  background:
    linear-gradient(180deg, #ff5147, #c51610);

  color: #fff;

  box-shadow:
    0 0 0 1px rgba(255, 59, 48, .18),
    0 8px 22px rgba(170, 20, 10, .26);

  text-shadow:
    0 1px 1px rgba(0, 0, 0, .35);
}

.button-danger:hover {
  filter: brightness(1.08);
  transform: translateY(-2px) rotate(.4deg);
}

.button-danger:active {
  transform: translateY(1px) scale(.98);
}



/* =========================================================
   Kiwi Emergency Button Warning
   ========================================================= */

.emergency-control {
  display: flex;
  align-items: center;
  gap: 14px;
}

.button-danger {
  flex-direction: column;
  gap: 2px;
  min-width: 165px;
  line-height: 1.05;
}

.emergency-only {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.do-not-press-text {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.emergency-warning {
  max-width: 190px;

  color: #ff8b83;

  font-size: .82rem;
  font-weight: 800;
  line-height: 1.25;
}

@media (max-width: 600px) {
  .emergency-control {
    width: 100%;
    align-items: center;
  }

  .emergency-warning {
    flex: 1;
    max-width: 220px;
  }
}



/* =========================================================
   Kiwi Emergency Button Confirmation
   ========================================================= */

.emergency-control-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kiwi-emergency-message {
  max-width: 430px;

  padding: 10px 12px;

  border-left: 3px solid #ff3b30;
  border-radius: 0 8px 8px 0;

  background: rgba(255, 59, 48, .08);
  color: #ffaaa5;

  font-size: .88rem;
  font-weight: 800;
  line-height: 1.35;
}

.kiwi-emergency-message[hidden] {
  display: none;
}

.button-danger.armed {
  animation: kiwiEmergencyPulse .8s ease-in-out infinite alternate;
}

.button-danger.armed .emergency-only {
  color: #ffe1df;
}

.button-danger.armed .do-not-press-text {
  font-size: 1.05rem;
}

@keyframes kiwiEmergencyPulse {
  from {
    box-shadow:
      0 0 0 1px rgba(255, 59, 48, .25),
      0 8px 22px rgba(170, 20, 10, .28);
  }

  to {
    box-shadow:
      0 0 0 4px rgba(255, 59, 48, .14),
      0 0 28px rgba(255, 59, 48, .42);
  }
}



/* =========================================================
   Kiwi Talking Cam
   Appears beside Brain Cell Status while Kiwi is speaking.
   ========================================================= */

.kiwi-talking-cam {
  position: relative;

  width: 82px;
  height: 82px;

  flex: 0 0 82px;

  overflow: hidden;

  border: 2px solid var(--orange);
  border-radius: 12px;

  background: #120d08;

  box-shadow:
    0 0 0 2px rgba(245, 138, 31, .12),
    0 0 22px rgba(245, 138, 31, .28);

  animation: kiwiTalkingCamPulse .8s ease-in-out infinite alternate;
}

.kiwi-talking-cam[hidden] {
  display: none;
}

.kiwi-talking-cam img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}

.kiwi-talking-cam span {
  position: absolute;

  left: 4px;
  right: 4px;
  bottom: 4px;

  padding: 2px 3px;

  border-radius: 4px;

  background: rgba(0, 0, 0, .76);
  color: #ffb347;

  font-size: .55rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
}

@keyframes kiwiTalkingCamPulse {
  from {
    transform: scale(1);
    box-shadow:
      0 0 0 2px rgba(245, 138, 31, .12),
      0 0 14px rgba(245, 138, 31, .20);
  }

  to {
    transform: scale(1.035);
    box-shadow:
      0 0 0 3px rgba(245, 138, 31, .18),
      0 0 28px rgba(245, 138, 31, .42);
  }
}

@media (max-width: 680px) {
  .kiwi-talking-cam {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
  }
}


/* =========================================================
   Fixed Kiwi Hero Control Sizes
   Prevent buttons from jumping when their text changes.
   ========================================================= */

.hero-actions > .button,
.hero-actions > .emergency-control-wrap {
  width: 200px;
  flex: 0 0 200px;
}

.hero-actions > .button {
  height: 62px;
  min-height: 62px;
  padding: .65rem 1rem;
}

.emergency-control-wrap {
  width: auto !important;
  flex: 1 1 420px !important;
}

.emergency-control {
  display: flex;
  align-items: center;
  gap: 14px;
}

.emergency-control .button-danger {
  width: 200px;
  height: 62px;
  min-height: 62px;
  flex: 0 0 200px;
  padding: .5rem .8rem;
}

/* Keep changing emergency text from changing button dimensions */
.button-danger .emergency-only,
.button-danger .do-not-press-text {
  width: 100%;
  text-align: center;
}

@media (max-width: 680px) {
  .hero-actions > .button {
    width: 200px;
    flex-basis: 200px;
  }

  .emergency-control-wrap {
    width: 100% !important;
    flex-basis: 100% !important;
  }

  .emergency-control .button-danger {
    width: 200px;
    flex-basis: 200px;
  }
}

/* =========================================================
   Larger Kiwi Live Cam
   ========================================================= */

.kiwi-talking-cam {
  width: 164px;
  height: 164px;
  flex: 0 0 164px;
}

.kiwi-talking-cam span {
  font-size: .72rem;
  padding: 4px 5px;
}

@media (max-width: 680px) {
  .kiwi-talking-cam {
    width: 136px;
    height: 136px;
    flex-basis: 136px;
  }
}

/* =========================================================
   Stable Kiwi Hero Layout
   Reserve camera space so controls never jump around.
   ========================================================= */

@media (min-width: 681px) {

  .hero-actions {
    display: grid;

    grid-template-columns:
      200px
      200px
      164px;

    grid-template-areas:
      "chat status cam"
      "emergency emergency cam";

    gap: 16px;
    align-items: start;

    width: max-content;
  }

  .hero-actions > .button-primary {
    grid-area: chat;
    width: 200px;
  }

  .hero-actions > .button-secondary {
    grid-area: status;
    width: 200px;
  }

  .hero-actions > .kiwi-talking-cam {
    grid-area: cam;

    width: 164px;
    height: 164px;

    flex: none;

    align-self: start;
    justify-self: start;
  }

  .hero-actions > .emergency-control-wrap {
    grid-area: emergency;

    width: 416px !important;
    max-width: 416px;
    flex: none !important;
  }

}

/* =========================================================
   FIA Character Handoff System Messages
   ========================================================= */

.message.handoff-system {
    max-width: 100%;
    width: 100%;
    margin: 4px 0;
    text-align: center;
}

.message.handoff-system .message-name {
    margin: 0 0 6px;
    text-align: center;
    color: #bd6d0b;
    font-size: 10px;
    letter-spacing: .18em;
}

.message.handoff-system .bubble {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    max-width: 100%;
    padding: 0;

    border: 0;
    background: transparent;

    color: var(--muted, #6f604f);
    font-size: 13px;
    font-style: italic;
}

.message.handoff-system .bubble::before,
.message.handoff-system .bubble::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(87,53,18,.18);
}

.message.handoff-system .bubble p {
    margin: 0;
    white-space: nowrap;
}


/* =========================================================
   Kiwi Brain Cell Emergency
   ========================================================= */

.kiwi-brain-emergency {
  position: fixed;
  inset: 0;
  z-index: 31000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background:
    radial-gradient(circle at center, #241500 0%, #080400 72%);

  font-family: "Courier New", Courier, monospace;
}

.kiwi-brain-emergency[hidden] {
  display: none;
}

.kiwi-brain-emergency-panel {
  width: min(850px, 100%);
  min-height: min(590px, 84vh);

  padding: clamp(20px, 4vw, 40px);

  border: 2px solid #ff9f1c;
  border-radius: 10px;

  background: rgba(10, 6, 0, .96);

  box-shadow:
    0 0 35px rgba(255, 120, 0, .25),
    inset 0 0 40px rgba(255, 120, 0, .05);
}

.kiwi-brain-emergency-title {
  margin-bottom: 24px;
  padding-bottom: 15px;

  border-bottom: 1px solid rgba(255, 159, 28, .35);

  color: #ff4b3e;

  font-size: clamp(1.15rem, 4vw, 1.8rem);
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;

  animation: kiwiBrainEmergencyFlash .65s infinite alternate;
}

.kiwi-brain-emergency-output {
  min-height: 330px;
  margin: 0;

  white-space: pre-wrap;
  overflow-wrap: anywhere;

  color: #ffb347;

  font: inherit;
  font-size: clamp(.85rem, 2.2vw, 1.05rem);
  line-height: 1.65;
}

.kiwi-brain-reboot-bar {
  height: 24px;
  margin-top: 18px;

  overflow: hidden;

  border: 1px solid #ff9f1c;
  border-radius: 5px;

  background: #160c00;
}

.kiwi-brain-reboot-bar[hidden] {
  display: none;
}

.kiwi-brain-reboot-progress {
  width: 0%;
  height: 100%;

  background:
    repeating-linear-gradient(
      90deg,
      #ff9f1c 0,
      #ff9f1c 18px,
      #d46b00 18px,
      #d46b00 22px
    );

  transition: width .35s ease;
}

.kiwi-brain-emergency-final {
  margin-top: 22px;
  padding: 14px;

  border: 2px solid #6dff6d;
  border-radius: 6px;

  color: #7cff7c;

  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 900;
  text-align: center;

  text-shadow: 0 0 12px rgba(124, 255, 124, .45);
}

.kiwi-brain-emergency-final[hidden] {
  display: none;
}

@keyframes kiwiBrainEmergencyFlash {
  from {
    opacity: 1;
  }

  to {
    opacity: .55;
  }
}

@media (max-width: 680px) {
  .kiwi-brain-emergency {
    padding: 10px;
  }

  .kiwi-brain-emergency-panel {
    min-height: calc(100dvh - 20px);
    padding: 18px 15px;
  }
}



/* =========================================================
   Kiwi Accidental Genius
   ========================================================= */

.kiwi-genius-alert {
  position: fixed;

  top: 18px;
  left: 50%;

  z-index: 32000;

  width: min(560px, calc(100% - 28px));

  transform: translateX(-50%);

  padding: 14px 18px;

  border: 2px solid #7cff7c;
  border-radius: 10px;

  background: rgba(8, 28, 8, .96);
  color: #baffba;

  text-align: center;

  box-shadow:
    0 0 30px rgba(124, 255, 124, .28);

  animation:
    kiwiGeniusPop .3s ease-out,
    kiwiGeniusGlow .8s ease-in-out infinite alternate;
}

.kiwi-genius-alert[hidden] {
  display: none;
}

.kiwi-genius-alert strong,
.kiwi-genius-alert span {
  display: block;
}

.kiwi-genius-alert strong {
  font-size: clamp(.95rem, 3vw, 1.25rem);
  letter-spacing: .06em;
}

.kiwi-genius-alert span {
  margin-top: 6px;

  color: #fff4a8;

  font-size: clamp(.82rem, 2.5vw, 1rem);
  font-weight: 900;
}

@keyframes kiwiGeniusPop {
  from {
    opacity: 0;
    transform: translate(-50%, -18px) scale(.95);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes kiwiGeniusGlow {
  from {
    box-shadow:
      0 0 15px rgba(124, 255, 124, .18);
  }

  to {
    box-shadow:
      0 0 34px rgba(124, 255, 124, .42);
  }
}



/* =========================================================
   Kiwi Hidden Event Test Panel
   Only created by JS when ?test=events is present.
   ========================================================= */

.kiwi-event-test-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40000;

  padding: 11px 14px;

  border: 2px solid #f39a28;
  border-radius: 9px;

  background: #241500;
  color: #ffd38a;

  font-family: "Courier New", Courier, monospace;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .05em;

  box-shadow: 0 6px 24px rgba(0,0,0,.35);

  cursor: pointer;
}

.kiwi-event-test-panel {
  position: fixed;
  right: 14px;
  bottom: 64px;
  z-index: 40001;

  width: min(300px, calc(100vw - 28px));

  padding: 14px;

  border: 2px solid #f39a28;
  border-radius: 10px;

  background: rgba(25, 14, 2, .98);
  color: #fff4d6;

  box-shadow: 0 8px 30px rgba(0,0,0,.45);

  font-family: "Courier New", Courier, monospace;
}

.kiwi-event-test-panel[hidden] {
  display: none;
}

.kiwi-event-test-panel strong,
.kiwi-event-test-panel span {
  display: block;
}

.kiwi-event-test-panel strong {
  color: #ffd38a;
  font-size: .95rem;
}

.kiwi-event-test-panel span {
  margin: 3px 0 12px;
  color: #c7ad82;
  font-size: .72rem;
}

.kiwi-event-test-panel button {
  display: block;
  width: 100%;

  margin-top: 8px;
  padding: 10px 11px;

  border: 1px solid rgba(243,154,40,.55);
  border-radius: 7px;

  background: #352006;
  color: #fff5dd;

  font: inherit;
  font-size: .78rem;
  font-weight: 800;

  text-align: left;
  cursor: pointer;
}

.kiwi-event-test-panel button:hover {
  background: #4a2c08;
}

@media (max-width: 680px) {
  .kiwi-event-test-toggle {
    right: 10px;
    bottom: 10px;
  }

  .kiwi-event-test-panel {
    right: 10px;
    bottom: 60px;
    width: calc(100vw - 20px);
  }

  .kiwi-event-test-panel button {
    min-height: 46px;
    font-size: .85rem;
  }
}


/* =========================================================
   Kiwi Chat Horizontal Overflow Fix
   Keep wide Markdown/code from widening the entire chat pane.
   ========================================================= */

.chat-messages {
  overflow-x: hidden;
  min-width: 0;
}

.chat-messages .message,
.chat-messages .bubble,
.chat-messages .message-content,
.chat-messages .markdown-content {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.chat-messages .markdown-content pre {
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

.chat-messages .markdown-content code {
  max-width: 100%;
}



/* =========================================================
   Easter Egg: Poke Kiwi / Nibbler Administrative Shutdown
   ========================================================= */

#kiwi-poke-image {
  cursor: default;
  user-select: none;
  -webkit-user-drag: none;
}

#kiwi-poke-image.kiwi-being-poked {
  animation: kiwiPokeShake .18s linear;
}

@keyframes kiwiPokeShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-4px) rotate(-.4deg); }
  50%  { transform: translateX(4px) rotate(.4deg); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.nibbler-kiwi-shutdown {
  position: fixed;
  inset: 0;
  z-index: 60000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 22px;

  background:
    radial-gradient(circle at center, #170606 0%, #030303 72%);

  color: #ffdddd;

  font-family: "Courier New", Courier, monospace;
}

.nibbler-kiwi-shutdown[hidden] {
  display: none;
}

.nibbler-shutdown-terminal {
  width: min(850px, 100%);
  min-height: min(520px, 82vh);

  padding: clamp(22px, 4vw, 42px);

  border: 1px solid rgba(255,70,70,.55);
  border-radius: 8px;

  background: rgba(10,0,0,.97);

  box-shadow:
    0 0 40px rgba(255,0,0,.14),
    inset 0 0 35px rgba(255,0,0,.035);
}

.nibbler-shutdown-title {
  margin-bottom: 25px;
  padding-bottom: 14px;

  border-bottom: 1px solid rgba(255,70,70,.35);

  color: #ff5757;

  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 900;
  letter-spacing: .09em;
  text-align: center;
}

.nibbler-shutdown-output {
  min-height: 330px;
  margin: 0;

  white-space: pre-wrap;
  overflow-wrap: anywhere;

  color: #ff8b8b;

  font: inherit;
  font-size: clamp(.9rem, 2.2vw, 1.05rem);
  line-height: 1.7;
}

.nibbler-shutdown-final {
  margin-top: 18px;
  padding: 14px;

  border: 1px solid #7cff7c;
  border-radius: 6px;

  color: #7cff7c;

  font-weight: 900;
  text-align: center;
}

.nibbler-shutdown-final[hidden] {
  display: none;
}

@media (max-width: 680px) {
  .nibbler-kiwi-shutdown {
    padding: 10px;
  }

  .nibbler-shutdown-terminal {
    min-height: calc(100dvh - 20px);
    padding: 18px 15px;
  }
}


/* =========================================================
   Kiwi Speech Input v1
   ========================================================= */

.voice-autosend-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    min-height: 50px;
    padding: 0 8px;

    font-size: .78rem;
    white-space: nowrap;
    cursor: pointer;
}

.voice-autosend-control input {
    margin: 0;
}

.kiwi-mic-button {
    flex: 0 0 50px;

    width: 50px;
    min-width: 50px;
    min-height: 50px;

    padding: 0;

    border: 1px solid rgba(87,53,18,.20);
    border-radius: 12px;

    background: rgba(255,180,68,.10);
    color: inherit;

    font: inherit;
    font-size: 1.15rem;

    cursor: pointer;
}

.kiwi-mic-button:hover {
    border-color: #f39a28;
    background: rgba(255,180,68,.18);
}

.kiwi-mic-button:disabled {
    cursor: wait;
    opacity: .65;
}

.kiwi-mic-button.is-recording {
    outline: 2px solid #f39a28;
    outline-offset: 2px;
}


/* Kiwi's original <=680px rule changes the form to a column.
   Keep the voice-enabled form on one row instead. */

@media (max-width: 680px) {

    body.kiwi-mobile-chat-open .chat-form {
        flex-direction: row;
        align-items: stretch;
    }

    body.kiwi-mobile-chat-open .chat-form textarea {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.kiwi-mobile-chat-open
    .voice-autosend-control {
        flex: 0 0 auto;
        min-height: 48px;
        padding: 0 3px;
        font-size: .68rem;
    }

    body.kiwi-mobile-chat-open
    .kiwi-mic-button {
        flex: 0 0 48px;
        width: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    body.kiwi-mobile-chat-open
    .send-button {
        flex: 0 0 auto;
    }
}


/* =========================================================
   Kiwi Speech Mobile Layout Fix v1
   ========================================================= */

@media (max-width: 680px) {

    .chat-form {
        flex-direction: row;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .chat-form textarea {
        flex: 1 1 auto;
        min-width: 0;
    }

    .voice-autosend-control {
        flex: 0 0 auto;
        min-width: 42px;
        min-height: 48px;
        padding: 0 2px;
        font-size: .66rem;
    }

    .kiwi-mic-button {
        flex: 0 0 48px;
        width: 48px;
        min-width: 48px;
        min-height: 48px;
        padding: 0;
    }

    .send-button {
        flex: 0 0 auto;
        min-width: 68px;
        min-height: 48px;
        padding: 0 10px;
    }

    body.kiwi-mobile-chat-open .chat-form {
        flex-direction: row;
        flex-wrap: nowrap;
    }
}


/* =========================================================
   Kiwi Mobile Chat Layout v2
   - Composer matches Nibbler
   - Camera/title/status sit above controls cleanly
   - Kiwi status text moves below top buttons
   ========================================================= */

@media (max-width: 680px) {

  /* -------------------------------------------------------
     TOP CHAT HEADER
     ------------------------------------------------------- */

  body.kiwi-mobile-chat-open .chat-header {
    display: grid !important;
    grid-template-columns: 62px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
    padding: 10px 16px 12px !important;
  }

  /* Kiwi camera stays at upper left */
  body.kiwi-mobile-chat-open .chat-header > .kiwi-cam {
    grid-column: 1;
    grid-row: 1;
    width: 62px !important;
    height: 62px !important;
    margin: 0 !important;
    align-self: center;
  }

  body.kiwi-mobile-chat-open .chat-header > .kiwi-cam img {
    width: 62px !important;
    height: 62px !important;
    object-fit: cover;
  }

  /*
     Voice / New chat / Exit take the entire row
     to the right of the camera.
  */
  body.kiwi-mobile-chat-open .chat-header-actions {
    grid-column: 2;
    grid-row: 1;
    display: grid !important;
    grid-template-columns: 1.15fr 1.35fr .8fr;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    align-items: stretch;
  }

  body.kiwi-mobile-chat-open .chat-header-actions .icon-button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 54px;
    margin: 0 !important;
    padding: 7px 8px !important;
    white-space: nowrap;
    text-align: center;
  }

  /*
     Kiwi + brain-cell/camera status moves BELOW
     Voice / New chat / Exit.
  */
  body.kiwi-mobile-chat-open .chat-header > div:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    padding: 0 4px 2px;
  }

  body.kiwi-mobile-chat-open .chat-header > div:nth-child(2) > strong {
    display: inline-block;
    margin-right: 8px;
  }

  body.kiwi-mobile-chat-open .chat-header > div:nth-child(2) > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }


  /* -------------------------------------------------------
     BOTTOM COMPOSER — MATCH NIBBLER EXACTLY
     Input | Auto | Mic | Send
     ------------------------------------------------------- */

  body.kiwi-mobile-chat-open .chat-form {
    flex: 0 0 auto;
    display: grid !important;

    grid-template-columns:
      minmax(0, 1fr)
      auto
      42px
      auto;

    align-items: stretch;
    gap: 5px !important;

    width: 100%;
    padding: 7px 8px !important;
    margin: 0 !important;

    background: #090909;
  }

  body.kiwi-mobile-chat-open #message-input {
    grid-column: 1;

    min-width: 0;
    width: 100%;

    min-height: 44px !important;
    height: 44px !important;
    max-height: 88px !important;

    padding: 9px 10px !important;
    margin: 0 !important;

    font-size: .78rem !important;
    line-height: 1.3;

    resize: none;
  }

  body.kiwi-mobile-chat-open .voice-autosend-control {
    grid-column: 2;

    width: auto !important;
    min-width: 0 !important;

    min-height: 44px !important;
    height: 44px !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    padding: 0 3px !important;
    margin: 0 !important;
    gap: 3px !important;

    font-size: .62rem !important;
    white-space: nowrap;
  }

  body.kiwi-mobile-chat-open .voice-autosend-control input {
    width: 15px !important;
    height: 15px !important;
    margin: 0 !important;
  }

  body.kiwi-mobile-chat-open #kiwi-mic-button {
    grid-column: 3;

    width: 42px !important;
    min-width: 42px !important;

    height: 44px !important;
    min-height: 44px !important;

    padding: 0 !important;
    margin: 0 !important;

    font-size: 1rem !important;
  }

  body.kiwi-mobile-chat-open .send-button {
    grid-column: 4;

    width: auto !important;
    min-width: 58px !important;

    height: 44px !important;
    min-height: 44px !important;

    padding: 0 9px !important;
    margin: 0 !important;

    font-size: .72rem !important;
  }


  /*
     Keep the "Brain cell ready" status underneath,
     like Nibbler's Memory restored line.
  */
  body.kiwi-mobile-chat-open .chat-footer {
    flex: 0 0 auto;
    min-height: 0 !important;
    margin: 0 !important;

    padding: 3px 9px 4px !important;

    font-size: .58rem !important;
    line-height: 1.1;
  }
}


/*
   Extra-narrow phones:
   shave a little width without breaking the row.
*/
@media (max-width: 390px) {

  body.kiwi-mobile-chat-open .chat-form {
    grid-template-columns:
      minmax(0, 1fr)
      auto
      52px
      78px;
    gap: 6px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body.kiwi-mobile-chat-open .voice-autosend-control {
    min-width: 58px;
    font-size: .9rem;
  }

  body.kiwi-mobile-chat-open #kiwi-mic-button {
    width: 52px !important;
    min-width: 52px !important;
  }

  body.kiwi-mobile-chat-open .send-button {
    width: 78px !important;
    min-width: 78px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}


/* =========================================================
   Kiwi Android App Chat Mode v1
   Allow the dedicated chat UI at tablet widths without
   changing the normal website's <=680px behavior.
   ========================================================= */

body.kiwi-android-app.kiwi-mobile-chat-open {
  overflow: hidden;
}

body.kiwi-android-app.kiwi-mobile-chat-open .chat-card {
  position: fixed;
  inset: 0;
  z-index: 10000;

  width: 100%;
  height: 100vh;
  height: 100dvh;

  display: flex;
  flex-direction: column;

  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--panel, #fffaf0);
}

body.kiwi-android-app.kiwi-mobile-chat-open .chat-header {
  flex: 0 0 auto;
}

body.kiwi-android-app.kiwi-mobile-chat-open .exit-chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.kiwi-android-app.kiwi-mobile-chat-open .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.kiwi-android-app.kiwi-mobile-chat-open .suggestions {
  flex: 0 0 auto;
}

body.kiwi-android-app.kiwi-mobile-chat-open .chat-form {
  flex: 0 0 auto;
}

body.kiwi-android-app.kiwi-mobile-chat-open .chat-footer {
  flex: 0 0 auto;
}


/* =========================================================
   Kiwi Android App — Opaque Full-Screen Chat
   Prevent the underlying website from bleeding through.
   ========================================================= */

body.kiwi-android-app.kiwi-mobile-chat-open .chat-card,
body.kiwi-android-app.kiwi-mobile-chat-open .chat-messages {
  background: #1c170f !important;
}

/* =========================================================
   Kiwi Android App — Full-Screen Isolation
   Do not render the normal Contact-page content behind chat.
   ========================================================= */

body.kiwi-android-app.kiwi-mobile-chat-open #contact > *:not(.chat-card) {
  display: none !important;
}
