:root {
  --primary-dark: #1a2744;
  --primary-medium: #2d4a7c;
  --accent-gold: #c9a227;
  --accent-gold-light: #e8d48a;
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --bg-cream: #faf8f5;
  --bg-muted: #f3f5f8;
  --bg-assistant: #f1f3f8;
  --border: #e0e4e8;
  --border-strong: #cfd7e2;
  --text: #1a1a1a;
  --text-muted: #5a6a7a;
  --blue: #3166e3;
  --blue-dark: #0b4570;
  --button-brown: #9a3f13;
  --button-brown-dark: #7d320f;
  --shadow-sm: 0 4px 14px rgba(24, 40, 64, 0.06);
  --shadow-md: 0 4px 20px rgba(26, 39, 68, 0.12);
  --shadow-lg: 0 8px 40px rgba(26, 39, 68, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  color: var(--text);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

body.has-modal-open {
  overflow: hidden;
}

.page-shell {
  padding: 24px 16px 48px;
}

.calculator-container {
  max-width: 900px;
  margin: 0 auto;
}

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

.list-panel,
.logo-section {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.list-panel {
  margin-bottom: 24px;
  padding: 28px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.list-header h2 {
  margin: 0 0 6px;
  color: var(--primary-dark);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
}

.list-header p {
  margin: 0;
  color: var(--text-muted);
}

.create-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
  color: #ffffff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.create-button:hover {
  filter: brightness(1.05);
}

.list-empty {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-cream);
  color: var(--text-muted);
}

.list-empty p {
  margin: 0;
}

.buybox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.buybox-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  background: #ffffff;
}

.buybox-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.buybox-card-head h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.02rem;
}

.buybox-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.buybox-status.is-draft {
  background: #fef3c7;
  color: #92400e;
}

.buybox-status.is-complete {
  background: #d1fae5;
  color: #065f46;
}

.buybox-meta {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.buybox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.buybox-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--primary-dark);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.buybox-action.is-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
  color: #ffffff;
}

.buybox-action.is-danger {
  color: #9a3f13;
}

.buybox-action:hover {
  background: #f8fafc;
}

.buybox-action.is-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
  color: #ffffff;
  filter: brightness(1.05);
}

.buybox-action.is-danger:hover {
  background: #fff7f3;
}

.logo-section {
  border-radius: 16px 16px 0 0;
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: none;
}

.logo-section img {
  max-width: 70%;
  height: auto;
  display: block;
}

.header {
  text-align: center;
  margin-bottom: 32px;
  padding: 18px 24px 16px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
  border-radius: 0 0 16px 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.how-to-button {
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--button-brown);
  color: #ffffff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(154, 63, 19, 0.22);
}

.how-to-button:hover {
  background: var(--button-brown-dark);
}

.how-to-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.82rem;
  line-height: 1;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.1) 0%, transparent 60%);
  animation: shimmer 15s ease-in-out infinite;
}

@keyframes shimmer {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10%, 10%);
  }
}

.header h1 {
  position: relative;
  margin: 0 0 6px;
  color: #ffffff;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header p {
  position: relative;
  margin: 0;
  color: var(--accent-gold-light);
  font-size: 0.95rem;
  font-weight: 500;
}

.chat-container,
.document-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-container {
  display: flex;
  flex-direction: column;
  min-height: min(520px, calc(100dvh - 40px));
  height: min(760px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
}

.chat-header,
.status-banner,
.chat-footer {
  flex-shrink: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-button,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #2d6d75;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.header-button:hover,
.back-button:hover {
  background: #f9fbfd;
}

.danger-button {
  color: #9a3f13;
}

.danger-button:hover {
  background: #fff7f3;
}

.chat-header-title {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.status-banner {
  margin: 16px 22px 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.status-banner.is-error {
  border: 1px solid #efc2c2;
  background: #fff1f1;
  color: #a13a3a;
}

.status-banner.is-success {
  border: 1px solid #cbe7d4;
  background: #eef9f1;
  color: #24613a;
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-gutter: stable;
}

.message {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 96%;
}

.message.is-user {
  align-self: flex-end;
  justify-content: flex-end;
}

.message-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
}

.message.is-assistant .message-avatar,
.message.is-typing .message-avatar {
  background: var(--blue);
  color: #ffffff;
}

.message.is-user .message-avatar {
  order: 2;
  background: #f1f3f6;
  color: #2d3340;
}

.message-bubble {
  padding: 16px 20px;
  border-radius: 18px;
  font-size: 0.99rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.message.is-assistant .message-bubble,
.message.is-typing .message-bubble {
  max-width: 650px;
  background: var(--bg-assistant);
  color: var(--text);
}

.message.is-user .message-bubble {
  max-width: 420px;
  background: var(--blue);
  color: #ffffff;
}

.message-bubble strong {
  font-weight: 700;
}

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

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a94a3;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

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

@keyframes typing-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-footer {
  padding: 18px 26px 22px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.chat-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.consent-panel {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-cream);
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.4;
  cursor: pointer;
}

.consent-checkbox input {
  margin-top: 3px;
  accent-color: var(--button-brown);
}

.consent-links {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding-left: 24px;
  font-size: 0.84rem;
}

.consent-links a,
.consent-link-button {
  color: var(--button-brown);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.consent-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.consent-links a:hover,
.consent-link-button:hover {
  color: var(--button-brown-dark);
  text-decoration: underline;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.chat-form textarea {
  min-height: 56px;
  max-height: 160px;
  resize: none;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 2px;
  background: var(--bg-cream);
  font: inherit;
  font-size: 1rem;
  color: var(--text);
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.15);
}

.send-button,
.generate-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--button-brown);
  color: #ffffff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.send-button:hover,
.generate-button:hover,
.download-button:hover {
  background: var(--button-brown-dark);
}

.send-button:disabled,
.generate-button:disabled,
.download-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.generate-button {
  min-width: 92px;
  min-height: 92px;
  padding: 8px 10px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
  text-align: center;
  font-size: 0.9rem;
}

.generate-button span {
  display: block;
}

.input-hint {
  margin: 10px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.document-container {
  padding-top: 28px;
}

.document-card {
  padding: 0 36px 34px;
}

.document-header {
  padding: 34px 0 30px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.document-header h1 {
  margin: 0 0 18px;
  color: var(--blue-dark);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 2.9rem;
  font-weight: 700;
}

.document-meta {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.45;
}

.document-meta strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.document-body {
  padding: 34px 0 8px;
  color: var(--text);
}

.document-body h2,
.document-body h3,
.document-body h4 {
  margin: 0 0 14px;
  color: #366f72;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
}

.document-body h2 {
  margin-top: 28px;
  font-size: 2.1rem;
}

.document-body h3 {
  margin-top: 24px;
  font-size: 1.8rem;
}

.document-body h4 {
  margin-top: 20px;
  font-size: 1.1rem;
  font-weight: 700;
}

.document-body p {
  margin: 0 0 16px;
  font-size: 1.02rem;
  line-height: 1.7;
}

.document-body ul {
  margin: 0 0 20px;
  padding-left: 18px;
}

.document-body li {
  margin-bottom: 8px;
  font-size: 1.02rem;
  line-height: 1.65;
}

.document-body li::marker {
  color: var(--blue);
}

.document-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.download-button,
.back-button {
  min-width: 250px;
  border-radius: 0;
}

.back-button {
  color: #2d6d75;
  background: #f3f5f8;
}

.back-button:hover {
  background: #edf1f5;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-panel {
  position: relative;
  width: min(100%, 440px);
  padding: 34px 34px 30px;
  border-radius: 18px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.how-to-modal-panel {
  position: relative;
  width: min(100%, 920px);
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.consent-modal-panel {
  max-width: 640px;
}

.modal-close-inline {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close-inline:hover {
  color: var(--text);
}

.consent-modal-copy p {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.6;
}

.consent-modal-link {
  margin: 12px 0 0;
}

.consent-modal-link a {
  color: var(--button-brown);
  font-weight: 700;
  text-decoration: none;
}

.consent-modal-link a:hover {
  color: var(--button-brown-dark);
  text-decoration: underline;
}

.modal-close-button {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid #ffffff;
  background: var(--button-brown);
  color: #ffffff;
  font: inherit;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.modal-close-button:hover {
  background: var(--button-brown-dark);
}

.how-to-video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000000;
}

.how-to-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-panel h2 {
  margin: 0 0 18px;
  color: var(--blue-dark);
  font-size: 2rem;
  font-weight: 500;
}

.modal-panel p {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.45;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  border: 4px solid #dbe7ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dev-panel {
  margin-top: 14px;
  padding: 0 18px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.dev-panel summary {
  padding: 14px 0;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.dev-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dev-grid article {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-muted);
}

.dev-grid strong,
.dev-grid span {
  display: block;
}

.dev-grid strong {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dev-grid span {
  color: var(--text);
  font-size: 0.92rem;
}

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

@media (max-width: 768px) {
  .page-shell {
    padding: 8px;
  }

  .logo-section {
    display: none;
  }

  .list-panel {
    padding: 16px;
  }

  .chat-view {
    margin-top: 0;
  }

  .list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .logo-section img {
    max-width: 90%;
  }

  .header {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 0 0 14px 14px;
  }

  .header h1 {
    margin-bottom: 0;
    padding-right: 68px;
    font-size: 0.96rem;
    line-height: 1.15;
  }

  .header p {
    display: none;
  }

  .how-to-button {
    top: 10px;
    right: 10px;
    transform: none;
    min-height: 28px;
    padding: 0 8px;
    gap: 5px;
    font-size: 0.74rem;
    border-radius: 5px;
  }

  .how-to-button-icon {
    width: 14px;
    height: 14px;
    font-size: 0.66rem;
  }

  .chat-container {
    display: block;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    border-radius: 14px;
  }

  .chat-header {
    padding: 10px;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .status-banner {
    margin: 10px 10px 0;
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .chat-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .header-button {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 0.84rem;
    text-align: center;
    line-height: 1.2;
  }

  .chat-header-title {
    width: 100%;
    font-size: 0.82rem;
  }

  .chat-messages {
    flex: none;
    overflow: visible;
    min-height: 240px;
    max-height: none;
    padding: 12px 10px;
  }

  .chat-footer,
  .document-card {
    padding-left: 10px;
    padding-right: 10px;
  }

  .chat-footer {
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .message {
    max-width: 100%;
  }

  .message.is-assistant .message-bubble,
  .message.is-typing .message-bubble {
    max-width: calc(100% - 46px);
  }

  .message.is-user {
    width: 100%;
  }

  .message.is-user .message-bubble {
    max-width: calc(100% - 46px);
  }

  .message-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.76rem;
  }

  .message-bubble {
    padding: 11px 12px;
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .chat-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
  }

  .chat-form textarea {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 16px;
  }

  .send-button {
    width: 84px !important;
    flex: 0 0 84px;
    min-width: 84px;
    min-height: 48px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .chat-action-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
    gap: 6px;
  }

  .generate-button {
    width: 72px !important;
    flex: 0 0 72px;
    width: 72px;
    min-width: 72px;
    min-height: 72px;
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .consent-panel {
    min-width: 0;
    padding: 7px 9px;
  }

  .consent-checkbox {
    gap: 8px;
    font-size: 0.73rem;
    line-height: 1.3;
  }

  .consent-links {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    padding-left: 20px;
    font-size: 0.73rem;
  }

  .download-button,
  .back-button,
  .create-button,
  .buybox-action {
    width: 100%;
  }

  .document-footer {
    flex-direction: column;
  }

  .dev-grid {
    grid-template-columns: 1fr;
  }

  .modal-panel,
  .how-to-modal-panel {
    width: calc(100% - 24px);
  }

  .how-to-modal-panel {
    padding: 10px;
  }

  .modal-close-button {
    top: -12px;
    right: -4px;
  }

  .input-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .header {
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  .header h1 {
    padding-right: 64px;
    font-size: 0.88rem;
  }

  .how-to-button {
    top: 8px;
    right: 8px;
    min-height: 26px;
    padding: 0 7px;
    font-size: 0.7rem;
  }

  .chat-messages {
    min-height: 220px;
  }

  .message.is-assistant .message-bubble,
  .message.is-typing .message-bubble,
  .message.is-user .message-bubble {
    max-width: calc(100% - 40px);
  }

  .header-button {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 0.78rem;
  }

  .chat-form {
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 6px;
  }

  .send-button {
    width: 78px !important;
    min-width: 78px;
    min-height: 46px;
    font-size: 0.84rem;
  }

  .chat-action-row {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 5px;
  }

  .consent-panel {
    flex: 1 1 0;
    padding: 6px 8px;
  }

  .generate-button {
    width: 62px !important;
    min-width: 62px;
    min-height: 62px;
    padding: 5px 6px;
    font-size: 0.64rem;
  }

  .consent-checkbox {
    gap: 6px;
    font-size: 0.66rem;
    line-height: 1.25;
  }

  .consent-links {
    gap: 6px;
    padding-left: 18px;
    font-size: 0.66rem;
  }
}
