export const surfaceStyles = `
  :host {
    --akintu-border-color-1: #8b5cf6;
    --akintu-border-color-2: #f59e0b;
    --akintu-border-color-3: #10b981;
    --akintu-button-color: #10b981;
    --akintu-button-text: #07111f;
    --akintu-primary-color: #111827;
    --akintu-primary-text: #ffffff;
    --akintu-primary-soft: #eceef0;
    --akintu-primary-border: #b8bac0;
    all: initial;
    color: #111827;
    display: block;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
  }

  *, *::before, *::after { box-sizing: border-box; }
  button, textarea { font: inherit; }

  .surface {
    color: #374151;
    margin: 0;
    width: 100%;
  }

  .composer {
    background:
      linear-gradient(#fff, #fff) padding-box,
      conic-gradient(
        from 225deg,
        var(--akintu-border-color-1),
        var(--akintu-border-color-2),
        var(--akintu-border-color-3),
        var(--akintu-border-color-1)
      ) border-box;
    border: 2px solid transparent;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.16);
    min-height: 86px;
    position: relative;
    transition: box-shadow 150ms ease, transform 150ms ease;
    width: 100%;
  }

  .composer:focus-within {
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.2);
    transform: translateY(-1px);
  }

  textarea {
    background: transparent;
    border: 0;
    color: #111827;
    display: block;
    min-height: 82px;
    outline: 0;
    padding: 12px 54px 12px 12px;
    resize: none;
    width: 100%;
  }

  textarea::placeholder { color: #718096; opacity: 1; }
  textarea:disabled { cursor: not-allowed; opacity: 0.7; }

  .resume-button {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 14px;
    color: #111827;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    inset: 0;
    justify-content: space-between;
    padding: 16px;
    position: absolute;
    text-align: left;
    z-index: 2;
  }

  .resume-button::after {
    color: var(--akintu-button-color);
    content: "→";
    font-size: 22px;
  }

  .resume-button[hidden] { display: none; }

  .toolbar {
    align-items: flex-end;
    bottom: 9px;
    display: flex;
    gap: 7px;
    position: absolute;
    right: 9px;
  }

  .speech-button, .send-button, .close-button, .reset-button, .listen-button, .feedback-button {
    cursor: pointer;
  }

  .speech-button {
    background: var(--akintu-primary-soft);
    border: 1px solid var(--akintu-primary-border);
    border-radius: 8px;
    color: var(--akintu-primary-color);
    min-height: 31px;
    padding: 5px 9px;
  }

  .speech-button[hidden] { display: none; }
  .speech-button--active { background: #d1fae5; }

  .send-button {
    align-items: center;
    background: var(--akintu-button-color);
    border: 0;
    border-radius: 8px;
    color: var(--akintu-button-text);
    display: inline-flex;
    height: 31px;
    justify-content: center;
    padding: 0;
    width: 31px;
  }

  .send-button:hover { filter: brightness(0.94); }
  .send-button:disabled { cursor: not-allowed; opacity: 0.55; }
  .send-icon { font-size: 23px; font-weight: 500; line-height: 1; transform: translateY(-1px); }


  .dialog {
    background: transparent;
    border: 0;
    height: 100dvh;
    inset: 0;
    margin: 0;
    max-height: none;
    max-width: none;
    padding: clamp(16px, 4vw, 40px);
    width: 100vw;
  }

  .dialog[open] {
    display: grid;
    place-items: center;
  }

  .dialog::backdrop {
    background: rgba(17, 24, 39, 0.38);
    backdrop-filter: blur(1px);
  }

  .dialog-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(17, 24, 39, 0.25);
    display: flex;
    flex-direction: column;
    height: min(720px, calc(100dvh - 48px));
    max-width: 760px;
    min-height: 420px;
    overflow: hidden;
    padding: 18px 22px 20px;
    width: 100%;
  }

  .dialog-header {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    min-height: 36px;
  }


  .dialog-header-actions {
    align-items: center;
    display: flex;
    gap: 8px;
  }

  .reset-button {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 9px;
  }

  .reset-button:hover {
    background: #f3f4f6;
    color: #111827;
  }

  .close-button {
    align-items: center;
    background: #f3f4f6;
    border: 0;
    border-radius: 999px;
    color: #4b5563;
    display: inline-flex;
    font-size: 22px;
    height: 34px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 2px;
    width: 34px;
  }

  .close-button:hover { background: #e5e7eb; color: #111827; }

  .conversation {
    display: grid;
    grid-template-rows: 0fr;
    min-height: 0;
    opacity: 0;
    transition: grid-template-rows 150ms ease, opacity 150ms ease, margin 150ms ease;
  }

  .conversation--open {
    grid-template-rows: 1fr;
    opacity: 1;
  }

  .surface--inline .conversation--open { margin-bottom: 16px; }

  .dialog-panel .conversation {
    flex: 1;
    margin: 14px 0;
  }

  .conversation-inner { min-height: 0; overflow: hidden; }

  .messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    max-height: 320px;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 4px;
    scrollbar-color: #d1d5db transparent;
  }

  .dialog-panel .messages { max-height: none; }
  .surface--inline .messages { max-height: 260px; }

  .message {
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
    max-width: min(88%, 620px);
    overflow-wrap: anywhere;
    padding: 11px 14px;
    white-space: pre-wrap;
  }

  .message--user {
    align-self: flex-end;
    background: var(--akintu-primary-color);
    color: var(--akintu-primary-text);
  }

  .message--assistant {
    align-self: flex-start;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
  }

  .message-content--formatted { white-space: normal; }
  .message-content--formatted > :first-child { margin-top: 0; }
  .message-content--formatted > :last-child { margin-bottom: 0; }
  .message-content--formatted p { margin: 0 0 0.8em; }
  .message-content--formatted h3,
  .message-content--formatted h4,
  .message-content--formatted h5 {
    color: #111827;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.4;
    margin: 0.9em 0 0.4em;
  }
  .message-content--formatted ul,
  .message-content--formatted ol {
    margin: 0.45em 0 0.85em;
    padding-left: 1.35em;
  }
  .message-content--formatted li + li { margin-top: 0.25em; }
  .message-content--formatted strong { color: #111827; font-weight: 700; }
  .message-content--formatted em { font-style: italic; }
  .message-content--formatted code {
    background: #e5e7eb;
    border-radius: 4px;
    color: #111827;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9em;
    padding: 0.08em 0.3em;
  }

  .message-actions { margin-top: 8px; }

  .listen-button {
    background: transparent;
    border: 0;
    color: #047857;
    font-size: 12px;
    font-weight: 650;
    padding: 4px 0;
  }

  .feedback-actions {
    align-items: center;
    color: #6b7280;
    display: flex;
    font-size: 12px;
    gap: 6px;
    margin-top: 9px;
  }

  .feedback-label { margin-right: 2px; }

  .feedback-button {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    color: #374151;
    font-size: 12px;
    padding: 3px 9px;
  }

  .feedback-button:hover { border-color: var(--akintu-primary-color); color: var(--akintu-primary-color); }

  .calendly-booking {
    align-self: stretch;
    background: #fff;
    border: 1px solid var(--akintu-primary-border);
    border-radius: 14px;
    color: #374151;
    flex: none;
    overflow: hidden;
    padding: 12px;
  }
  .booking-offer {
    margin: 12px 0;
    padding: 16px;
    border: 1px solid var(--akintu-primary-border);
    border-radius: 16px;
    background: var(--akintu-primary-soft);
    color: #172033;
  }
  .booking-offer-title { display: block; font-size: 15px; }
  .booking-offer-timezone {
    margin: 4px 0 12px;
    color: #64748b;
    font-size: 12px;
  }
  .booking-date-filter,
  .booking-field input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    font: inherit;
  }
  .booking-date-filter { padding: 9px 10px; }
  .booking-offer-slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }
  .booking-slot-button {
    min-height: 42px;
    padding: 8px;
    border: 1px solid var(--akintu-primary-border);
    border-radius: 10px;
    background: #fff;
    color: #172033;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
  }
  .booking-slot-button:hover,
  .booking-slot-button[aria-pressed="true"] {
    border-color: var(--akintu-primary-color);
    background: var(--akintu-primary-soft);
  }
  .booking-details-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--akintu-primary-border);
  }
  .booking-selected-summary { margin: 0; font-size: 13px; font-weight: 600; }
  .booking-field { display: grid; gap: 4px; }
  .booking-field-label { font-size: 12px; font-weight: 600; }
  .booking-field input { padding: 10px 11px; }
  .booking-submit-button {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: var(--akintu-button-color);
    color: var(--akintu-button-text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
  }
  .booking-submit-button:disabled,
  .booking-slot-button:disabled { cursor: wait; opacity: .65; }

  .calendly-booking-title {
    color: #111827;
    display: block;
    font-size: 14px;
  }
  .calendly-booking-description {
    color: #6b7280;
    font-size: 12px;
    margin: 5px 0 10px;
  }
  .calendly-booking-frame {
    background: #fff;
    border: 0;
    display: block;
    height: min(560px, 65dvh);
    min-height: 460px;
    width: 100%;
  }
  .calendly-booking-fallback {
    color: var(--akintu-primary-color);
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    margin-top: 9px;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .calendly-booking-fallback:hover { filter: brightness(0.75); }
  .surface--inline .messages:has(.calendly-booking) {
    max-height: min(720px, 80dvh);
  }

  .action-confirmation {
    background: var(--akintu-primary-soft);
    border: 1px solid var(--akintu-primary-border);
    border-radius: 12px;
    color: #172033;
    margin: 10px 0;
    padding: 12px;
  }

  .action-confirmation-title { display: block; font-size: 13px; }
  .action-confirmation-summary { font-size: 13px; line-height: 1.5; margin: 6px 0 0; }
  .action-confirmation-actions { display: flex; gap: 8px; margin-top: 10px; }
  .action-confirm-button, .action-cancel-button {
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
  }
  .action-confirm-button { background: var(--akintu-button-color); border: 1px solid var(--akintu-button-color); color: var(--akintu-button-text); }
  .action-cancel-button { background: #fff; border: 1px solid var(--akintu-primary-border); color: var(--akintu-primary-color); }
  .action-confirm-button:disabled, .action-cancel-button:disabled { cursor: wait; opacity: .6; }

  .dialog-composer-slot { flex: none; }

  .status {
    color: #6b7280;
    font-size: 12px;
    min-height: 18px;
    padding-top: 7px;
  }

  .error {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 13px;
    margin-top: 8px;
    padding: 9px 11px;
  }
  .playbook-card { background: #f9fafb; border: 1px solid var(--akintu-primary-border); border-radius: 12px; display: grid; gap: 12px; margin: 10px 0; padding: 14px; }
  .playbook-title { color: #111827; font-size: 15px; }
  .playbook-form, .playbook-choices { display: grid; gap: 10px; }
  .playbook-field { display: grid; gap: 4px; }
  .playbook-field-label { color: #4b5563; font-size: 12px; font-weight: 600; }
  .playbook-field input { background: #fff; border: 1px solid var(--akintu-primary-border); border-radius: 8px; color: #111827; font: inherit; min-height: 40px; padding: 8px 10px; width: 100%; }
  .playbook-consent { align-items: flex-start; display: flex; font-size: 12px; gap: 8px; }
  .playbook-submit, .playbook-choice, .playbook-destination { background: var(--akintu-button-color); border: 0; border-radius: 8px; color: var(--akintu-button-text); cursor: pointer; font: inherit; font-weight: 700; padding: 10px 12px; text-align: center; text-decoration: none; }
  .playbook-submit:disabled, .playbook-choice:disabled { cursor: wait; opacity: .6; }
  .playbook-result { display: grid; gap: 10px; }


  button:focus-visible {
    outline: 3px solid var(--akintu-primary-color);
    outline-offset: 3px;
  }

  .visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  @media (max-width: 520px) {
    .dialog { padding: 0; }
    .dialog-panel {
      border-radius: 0;
      height: 100dvh;
      min-height: 100dvh;
      padding: 14px 14px 16px;
    }
    .message { max-width: 94%; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
  }
`;
