.mobile-info-link,
.mobile-account-link,
.mobile-app-status,
.mobile-app-nav,
.mobile-drawer,
.mobile-save-tabs {
  display: none;
}

.cloud-pattern-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(66, 211, 107, .24);
  border-radius: 14px;
  background: rgba(10, 19, 16, .56);
}

.cloud-pattern-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cloud-pattern-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.cloud-pattern-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cloud-pattern-state.is-signed-in {
  border-color: rgba(66, 211, 107, .42);
  color: #a9ffbd;
}

.cloud-pattern-signed-out,
.cloud-pattern-signed-in {
  margin-top: 11px;
}

.cloud-pattern-signed-out p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.cloud-pattern-controls {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.cloud-pattern-controls label {
  color: var(--dim);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cloud-pattern-controls label span {
  display: block;
  margin-top: 2px;
  font-size: 8px;
  font-weight: 800;
}

.cloud-pattern-controls input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #0f1318;
  color: var(--text);
  font: inherit;
}

.cloud-pattern-actions {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.cloud-pattern-message {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.cloud-pattern-message.is-working { color: #cbd6e4; }
.cloud-pattern-message.is-success { color: #9fffb4; }
.cloud-pattern-message.is-error { color: #ff9aa3; }

.cloud-pattern-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.cloud-pattern-item {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(6, auto);
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(0, 0, 0, .15);
}

.cloud-pattern-item.is-current {
  border-color: rgba(66, 211, 107, .45);
  background: rgba(66, 211, 107, .06);
}

.cloud-pattern-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.cloud-pattern-main strong,
.cloud-pattern-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-pattern-main strong {
  color: var(--text);
  font-size: 12px;
}

.cloud-pattern-main span {
  color: var(--muted);
  font-size: 10px;
}

.cloud-pattern-delete {
  border-color: rgba(255, 62, 76, .35) !important;
  color: #ffb1b7 !important;
}

.mobile-save-tabs {
  margin-bottom: 9px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mobile-save-tab {
  min-height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #11161c;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.mobile-save-tab.active {
  border-color: rgba(66, 211, 107, .48);
  background: rgba(66, 211, 107, .1);
  color: #b7ffc6;
}

@media (max-width: 980px) {
  .cloud-pattern-item {
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  }

  .cloud-pattern-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px),
       (max-width: 1024px) and (max-height: 620px) and (orientation: landscape) {
  html.rhythm-mobile-app,
  html.rhythm-mobile-app body {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  body.rhythm-mobile-app {
    position: relative;
    min-height: var(--sol-mobile-viewport-height, 100svh);
  }

  body.rhythm-mobile-app .rhythm-shell {
    width: 100%;
    max-width: none;
    height: var(--sol-mobile-viewport-height, 100svh);
    min-height: 0;
    box-sizing: border-box;
    margin: 0;
    padding:
      max(6px, env(safe-area-inset-top))
      6px
      calc(122px + env(safe-area-inset-bottom)) !important;
    display: grid !important;
    grid-template-rows: 46px 38px minmax(0, 1fr);
    gap: 6px !important;
    overflow: hidden !important;
  }

  body.rhythm-mobile-app .rhythm-shell > .site-nav {
    grid-row: 1;
    position: relative !important;
    inset: auto !important;
    z-index: 240;
    min-height: 0 !important;
    height: 46px;
    margin: 0 !important;
    padding: 7px 9px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center;
    gap: 7px;
    border-radius: 13px !important;
  }

  body.rhythm-mobile-app .site-brand {
    min-width: 0;
    font-size: 20px !important;
    line-height: 1 !important;
  }

  body.rhythm-mobile-app .site-links,
  body.rhythm-mobile-app.mobile-nav-open .site-links {
    display: none !important;
  }

  body.rhythm-mobile-app .mobile-info-link,
  body.rhythm-mobile-app .mobile-account-link {
    display: inline-flex;
    box-sizing: border-box;
    height: 32px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: #11161c;
    color: #dce5f0;
    appearance: none;
    font-family: inherit;
    font-size: 9px;
    font-weight: 1000;
    line-height: 1;
    letter-spacing: .07em;
    text-decoration: none;
    text-transform: uppercase;
  }

  body.rhythm-mobile-app .mobile-info-link {
    min-width: 44px;
  }

  body.rhythm-mobile-app .mobile-account-link {
    min-width: 62px;
  }

  body.rhythm-mobile-app .mobile-info-link.active,
  body.rhythm-mobile-app .mobile-account-link.is-signed-in,
  body.rhythm-mobile-app [data-mobile-panel].active {
    border-color: rgba(66, 211, 107, .48);
    color: #a9ffbd;
  }

  body.rhythm-mobile-app .mobile-account-link::before {
    content: '';
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: #8c98a8;
    box-shadow: 0 0 0 3px rgba(140, 152, 168, .1);
  }

  body.rhythm-mobile-app .mobile-account-link.is-signed-in::before {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(66, 211, 107, .12);
  }

  body.rhythm-mobile-app .mobile-app-status {
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    padding: 5px 9px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 11px;
    background: linear-gradient(180deg, #1b2129, #12171d);
    box-shadow: var(--inset);
  }

  body.rhythm-mobile-app .mobile-app-status > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
  }

  body.rhythm-mobile-app .mobile-app-status span,
  body.rhythm-mobile-app .mobile-app-status small {
    color: var(--dim);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  body.rhythm-mobile-app .mobile-app-status strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.rhythm-mobile-app .rhythm-hero,
  body.rhythm-mobile-app .app-transport,
  body.rhythm-mobile-app .quick-preset-panel:not(.mobile-drawer-content),
  body.rhythm-mobile-app .rhythm-disclosure-stack,
  body.rhythm-mobile-app .seo-section:not(.mobile-drawer-content),
  body.rhythm-mobile-app .related-tools:not(.mobile-drawer-content),
  body.rhythm-mobile-app .tool-feedback:not(.mobile-drawer-content),
  body.rhythm-mobile-app .site-footer,
  body.rhythm-mobile-app .tool-feedback-float {
    display: none !important;
  }

  body.rhythm-mobile-app .rhythm-app {
    display: contents !important;
  }

  body.rhythm-mobile-app .app-pattern {
    grid-row: 3;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 9px !important;
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    border-radius: 14px !important;
  }

  body.rhythm-mobile-app .app-pattern .pattern-head {
    flex: 0 0 auto;
    margin: 0 !important;
  }

  body.rhythm-mobile-app .app-pattern .pattern-head > div:first-child {
    display: none;
  }

  body.rhythm-mobile-app .legend-row {
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px !important;
  }

  body.rhythm-mobile-app .legend {
    min-width: 0;
    min-height: 30px;
    box-sizing: border-box;
    padding: 6px 4px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px !important;
    line-height: 1;
    text-align: center;
  }

  body.rhythm-mobile-app .pattern-ruler {
    flex: 0 0 auto;
    margin: 0 !important;
    gap: 4px !important;
  }

  body.rhythm-mobile-app .ruler-cell {
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c3d1;
    font-size: 12px !important;
    font-weight: 1000;
    line-height: 1;
  }

  body.rhythm-mobile-app .step-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: var(--rhythm-mobile-grid-height, 400px);
    align-content: stretch;
    grid-template-rows: repeat(var(--rhythm-mobile-rows, 2), minmax(64px, 1fr));
    grid-auto-rows: minmax(64px, 1fr);
    gap: 5px !important;
  }

  body.rhythm-mobile-app .step-button {
    min-width: 0;
    min-height: 54px !important;
    height: auto;
    padding: 8px 3px 4px;
    border-radius: 11px !important;
    font-size: clamp(17px, 5.5vw, 23px) !important;
  }

  body.rhythm-mobile-app .step-number {
    top: 3px;
    left: 4px;
    font-size: 7px;
  }

  body.rhythm-mobile-app .edit-toolbar {
    flex: 0 0 auto;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  body.rhythm-mobile-app .edit-toolbar .btn {
    min-width: 0;
    min-height: 38px !important;
    padding: 5px 3px !important;
    font-size: 9px !important;
    line-height: 1.1;
  }

  body.rhythm-mobile-app .mobile-sticky-transport {
    position: fixed !important;
    z-index: 250 !important;
    left: 6px !important;
    right: 6px !important;
    bottom: calc(58px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    height: 58px;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 6px 9px !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: stretch;
    gap: 5px !important;
    border-radius: 15px !important;
    background: linear-gradient(180deg, rgba(31, 36, 44, .98), rgba(13, 16, 20, .98)) !important;
  }

  body.rhythm-mobile-app .mobile-bpm-box,
  body.rhythm-mobile-app .mobile-step-box,
  body.rhythm-mobile-app .mobile-start-button,
  body.rhythm-mobile-app .mobile-tap-button {
    min-width: 0;
    height: 44px;
    min-height: 0;
    box-sizing: border-box;
    align-self: stretch;
    border-radius: 11px !important;
  }

  body.rhythm-mobile-app .mobile-bpm-box,
  body.rhythm-mobile-app .mobile-step-box {
    padding: 2px 3px !important;
  }

  body.rhythm-mobile-app .mobile-bpm-control {
    display: grid;
    grid-template-columns: 23px minmax(0, 1fr) 23px;
    align-items: center;
    gap: 2px;
    margin-top: 1px;
  }

  body.rhythm-mobile-app .mobile-bpm-button,
  body.rhythm-mobile-app .mobile-bpm-input {
    min-width: 0;
    height: 22px;
    box-sizing: border-box;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    font: inherit;
    font-weight: 1000;
    line-height: 1;
  }

  body.rhythm-mobile-app .mobile-bpm-button {
    padding: 0;
    background: #202733;
    color: #e8edf4;
    font-size: 16px;
    cursor: pointer;
  }

  body.rhythm-mobile-app .mobile-bpm-button:active {
    border-color: var(--green);
    background: #29343f;
  }

  body.rhythm-mobile-app .mobile-bpm-input {
    width: 100%;
    padding: 0 1px;
    background: #0b1015;
    color: var(--green);
    font-size: 17px;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
  }

  body.rhythm-mobile-app .mobile-bpm-input::-webkit-inner-spin-button,
  body.rhythm-mobile-app .mobile-bpm-input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
  }

  body.rhythm-mobile-app .mobile-bpm-input:focus {
    outline: 2px solid rgba(66, 211, 107, .45);
    outline-offset: 1px;
  }

  body.rhythm-mobile-app .mobile-step-box strong {
    font-size: 13px !important;
  }

  body.rhythm-mobile-app .mobile-start-button,
  body.rhythm-mobile-app .mobile-tap-button {
    min-width: 0;
  }

  body.rhythm-mobile-app .mobile-start-button {
    font-size: 16px !important;
  }

  body.rhythm-mobile-app .mobile-tap-button {
    font-size: 10px !important;
  }

  body.rhythm-mobile-app .mobile-app-nav {
    position: fixed;
    z-index: 251;
    left: 6px;
    right: 6px;
    bottom: max(6px, env(safe-area-inset-bottom));
    height: 46px;
    box-sizing: border-box;
    padding: 5px 9px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    border: 1px solid rgba(66, 211, 107, .28);
    border-radius: 14px;
    background: rgba(13, 18, 24, .98);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .42), var(--inset);
  }

  body.rhythm-mobile-app .mobile-panel-btn {
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: #171c23;
    color: #dce5f0;
    font: inherit;
    font-size: 8.5px;
    font-weight: 1000;
    letter-spacing: .04em;
    line-height: 1;
    white-space: nowrap;
  }

  body.rhythm-mobile-app .mobile-panel-btn.save-load {
    border-color: rgba(66, 211, 107, .38);
  }

  body.rhythm-mobile-app .mobile-drawer {
    position: fixed;
    z-index: 320;
    top: calc(max(6px, env(safe-area-inset-top)) + 52px);
    left: 6px;
    right: 6px;
    width: auto !important;
    box-sizing: border-box;
    margin: 0 !important;
    bottom: calc(58px + env(safe-area-inset-bottom));
    min-height: 0;
    padding: 0;
    display: grid;
    grid-template-rows: 46px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(66, 211, 107, .34);
    border-radius: 15px;
    background: rgba(13, 18, 24, .99);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .65), var(--inset);
  }

  body.rhythm-mobile-app .mobile-drawer[hidden] {
    display: none !important;
  }

  body.rhythm-mobile-app .mobile-drawer-head {
    min-width: 0;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--line-soft);
  }

  body.rhythm-mobile-app .mobile-drawer-head strong {
    color: var(--green);
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: .1em;
  }

  body.rhythm-mobile-app .mobile-drawer-head .btn {
    min-height: 30px !important;
    padding: 5px 10px !important;
    font-size: 9px !important;
  }

  body.rhythm-mobile-app .mobile-drawer-body {
    min-width: 0;
    min-height: 0;
    padding: 7px 8px 10px;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: auto;
  }

  body.rhythm-mobile-app .mobile-drawer-content,
  body.rhythm-mobile-app .mobile-drawer-content.tool-panel,
  body.rhythm-mobile-app .mobile-drawer-content.rhythm-disclosure {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0 !important;
    display: block !important;
  }

  body.rhythm-mobile-app .mobile-drawer .quick-preset-panel {
    display: none !important;
  }

  body.rhythm-mobile-app .mobile-drawer .rhythm-disclosure > summary {
    display: none;
  }

  body.rhythm-mobile-app .mobile-drawer .rhythm-disclosure > .disclosure-body {
    display: block !important;
    padding: 0 !important;
    border: 0;
  }

  body.rhythm-mobile-app .mobile-drawer .sub-panel {
    padding: 9px !important;
    border: 0;
    background: transparent;
  }

  body.rhythm-mobile-app .mobile-drawer .panel-title {
    margin-bottom: 8px;
    font-size: 16px;
  }

  body.rhythm-mobile-app .mobile-drawer .setup-grid,
  body.rhythm-mobile-app .mobile-drawer .practice-grid,
  body.rhythm-mobile-app .mobile-drawer .save-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.rhythm-mobile-app .mobile-drawer .quick-preset-grid,
  body.rhythm-mobile-app .mobile-drawer .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px !important;
  }

  body.rhythm-mobile-app [data-mobile-source='save'] .panel-title {
    display: none;
  }

  body.rhythm-mobile-app [data-mobile-source='save'] .browser-save-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.rhythm-mobile-app [data-mobile-source='save'] .browser-save-actions .btn {
    width: 100%;
  }

  body.rhythm-mobile-app [data-mobile-source='save'] .saved-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  body.rhythm-mobile-app [data-mobile-source='save'] .saved-item .btn {
    min-width: 66px;
    min-height: 36px !important;
    padding: 5px 8px !important;
  }

  body.rhythm-mobile-app .mobile-drawer .mobile-save-tabs {
    display: grid;
  }

  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='browser'] .backup-save-actions,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='browser'] .backup-save-hint,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='browser'] .cloud-pattern-box,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='cloud'] .browser-save-actions,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='cloud'] .browser-pattern-box,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='cloud'] .backup-save-actions,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='cloud'] .backup-save-hint,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='backup'] .browser-save-actions,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='backup'] .browser-pattern-box,
  body.rhythm-mobile-app [data-mobile-source='save'][data-mobile-save-view='backup'] .cloud-pattern-box {
    display: none !important;
  }

  body.rhythm-mobile-app .cloud-pattern-actions {
    grid-template-columns: 1fr;
  }

  body.rhythm-mobile-app .cloud-pattern-item {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.rhythm-mobile-app .cloud-pattern-main {
    grid-column: 1 / -1;
  }

  body.rhythm-mobile-app .cloud-pattern-item .btn {
    min-width: 0;
    min-height: 34px !important;
    padding: 5px 3px !important;
    font-size: 8.5px !important;
  }

  body.rhythm-mobile-app .mobile-drawer .seo-section,
  body.rhythm-mobile-app .mobile-drawer .related-tools,
  body.rhythm-mobile-app .mobile-drawer .tool-feedback {
    padding: 11px !important;
    border: 1px solid var(--line-soft);
    border-radius: 13px;
    background: #171c23;
  }

  body.rhythm-mobile-app.rhythm-drawer-open .mobile-sticky-transport {
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 390px) {
  body.rhythm-mobile-app .mobile-sticky-transport,
  body.rhythm-mobile-app .mobile-app-nav {
    left: 5px !important;
    right: 5px !important;
  }

  body.rhythm-mobile-app .mobile-bpm-control {
    grid-template-columns: 20px minmax(0, 1fr) 20px;
    gap: 1px;
  }

  body.rhythm-mobile-app .mobile-bpm-button {
    font-size: 14px;
  }

  body.rhythm-mobile-app .mobile-bpm-input {
    font-size: 15px;
  }

  body.rhythm-mobile-app .mobile-account-link {
    min-width: 58px;
    padding-inline: 7px;
  }

  body.rhythm-mobile-app .step-grid {
    max-height: var(--rhythm-mobile-grid-height, 400px);
  }

  body.rhythm-mobile-app .edit-toolbar .btn {
    font-size: 8px !important;
  }

  body.rhythm-mobile-app .mobile-panel-btn {
    font-size: 7.8px;
  }

  body.rhythm-mobile-app [data-mobile-source='save'] .saved-item {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(58px, auto));
  }

  body.rhythm-mobile-app [data-mobile-source='save'] .saved-item .btn {
    min-width: 58px;
    padding-inline: 5px !important;
  }
}
