@media (max-width: 768px) {
  .m-agent-page {
    background:
      radial-gradient(circle at 10% 0%, rgba(8, 119, 232, 0.12), transparent 34%),
      linear-gradient(180deg, #edf6ff 0%, #f6f9fd 46%, #f7fbff 100%);
  }

  .m-agent-hero {
    padding: 18px 14px 8px;
  }

  .m-agent-hero.compact {
    padding-top: 14px;
  }

  .m-agent-hero span {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eaf4ff;
    color: #0877e8;
    font-weight: 800;
    font-size: 12px;
  }

  .m-agent-hero h1 {
    margin: 0 0 8px;
    color: #071326;
    font-size: 29px;
    font-weight: 900;
    letter-spacing: 0;
  }

  .m-agent-hero p {
    margin: 0;
    color: #556273;
    font-size: 14px;
    line-height: 1.6;
  }

  .m-create-path-grid,
  .m-model-choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 12px 14px;
  }

  .m-model-choice-grid.compact {
    grid-template-columns: 1fr 1fr;
    padding: 0;
    gap: 10px;
  }

  .m-create-path-card,
  .m-model-card,
  .m-single-input-card,
  .m-quick-create-card,
  .m-provider-panel,
  .m-create-summary-card,
  .m-owned-agent-card,
  .m-agent-empty-card,
  .m-import-error-card {
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  }

  .m-create-path-card,
  .m-model-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 138px;
    padding: 18px;
    text-align: left;
    color: #101828;
  }

  .m-create-path-card strong,
  .m-model-card strong {
    font-size: 20px;
    font-weight: 900;
  }

  .m-create-path-card small,
  .m-model-card small {
    color: #667085;
    font-size: 14px;
    line-height: 1.45;
  }

  .m-create-path-icon,
  .m-model-card span {
    display: inline-grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 18px;
  }

  .m-create-path-icon .m-icon,
  .m-model-card .m-icon {
    width: 30px;
    height: 30px;
  }

  .m-create-path-icon.blue,
  .m-model-card.active span {
    background: #eaf4ff;
  }

  .m-create-path-icon.gold {
    background: #fff4df;
  }

  .m-model-card {
    min-height: 118px;
  }

  .m-model-card.active {
    border-color: rgba(8, 119, 232, 0.45);
    background: linear-gradient(135deg, #f7fbff, #eaf4ff);
  }

  .m-single-input-card,
  .m-quick-create-card,
  .m-provider-panel,
  .m-create-summary-card,
  .m-import-error-card {
    margin: 12px 14px;
    padding: 16px;
  }

  .m-agent-input,
  .m-agent-textarea,
  .m-agent-select {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid rgba(8, 119, 232, 0.16);
    border-radius: 16px;
    background: #f8fbff;
    color: #101828;
    font: inherit;
    font-size: 16px;
    outline: none;
  }

  .m-agent-input,
  .m-agent-select {
    height: 52px;
    padding: 0 14px;
  }

  .m-agent-textarea {
    min-height: 168px;
    padding: 14px;
    line-height: 1.6;
    resize: vertical;
  }

  .m-agent-textarea.large {
    min-height: 260px;
  }

  .m-agent-textarea.small {
    min-height: 96px;
    margin-bottom: 12px;
  }

  .m-agent-field-label {
    display: block;
    margin: 14px 0 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
  }

  .m-skip-button {
    margin-top: 12px;
    color: #0877e8;
    font-weight: 800;
  }

  .m-bottom-action.two {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 10px;
  }

  .m-primary-button,
  .m-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 900;
  }

  .m-primary-button {
    background: linear-gradient(135deg, #0877e8, #0066cc);
    color: #fff;
    box-shadow: 0 12px 24px rgba(8, 119, 232, 0.2);
  }

  .m-bottom-action .m-primary-button:not(:disabled) {
    background: linear-gradient(135deg, #0877e8, #0066cc);
    color: #fff;
    box-shadow: 0 14px 28px rgba(8, 119, 232, 0.24);
  }

  .m-secondary-button {
    border: 1px solid rgba(8, 119, 232, 0.16);
    background: #f4f9ff;
    color: #0877e8;
  }

  .m-primary-button:disabled,
  .m-secondary-button:disabled,
  .m-primary-button.disabled {
    opacity: 0.55;
    filter: grayscale(0.1);
  }

  .m-quick-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  .m-import-error-card {
    border-color: rgba(239, 68, 68, 0.22);
    background: #fff7f7;
  }

  .m-import-error-card strong {
    display: block;
    color: #991b1b;
    font-size: 17px;
    font-weight: 900;
  }

  .m-import-error-card p,
  .m-import-error-card small {
    display: block;
    margin: 8px 0 12px;
    color: #7f1d1d;
    line-height: 1.5;
  }

  .m-segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px;
    border-radius: 16px;
    background: #eef6ff;
  }

  .m-segmented button {
    min-height: 42px;
    border-radius: 12px;
    color: #667085;
    font-weight: 850;
  }

  .m-segmented button.active {
    background: #fff;
    color: #0877e8;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  }

  .m-agent-soft-copy {
    margin: 10px 0;
    color: #667085;
    line-height: 1.55;
  }

  .m-create-summary-card {
    background: linear-gradient(145deg, #ffffff, #eff8ff);
  }

  .m-create-summary-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }

  .m-create-summary-head span {
    display: inline-grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 18px;
    background: #eaf4ff;
  }

  .m-create-summary-head strong {
    font-size: 22px;
    font-weight: 950;
  }

  .m-create-summary-card p {
    color: #344054;
    line-height: 1.6;
  }

  .m-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
  }

  .m-summary-chips span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef6ff;
    color: #0877e8;
    font-size: 12px;
    font-weight: 800;
  }

  .m-agent-list {
    display: grid;
    gap: 14px;
    padding: 0 14px 92px;
  }

  .m-owned-agent-card {
    padding: 15px;
  }

  .m-owned-agent-card.open {
    border-color: rgba(8, 119, 232, 0.28);
  }

  .m-owned-agent-main {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    align-items: start;
  }

  .m-owned-agent-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .m-owned-agent-title strong {
    min-width: 0;
    overflow: hidden;
    color: #101828;
    font-size: 19px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .m-owned-agent-title span {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eafaf0;
    color: #16803a;
    font-size: 12px;
    font-weight: 900;
  }

  .m-owned-agent-title span.warn {
    background: #fff4df;
    color: #a45809;
  }

  .m-owned-agent-main p {
    display: -webkit-box;
    margin: 8px 0;
    overflow: hidden;
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .m-owned-agent-main small {
    color: #0877e8;
    font-weight: 800;
  }

  .m-owned-agent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  .m-agent-settings-panel {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(16, 24, 40, 0.08);
  }

  .m-agent-settings-panel h3 {
    margin: 10px 0;
    color: #101828;
    font-size: 17px;
    font-weight: 950;
  }

  .m-agent-advanced {
    margin: 10px 0 14px;
    padding: 13px;
    border: 1px dashed rgba(8, 119, 232, 0.22);
    border-radius: 16px;
    background: #f8fbff;
  }

  .m-agent-advanced summary {
    color: #0877e8;
    font-weight: 900;
  }

  .m-agent-advanced p {
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    color: #344054;
    font-size: 12px;
    line-height: 1.6;
  }

  .m-floating-create {
    position: fixed;
    right: 14px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 5;
    padding: 13px 16px;
    border-radius: 999px;
    background: #071326;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2);
  }

  .m-agent-empty-card {
    margin: 18px 14px;
    padding: 24px 18px;
    text-align: center;
  }

  .m-agent-empty-icon {
    display: inline-grid;
    width: 62px;
    height: 62px;
    margin-bottom: 12px;
    place-items: center;
    border-radius: 20px;
    background: #eaf4ff;
  }

  .m-agent-empty-icon .m-icon {
    width: 32px;
    height: 32px;
  }

  .m-agent-empty-card h1,
  .m-agent-empty-card h2 {
    margin: 0 0 10px;
    color: #101828;
    font-size: 23px;
    font-weight: 950;
  }

  .m-agent-empty-card p {
    margin: 0 0 18px;
    color: #667085;
    line-height: 1.55;
  }

  .m-mobile-toast {
    position: fixed;
    left: 50%;
    bottom: calc(105px + env(safe-area-inset-bottom));
    z-index: 10000;
    max-width: min(310px, calc(100vw - 40px));
    transform: translateX(-50%);
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(7, 19, 38, 0.9);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.2);
  }
}
