.main-screen,
.device-settings-screen {
  max-width: none;
  padding: 0;
}

.b-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top, 0px);
  background: #1c1c1e;
  overflow: hidden;
}

.b-links {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding: 16px;
}

.b-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 12px;
  border: none;
  border-radius: 16px;
  background: #2c2c2e;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.b-link:hover {
  background: #333335;
}

.b-link:active {
  transform: scale(0.97);
}

.b-link-icon {
  width: 18px;
  height: 18px;
}

.b-app .ios-navbar__large-title {
  margin: 0 auto 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  text-align: center;
}

#add_device_button,
#device_back_btn,
.wizard-back {
  background: #2c2c2e !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  color: var(--ios-label, #fff);
}

.b-scroll {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 0 40px;
}

.b-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 4px;
  text-align: center;
}

.b-hero .status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ios-label-secondary, #8e8e93);
}

.b-hero .status .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ios-green, #30d158);
}

.b-hero .status.inactive .dot {
  background: var(--ios-red, #ff453a);
}

.b-hero .days {
  margin: 0;
  font-size: 60px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--ios-label, #fff);
}

.b-hero .days small {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}

.b-hero .expire {
  font-size: 15px;
  color: var(--ios-label-secondary, #8e8e93);
}

.b-hero .expire.blurred {
  filter: blur(5px);
}

.b-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.b-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 36px;
}

.b-head .ios-list__header {
  margin: 0;
  padding: 0;
}

.b-list {
  padding: 0;
}

#devices-card {
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

.b-devices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  background: #2c2c2e;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.device-item + .device-item {
  border-top: none;
}

.device-item:active {
  background: #3a3a3c;
  transform: scale(0.99);
}

.di-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--ios-label-secondary, #8e8e93);
}

.di-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.di-icon img {
  width: 22px;
  height: 22px;
  display: block;
}

.di-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.di-name {
  font-size: 16px;
  color: var(--ios-label, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.di-sub {
  font-size: 13px;
  color: var(--ios-label-secondary, #8e8e93);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.di-chev {
  display: inline-flex;
  align-items: center;
  color: var(--ios-tertiary-label, rgba(235, 235, 245, 0.3));
}

.devices-empty {
  padding: 18px 16px;
  border-radius: 18px;
  background: #2c2c2e;
  text-align: center;
  font-size: 14px;
  color: var(--ios-label-secondary, #8e8e93);
}

.devices-empty p {
  margin: 0;
}

.devices-empty b {
  color: var(--ios-label, #fff);
}

#devices-card.is-collapsed .b-devices,
#devices-card.is-collapsed .devices-empty {
  display: none;
}

.b-device-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
}

.b-device-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--ios-fill, #1c1c1e);
  color: var(--ios-label, #fff);
}

.b-device-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.b-device-icon img {
  width: 32px;
  height: 32px;
  display: block;
}

.b-device-name {
  font-size: 22px;
  font-weight: 700;
}

.b-device-platform {
  font-size: 14px;
  color: var(--ios-label-secondary, #8e8e93);
}

.b-input-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.b-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ios-label, #fff);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.happ-ico {
  background: transparent !important;
}

.happ-ico img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: block;
}

@media (min-width: 768px) {
  .b-app .ios-navbar,
  .b-app .b-scroll,
  .b-app .b-links {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
  }
}

.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(0 0 0 / 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ad-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ad-overlay.hidden {
  display: none;
}

.ad-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - max(44px, env(safe-area-inset-top)) - 8px);
  border-radius: 30px 30px 0 0;
  background: #1c1c1e;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.2, 1, 0.3, 1);
}

.ad-overlay.active .ad-sheet {
  transform: none;
}

.ad-sheet .ios-sheet__body {
  padding: 0 16px 18px;
}

.ad-sheet .wizard-steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ad-sheet .wizard-step {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.25s ease;
}

.ad-sheet .wizard-step.active {
  width: 7px;
  background: var(--ios-tint, #0c8be2);
}

.ad-sheet .wizard-step.done {
  width: 7px;
  background: rgba(12, 139, 226, 0.55);
}

.ad-ios-close {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  color: var(--ios-label, #fff);
}

.ad-sheet .add-device-title {
  margin: 10px 0 4px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-align: center;
}

.ad-sheet .add-device-subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  color: #98989f;
}

.ad-sheet .platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: auto;
  margin: 0 0 18px;
}

.ad-sheet .platform-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 16px 8px;
  border: 1.5px solid transparent;
  border-radius: 20px;
  background: #2c2c2e;
  color: #fff;
  font: inherit;
  aspect-ratio: auto;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ad-sheet .platform-btn:hover {
  background: #333335;
}

.ad-sheet .platform-btn:active {
  transform: scale(0.97);
}

.ad-sheet .platform-btn.selected {
  border-color: var(--ios-tint, #0c8be2);
  background: rgba(12, 139, 226, 0.14);
}

.ad-sheet .platform-ico {
  width: 30px;
  height: 30px;
  color: #fff;
}

.ad-sheet .platform-ico svg {
  width: 26px;
  height: 26px;
}

.ad-sheet .platform-ico img {
  width: 26px;
  height: 26px;
}

.ad-sheet .platform-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.ad-sheet .wizard-happ {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  margin: 0 0 14px;
  padding: 13px 14px;
  border-radius: 24px;
  background: #2c2c2e;
  text-decoration: none;
  transition: background 0.2s ease;
}

.ad-sheet .wizard-happ:hover {
  background: #333335;
}

.ad-sheet .wizard-happ:active {
  transform: scale(0.98);
}

.ad-sheet .wizard-happ .plans-pay-row-icon img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.ad-sheet .happ-link-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ad-sheet .happ-link-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.ad-sheet .happ-link-platform {
  font-size: 13px;
  color: #98989f;
}

.ad-sheet .wizard-happ .ios-icon {
  --w: 18px;
  --h: 18px;
  color: #5a5a5a;
}

.ad-sheet .wizard-hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #98989f;
  text-align: center;
}

.ad-sheet .sub-url-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: auto;
  margin: 0 0 16px;
}

.ad-sheet .sub-url-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 13px 14px;
  border: none;
  border-radius: 16px;
  background: #2c2c2e;
  font: inherit;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-sheet .sub-url-copy {
  flex: none;
  width: 46px;
  height: auto;
  border: none;
  border-radius: 16px;
  background: #2c2c2e;
  color: #fff;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ad-sheet .sub-url-copy:hover {
  background: #333335;
}

.ad-sheet .sub-url-copy svg {
  width: 18px;
  height: 18px;
}

.ad-sheet .sub-url-copy.copied {
  background: rgba(48, 209, 88, 0.16);
  color: #30d158;
}

.ad-sheet .install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: auto;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.ad-sheet .install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #d1d1d6;
}

.ad-sheet .install-steps .step-num {
  flex: none;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(12, 139, 226, 0.16);
  color: var(--ios-tint, #0c8be2);
  font-size: 12px;
  font-weight: 700;
}

.ad-sheet .wizard-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: auto;
  margin: 0;
}

.ad-sheet .wizard-actions .ios-button {
  width: 100%;
}

@media (min-width: 768px) {
  .ad-overlay {
    align-items: center;
    padding: 32px;
  }

  .ad-sheet {
    width: 440px;
    max-width: 100%;
    max-height: min(88vh, 780px);
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(24px);
  }

  .ad-sheet .ios-sheet__grabber {
    display: none;
  }
}
