:root{
  --native-safe-top:0px;
  --native-safe-right:0px;
  --native-safe-bottom:0px;
  --native-safe-left:0px;
  --safe-top:env(safe-area-inset-top,0px);
  --safe-right:env(safe-area-inset-right,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-left:env(safe-area-inset-left,0px);
  --app-height:100vh;
  --app-dvh:100dvh;
}

@supports (padding:max(0px,1px)){
  :root{
    --safe-top:max(env(safe-area-inset-top,0px),var(--native-safe-top));
    --safe-right:max(env(safe-area-inset-right,0px),var(--native-safe-right));
    --safe-bottom:max(env(safe-area-inset-bottom,0px),var(--native-safe-bottom));
    --safe-left:max(env(safe-area-inset-left,0px),var(--native-safe-left));
  }
}

html.capacitor-ios,
html.capacitor-ios body{
  min-height:100%;
  min-height:100dvh;
}

html.capacitor-ios body{
  overscroll-behavior:none;
}

.ios-app-shell{
  display:none;
}

html.capacitor-ios body.ios-shell-page{
  min-height:100vh;
  min-height:100dvh;
  overflow:hidden;
  background:#29343a;
}

html.capacitor-ios body.ios-shell-page > :not(.ios-app-shell):not(script):not(style):not(.safe-area-debug){
  display:none!important;
}

html.capacitor-ios body.ios-shell-page .ios-app-shell{
  display:flex;
}

.ios-app-shell{
  position:relative;
  min-height:100vh;
  min-height:100dvh;
  width:100%;
  flex-direction:column;
  justify-content:space-between;
  gap:24px;
  padding:calc(22px + var(--safe-top)) calc(20px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(20px + var(--safe-left));
  color:#fff;
  background:
    linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,0) 32%),
    radial-gradient(circle at 50% -12%,rgba(196,96,42,.22),transparent 34%),
    #29343a;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.ios-app-shell::before{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px);
  background-size:var(--ios-grid-cell,42px) var(--ios-grid-cell,42px);
  background-position:top left;
  mask-image:linear-gradient(180deg,rgba(0,0,0,.55),transparent 72%);
}

.ios-app-content,
.ios-app-footer{
  position:relative;
  z-index:1;
}

.ios-app-content{
  width:100%;
  max-width:430px;
  margin:0 auto;
  display:flex;
  flex:1;
  flex-direction:column;
  justify-content:center;
  gap:24px;
  padding:14px 0;
}

.ios-wordmark{
  font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-size:34px;
  font-weight:900;
  letter-spacing:-.03em;
  line-height:1;
}

.ios-wordmark span{
  color:#c4602a;
}

.ios-app-kicker{
  margin-top:10px;
  font-family:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:rgba(255,255,255,.46);
}

.ios-app-title{
  margin:0;
  font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-size:30px;
  line-height:1.08;
  font-weight:900;
  letter-spacing:-.02em;
}

.ios-app-copy{
  margin:0;
  font-size:15px;
  line-height:1.58;
  color:rgba(255,255,255,.66);
}

.ios-auth-panel,
html.capacitor-ios body.welcome-native .card,
html.capacitor-ios body.welcome-native .onboard-card{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 18px 42px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.08);
  -webkit-backdrop-filter:blur(18px) saturate(1.15);
  backdrop-filter:blur(18px) saturate(1.15);
}

.ios-auth-panel{
  border-radius:24px;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ios-auth-button{
  width:100%;
  min-height:52px;
  border:0;
  border-radius:15px;
  padding:0 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-size:15px;
  font-weight:800;
  color:#fff;
  text-decoration:none;
  background:#c4602a;
  box-shadow:0 10px 24px rgba(196,96,42,.32);
  cursor:pointer;
  touch-action:manipulation;
  -webkit-appearance:none;
  appearance:none;
}

.ios-auth-button.secondary{
  background:rgba(255,255,255,.09);
  border:1px solid rgba(255,255,255,.15);
  box-shadow:none;
  color:rgba(255,255,255,.86);
}

.ios-auth-note{
  font-size:12px;
  line-height:1.5;
  color:rgba(255,255,255,.46);
  text-align:center;
  padding:2px 4px 0;
}

.ios-auth-error{
  display:none;
  margin-top:4px;
  border-radius:12px;
  padding:10px 12px;
  font-size:12px;
  line-height:1.45;
  color:#ffd6cc;
  background:rgba(181,66,59,.16);
  border:1px solid rgba(181,66,59,.34);
}

.ios-app-footer{
  width:100%;
  max-width:430px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px 14px;
  font-size:12px;
  color:rgba(255,255,255,.42);
}

.ios-app-footer a,
.ios-account-links a{
  color:rgba(255,255,255,.7);
  text-decoration:none;
}

.ios-app-footer a:hover,
.ios-account-links a:hover{
  color:#fff;
  text-decoration:underline;
}

html.capacitor-ios body.welcome-native{
  min-height:100vh;
  min-height:100dvh;
  padding:calc(20px + var(--safe-top)) calc(18px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(18px + var(--safe-left));
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

html.capacitor-ios body.welcome-native .card,
html.capacitor-ios body.welcome-native .onboard-card{
  max-width:430px;
  border-radius:24px;
  padding:30px 22px;
  margin:auto;
}

html.capacitor-ios body.welcome-native .card-title{
  font-size:26px;
  line-height:1.12;
}

html.capacitor-ios body.welcome-native .card-body{
  font-size:14px;
  line-height:1.58;
  margin-bottom:22px;
}

html.capacitor-ios body.welcome-native .btn{
  min-height:52px;
  border-radius:15px;
}

html.capacitor-ios body.welcome-native .revit-callout{
  display:none!important;
}

.ios-account-links{
  display:none;
  margin:14px 0 2px;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.1);
  flex-wrap:wrap;
  justify-content:center;
  gap:9px 14px;
  font-size:12px;
  line-height:1.4;
}

html.capacitor-ios body.welcome-native .ios-account-links{
  display:flex;
}

html.capacitor-ios body.safe-doc{
  min-height:100vh;
  min-height:100dvh;
}

html.capacitor-ios body.safe-doc nav{
  height:auto;
  min-height:calc(56px + var(--safe-top));
  padding:var(--safe-top) calc(20px + var(--safe-right)) 0 calc(20px + var(--safe-left));
}

html.capacitor-ios body.safe-doc .wrap,
html.capacitor-ios body.safe-doc .page{
  padding-top:calc(34px + var(--safe-top));
  padding-right:calc(22px + var(--safe-right));
  padding-bottom:calc(72px + var(--safe-bottom));
  padding-left:calc(22px + var(--safe-left));
}

.safe-area-debug{
  position:fixed;
  inset:0;
  z-index:2147483647;
  pointer-events:none;
  display:none;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:10px;
  color:#fff;
}

html.safe-area-debug-on .safe-area-debug{
  display:block;
}

.safe-area-debug-top,
.safe-area-debug-bottom,
.safe-area-debug-left,
.safe-area-debug-right{
  position:absolute;
  background:rgba(196,96,42,.26);
  border:1px solid rgba(255,255,255,.36);
}

.safe-area-debug-top{
  top:0;
  left:0;
  right:0;
  height:var(--safe-top);
}

.safe-area-debug-bottom{
  bottom:0;
  left:0;
  right:0;
  height:var(--safe-bottom);
}

.safe-area-debug-left{
  top:0;
  bottom:0;
  left:0;
  width:var(--safe-left);
}

.safe-area-debug-right{
  top:0;
  right:0;
  bottom:0;
  width:var(--safe-right);
}

.safe-area-debug-label{
  position:absolute;
  right:8px;
  bottom:calc(8px + var(--safe-bottom));
  padding:5px 7px;
  border-radius:6px;
  background:rgba(31,37,43,.82);
}

@media(max-height:700px){
  .ios-app-shell{
    justify-content:flex-start;
  }
  .ios-app-content{
    justify-content:flex-start;
  }
  .ios-app-title{
    font-size:26px;
  }
}
