:root {
  /* Brand palette (docs/brand/README.md): green primary, ink text, paper
     surfaces, warm lines. Navy is retired. */
  --bg: #fafaf8;
  --bg-page: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f6f3ec;
  --sidebar-bg: #16201f;
  --sidebar: #16201f;
  --sidebar-fg: #f2f2ee;
  --sidebar-mute: #9c9a8c;
  --sidebar-mute-soft: #7c7a6e;
  --sidebar-muted: #9c9a8c;
  --sidebar-line: rgb(255 255 255 / 0.07);
  --sidebar-hover: rgb(255 255 255 / 0.05);
  --sidebar-active: rgb(255 255 255 / 0.09);
  --ink: #16201f;
  --ink-soft: #454b47;
  --ink-muted: #6b6a5e;
  --ink-mute: #8b897c;
  --ink-faint: #9c9a8c;
  --line: #e4e4dc;
  --line-soft: #ecece5;
  --primary: #145c3f;
  --primary-deep: #0f4630;
  --primary-wash: #e1efe6;
  --primary-tint: #c5ddcf;
  --success: #2e7d4f;
  --success-wash: #e3f1e8;
  --success-dot: #2e9966;
  --warn: #b77b1f;
  --warn-wash: #faf0dd;
  --warn-dot: #d17a1f;
  --danger: #b3403a;
  --danger-wash: #fbe9e7;
  --danger-dot: #c8463f;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, "Iowan Old Style", serif;
  --serif: var(--font-display);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  padding-bottom: 42px;
}

a {
  color: var(--primary);
}

.tool-footer {
  position: fixed;
  left: 10px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 20px);
  border-radius: 6px;
  padding: 5px 7px;
  background: rgb(251 249 244 / 0.88);
  color: var(--ink-muted);
  font-size: 0.68rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tool-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

button {
  font: inherit;
}

input,
select,
textarea {
  font-family: var(--font);
  font-size: inherit;
  font-weight: 400;
  line-height: 1.45;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 52px;
  height: 40px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 0.83rem;
  font-weight: 700;
}

.brand-subtitle {
  max-width: 56vw;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0;
}

.lang-switch-option {
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--ink-muted);
  font-size: 0.74rem;
  line-height: 1;
  text-decoration: none;
}

.lang-switch-option:hover {
  color: var(--ink);
}

.lang-switch-option:focus-visible {
  outline: 2px solid var(--primary-wash);
  outline-offset: 1px;
  color: var(--ink);
}

.lang-switch-option:not(:last-child)::after {
  margin: 0 2px;
  color: var(--line);
  content: "|";
}

.lang-switch-option.is-active,
.lang-switch-option[aria-current] {
  background: var(--primary-wash);
  color: var(--primary);
  font-weight: 700;
}

.main-content {
  width: 100%;
  flex: 1;
  padding: 24px 18px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.entry-panel,
.finish-panel {
  width: min(100%, 620px);
  margin: 0 auto;
}

.step-label {
  margin-bottom: 8px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.18;
}

h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.lead {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.code-form,
.consent-box {
  display: grid;
  gap: 12px;
}

.code-form label {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.code-input {
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.code-input:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid var(--primary-wash);
}

.form-hint,
.chat-hint,
.soft-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.button,
.link-button,
.send-button {
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(26 31 44 / 0.06);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.button:hover,
.button:focus-visible {
  outline: 0;
  text-decoration: none;
}

.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgb(20 92 63 / 0.18);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--primary-deep);
  box-shadow: 0 12px 26px rgb(20 92 63 / 0.24);
  color: #fff;
}

.button:focus-visible {
  outline: 3px solid var(--primary-tint);
  outline-offset: 2px;
}

.button:disabled,
.button[aria-disabled="true"],
.button-primary:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--line);
  color: var(--ink-muted);
  box-shadow: none;
  transform: none;
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--primary-tint);
  background: var(--primary-wash);
  color: var(--primary);
  box-shadow: 0 8px 18px rgb(26 31 44 / 0.08);
}

.button-small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.82rem;
  line-height: 1.15;
}

.button-danger {
  border-color: #e8c7c2;
  background: var(--surface);
  color: var(--danger);
}

.button-danger:hover,
.button-danger:focus-visible {
  border-color: #d9a6a0;
  background: var(--danger-wash);
  color: var(--danger);
}

.button-primary.button-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  box-shadow: 0 10px 22px rgb(168 47 47 / 0.16);
}

.button-primary.button-danger:hover,
.button-primary.button-danger:focus-visible {
  border-color: #862626;
  background: #862626;
  color: #fff;
  box-shadow: 0 12px 26px rgb(168 47 47 / 0.22);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
  border: 1px solid var(--primary-tint);
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--primary-wash);
  color: var(--ink-soft);
  line-height: 1.45;
}

.notice h2,
.notice p {
  margin: 0;
}

.notice-icon {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: inherit;
  font-weight: 800;
}

.notice-error {
  border-color: #e8c7c2;
  background: var(--danger-wash);
  color: var(--danger);
}

.notice-success {
  border-color: #c7e0cf;
  background: var(--success-wash);
  color: var(--success);
}

.consent-layout {
  display: grid;
  gap: 22px;
  width: min(100%, 760px);
  margin: 0 auto;
}

.fact-grid,
.summary-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.fact-item,
.summary-item,
.consent-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.fact-item {
  padding: 14px;
}

.fact-item strong,
.fact-item span {
  display: block;
}

.fact-item strong {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fact-item span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.consent-box {
  padding: 18px;
}

.privacy-text {
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  cursor: pointer;
  line-height: 1.45;
}

.check-row input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 4px 0 12px;
}

.meta-list div {
  display: grid;
  gap: 2px;
}

.meta-list dt {
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
}

.chat-shell {
  width: 100%;
  max-width: 880px;
  min-height: 0;
  margin: 0 auto;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.message {
  max-width: 92%;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 15px;
  background: var(--surface);
}

.message-user {
  margin-left: auto;
  border-color: var(--primary-tint);
  background: var(--primary-wash);
}

.message-user .message-label {
  color: var(--primary);
}

.message-body {
  color: var(--ink);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.send-button {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}

.chat-hint,
.form-error {
  padding: 0 18px 12px;
  background: var(--surface);
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.success-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--success-wash);
  color: var(--success);
  font-size: 2rem;
  font-weight: 800;
}

.summary-item {
  padding: 18px;
}

.summary-item span,
.summary-item small {
  display: block;
  color: var(--ink-muted);
}

.summary-item span {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

body:not(.admin-page) {
  --bg: #fafaf8;
  --surface: #ffffff;
  --ink: #16201f;
  --ink-soft: #454b47;
  --ink-muted: #6b6a5e;
  --ink-faint: #9c9a8c;
  --line: #e4e4dc;
  --line-soft: #ecece5;
  --primary: #145c3f;
  --primary-deep: #0f4630;
  --primary-wash: #e1efe6;
  --primary-tint: #c5ddcf;
  --accent: #b34a5d;
  --success: #2e7d4f;
  --success-wash: #e3f1e8;
  --warn: #b77b1f;
  --warn-wash: #faf0dd;
  --danger: #b3403a;
  --danger-wash: #fbe9e7;
  min-height: 100vh;
  padding-bottom: 0;
  background: var(--bg);
  color: var(--ink);
}

body:not(.admin-page) .app-shell {
  min-height: 100vh;
  background: var(--bg);
}

body:not(.admin-page) .site-header {
  min-height: 68px;
  padding: 18px 28px;
  border-bottom-color: var(--line);
  background: var(--surface);
}

body:not(.admin-page) .brand-logo {
  width: 52px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

body:not(.admin-page) .brand-title {
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0;
}

body:not(.admin-page) .brand-subtitle {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

body:not(.admin-page) .main-content {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 40px 24px;
}

body:not(.admin-page) .site-footer {
  align-items: center;
  padding: 12px 28px;
  border-top-color: var(--line-soft);
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:not(:last-child)::after {
  margin-left: 4px;
  content: "·";
}

.tool-meta {
  flex: 1 0 100%;
  color: var(--ink-muted);
  font-size: 0.68rem;
  opacity: 0.8;
}

.tool-meta a {
  color: inherit;
}

body:not(.admin-page) h1 {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
}

body:not(.admin-page) .lead {
  color: var(--ink-soft);
  line-height: 1.55;
}

.entry-card,
.consent-card,
.finish-card,
.state-card {
  width: min(100%, 480px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(26 31 44 / 0.02);
}

.success-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--success-wash);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
}

.success-pill span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.code-form {
  position: relative;
  gap: 10px;
}

.code-entry-field {
  position: relative;
  min-height: 106px;
}

.code-boxes {
  width: min(100%, 506px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.code-box {
  min-width: 0;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--line-soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.code-box:not(:empty) {
  border-color: var(--primary);
  background: var(--surface);
}

.code-boxes-error .code-box {
  border-color: var(--danger);
  color: var(--danger);
}

.code-input-native {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 50px;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: text;
}

.code-entry-field:focus-within .code-boxes {
  outline: 3px solid var(--primary-wash);
  outline-offset: 4px;
}

.code-form .button-primary {
  width: 100%;
  margin-top: 10px;
}

.notice {
  border-radius: 10px;
}

.consent-layout {
  display: block;
  width: min(100%, 720px);
}

.consent-card {
  width: 100%;
  padding: 40px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.stepper-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.stepper-item span {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.stepper-item.is-done span {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.stepper-item.is-active {
  color: var(--ink);
}

.stepper-item.is-active span {
  border: 1.5px solid var(--primary);
  background: var(--primary-wash);
  color: var(--primary);
}

.stepper-line {
  width: 24px;
  height: 1px;
  flex: 0 0 auto;
  background: var(--line);
}

.fact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.fact-item {
  border: 0;
  border-radius: 10px;
  padding: 14px;
  background: var(--primary-wash);
}

.fact-item strong {
  color: var(--primary);
  font-size: 0.74rem;
}

.fact-item span {
  color: var(--ink);
  font-size: 0.82rem;
}

.consent-check-card {
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--surface);
}

.consent-check-card > span {
  font-size: calc(1rem - 3px);
  line-height: 1.55;
}

.consent-check-card a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: inherit;
}

.consent-privacy-link-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: currentColor;
}

/* Honeypot field: visually hidden but still reachable by naive form-filling bots.
   Off-screen technique keeps the element in the DOM without display:none
   so automated crawlers can find and fill it. tabindex=-1 removes keyboard access. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent-check-card:focus-within,
.consent-check-card:hover {
  border-color: var(--primary-tint);
  background: var(--primary-wash);
}

.privacy-details {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
}

.privacy-details summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
}

.privacy-details .privacy-text {
  max-height: 190px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 10px 10px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-page .main-content {
  display: block;
  min-height: 100vh;
  overflow: hidden;
  padding: 0;
}

.chat-page {
  background: var(--bg-page);
  overflow: hidden;
  padding-bottom: 0;
}

.chat-page .main-content {
  background: var(--bg-page);
}

.chat-page .site-header,
.chat-page .site-footer {
  display: none;
}

.chat-shell {
  width: min(calc(100vw - 48px), 880px);
  height: 90vh;
  max-height: none;
  min-height: 0;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
}

.chat-card {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.chat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 22px;
}

.chat-progress-strip {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr);
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 22px 10px;
  background: var(--surface);
}

.chat-progress-label {
  color: var(--ink-muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.chat-progress-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-soft);
}

.chat-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--success);
  transition: width 1.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-mobile-menu,
.chat-mobile-status-strip {
  display: none;
}

.chat-mobile-menu {
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.chat-mobile-menu svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.chat-title-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-title-group strong,
.chat-title-group small {
  display: block;
}

.chat-title-group strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title-group small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.bot-mark {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
}

.bot-mark-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.chat-topic-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 34%;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 16px;
  background: var(--line-soft);
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-topic-pill span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--ink-faint);
}

.message-list {
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  overflow-y: auto;
  padding: 22px 28px 8px;
  scroll-behavior: smooth;
  list-style: none;
}

.message {
  max-width: none;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0 0 18px;
  border: 0;
  padding: 0;
  background: transparent;
}

.message-user {
  border-color: transparent;
  background: transparent;
}

.message-user .message-avatar {
  display: none;
}

.message-user .message-card {
  margin-left: 46px;
  border-color: var(--primary-tint);
  background: var(--primary-wash);
}

.message-card {
  min-width: 0;
  max-width: calc(100% - 46px);
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--surface);
}

.message-label {
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-body {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft);
}

.message-read-button {
  appearance: none;
  display: inline-flex;
  min-height: 32px;
  max-width: max-content;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.message-read-button svg,
.message-read-speaker {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.message-read-speaker {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.message-read-speaker polygon {
  fill: currentColor;
  stroke: none;
}

.message-read-button:hover:not(:disabled),
.message-read-button:focus-visible {
  border-color: #ded8cd;
  background: #fff;
  color: var(--ink-soft);
  outline: 0;
}

.message-read-button.is-playing {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.message-read-button.is-playing:hover:not(:disabled),
.message-read-button.is-playing:focus-visible {
  border-color: var(--primary-deep);
  background: var(--primary-deep);
  color: #fff;
}

.message-read-button:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
  opacity: 0.6;
}

.message-finish-cta {
  width: fit-content;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--primary);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
}

.message-finish-cta:hover,
.message-finish-cta:focus-visible {
  background: var(--primary-deep);
}

.message-waiting .message-card {
  max-width: 150px;
  flex: 0 1 150px;
}

.message-waiting-body {
  min-height: 24px;
  display: flex;
  align-items: center;
}

.typing-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: typing-dot-pulse 1.2s ease-in-out infinite;
  background: var(--ink-muted);
}

.typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typing-dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.message-avatar-user {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.chat-form {
  display: block;
  border-top: 1px solid var(--line-soft);
  padding: 18px 22px 8px;
  background: var(--surface);
}

.composer-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 8px 8px 8px 14px;
  background: var(--bg-page);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgb(20 92 63 / 0.08);
}

.chat-form textarea {
  min-height: 30px;
  max-height: 140px;
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
}

.chat-form textarea::placeholder {
  color: var(--ink-faint);
}

.send-button {
  position: relative;
  width: 36px;
  height: 36px;
  min-height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.send-button:hover:not(:disabled) {
  background: var(--primary-deep);
}

.send-button:active:not(:disabled) {
  transform: scale(0.96);
}

.send-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(20 92 63 / 0.18);
}

.send-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.send-button:disabled {
  background: var(--line);
  color: var(--ink-faint);
  cursor: not-allowed;
}

.chat-action-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  justify-content: flex-end;
}

.voice-button {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.voice-button:hover:not(:disabled) {
  border-color: #d8d4c8;
  background: var(--surface-2);
  color: var(--ink);
}

.voice-button[data-recording="true"] {
  border-color: rgb(168 47 47 / 0.25);
  background: var(--danger-wash);
  color: var(--danger);
}

.voice-button[data-recording="true"]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--danger);
  border-radius: 14px;
  opacity: 0.42;
  animation: chat-recording-pulse 1.4s ease-out infinite;
}

.voice-recording-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  display: none;
  border-radius: 50%;
  background: var(--danger);
}

.voice-button[data-recording="true"] .voice-recording-dot {
  display: block;
}

.voice-button[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  border-radius: 6px;
  padding: 5px 9px;
  background: var(--ink);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.15s;
  white-space: nowrap;
}

.voice-button:hover[data-tooltip]::before,
.voice-button:focus-visible[data-tooltip]::before {
  opacity: 1;
}

@keyframes chat-recording-pulse {
  0% {
    opacity: 0.55;
    transform: scale(0.85);
  }

  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

.chat-hint {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 26px 16px;
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.recording-status {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--danger);
  font-weight: 600;
}

.chat-form.is-recording + .chat-hint .chat-hint-text {
  display: none;
}

.chat-form.is-recording + .chat-hint .recording-status {
  display: inline-flex;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: chat-recording-dot 1s infinite;
}

.recording-time {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

@keyframes chat-recording-dot {
  50% {
    opacity: 0.3;
  }
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.chat-meta-copy {
  display: grid;
  gap: 4px;
}

.chat-meta-copy a {
  color: var(--ink-muted);
}

.chat-meta form {
  flex: 0 0 auto;
}

.chat-meta .link-button {
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.chat-meta .link-button:hover,
.chat-meta .link-button:focus-visible {
  color: var(--danger);
}

.finish-card {
  width: min(100%, 560px);
}

.finish-panel .lead {
  max-width: 460px;
}

.finish-panel .soft-note {
  margin-bottom: 14px;
}

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

.summary-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.summary-item {
  border-radius: 12px;
}

.summary-item strong {
  font-size: 1.5rem;
}

.state-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 14px;
  font-size: 1.5rem;
  font-weight: 800;
}

.state-mark-error {
  border: 1px solid #e8c7c2;
  background: var(--danger-wash);
  color: var(--danger);
}

@media (max-width: 720px) {
  body:not(.admin-page) .site-header,
  body:not(.admin-page) .site-footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  body:not(.admin-page) .main-content {
    align-items: stretch;
    padding: 28px 20px;
  }

  .entry-card,
  .consent-card,
  .finish-card,
  .state-card {
    padding: 24px;
  }

  .fact-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .stepper {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .stepper-item strong {
    white-space: nowrap;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .button {
    width: 100%;
  }

}

@media (max-width: 767px) {
  body:not(.admin-page):not(.chat-page) {
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.admin-page):not(.chat-page) .app-shell {
    min-height: 100dvh;
  }

  body:not(.admin-page):not(.chat-page) .main-content {
    display: block;
    min-height: auto;
    padding: 20px 16px 34px;
  }

  body:not(.admin-page):not(.chat-page) .site-header {
    min-height: 64px;
    padding: 12px 16px;
  }

  body:not(.admin-page):not(.chat-page) .brand-logo {
    width: 48px;
    height: 38px;
  }

  body:not(.admin-page):not(.chat-page) .brand-subtitle {
    max-width: calc(100vw - 104px);
  }

  body:not(.admin-page):not(.chat-page) .site-footer {
    padding: 10px 16px;
  }

  body:not(.admin-page):not(.chat-page) .entry-panel,
  body:not(.admin-page):not(.chat-page) .finish-panel,
  body:not(.admin-page):not(.chat-page) .consent-layout {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body:not(.admin-page):not(.chat-page) .entry-card,
  body:not(.admin-page):not(.chat-page) .consent-card,
  body:not(.admin-page):not(.chat-page) .finish-card,
  body:not(.admin-page):not(.chat-page) .state-card {
    width: 100%;
    padding: 28px 24px;
  }

  body:not(.admin-page):not(.chat-page) h1 {
    font-size: 1.72rem;
  }

  body:not(.admin-page):not(.chat-page) .lead {
    font-size: 0.95rem;
  }

  body:not(.admin-page):not(.chat-page) .consent-check-card > span {
    font-size: calc(0.95rem - 3px);
  }

  body:not(.admin-page):not(.chat-page) .fact-grid {
    grid-template-columns: 1fr;
  }

  body:not(.admin-page):not(.chat-page) .meta-list {
    grid-template-columns: 1fr;
  }

  body:not(.admin-page):not(.chat-page) .stepper {
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 900px) {
  html:has(body.chat-page) {
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    max-height: 100vh;
    max-height: 100svh;
    overflow: hidden;
  }

  body.chat-page {
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    max-height: 100vh;
    max-height: 100svh;
    margin: 0;
    border: 0;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    background: var(--surface) !important;
  }

  body:not(.admin-page).chat-page .app-shell {
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    max-height: 100vh;
    max-height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--surface) !important;
  }

  .chat-page .site-header,
  .chat-page .site-footer {
    display: none !important;
  }

  body:not(.admin-page).chat-page .main-content {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    background: var(--surface) !important;
    display: flex;
    flex-direction: column;
  }

  .chat-page .chat-shell {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 0;
    max-height: none !important;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    padding: 0 !important;
  }

  .chat-page .chat-card {
    width: 100%;
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: var(--surface);
  }

  .chat-page .chat-progress-strip {
    grid-template-columns: auto minmax(64px, 1fr);
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  }

  .chat-page .chat-progress-label {
    font-size: 0.72rem;
  }

  .chat-page .chat-progress-strip + .chat-card-header {
    padding-top: 10px;
  }

  /* HEADER */
  .chat-page .chat-card-header {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line-soft);
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: var(--surface);
  }

  .chat-page .chat-title-group {
    flex: 1 1 auto;
    min-width: 0;
  }

  .chat-page .chat-title-group strong {
    font-size: 0.92rem;
  }

  .chat-page .chat-title-group > span:not(.bot-mark) {
    min-width: 0;
    overflow: hidden;
  }

  .chat-page .chat-title-group small {
    display: none !important;
  }

  /* Pille im Header verstecken, sie wird im Mobile-Strip darunter gezeigt */
  .chat-page .chat-card-header > .chat-topic-pill {
    display: none !important;
  }

  .chat-page .chat-mobile-menu {
    display: grid !important;
    flex: 0 0 auto;
  }

  .chat-page .chat-menu-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    background: rgba(15, 23, 38, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease-out;
  }

  .chat-page .chat-menu-backdrop.is-open {
    opacity: 1;
  }

  .chat-page .chat-menu-sheet:not([hidden]) {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 81;
    max-height: min(82dvh, 560px);
    display: flex;
    flex-direction: column;
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    box-shadow: 0 -18px 54px rgb(15 23 38 / 0.2);
    transform: translateY(100%);
    transition: transform 0.2s ease-out;
  }

  .chat-page .chat-menu-sheet.is-open {
    transform: translateY(0);
  }

  .chat-page .chat-menu-header {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 16px;
  }

  .chat-page .chat-menu-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
  }

  .chat-page .chat-menu-close {
    width: 36px;
    height: 36px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
  }

  .chat-page .chat-menu-close:hover,
  .chat-page .chat-menu-close:active {
    background: var(--bg-page);
    color: var(--ink);
  }

  .chat-page .chat-menu-close svg,
  .chat-page .chat-menu-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }

  .chat-page .chat-menu-content {
    overflow-y: auto;
    padding: 8px 0 calc(16px + env(safe-area-inset-bottom));
  }

  .chat-page .chat-menu-action {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    padding: 8px 16px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
  }

  .chat-page .chat-menu-action:hover,
  .chat-page .chat-menu-action:active {
    background: var(--bg-page);
  }

  .chat-page .chat-menu-action-primary {
    background: var(--primary-wash);
    color: var(--primary);
  }

  .chat-page .chat-menu-icon {
    width: 32px;
    height: 32px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--bg-page);
    color: currentColor;
  }

  .chat-page .chat-menu-action-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .chat-page .chat-menu-action-copy strong {
    font-size: 0.9rem;
    font-weight: 700;
  }

  .chat-page .chat-menu-action-copy small {
    color: var(--ink-muted);
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .chat-page .chat-menu-action-danger {
    color: var(--danger);
  }

  .chat-page .chat-menu-action-danger .chat-menu-icon {
    background: var(--danger-wash);
  }

  .chat-page .chat-menu-panel {
    margin: 0 16px 8px 60px;
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--bg-page);
    color: var(--ink-soft);
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .chat-page .chat-menu-panel p {
    margin: 0;
  }

  .chat-page .chat-menu-panel strong {
    display: block;
    margin-bottom: 4px;
    color: var(--ink);
    font-size: 0.74rem;
  }

  .chat-page .chat-menu-panel code {
    display: inline-block;
    margin-bottom: 6px;
    border-radius: 6px;
    padding: 4px 7px;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.84rem;
    font-weight: 700;
  }

  .chat-page .chat-menu-links {
    display: grid;
    gap: 8px;
  }

  .chat-page .chat-menu-links a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
  }

  .chat-page .chat-menu-separator {
    margin: 8px 16px;
    border: 0;
    border-top: 1px solid var(--line-soft);
  }

  .chat-page .chat-menu-confirm {
    margin: 0 16px 8px;
    border-radius: 8px;
    padding: 12px;
    background: var(--danger-wash);
    color: var(--danger);
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .chat-page .chat-menu-confirm p {
    margin: 0 0 10px;
  }

  .chat-page .chat-menu-confirm div {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }

  /* MOBILE STATUS-STRIP */
  .chat-page .chat-mobile-status-strip {
    display: none !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--bg-page);
    color: var(--ink-muted);
    font-size: 0.72rem;
  }

  .chat-page .chat-mobile-status-strip .chat-topic-pill {
    flex: 0 0 auto;
    min-height: 24px;
    max-width: none;
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  .chat-page .chat-mobile-status-strip > span:last-child {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* MESSAGE LIST */
  .chat-page .message-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px;
    margin: 0;
    list-style: none;
  }

  .chat-page .message {
    width: 100%;
    max-width: none;
    display: flex;
    gap: 10px;
    margin: 0 0 14px;
    border: 0;
    padding: 0;
    background: transparent;
  }

  .chat-page .message-card {
    min-width: 0;
    max-width: calc(100% - 42px);
    flex: 1 1 auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--surface);
  }

  /* USER BUBBLE */
  .chat-page .message-user {
    justify-content: flex-end;
  }

  .chat-page .message-user .message-avatar {
    display: none !important;
  }

  .chat-page .message-user .message-card {
    margin-left: auto;
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
  }

  .chat-page .message-user .message-label {
    display: none !important;
  }

  .chat-page .message-user .message-body {
    color: #fff;
  }

  .chat-page .message-actions {
    margin-top: 10px;
  }

  .chat-page .message-read-button {
    min-height: 32px;
    padding: 0 13px;
    font-size: 0.84rem;
  }

  /* COMPOSER */
  .chat-page .chat-form {
    flex: 0 0 auto;
    display: block;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    background: var(--surface);
  }

  .chat-page .composer-shell {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border: 1.5px solid var(--line);
    border-radius: 22px;
    padding: 6px 6px 6px 14px;
    background: var(--bg-page);
  }

  .chat-page .chat-form textarea {
    flex: 1 1 auto;
    min-height: 32px;
    max-height: 120px;
    font-size: 16px; /* iOS-Zoom-Prevention, kritisch, nicht aendern */
    line-height: 1.4;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    overflow-y: auto;
    resize: none;
    scrollbar-width: none;
    padding: 6px 0;
  }

  .chat-page .chat-form textarea::-webkit-scrollbar {
    display: none;
  }

  .chat-page .chat-action-buttons {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }

  .chat-page .send-button,
  .chat-page .voice-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
  }

  /* HIDE NICHT-MOBILE ELEMENTE */
  .chat-page .chat-hint {
    display: none !important;
  }

  .chat-page .chat-meta {
    display: none !important;
  }
}

