:root {
  color-scheme: light;
  --background: #f2f2f7;
  --nav-background: #f7f7f8;
  --card: #ffffff;
  --text: #111111;
  --secondary: #8e8e93;
  --separator: #d6d6da;
  --chevron: #c7c7cc;
  --blue: #007aff;
  --green: #34c759;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  overflow: hidden;
}

body {
  height: var(--app-height, 100vh);
  min-height: var(--app-height, 100vh);
  overflow: hidden;
  color: var(--text);
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overscroll-behavior: none;
  touch-action: manipulation;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  padding: 0;
  border: 0;
  background: transparent;
}

.app-shell {
  width: 100vw;
  height: var(--app-height, 100vh);
  min-height: var(--app-height, 100vh);
  overflow: hidden;
  background: var(--background);
}

.view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view[hidden] {
  display: none;
}

.home-page {
  min-height: 100%;
  padding: calc(20px + env(safe-area-inset-top)) 16px 30px;
}

.home-title {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #000000;
  font-size: 18px;
  font-weight: 700;
}

.feature-list {
  margin-top: 24px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--card);
}

.feature-row {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--text);
  text-align: left;
}

.feature-row:active,
.settings-row:active,
.nav-back:active {
  opacity: 0.58;
}

.cache-tools {
  margin-top: 24px;
}

.cache-clear-button {
  width: 100%;
  height: 46px;
  border-radius: 11px;
  color: #ffffff;
  background: var(--blue);
  font-size: 17px;
  font-weight: 600;
  opacity: 0;
}

.cache-clear-button:active,
.cache-clear-button:disabled {
  opacity: 0;
}

.feature-icon {
  width: 29px;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 7px;
  background: #8e8e93;
}

.feature-gear {
  width: 22px;
  height: 22px;
  background: #ffffff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23000' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M32 8v8M32 48v8M8 32h8M48 32h8M15 15l6 6M43 43l6 6M49 15l-6 6M21 43l-6 6'/%3E%3Ccircle cx='32' cy='32' r='15'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23000' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M32 8v8M32 48v8M8 32h8M48 32h8M15 15l6 6M43 43l6 6M49 15l-6 6M21 43l-6 6'/%3E%3Ccircle cx='32' cy='32' r='15'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.feature-title {
  flex: 1;
  margin-left: 14px;
  font-size: 17px;
}

.page-nav {
  position: relative;
  height: calc(52px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-background);
}

.nav-title {
  margin: 0;
  color: #000000;
  font-size: 18px;
  font-weight: 700;
  line-height: 52px;
}

.nav-back {
  position: absolute;
  left: 14px;
  top: env(safe-area-inset-top);
  height: 52px;
  display: flex;
  align-items: center;
  color: var(--blue);
  font-size: 17px;
}

.back-arrow {
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border-left: 3px solid var(--blue);
  border-bottom: 3px solid var(--blue);
  transform: rotate(45deg);
}

.nav-divider {
  height: 1px;
  background: #c7c7cc;
}

.scroll-view {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.settings-content {
  padding: 12px 15px calc(42px + var(--safe-bottom));
}

.settings-group,
.settings-card {
  overflow: hidden;
  border-radius: 11px;
  background: var(--card);
}

.settings-group {
  margin-bottom: 34px;
}

.settings-row,
.cell-row,
.sim-row,
.app-row {
  width: 100%;
  display: flex;
  align-items: center;
  color: var(--text);
  text-align: left;
}

.settings-row {
  min-height: 44px;
  padding-left: 17px;
}

.setting-icon,
.app-icon {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 6px;
}

.row-main {
  min-height: 44px;
  flex: 1;
  margin-left: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--separator);
}

.settings-row:last-child .row-main,
.cell-row:last-child,
.sim-row:last-child,
.app-row:last-child {
  border-bottom: 0;
}

.row-label,
.cell-label {
  color: var(--text);
  font-size: 17px;
  line-height: 22px;
  white-space: nowrap;
}

.row-right {
  min-width: 66px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 14px;
}

.row-value,
.usage-value {
  color: var(--secondary);
  font-size: 16.5px;
  line-height: 22px;
  white-space: nowrap;
}

.chevron {
  width: 15px;
  margin-left: 9px;
  color: var(--chevron);
  font-family: Arial, sans-serif;
  font-size: 29px;
  font-weight: 300;
  line-height: 29px;
}

.ios-switch {
  position: relative;
  width: 48px;
  height: 29px;
  flex: none;
  border-radius: 29px;
  background: #e8e8eb;
}

.ios-switch.on {
  background: var(--green);
}

.switch-thumb {
  position: absolute;
  top: 1.5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ios-switch .switch-thumb {
  left: 1.5px;
}

.ios-switch.on .switch-thumb {
  left: auto;
  right: 1.5px;
}

.cellular-content {
  padding: 43px 15px calc(12px + var(--safe-bottom));
}

.cell-row {
  width: auto;
  min-height: 44px;
  margin-left: 17px;
  padding-right: 14px;
  justify-content: space-between;
  border-bottom: 1px solid var(--separator);
}

.value-row {
  padding-right: 22px;
}

.value-row .usage-value {
  margin-left: 14px;
  min-width: 92px;
  text-align: right;
}

.section-note {
  display: block;
  margin: 9px 24px 29px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 19px;
}

.single-card {
  margin-bottom: 39px;
}

.section-title {
  display: block;
  margin: 0 0 9px 24px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 17px;
}

.sim-card {
  margin-bottom: 40px;
}

.sim-row {
  width: auto;
  min-height: 56px;
  margin-left: 17px;
  padding-right: 0;
  justify-content: space-between;
  border-bottom: 1px solid var(--separator);
}

.sim-main {
  min-width: 0;
}

.sim-name-line {
  display: flex;
  align-items: center;
}

.sim-tag {
  min-width: 29px;
  height: 15px;
  margin-right: 7px;
  padding: 0 5px;
  border-radius: 3px;
  color: #ffffff;
  background: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.sim-name {
  color: var(--text);
  font-size: 17px;
  line-height: 22px;
}

.sim-number {
  display: block;
  margin-top: 4px;
  color: var(--secondary);
  font-size: 15px;
  line-height: 18px;
}

.sim-edit-button {
  align-self: stretch;
  min-width: 86px;
  height: auto;
  padding-right: 14px;
}

.usage-card {
  margin-bottom: 34px;
}

.app-row {
  width: auto;
  min-height: 61px;
  margin-left: 17px;
  padding-right: 14px;
  border-bottom: 1px solid var(--separator);
}

.app-icon {
  margin-right: 15px;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-name {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 22px;
}

.app-network {
  display: block;
  margin-top: 2px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 17px;
}

.app-right {
  margin-left: 9px;
  flex: none;
}

.switch-card {
  min-height: 53px;
  margin-bottom: 9px;
  padding: 0 18px 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch-text {
  display: flex;
  flex-direction: column;
}

.switch-subtitle {
  margin-top: 3px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 15px;
}

.reset-card {
  min-height: 44px;
  margin-top: 41px;
  padding-left: 17px;
  display: flex;
  align-items: center;
}

.reset-text {
  color: var(--blue);
  font-size: 17px;
  line-height: 22px;
}

.editor-mask {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  background: rgba(0, 0, 0, 0.22);
}

.editor-mask[hidden] {
  display: none;
}

.phone-editor {
  width: min(100%, 360px);
  overflow: hidden;
  border-radius: 13px;
  background: #ffffff;
}

.editor-title {
  margin: 0;
  padding-top: 17px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.phone-input {
  width: calc(100% - 34px);
  height: 43px;
  margin: 14px 17px 15px;
  padding: 0 11px;
  border: 0;
  outline: 0;
  border-radius: 8px;
  color: var(--text);
  background: var(--background);
  font-size: 16px;
}

.editor-actions {
  height: 44px;
  display: flex;
  border-top: 1px solid var(--separator);
}

.editor-button {
  flex: 1;
  color: var(--blue);
  font-size: 17px;
}

.cancel-button {
  border-right: 1px solid var(--separator);
}

.confirm-button {
  font-weight: 600;
}

.sim-edit-button:disabled {
  opacity: 1;
  pointer-events: none;
}

@media (min-width: 520px) {
  .app-shell {
    max-width: 430px;
    margin: 0 auto;
    border-left: 1px solid #e2e2e7;
    border-right: 1px solid #e2e2e7;
  }
}

.standalone-mode .app-shell {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  min-height: 0;
  max-width: none;
  margin: 0;
  border: 0;
}

.standalone-mode {
  --safe-bottom: 0px;
}

.debug-mode .home-page,
.debug-mode .settings-content,
.debug-mode .cellular-content {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.install-gate {
  height: 100%;
  min-height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--background);
}

.install-card {
  width: 100%;
  max-width: 390px;
  padding: 30px 24px 26px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.08);
}

.install-icon {
  width: 70px;
  height: 70px;
  display: block;
  margin: 0 auto 18px;
  border-radius: 16px;
}

.install-title {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

.install-copy {
  margin: 10px 0 22px;
  color: var(--secondary);
  font-size: 15px;
  line-height: 22px;
  text-align: center;
}

.install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.install-steps li {
  position: relative;
  min-height: 38px;
  padding: 8px 0 8px 42px;
  color: var(--text);
  font-size: 16px;
  line-height: 22px;
  border-top: 1px solid var(--separator);
  counter-increment: step;
}

.install-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}

.install-tip {
  margin: 18px 0 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}
