/* Mobile layout: readable content, useful touch targets, and full-width sheets. */
@media (max-width: 620px) {
  .shell, .public-home, .landing-main { min-width: 0; max-width: 100%; }

  .topbar, .landing-topbar {
    height: 64px;
    padding-inline: 10px;
    gap: 6px;
  }
  .header-actions { gap: 6px; min-width: 0; }
  .topbar .wordmark { font-size: 15px !important; }
  .landing-brand { font-size: 16px; white-space: nowrap; }
  .topbar .language-control, .landing-topbar .language-control {
    height: 44px;
    padding-inline: 5px;
    box-shadow: none;
  }
  .language-control .language-select { min-width: 47px; height: 42px; font-size: 12px; }
  .topbar .account-button { min-height: 44px; padding-inline: 8px; }
  .topbar .account-label { font-size: 11px; }
  .landing-login { min-height: 44px; }

  .shell > main { padding: 24px 16px calc(106px + env(safe-area-inset-bottom)); }
  .hero h1 {
    max-width: 100%;
    margin: 6px 0 16px;
    font-size: clamp(30px, 8vw, 38px);
    line-height: 1.13;
    overflow-wrap: anywhere;
  }
  .lead { margin: 0; font-size: 14px; line-height: 1.55; }
  .capture { margin: 24px 0 40px; padding: 16px; }
  .capture-row { height: 60px; min-width: 0; gap: 8px; padding: 5px 5px 5px 12px; }
  .capture .link-icon { display: none; }
  .capture input { min-width: 0; font-size: 16px; }
  .capture .send { width: 48px; height: 48px; font-size: 24px; }
  .capture-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .capture-actions .text-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 48px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }
  .capture .capture-hint { margin: 14px 0 0; font-size: 11px; line-height: 1.5; }
  .capture .demo-link { display: inline-flex; align-items: center; min-height: 44px; padding: 7px 0; }

  .section-head { gap: 8px; margin-bottom: 22px; }
  .section-head h2 { font-size: 24px; }
  .section-head .text-btn { min-height: 44px; padding: 8px 0 8px 8px; }
  .filters { overflow: visible; padding-bottom: 0; }
  .filters button { min-height: 44px; font-size: 11px; }
  .saved-row { min-width: 0; }
  .saved-row-main, .saved-row-end { min-width: 0; }

  .library-view .back { min-height: 44px; margin-bottom: 12px; }
  .library-view h1 {
    max-width: 100%;
    margin: 12px 0 20px;
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1.14;
    overflow-wrap: anywhere;
  }
  .search { height: 52px; margin: 18px 0 22px; }
  .search input { min-width: 0; font-size: 16px; }
  .library-toolbar { gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
  .library-toolbar select, .library-toolbar .text-btn { min-height: 44px; }
  .library-toolbar .text-btn { padding: 8px; }

  .bottom-nav {
    height: calc(70px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 4px 6px env(safe-area-inset-bottom);
  }
  .bottom-nav button {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    line-height: 1.1;
  }
  .bottom-nav button span { font-size: 20px; }
  .bottom-nav .add-mobile { width: 52px; height: 52px; min-height: 52px; transform: translateY(-7px); }

  dialog.sheet {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    margin: 0;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }
  .sheet h2 { font-size: 22px; }
  .sheet .close { min-width: 44px; min-height: 44px; }
  .edit-form { gap: 14px; margin-top: 18px; }
  .edit-form input, .edit-form select, .edit-form textarea { min-height: 48px; font-size: 16px; }
  .edit-form textarea { min-height: 96px; }
  .primary { min-height: 52px; }
  .form-row { min-width: 0; }

  .landing-hero { padding: 30px 16px 48px; }
  .landing-copy h1 { font-size: clamp(32px, 8.5vw, 38px); line-height: 1.08; overflow-wrap: anywhere; }
  .landing-actions { gap: 10px; }
  .landing-primary { height: 56px; }
  .landing-secondary { display: grid; place-items: center; min-height: 44px; }
  .landing-how, .inside-section, .login-section { padding: 56px 16px; }
  .landing-section-head h2, .inside-section h2, .login-copy h2 { font-size: 27px; overflow-wrap: anywhere; }
  .public-home .auth-card { padding: 22px 18px; }
  .auth-card input { font-size: 16px; }
}

@media (max-width: 380px) {
  .topbar .wordmark { font-size: 14px !important; }
  .topbar .account-label { font-size: 10px; }
  .category-head > span { display: none; }
  .bottom-nav button { font-size: 9px; }
}

@media (max-width: 430px) {
  .form-row, .plan-fields { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
