/* BioStudio AI — mobile UI components */

.mobile-sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 200000;
  pointer-events: none;
}

.mobile-sheet-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-sheet-wrap.show {
  pointer-events: auto;
  opacity: 1;
}

.mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.mobile-sheet {
  position: relative;
  max-height: 85dvh;
  background: var(--ios-grouped, #fff);
  border-radius: var(--ios-sheet-radius, 13px) var(--ios-sheet-radius, 13px) 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.mobile-sheet-wrap.show .mobile-sheet {
  transform: translateY(0);
}

.mobile-sheet-grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(60, 60, 67, 0.3);
  margin: 8px auto 4px;
}

.mobile-sheet-title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px 12px;
  border-bottom: 0.5px solid var(--ios-separator, rgba(60, 60, 67, 0.29));
}

.mobile-sheet-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 16px;
}

.mobile-nav-bar {
  background: var(--ios-grouped, #fff);
  border-bottom: 0.5px solid var(--ios-separator, rgba(60, 60, 67, 0.29));
}

.mobile-nav-row {
  display: flex;
  align-items: center;
  min-height: var(--ios-nav-h, 44px);
  padding: 0 8px;
}

.mobile-nav-back {
  border: none;
  background: none;
  color: var(--ios-accent, #0a84ff);
  font-size: 28px;
  line-height: 1;
  min-width: var(--ios-touch, 44px);
  min-height: var(--ios-touch, 44px);
  cursor: pointer;
}

.mobile-nav-back-spacer { width: 44px; }

.mobile-nav-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
}

.mobile-nav-large-title { display: none; }

.mobile-nav-bar.large-title .mobile-nav-title { visibility: hidden; }
.mobile-nav-bar.large-title .mobile-nav-large-title {
  display: block;
  font-size: 34px;
  font-weight: 700;
  padding: 0 16px 8px;
  letter-spacing: -0.4px;
}

.mobile-grouped-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-group-header {
  font-size: 13px;
  color: var(--ios-secondary, rgba(60, 60, 67, 0.6));
  text-transform: uppercase;
  padding: 0 16px 6px;
}

.mobile-group-body {
  background: var(--ios-grouped, #fff);
  border-radius: var(--ios-radius, 10px);
  overflow: hidden;
}

.mobile-cell {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--ios-touch, 44px);
  padding: 12px 16px;
  border: none;
  background: var(--ios-grouped, #fff);
  font-size: 17px;
  text-align: left;
  color: var(--ios-label, #000);
  border-bottom: 0.5px solid var(--ios-separator, rgba(60, 60, 67, 0.29));
  cursor: pointer;
}

.mobile-cell:last-child { border-bottom: none; }
.mobile-cell.destructive .mobile-cell-label { color: #ff3b30; }

.mobile-cell-label { flex: 1; }
.mobile-cell-value { color: var(--ios-secondary); font-size: 17px; margin-right: 6px; }
.mobile-cell-chevron { color: var(--ios-secondary); font-size: 20px; }

.mobile-segmented {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 8px;
  padding: 2px;
  margin: 8px 16px;
}

.mobile-segment {
  flex: 1;
  border: none;
  background: none;
  min-height: 32px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ios-label);
  cursor: pointer;
}

.mobile-segment.active {
  background: var(--ios-grouped, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.mobile-search-bar {
  padding: 8px 16px;
}

.mobile-search-input {
  width: 100%;
  min-height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.12);
  padding: 8px 12px;
  font-size: 16px;
}

.mobile-action-sheet {
  padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
}

.mobile-action-sheet-group {
  background: var(--ios-grouped, #fff);
  border-radius: var(--ios-radius, 10px);
  overflow: hidden;
  margin-bottom: 8px;
}

.mobile-action-item {
  display: block;
  width: 100%;
  min-height: 56px;
  border: none;
  background: var(--ios-grouped, #fff);
  font-size: 20px;
  color: var(--ios-accent);
  border-bottom: 0.5px solid var(--ios-separator);
  cursor: pointer;
}

.mobile-action-item.destructive { color: #ff3b30; }
.mobile-action-cancel {
  display: block;
  width: 100%;
  min-height: 56px;
  border: none;
  background: var(--ios-grouped, #fff);
  border-radius: var(--ios-radius, 10px);
  font-size: 20px;
  font-weight: 600;
  color: var(--ios-accent);
  cursor: pointer;
}

.mobile-gate-sheet {
  position: relative;
  background: var(--ios-grouped, #fff);
  border-radius: var(--ios-sheet-radius, 13px) var(--ios-sheet-radius, 13px) 0 0;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.mobile-sheet-wrap.show .mobile-gate-sheet { transform: translateY(0); }

.mobile-gate-icon { font-size: 48px; margin-bottom: 12px; }
.mobile-gate-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.mobile-gate-body { font-size: 15px; color: var(--ios-secondary); line-height: 1.5; margin-bottom: 20px; }

.mobile-gate-primary,
.mobile-gate-secondary {
  display: block;
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  cursor: pointer;
}

.mobile-gate-primary {
  border: none;
  background: var(--ios-accent, #0a84ff);
  color: #fff;
}

.mobile-gate-secondary {
  border: none;
  background: rgba(118, 118, 128, 0.12);
  color: var(--ios-label);
}

.mobile-readonly-banner {
  background: rgba(255, 149, 0, 0.15);
  color: #c93400;
  font-size: 13px;
  padding: 8px 12px;
  text-align: center;
  border-bottom: 0.5px solid rgba(255, 149, 0, 0.3);
}

.mobile-ptr-indicator {
  text-align: center;
  font-size: 13px;
  color: var(--ios-secondary);
  padding: 8px;
  transform: translateY(-100%);
  transition: transform 0.15s ease;
}

.mobile-ptr-indicator.ready { color: var(--ios-accent); }
