/* CRAFTAGENT V20.58.3 – MOBILE ASSISTANT LAYOUT POLISH
 *
 * Vereinheitlicht Classic und Modern innerhalb des Smartphone-Viewports.
 * Die Persona bleibt kompakt und vollständig; die Startauswahl zeigt
 * mindestens vier Anliegen ohne äußeres Seitenscrollen.
 */

@media (max-width: 800px) {
  html body.widget-embed,
  html body.widget-embed .assistant-app {
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: 0 !important;
    max-height: 100dvh;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  html body.widget-embed .assistant-shell {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: clamp(150px, 23dvh, 166px) minmax(0, 1fr) !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  html body.widget-embed .assistant-persona {
    grid-row: 1;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    padding: 17px 20px 0 !important;
    overflow: hidden !important;
  }

  html body.widget-embed .persona-company-logo {
    max-width: 118px !important;
    min-height: 0 !important;
    margin: 0 0 11px !important;
    padding: 7px 9px !important;
  }

  html body.widget-embed .persona-company-logo img {
    max-width: 98px !important;
    max-height: 55px !important;
  }

  html body.widget-embed .assistant-persona:has(.persona-company-logo:not([hidden])) .persona-copy {
    display: none !important;
  }

  html body.widget-embed .status-badge,
  html[data-assistant-theme="modern"] body.widget-embed .status-badge {
    min-height: 29px !important;
    padding: 6px 10px !important;
    font-size: 9px !important;
  }

  html body.widget-embed .persona-copy {
    width: 58% !important;
    margin-top: 14px !important;
  }

  html body.widget-embed .persona-copy h1,
  html[data-assistant-theme="modern"] body.widget-embed .persona-copy h1 {
    margin: 0 !important;
    font-size: clamp(33px, 9.5vw, 38px) !important;
  }

  html body.widget-embed .persona-copy h1 em,
  html[data-assistant-theme="modern"] body.widget-embed .persona-copy h1 em {
    margin-top: 7px !important;
    font-size: .38em !important;
  }

  html body.widget-embed .persona-copy > p:last-child,
  html body.widget-embed .trust-row {
    display: none !important;
  }

  html body.widget-embed .persona-image-wrap,
  html[data-assistant-theme="modern"] body.widget-embed .persona-image-wrap {
    width: 55% !important;
    height: 112% !important;
    left: auto !important;
    right: -4% !important;
    bottom: -17px !important;
  }

  html body.widget-embed .assistant-panel {
    grid-row: 2;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    align-self: stretch;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  html body.widget-embed .panel-head,
  html body.widget-embed .progress-shell,
  html body.widget-embed .panel-footer {
    flex: 0 0 auto !important;
  }

  html body.widget-embed .panel-head {
    min-height: 62px !important;
    padding: 9px 17px !important;
  }

  html body.widget-embed .assistant-mini img {
    width: 38px !important;
    height: 38px !important;
  }

  html body.widget-embed .progress-shell {
    padding: 10px 17px 0 !important;
  }

  html body.widget-embed .progress-meta {
    margin-bottom: 7px !important;
  }

  html body.widget-embed .conversation-stage,
  html[data-assistant-theme="modern"] body.widget-embed .conversation-stage {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    padding: 16px 14px 20px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  html body.widget-embed .intro-card,
  html[data-assistant-theme="modern"] body.widget-embed .intro-card {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 10px !important;
    max-width: none !important;
    margin: 0 0 14px !important;
    padding: 0 0 14px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body.widget-embed .intro-icon,
  html[data-assistant-theme="modern"] body.widget-embed .intro-icon {
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    font-size: 18px !important;
  }

  html body.widget-embed .intro-kicker {
    margin: 0 0 4px !important;
    font-size: 9px !important;
  }

  html body.widget-embed .intro-card h2,
  html[data-assistant-theme="modern"] body.widget-embed .intro-card h2 {
    margin: 0 !important;
    font-size: clamp(23px, 7vw, 27px) !important;
    line-height: 1.05 !important;
  }

  html body.widget-embed .intro-card p {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  html body.widget-embed .service-grid,
  html[data-assistant-theme="modern"] body.widget-embed .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    max-width: none !important;
  }

  html body.widget-embed .trade-service-group {
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  html body.widget-embed .service-card,
  html[data-assistant-theme="modern"] body.widget-embed .service-card {
    min-width: 0 !important;
    min-height: 78px !important;
    padding: 10px !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: center !important;
    border-radius: 16px !important;
  }

  html body.widget-embed .service-icon,
  html[data-assistant-theme="modern"] body.widget-embed .service-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    flex-basis: 34px !important;
    border-radius: 10px !important;
    font-size: 17px !important;
  }

  html body.widget-embed .service-copy {
    gap: 0 !important;
  }

  html body.widget-embed .service-copy strong {
    font-size: 11px !important;
    line-height: 1.22 !important;
    overflow-wrap: anywhere;
  }

  html body.widget-embed .service-copy small {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  html body.widget-embed .service-arrow {
    display: none !important;
  }

  html body.widget-embed .panel-footer {
    min-height: 0 !important;
    padding: 8px 17px calc(8px + env(safe-area-inset-bottom)) !important;
    gap: 5px !important;
  }
}

@media (max-width: 380px) and (max-height: 700px) {
  html body.widget-embed .assistant-shell {
    grid-template-rows: 150px minmax(0, 1fr) !important;
  }

  html body.widget-embed .service-card {
    min-height: 72px !important;
  }
}
