.touch-app,
.touch-customer-workspace {
  display: none;
}

@media (max-width: 760px) {
  body {
    background: #eef2f0;
    overscroll-behavior-y: none;
  }

  .app-frame {
    display: block;
    min-height: 100dvh;
  }

  .workspace {
    display: none;
  }

  .touch-app {
    display: block;
    min-height: 100dvh;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    background: #eef2f0;
  }

  .touch-app[hidden],
  .touch-customer-workspace[hidden] {
    display: none !important;
  }

  .touch-topbar {
    position: sticky;
    top: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(64px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
    border-bottom: 1px solid rgba(207, 218, 212, .88);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(18px);
  }

  .touch-user {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
  }

  .touch-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #1f6a4d;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
  }

  .touch-user-copy {
    min-width: 0;
  }

  .touch-kicker {
    color: #75817b;
    font-size: 11px;
    line-height: 1.3;
  }

  .touch-user-name {
    overflow: hidden;
    color: #17231e;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .touch-icon-button {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #355047;
    touch-action: manipulation;
  }

  .touch-icon-button:active {
    background: #e6eeea;
  }

  .touch-icon-button .icon {
    width: 21px;
    height: 21px;
  }

  .touch-main {
    width: 100%;
  }

  .touch-screen {
    display: none;
    padding: 18px 14px 26px;
  }

  .touch-screen.active {
    display: block;
  }

  .touch-screen-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: 0 2px 16px;
  }

  .touch-screen-head > div {
    min-width: 0;
    flex: 1 1 auto;
  }

  .touch-screen-head .touch-action {
    width: auto;
    min-width: max-content;
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 14px;
  }

  .touch-screen-title {
    margin: 0;
    color: #17231e;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
  }

  .touch-screen-subtitle {
    margin: 4px 0 0;
    color: #68766f;
    font-size: 13px;
    line-height: 1.5;
  }

  .touch-screen-subtitle:has(.touch-summary-segment) {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
  }

  .touch-summary-segment {
    white-space: nowrap;
  }

  .touch-sync-button {
    width: auto;
    min-height: 36px;
    flex: 0 0 auto;
    border: 1px solid #d7dfdb;
    background: #fff;
    color: #5e6c65;
    font: inherit;
    font-size: 11px;
    touch-action: manipulation;
  }

  .touch-sync-button.connection-offline {
    border-color: #ddb0aa;
    color: #a3372d;
  }

  .touch-section {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid #d8e0dc;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(31, 54, 45, .045);
  }

  .touch-lead-priority.has-pending {
    border-color: #dfbd82;
    box-shadow: 0 4px 14px rgba(126, 78, 12, .09);
  }

  .touch-lead-priority.has-pending .touch-section-head {
    border-bottom-color: #ead4ad;
    background: #fff8eb;
  }

  .touch-lead-priority.has-pending .touch-section-title {
    color: #66400c;
  }

  .touch-section-head {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid #e3e9e6;
  }

  .touch-section-title {
    color: #1c2924;
    font-size: 15px;
    font-weight: 800;
  }

  .touch-section-note {
    margin-top: 2px;
    color: #7a8781;
    font-size: 11px;
    line-height: 1.4;
  }

  .touch-text-button {
    min-height: 44px;
    border: 0;
    background: transparent;
    color: #1f6a4d;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    touch-action: manipulation;
  }

  .touch-list {
    display: grid;
  }

  .touch-inbox-cta {
    width: calc(100% - 28px);
    margin: 2px 14px 14px;
  }

  .touch-empty {
    padding: 24px 16px;
    color: #718079;
    font-size: 13px;
    line-height: 1.65;
    text-align: left;
  }

  .touch-card {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 0;
    border-bottom: 1px solid #e4eae7;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    touch-action: manipulation;
  }

  .touch-card:last-child {
    border-bottom: 0;
  }

  .touch-card:active {
    background: #f1f6f3;
  }

  .touch-card-main {
    min-width: 0;
  }

  .touch-card-title {
    color: #17231e;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
    text-wrap: pretty;
    word-break: auto-phrase;
  }

  .touch-card-meta,
  .touch-card-copy {
    margin-top: 5px;
    color: #6c7973;
    font-size: 12px;
    line-height: 1.55;
    text-align: left;
    text-wrap: pretty;
    word-break: auto-phrase;
  }

  .touch-card-copy {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .touch-card-side {
    display: grid;
    justify-items: end;
    gap: 8px;
  }

  .touch-card-side .icon {
    color: #7b8982;
  }

  .touch-action-card {
    display: block;
    padding: 14px;
    border-bottom: 1px solid #e4eae7;
  }

  .touch-action-card:last-child {
    border-bottom: 0;
  }

  .touch-today-lead {
    padding: 11px 14px;
  }

  .touch-today-lead-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 5px;
    color: #6c7973;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
  }

  .touch-today-lead-meta > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .touch-today-lead-meta .pill {
    flex: 0 0 auto;
  }

  .touch-today-lead .touch-card-actions {
    margin-top: 8px;
  }

  .touch-today-lead .touch-card-actions .touch-action {
    min-height: 42px;
  }

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

  .touch-action-row > .pill {
    flex: 0 0 auto;
    justify-self: start;
  }

  .touch-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .touch-card-actions:has(> :only-child) {
    grid-template-columns: 1fr;
  }

  .touch-action,
  .touch-card-actions .small-btn,
  .touch-card-actions .mini-select {
    min-height: 48px;
    width: 100%;
    border-radius: 7px;
    font-size: 14px;
    touch-action: manipulation;
  }

  .touch-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #cfdad4;
    background: #fff;
    color: #27483b;
    font-weight: 750;
    text-decoration: none;
  }

  .touch-action.primary {
    border-color: #1f6a4d;
    background: #1f6a4d;
    color: #fff;
  }

  .touch-action.warn {
    border-color: #d3a052;
    background: #fff6e7;
    color: #8f5f13;
  }

  .touch-action.danger {
    border-color: #d49a92;
    background: #fff3f1;
    color: #a3372d;
  }

  .touch-search {
    position: relative;
    margin-bottom: 10px;
  }

  .touch-search .icon {
    position: absolute;
    top: 15px;
    left: 14px;
    width: 19px;
    height: 19px;
    color: #718079;
    pointer-events: none;
  }

  .touch-search input {
    width: 100%;
    min-height: 50px;
    border: 1px solid #ccd7d1;
    border-radius: 8px;
    background: #fff;
    padding: 0 14px 0 44px;
    color: #17231e;
    font: inherit;
    font-size: 16px;
  }

  .touch-filter-strip {
    display: flex;
    gap: 8px;
    margin: 0 -14px 12px;
    padding: 0 14px 3px;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .touch-filter-strip.can-scroll:not(.at-end) {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent 100%);
  }

  .touch-filter-strip::-webkit-scrollbar {
    display: none;
  }

  .touch-filter-chip {
    min-width: max-content;
    min-height: 44px;
    border: 1px solid #ccd7d1;
    border-radius: 999px;
    background: #fff;
    padding: 0 16px;
    color: #52625a;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    touch-action: manipulation;
  }

  .touch-filter-chip.active {
    border-color: #1f6a4d;
    background: #e8f2ed;
    color: #17553d;
  }

  .touch-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }

  .touch-summary {
    min-height: 74px;
    display: grid;
    align-content: center;
    gap: 3px;
    border: 1px solid #d8e0dc;
    border-radius: 8px;
    background: #fff;
    padding: 11px;
  }

  .touch-summary span {
    color: #75817b;
    font-size: 10px;
  }

  .touch-summary strong {
    color: #17231e;
    font-size: 22px;
    font-variant-numeric: tabular-nums;
  }

  .mobile-bottom-nav {
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 0 5px env(safe-area-inset-bottom);
  }

  .mobile-nav-button {
    min-height: 54px;
    font-size: 11px;
    touch-action: manipulation;
  }

  .mobile-nav-button .icon {
    width: 22px;
    height: 22px;
  }

  .mobile-nav-create .mobile-create-icon {
    width: 46px;
    height: 46px;
    margin-top: -20px;
  }

  .mobile-nav-badge {
    top: 8px;
    font-size: 10px;
  }

  .mobile-nav-badge.mobile-work-badge {
    background: #a66b13;
  }

  .touch-customer-workspace {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    background: #eef2f0;
  }

  .touch-customer-header {
    min-height: calc(62px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    padding: env(safe-area-inset-top) 8px 0;
    border-bottom: 1px solid #d8e0dc;
    background: #fff;
  }

  .touch-customer-heading {
    min-width: 0;
    text-align: center;
  }

  #touchCustomerBackBtn .icon {
    transform: rotate(180deg);
  }

  .touch-customer-name {
    width: 100%;
    display: -webkit-box;
    overflow: hidden;
    border: 0;
    background: transparent;
    padding: 0;
    color: #17231e;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    text-wrap: pretty;
    word-break: auto-phrase;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .touch-customer-status {
    margin-top: 2px;
    color: #718079;
    font-size: 11px;
  }

  .touch-customer-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid #d8e0dc;
    background: #fff;
  }

  .touch-customer-tab {
    position: relative;
    min-height: 50px;
    border: 0;
    background: transparent;
    color: #67756e;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    touch-action: manipulation;
  }

  .touch-customer-tab.active {
    color: #1f6a4d;
  }

  .touch-customer-tab.active::after {
    position: absolute;
    right: 20%;
    bottom: 0;
    left: 20%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #1f6a4d;
    content: "";
  }

  .touch-customer-body {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 14px;
  }

  .touch-customer-overview {
    margin-bottom: 12px;
    border: 1px solid #d8e0dc;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
  }

  .touch-customer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .touch-customer-primary-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #d8e0dc;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -8px 22px rgba(31, 54, 45, .08);
  }

  .touch-customer-primary-actions .touch-action {
    min-width: 0;
    padding: 0 6px;
    font-size: 14px;
  }

  .touch-contact-actions {
    display: grid;
    gap: 7px;
    margin-top: 10px;
  }

  .touch-contact-link {
    width: 100%;
    min-height: 44px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 1px solid #d8e0dc;
    border-radius: 7px;
    background: #f8faf9;
    padding: 8px 11px;
    color: #285845;
    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
  }

  .touch-contact-link .icon {
    width: 18px;
    height: 18px;
  }

  .touch-contact-link span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .touch-contact-link small {
    color: #718079;
    font-size: 11px;
  }

  .mobile-action-group {
    display: grid;
    gap: 7px;
  }

  .mobile-action-group + .mobile-action-group {
    margin-top: 7px;
    padding-top: 13px;
    border-top: 1px solid #e0e6e3;
  }

  .mobile-action-group-title {
    padding: 0 3px 2px;
    color: #748079;
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-decision-form {
    display: grid;
    gap: 14px;
  }

  .touch-full-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    padding: 0;
    background: #eef2f0;
  }

  .touch-full-dialog::backdrop {
    background: rgba(17, 31, 25, .5);
  }

  .touch-dialog-frame {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .touch-dialog-head {
    min-height: calc(62px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    padding: env(safe-area-inset-top) 8px 0;
    border-bottom: 1px solid #d8e0dc;
    background: #fff;
  }

  .touch-dialog-title {
    color: #17231e;
    font-size: 17px;
    font-weight: 800;
    text-align: center;
  }

  .touch-dialog-body {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 16px 14px 24px;
  }

  .touch-form {
    display: grid;
    gap: 13px;
  }

  .touch-field {
    display: grid;
    gap: 6px;
  }

  .touch-field label {
    color: #46564e;
    font-size: 12px;
    font-weight: 750;
  }

  .touch-field input,
  .touch-field select,
  .touch-field textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid #cbd7d1;
    border-radius: 7px;
    background: #fff;
    padding: 11px 12px;
    color: #17231e;
    font: inherit;
    font-size: 16px;
  }

  .touch-field textarea {
    min-height: 112px;
    resize: vertical;
  }

  .touch-dialog-actions {
    display: grid;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #d8e0dc;
    background: #fff;
  }

  .touch-dialog-actions .touch-action {
    min-height: 50px;
  }

  .touch-inline-result {
    display: none;
    border: 1px solid #e0c48f;
    border-radius: 7px;
    background: #fff8ea;
    padding: 12px;
    color: #72511b;
    font-size: 13px;
    line-height: 1.6;
  }

  .touch-inline-result.show {
    display: block;
  }

  .touch-secondary-block {
    margin-top: 14px;
    border: 1px solid #d8e0dc;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
  }

  .touch-secondary-title {
    margin-bottom: 10px;
    color: #26362f;
    font-size: 13px;
    font-weight: 800;
  }

  .touch-team-member {
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid #e4eae7;
    background: #fff;
    text-align: left;
  }

  .touch-team-member:last-child,
  .touch-team-customer:last-child,
  .touch-team-activity:last-child {
    border-bottom: 0;
  }

  .touch-team-member.active {
    background: #e8f3ed;
    box-shadow: inset 4px 0 0 #2f7555;
  }

  .touch-team-member-name,
  .touch-team-customer-name,
  .touch-team-activity-action {
    color: #17231e;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
    text-wrap: pretty;
    word-break: auto-phrase;
  }

  .touch-team-member-meta,
  .touch-team-customer-meta,
  .touch-team-activity-meta {
    margin-top: 4px;
    color: #6c7973;
    font-size: 11px;
    line-height: 1.55;
    text-align: left;
  }

  .touch-team-count {
    min-width: 34px;
    min-height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #eef2f0;
    color: #355047;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
  }

  .touch-team-customer {
    min-height: 78px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 11px 12px 11px 4px;
    border-bottom: 1px solid #e4eae7;
    background: #fff;
  }

  .touch-team-customer.selected {
    background: #edf6f1;
  }

  .touch-team-check-label {
    width: 48px;
    min-height: 48px;
    display: grid;
    place-items: center;
  }

  .touch-team-check {
    width: 22px;
    height: 22px;
    accent-color: #2f7555;
  }

  .touch-team-open {
    min-width: 48px;
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: #eef4f1;
    color: #1f6a4d;
    font-weight: 800;
  }

  .touch-team-batch {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-top: 1px solid #e3e9e6;
    background: #f7faf8;
  }

  .touch-team-batch-summary {
    color: #66746d;
    font-size: 12px;
    line-height: 1.55;
  }

  .touch-team-field {
    display: grid;
    gap: 6px;
    color: #46564e;
    font-size: 12px;
    font-weight: 750;
  }

  .touch-team-field select,
  .touch-team-field textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid #cbd7d1;
    border-radius: 7px;
    background: #fff;
    padding: 11px 12px;
    color: #17231e;
    font: inherit;
    font-size: 16px;
  }

  .touch-team-field textarea {
    min-height: 88px;
    resize: vertical;
  }

  .touch-team-activity {
    width: 100%;
    min-height: 72px;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid #e4eae7;
    background: #fff;
  }
}

@media (pointer: coarse) {
  button,
  a,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }
}
