@import url("https://fonts.googleapis.com/css2?family=Sahitya:wght@400;700&display=swap");

/* ========== Spinner Styles ========== */
.spinner {
    border: 6px solid #caffdc;
    border-top: 6px solid #20663a;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  .spinner-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #ffffffbf;
    backdrop-filter: blur(1.3px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
  }

  /* ========== Global Styles ========== */
  html, body {
    margin: 0; padding: 0;
    box-sizing: border-box;
  }

  *, *::before, *::after {
    box-sizing: inherit;
  }

  body {
    font-family: Georgia, sans-serif;
    font-size: 16px;
    text-align: left;
    line-height: 1.5;
    background-color: #fafff0;
    color: #000;
  }

  .container {
    max-width: 90%;
    margin: 0 auto;
    padding: 8px;
  }

  /* ========== Header and Footer ========== */
  header {
    background-color: #20663a;
    color: white;
    text-align: center;
    padding: 4px 4px;
    margin-bottom: 4px;
  }

  header h1 {
    font-size: 1.5em;
    margin-bottom: 6px;
  }

  header h2 {
    font-size: 1.25em;
    margin-bottom: 3px;
  }

  header h3 {
    font-size: 1.125em;
    margin-bottom: 3px;
  }

  footer {
    text-align: center;
    padding: 8px;
    background-color: #caffdc;
    margin-top: 12px;
    font-size: 0.8em;
  }

  /* ========== Buttons ========== */
  button {
    font-family: inherit;
    border: none;
    border-radius: 6px;
    padding: 6px 6px;
    font-size: 0.9em;
    cursor: pointer;
    background-color: #286638;
    transition: background-color 0.3s ease, transform 0.2s ease;
  }
  button {
    color: white;
  }
  button:hover {
    background-color: #206830;
    color: #fefea0;
    transform: scale(1.05);
  }

  .button-danger {
    background-color: #7a1f1f;
    color: #fff;
  }
  .button-danger:hover{
    background-color: #5f1717;
    color: #fff;
    transform: scale(1.05);
  }
  /* ========== Links ========== */
  a {
    color: #007bff;
    text-decoration: none;
  }
  a:hover {
    text-decoration: underline;
  }

  /* ========== Lists ========== */
  ul {
    list-style: none;
    padding: 2px;
    margin: auto;
  }
  ul li {
    color:#000;
    margin: auto;
  }

  /* ========== Koan Styling ========== */
  .koan-preface {
    border-top: 1px solid #ffd;
    white-space: pre-line; /* or pre-wrap; */
    font-size: 0.9em;
    margin-bottom: 0;
    color: #f0ffd0;
    text-align: left;
  }

  .koan-title {
    font-weight: bold;
    margin-bottom: 1.1em;
    text-align: left;
  }

  .koan-body,
  .koan-comment {
    white-space: pre-wrap;
    margin-bottom: 1em;
    text-align: left;
  }
  .koan-verse {
    font-style: italic;
    white-space: pre-wrap;
    text-align: left;
}

  .koan-session-status {
    margin-top: 0.85em;
    padding: 0.65em 0.8em;
    border-radius: 6px;
    border: 1px solid #a6b69c;
    background: #f3f8ec;
    color: #1f3422;
    max-width: 48rem;
  }

  .koan-session-status[data-tone="pending"] {
    border-color: #c7a24f;
    background: #fff7df;
    color: #674b07;
  }

  .koan-session-status[data-tone="success"] {
    border-color: #7cab8a;
    background: #edf8ef;
    color: #1f4b2b;
  }

  .koan-session-status[data-tone="error"] {
    border-color: #c98989;
    background: #fff0f0;
    color: #7a1f1f;
  }

  /* Container that spans full height if you want a "full page" chat */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 80vh; /* Or 100vh for full screen */
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

/* Header area stays fixed in the flex flow while messages scroll. */
.chat-header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding: 0.5em;
  border-bottom: 2px solid #ccc;
}

.chat-preface-panel {
  max-height: min(28vh, 18rem);
  overflow-y: auto;
  padding: 0.45em 0.65em;
  border: 1px solid #5d8d6a;
  border-radius: 6px;
  background: linear-gradient(180deg, #29543a 0%, #1d3f2b 100%);
  box-shadow: inset 0 0 0 1px #173220;
}

.chat-preface-panel[hidden] {
  display: none;
}

/* Main messages area, flexible in height, with scroll. */
.chat-messages {
  flex: 1 1 auto;        /* Let this grow/shrink to fill space */
  overflow-y: auto;      /* Make it scrollable */
  padding: 0.5em;
}

/* Input area pinned at the bottom. */
.chat-input-area {
  flex: 0 0 auto;
  padding: 0.5em;
  border-top: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5em;
}

/* Expand textarea to fill the horizontal space,
   but still allow row resizing if needed. */
.chat-input-area textarea {
  width: 100%;
  resize: vertical; /* Let user drag the corner to make it bigger if desired */
  font-size: 1em;
  font-family: Georgia, sans-serif;
  padding: 0.5em;
  box-sizing: border-box;
}

/* Buttons area on the right. */
.chat-buttons {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5em;
}

.chat-help {
  color: #333;
}

.admin-actions {
  margin: 0.75em 0 1em;
}

.button-link {
  display: inline-block;
  padding: 0.4em 0.8em;
  border-radius: 6px;
  background-color: #286638;
  color: #fff;
}

.button-link:hover {
  background-color: #206830;
  color: #fefea0;
  text-decoration: none;
}

.session-settings-panel {
  border: 1px solid #9dc0a3;
  border-radius: 8px;
  padding: 0.75em;
  background: linear-gradient(180deg, #f8fff2 0%, #eef8e7 100%);
  box-shadow: inset 0 0 0 1px #d8e8d0;
}

.session-settings-panel.is-locked {
  background: linear-gradient(180deg, #eef3ea 0%, #e4ebe0 100%);
}

.session-settings-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75em;
  flex-wrap: wrap;
}

.session-settings-topline h3 {
  margin: 0 0 0.2em;
}

.session-settings-status {
  font-size: 0.92em;
  color: #25492c;
}

.session-settings-status[data-tone="locked"] {
  color: #5d4421;
}

.session-settings-summary {
  max-width: 32rem;
  padding: 0.45em 0.65em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #cddfc5;
  font-size: 0.92em;
  color: #203624;
}

.session-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65em;
  margin-top: 0.75em;
}

.session-field {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  font-size: 0.94em;
  color: #1c361f;
}

.session-field span {
  font-weight: bold;
}

.session-field input,
.session-field select {
  width: 100%;
  min-height: 2.25em;
  padding: 0.4em 0.5em;
  border: 1px solid #95b49a;
  border-radius: 6px;
  background: #fff;
  color: #142918;
  font-family: inherit;
}

.session-settings-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.5em;
  margin-top: 0.75em;
}

.session-toggle {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 0.6em;
  border: 1px solid #c7dcc9;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  color: #1d341f;
  font-size: 0.93em;
}

.session-toggle input {
  margin: 0;
}

.session-toggle.is-disabled {
  opacity: 0.62;
}

  /* ========== Chat Message Bubbles ========== */
  .user-message {
    background-color: #afffef;
  }

  .zenbot-message {
    background-color: #afffbb;
  }

  .user-message,
  .zenbot-message {
    font-family: Georgia, sans-serif;
    margin: 0.25em 0;
    padding: 0.25em;
    border-radius: 5px;
    /* For preserving line breaks inside messages if they have \n */
    white-space: pre-wrap; /*  or 'pre-line', 'white-space-collapse'; */
    line-height: 1.25;
  }

  .zenbot-thinking {
    margin: 0.25em 0;
    padding: 0.55em 0.75em;
    border-left: 3px solid #20663a;
    background: linear-gradient(90deg, #f3ffe9 0%, #fbfff6 100%);
    color: #2a422a;
    display: inline-flex;
    align-items: center;
    gap: 0.75em;
    border-radius: 0 8px 8px 0;
    box-shadow: inset 0 0 0 1px #dceccc;
  }

  .zenbot-thinking-label {
    font-style: italic;
    letter-spacing: 0;
  }

  .zenbot-thinking-breath {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
  }

  .zenbot-thinking-breath span {
    width: 0.45em;
    height: 0.45em;
    border-radius: 999px;
    background-color: #20663a;
    opacity: 0.25;
    animation: zenbot-breath 1.2s ease-in-out infinite;
  }

  .zenbot-thinking-breath span:nth-child(2) {
    animation-delay: 0.18s;
  }

  .zenbot-thinking-breath span:nth-child(3) {
    animation-delay: 0.36s;
  }

  @keyframes zenbot-breath {
    0%, 100% {
      opacity: 0.25;
      transform: translateY(0) scale(0.92);
    }
    40% {
      opacity: 0.95;
      transform: translateY(-1px) scale(1.08);
    }
  }

  /* ========== Media Queries for Mobile ========== */
  @media (max-width: 600px) {
    body {
      font-size: 14px;
    }
    header h1 {
      font-size: 1.25em;
    }
    header h2 {
      font-size: 1.1em;
    }
    button {
      font-size: 1em;
      padding: 4px 6px;
    }
    .chat-container {
      height: 85vh;
    }
    .chat-preface-panel {
      max-height: min(24vh, 14rem);
    }
    .session-settings-topline {
      flex-direction: column;
    }
    .session-settings-grid,
    .session-settings-toggles {
      grid-template-columns: 1fr;
    }
  }

/* ========== Public UI Rebuild ========== */
:root {
  --z-paper: #f6efe1;
  --z-paper-deep: #eadcc3;
  --z-ink: #201d18;
  --z-muted: #6f6658;
  --z-green: #244f35;
  --z-green-dark: #173725;
  --z-moss: #71875d;
  --z-gold: #b78a3a;
  --z-persimmon: #b65b32;
  --z-lacquer: #7d2424;
  --z-slate: #314452;
  --z-line: #cdbb9e;
  --z-shadow: rgba(32, 29, 24, 0.16);
  --z-font: "Sahitya", "Noto Serif Devanagari", "Nirmala UI", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --z-fs-micro: 11px;
  --z-fs-xs: 12px;
  --z-fs-sm: 13px;
  --z-fs-base: 14px;
  --z-fs-md: 15px;
  --z-fs-lg: 17px;
  --z-fs-xl: 20px;
  --z-fs-2xl: 23px;
}

body {
  font-family: var(--z-font);
  background:
    linear-gradient(90deg, rgba(36, 79, 53, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #fff9ed 0%, var(--z-paper) 54%, #e7dac2 100%);
  background-size: 26px 26px, auto;
  color: var(--z-ink);
}

body > .container {
  max-width: none;
  width: 100%;
  padding: 0;
}

body > .container > section:not([class]) {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

footer {
  background: #e6d6b8;
  border-top: 1px solid var(--z-line);
  color: var(--z-ink);
}

footer ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 10px;
}

footer a,
.entrance-hall a,
.zendo-workspace a {
  color: #24557a;
}

.legacy-splash-page {
  max-width: 90%;
  padding: 8px;
}

.entrance-hall {
  min-height: calc(100vh - 96px);
}

.entrance-hero {
  position: relative;
  min-height: min(620px, 74vh);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--z-line);
}

.entrance-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.entrance-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 26, 20, 0.72) 0%, rgba(18, 26, 20, 0.42) 46%, rgba(18, 26, 20, 0.2) 100%),
    linear-gradient(180deg, transparent 50%, rgba(19, 15, 12, 0.72) 100%);
}

.entrance-hero-content {
  position: relative;
  z-index: 2;
  width: min(560px, calc(100% - 28px));
  margin: 0 0 6vh clamp(14px, 6vw, 96px);
  color: #fff8e8;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.42);
}

.entrance-flourish {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.72;
}

.entrance-bamboo {
  right: clamp(18px, 4vw, 70px);
  bottom: 4vh;
  width: 90px;
  height: 205px;
  background:
    linear-gradient(90deg, transparent 13%, rgba(176, 203, 136, 0.72) 14% 18%, transparent 19%),
    linear-gradient(90deg, transparent 47%, rgba(151, 181, 113, 0.78) 48% 53%, transparent 54%),
    linear-gradient(90deg, transparent 78%, rgba(198, 218, 153, 0.68) 79% 83%, transparent 84%);
}

.entrance-bamboo::before,
.entrance-bamboo::after {
  content: "";
  position: absolute;
  border-radius: 999px 0;
  background: rgba(178, 205, 137, 0.58);
  transform-origin: left center;
}

.entrance-bamboo::before {
  width: 58px;
  height: 15px;
  right: 22px;
  top: 54px;
  transform: rotate(-24deg);
  box-shadow: -9px 41px 0 rgba(198, 218, 153, 0.44);
}

.entrance-bamboo::after {
  width: 52px;
  height: 14px;
  left: 36px;
  top: 98px;
  transform: rotate(30deg) scaleX(-1);
  box-shadow: 14px 44px 0 rgba(151, 181, 113, 0.42);
}

.entrance-lotus {
  left: clamp(24px, 5vw, 90px);
  bottom: 5vh;
  width: 128px;
  height: 54px;
}

.entrance-lotus::before,
.entrance-lotus::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  margin: auto;
  border-radius: 70% 70% 18% 18%;
  background:
    radial-gradient(ellipse at center bottom, rgba(255, 248, 232, 0.26), transparent 52%),
    linear-gradient(120deg, rgba(246, 210, 178, 0.56), rgba(187, 92, 68, 0.42));
  border: 1px solid rgba(255, 248, 232, 0.2);
}

.entrance-lotus::before {
  width: 42px;
  height: 50px;
  transform: translateX(0) rotate(0deg);
  box-shadow:
    -36px 8px 0 -3px rgba(205, 126, 106, 0.36),
    36px 8px 0 -3px rgba(205, 126, 106, 0.36);
}

.entrance-lotus::after {
  width: 39px;
  height: 44px;
  transform: translateX(-21px) rotate(-24deg);
  box-shadow: 44px 17px 0 -2px rgba(246, 210, 178, 0.42);
}

.entrance-bowl {
  right: clamp(126px, 13vw, 240px);
  bottom: 7vh;
  width: 99px;
  height: 38px;
  border: 2px solid rgba(232, 204, 151, 0.48);
  border-top-color: rgba(255, 248, 232, 0.62);
  border-radius: 12px 12px 60px 60px;
  background: linear-gradient(180deg, rgba(48, 68, 82, 0.4), rgba(21, 34, 29, 0.72));
}

.entrance-bowl::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: -7px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 232, 0.36);
  background: rgba(255, 248, 232, 0.1);
}

.entrance-kicker,
.section-heading span,
.panel-heading span {
  display: block;
  color: var(--z-gold);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.entrance-hero h1 {
  margin: 6px 0 9px;
  font-size: clamp(2rem, 4.3vw, 3.65rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.entrance-hero p {
  max-width: 540px;
  font-size: 1rem;
  line-height: 1.45;
}

.entrance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.entrance-button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 6px;
  border: 1px solid rgba(255, 248, 232, 0.72);
  background: rgba(246, 239, 225, 0.9);
  color: var(--z-ink);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.entrance-button.primary,
.button-link {
  background: var(--z-green);
  color: #fff8e8;
  border-color: var(--z-green);
}

.entrance-button:hover,
.button-link:hover {
  color: var(--z-ink);
  background: #fff8e8;
  text-decoration: none;
}

.entrance-band {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 18px;
}

.section-heading h2,
.panel-heading h2 {
  margin: 4px 0 0;
  color: var(--z-ink);
}

.entrance-link-grid,
.entrance-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.entrance-link-grid a,
.entrance-guide-grid > div {
  border: 1px solid var(--z-line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.78);
  padding: 12px;
  box-shadow: 0 7px 18px rgba(32, 29, 24, 0.08);
}

.entrance-link-grid a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
}

.entrance-link-grid strong,
.entrance-guide-grid h3 {
  color: var(--z-green-dark);
}

.entrance-link-grid span,
.entrance-guide-grid p {
  color: var(--z-muted);
}

.intro-tour {
  min-height: calc(100vh - 96px);
  color: var(--z-ink);
}

.intro-tour-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(18px, 3.5vw, 48px);
  overflow: hidden;
  border-bottom: 1px solid var(--z-line);
  background:
    radial-gradient(circle at center, rgba(36, 79, 53, 0.24), transparent 58%),
    #080b0d;
}

.intro-tour-tree {
  position: relative;
  grid-area: 1 / 1;
  display: block;
  width: min(100%, 1180px, 94vh);
  height: auto;
  min-width: 0;
  justify-self: center;
  object-fit: contain;
  object-position: center center;
}

.intro-tour-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 11, 13, 0.78) 0%, rgba(8, 11, 13, 0.3) 38%, rgba(8, 11, 13, 0.12) 100%),
    linear-gradient(180deg, rgba(8, 11, 13, 0.04) 0%, rgba(8, 11, 13, 0.52) 100%);
  pointer-events: none;
}

.intro-tour-hero-text {
  position: relative;
  grid-area: 1 / 1;
  z-index: 1;
  width: min(620px, calc(100vw - 36px));
  min-width: 0;
  justify-self: start;
  align-self: end;
  margin: 0 0 clamp(10px, 3vh, 32px) clamp(0px, 4vw, 70px);
  color: #fff8e8;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.42);
}

.intro-tour-hero h1 {
  margin: 6px 0 9px;
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-tour-hero p {
  max-width: 540px;
  margin: 0;
  font-size: var(--z-fs-md);
  line-height: 1.45;
}

.intro-tour-body {
  width: min(880px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 30px 0 36px;
}

.intro-tour-stop,
.intro-tour-closing {
  padding: 22px 0;
  border-bottom: 1px solid rgba(205, 187, 158, 0.86);
}

.intro-tour-stop h2,
.intro-tour-closing h2 {
  margin: 3px 0 11px;
  color: var(--z-green-dark);
  font-size: var(--z-fs-2xl);
  line-height: 1.08;
}

.tour-question {
  margin: 0;
  color: var(--z-gold);
  font-size: var(--z-fs-xs);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-tour p,
.intro-tour li {
  font-size: var(--z-fs-md);
  line-height: 1.58;
}

.intro-tour ul {
  list-style: disc;
  padding-left: 22px;
  margin: 10px 0 12px;
}

.intro-tour li {
  margin: 5px 0;
}

.intro-tour blockquote {
  margin: 14px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--z-gold);
  background: rgba(255, 250, 241, 0.64);
  color: #342d24;
}

.intro-tour blockquote p {
  margin: 4px 0;
}

.intro-tour-koan {
  border-bottom-color: var(--z-gold);
}

.intro-tour-closing {
  border-bottom: 0;
}

.intro-tour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.zendo-workspace {
  min-height: calc(100vh - 106px);
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(520px, 1.92fr) minmax(280px, 0.78fr);
  align-items: stretch;
  gap: 9px;
  padding: 9px 14px;
  font-size: 0.84rem;
  background:
    linear-gradient(180deg, rgba(255, 249, 238, 0.86), rgba(232, 220, 196, 0.92)),
    radial-gradient(circle at top right, rgba(183, 138, 58, 0.22), transparent 36%);
}

.gg-page {
  width: min(1020px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.gg-header {
  margin: 0 0 13px;
  padding: 13px 16px;
  background: var(--z-green);
  border-bottom: 3px solid var(--z-gold);
}

.gg-header h1,
.gg-header h2 {
  margin: 0;
  color: #fff8e8;
}

.gg-panel {
  padding: 14px 16px;
  border: 1px solid var(--z-line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.88);
}

.gg-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  padding: 0;
  margin: 10px 0 0;
}

.gg-case-grid li {
  min-width: 0;
}

.gg-case-page .koan-title {
  font-size: 1.16rem;
}

.gg-case-page .koan-body,
.gg-case-page .koan-comment,
.gg-case-page .koan-verse {
  max-width: 76rem;
  font-size: 0.98rem;
  line-height: 1.62;
}

.zendo-room-panel,
.zendo-chat-panel {
  border: 1px solid var(--z-line);
  border-radius: 6px;
  background: rgba(255, 250, 241, 0.86);
  box-shadow: 0 9px 22px rgba(32, 29, 24, 0.1);
}

.zendo-room-panel {
  position: relative;
  padding: 10px;
  overflow: hidden;
}

.zendo-reference-panel {
  display: flex;
  flex-direction: column;
  font-size: 0.92rem;
}

.zendo-setup-panel {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.zendo-room-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(49, 68, 82, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(183, 138, 58, 0.08), transparent 42%);
  background-size: 14px 14px, auto;
}

.zendo-room-panel > * {
  position: relative;
}

.room-object {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 50%;
  border: 1px solid rgba(183, 138, 58, 0.58);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 248, 232, 0.88) 0 22%, transparent 23%),
    radial-gradient(circle, rgba(183, 138, 58, 0.38), rgba(125, 36, 36, 0.16));
}

.scroll-object {
  border-radius: 8px;
  width: 63px;
  height: 21px;
  background:
    linear-gradient(90deg, var(--z-gold), #f1d69c 24%, #f6ecd5 50%, #f1d69c 76%, var(--z-gold));
}

.zendo-teacher-seat {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: stretch;
  margin: 0 0 9px;
  overflow: hidden;
  border: 1px solid rgba(183, 138, 58, 0.6);
  border-radius: 8px;
  background: #181d18;
  box-shadow: 0 8px 18px rgba(32, 29, 24, 0.13);
}

.zendo-teacher-seat img {
  display: block;
  width: 74px;
  height: 74px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 40%;
}

.zendo-teacher-seat figcaption {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 7px 9px;
  background: linear-gradient(120deg, rgba(23, 55, 37, 0.94), rgba(49, 68, 82, 0.94));
  color: #fff8e8;
}

.zendo-teacher-seat figcaption span {
  color: #f4d28f;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.zendo-teacher-seat figcaption strong {
  font-size: 0.96rem;
  line-height: 1;
}

.zendo-small-links {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.zendo-small-links a {
  padding: 5px 0;
  border-top: 1px solid rgba(205, 187, 158, 0.72);
}

.empty-koan-note,
.zendo-context-form li,
.chat-help,
.session-settings-status,
.session-settings-summary {
  color: var(--z-muted);
}

.zendo-chat-panel {
  min-height: 69vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.94), rgba(246, 239, 225, 0.96)),
    linear-gradient(90deg, rgba(36, 79, 53, 0.04), transparent 22%, rgba(183, 138, 58, 0.06));
}

.zendo-chat-header {
  margin: 0;
  padding: 9px 12px 8px;
  background: linear-gradient(135deg, var(--z-green-dark), var(--z-slate));
  border-bottom: 3px solid var(--z-gold);
  color: #fff8e8;
  text-align: left;
}

.zendo-chat-header h1 {
  margin: 2px 0 3px;
  font-size: clamp(1.12rem, 1.4vw, 1.55rem);
  line-height: 1.08;
}

.zendo-chat-header p {
  margin: 0;
  max-width: 54rem;
  color: #f3e7cf;
  font-size: 0.86rem;
  line-height: 1.28;
}

.chat-streaming-note {
  color: #f4d28f;
  font-size: 0.84rem;
  line-height: 1.2;
}

.chat-preface-panel {
  max-height: min(32vh, 22rem);
  margin-top: 9px;
  color: #f9f2df;
  background: linear-gradient(180deg, #2a543a 0%, #193524 100%);
  border-color: rgba(183, 138, 58, 0.72);
}

.chat-messages {
  flex: 1 1 0;
  min-height: 330px;
  padding: 8px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0)),
    rgba(250, 244, 232, 0.62);
  border-top: 1px solid rgba(205, 187, 158, 0.48);
  border-bottom: 1px solid rgba(205, 187, 158, 0.48);
  scrollbar-gutter: stable;
}

.chat-input-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 6px 8px;
  padding: 8px 10px 9px;
  border-top: 1px solid var(--z-line);
  background: rgba(236, 224, 201, 0.9);
}

.chat-input-area textarea {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-height: 66px;
  height: 66px;
  max-height: 24vh;
  border: 1px solid var(--z-line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--z-ink);
  font-family: var(--z-font);
  line-height: 1.3;
  box-shadow: inset 0 1px 4px rgba(32, 29, 24, 0.08);
}

.chat-buttons {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  justify-items: stretch;
}

.chat-buttons button {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 3px 5px;
  background: var(--z-green);
  color: #fff8e8;
  font-size: 0.86em;
}

.chat-buttons button:hover {
  transform: none;
}

.chat-buttons .button-danger {
  background: var(--z-lacquer);
}

.chat-assist-row {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.gesture-buttons {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 4px;
}

.gesture-buttons button {
  min-height: 24px;
  padding: 2px 6px;
  border: 1px solid rgba(183, 138, 58, 0.52);
  background: rgba(255, 253, 247, 0.86);
  color: var(--z-green-dark);
  font-size: 0.82em;
  line-height: 1.1;
}

.gesture-buttons button:hover {
  background: #fff8e8;
  color: var(--z-ink);
  transform: none;
}

.chat-help {
  flex: 1 1 auto;
  min-width: 12rem;
  line-height: 1.25;
  text-align: right;
}

.user-message,
.zenbot-message {
  width: fit-content;
  max-width: min(78%, 660px);
  padding: 5px 7px;
  margin: 0 0 5px;
  border-radius: 6px;
  line-height: 1.25;
  box-shadow: 0 2px 7px rgba(32, 29, 24, 0.06);
  font-family: var(--z-font);
  font-size: 0.96rem;
}

.user-message p,
.zenbot-message p {
  display: inline;
  margin: 0;
}

.user-message strong,
.zenbot-message strong {
  font-size: 0.95em;
}

.user-message {
  margin-left: auto;
  background: #e6f1ea;
  border: 1px solid rgba(36, 79, 53, 0.24);
}

.zenbot-message {
  background: #fffaf0;
  border: 1px solid rgba(183, 138, 58, 0.34);
}

.zenbot-thinking {
  border-color: var(--z-green);
  background: linear-gradient(90deg, #fff8e8, #f4ecd9);
}

.session-settings-panel {
  border-color: rgba(183, 138, 58, 0.55);
  background: rgba(255, 250, 241, 0.86);
  box-shadow: none;
  padding: 10px;
}

.session-settings-topline h2 {
  margin: 0 0 4px;
  color: var(--z-green-dark);
}

.session-settings-summary {
  max-width: none;
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(246, 239, 225, 0.84);
  font-size: 0.82rem;
  line-height: 1.25;
}

.session-settings-status {
  line-height: 1.28;
}

.session-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 8px;
  margin-top: 8px;
}

.session-field {
  color: var(--z-ink);
  gap: 2px;
  font-size: 0.82rem;
}

.session-field input,
.session-field select {
  min-height: 29px;
  padding: 4px 6px;
  border-color: var(--z-line);
  background: #fffdf7;
}

.session-settings-toggles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.session-toggle {
  min-height: 29px;
  padding: 5px 6px;
  background: rgba(255, 253, 247, 0.78);
  border-color: var(--z-line);
  font-size: 0.82rem;
}

.zendo-context-form {
  margin-top: auto;
  padding-top: 14px;
}

.zendo-context-form ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.zendo-context-form li {
  padding: 5px 0;
  border-top: 1px solid rgba(205, 187, 158, 0.7);
}

/* Shared public scale for pages extending base.html. */
.entrance-hall,
.gg-page,
.intro-tour,
.zendo-workspace {
  font-size: var(--z-fs-base);
}

.entrance-kicker,
.section-heading span,
.panel-heading span {
  font-size: var(--z-fs-xs);
}

.entrance-hero h1 {
  font-size: clamp(30px, 3.5vw, 52px);
}

.entrance-hero p,
.entrance-link-grid span,
.entrance-guide-grid p {
  font-size: var(--z-fs-base);
}

.entrance-link-grid strong,
.entrance-guide-grid h3 {
  font-size: var(--z-fs-md);
}

.gg-header h1,
.gg-header h2 {
  font-size: 21px;
}

.gg-case-page .koan-title {
  font-size: var(--z-fs-lg);
}

.gg-case-page .koan-body,
.gg-case-page .koan-comment,
.gg-case-page .koan-verse {
  font-size: var(--z-fs-base);
  line-height: 1.5;
}

.zendo-workspace {
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 3fr) minmax(240px, 0.6fr);
  gap: 7px;
  padding: 7px 10px;
  font-size: var(--z-fs-base);
}

.zendo-reference-panel,
.zendo-chat-panel,
.zendo-setup-panel {
  font-size: var(--z-fs-base);
}

.zendo-room-panel {
  padding: 8px;
}

.zendo-workspace .panel-heading h2,
.session-settings-topline h2 {
  font-size: var(--z-fs-xl);
  line-height: 1.05;
}

.zendo-chat-header {
  padding: 6px 9px;
}

.zendo-chat-header h1 {
  font-size: clamp(18px, 1.2vw, 23px);
  line-height: 1.06;
}

.zendo-chat-header p,
.chat-streaming-note {
  font-size: var(--z-fs-sm);
  line-height: 1.2;
}

.chat-preface-panel {
  height: clamp(128px, 25vh, 240px);
  min-height: 128px;
  max-height: 240px;
  padding: 6px 8px;
}

.koan-preface {
  font-size: var(--z-fs-xs);
  line-height: 1.35;
}

.empty-koan-note,
.zendo-small-links a,
.zendo-context-form li {
  font-size: var(--z-fs-xs);
  line-height: 1.3;
}

.zendo-context-form {
  padding-top: 10px;
}

.zendo-context-form ul {
  margin-top: 6px;
}

.zendo-chat-panel {
  min-height: 0;
}

.chat-messages {
  min-height: 260px;
  padding: 6px 8px;
}

.user-message,
.zenbot-message {
  max-width: min(78%, 620px);
  padding: 4px 6px;
  margin-bottom: 4px;
  font-size: var(--z-fs-base);
  line-height: 1.25;
}

.chat-input-area {
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 5px 7px;
  padding: 6px 8px;
}

.chat-input-area textarea {
  height: 50px;
  min-height: 50px;
  padding: 5px 6px;
  font-size: var(--z-fs-base);
  line-height: 1.25;
}

.chat-buttons button {
  min-height: 0;
  padding: 2px 4px;
  font-size: var(--z-fs-xs);
}

.chat-assist-row {
  gap: 6px;
}

.gesture-buttons button {
  min-height: 20px;
  padding: 2px 5px;
  font-size: var(--z-fs-xs);
}

.chat-help {
  font-size: var(--z-fs-xs);
}

.zendo-teacher-seat {
  grid-template-columns: 58px minmax(0, 1fr);
  margin-bottom: 7px;
}

.zendo-teacher-seat img {
  width: 58px;
  height: 58px;
}

.zendo-teacher-seat figcaption {
  padding: 5px 7px;
  gap: 3px;
}

.zendo-teacher-seat figcaption span {
  font-size: var(--z-fs-micro);
}

.zendo-teacher-seat figcaption strong {
  font-size: var(--z-fs-base);
}

.session-settings-summary,
.session-settings-status {
  font-size: var(--z-fs-xs);
  line-height: 1.25;
}

.session-settings-panel {
  padding: 8px;
}

.session-settings-grid {
  gap: 6px;
  margin-top: 7px;
}

.session-field {
  font-size: var(--z-fs-xs);
  gap: 2px;
}

.session-field input,
.session-field select {
  min-height: 24px;
  padding: 3px 5px;
  font-size: var(--z-fs-xs);
}

.session-settings-toggles {
  gap: 5px;
  margin-top: 7px;
}

.session-toggle {
  min-height: 24px;
  padding: 3px 5px;
  font-size: var(--z-fs-xs);
}

footer {
  padding: 6px;
  margin-top: 8px;
  font-size: var(--z-fs-xs);
}

footer ul {
  gap: 6px 12px;
  margin-bottom: 6px;
}

@media (max-width: 1080px) {
  .zendo-workspace {
    grid-template-columns: 1fr;
  }

  .zendo-room-panel,
  .zendo-chat-panel {
    min-width: 0;
  }

  .zendo-setup-panel {
    max-height: none;
    overflow: visible;
  }

  .zendo-chat-panel {
    min-height: 68vh;
  }
}

@media (min-width: 1081px) {
  .zendo-workspace {
    height: calc(100vh - 92px);
    min-height: 0;
  }

  .zendo-room-panel,
  .zendo-chat-panel {
    min-height: 0;
    max-height: 100%;
  }

  .chat-messages {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .entrance-hero {
    min-height: 72vh;
  }

  .entrance-hero-content {
    margin: 0 auto 5vh;
  }

  .entrance-actions,
  footer ul {
    flex-direction: column;
    align-items: stretch;
  }

  .entrance-button {
    width: 100%;
  }

  .zendo-workspace {
    padding: 10px;
    gap: 10px;
    font-size: var(--z-fs-base);
  }

  .gg-page {
    width: min(100% - 20px, 1120px);
    padding: 12px 0 20px;
  }

  .gg-case-grid {
    grid-template-columns: 1fr;
  }

  .chat-messages {
    min-height: 300px;
    padding: 12px;
  }

  .chat-input-area {
    grid-template-columns: 1fr;
  }

  .chat-input-area textarea,
  .chat-buttons,
  .chat-assist-row {
    grid-column: 1;
  }

  .chat-input-area textarea {
    grid-row: 1;
  }

  .chat-buttons {
    grid-row: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .chat-assist-row {
    grid-row: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .gesture-buttons button {
    flex: 1 1 0;
  }

  .chat-help {
    min-width: 0;
    text-align: left;
  }

  .session-settings-grid,
  .session-settings-toggles {
    grid-template-columns: 1fr;
  }

  .user-message,
  .zenbot-message {
    max-width: 100%;
  }
}
