:root{
  --navy:#081426;
  --navy2:#152641;
  --gold:#c59633;
  --gold-dark:#80601f;
  --gold-soft:#faf2df;
  --paper:#ffffff;
  --bg:#f4f6f8;
  --text:#101828;
  --muted:#697586;
  --line:#e4e8ee;
  --success:#147447;
  --danger:#a92c38;
}

*{
  box-sizing:border-box;
}

html{
  min-height:100%;
  background:var(--bg);
  -webkit-text-size-adjust:100%;
}

body{
  min-height:100dvh;
  margin:0;
  color:var(--text);
  background:
    radial-gradient(
      circle at 50% -8rem,
      rgba(197,150,51,.17),
      transparent 25rem
    ),
    linear-gradient(
      180deg,
      #fbfbfc,
      var(--bg) 28rem
    );
  overscroll-behavior-y:none;
  -webkit-tap-highlight-color:transparent;
}

/* Kill the legacy injected second header permanently. */
.gim-v5-header{
  display:none!important;
}

.app-shell{
  width:100%;
  min-height:100dvh;
  padding-bottom:
    calc(
      91px +
      env(safe-area-inset-bottom)
    );
}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  min-height:70px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  padding:
    max(9px,env(safe-area-inset-top))
    13px
    8px;
  border-bottom:
    1px solid rgba(8,20,38,.07);
  background:rgba(255,255,255,.95);
  box-shadow:
    0 8px 28px rgba(8,20,38,.055);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
}

.gim-r5-brand{
  min-width:0;
  display:flex;
  align-items:center;
  gap:9px;
}

.gim-r5-brand img{
  flex:0 0 auto;
  display:block;
  width:58px;
  height:38px;
  object-fit:contain;
}

.gim-r5-brand-copy{
  min-width:0;
  display:grid;
  line-height:1.08;
}

.gim-r5-brand-copy strong{
  overflow:hidden;
  color:var(--navy);
  font-size:14px;
  font-weight:900;
  letter-spacing:-.03em;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.gim-r5-brand-copy span{
  margin-top:4px;
  color:var(--gold-dark);
  font-size:9px;
  font-weight:950;
  letter-spacing:.13em;
  text-transform:uppercase;
}

.topbar-status{
  flex:0 0 auto;
  max-width:49%;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:4px;
}

.badge{
  min-height:24px;
  padding:4px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:900;
  white-space:nowrap;
}

.view{
  width:min(760px,100%);
  margin:0 auto;
  padding:13px 11px 20px;
}

.stack{
  gap:12px;
}

.card{
  overflow:hidden;
  border:
    1px solid rgba(8,20,38,.07);
  border-radius:20px;
  background:rgba(255,255,255,.985);
  box-shadow:
    0 12px 35px rgba(8,20,38,.065),
    0 1px 2px rgba(8,20,38,.035);
}

.card-body{
  padding:16px;
}

.card-title{
  color:var(--navy);
  font-size:17px;
  font-weight:900;
  letter-spacing:-.025em;
}

.card-subtitle{
  color:var(--muted);
  line-height:1.45;
}

.section-title{
  margin:10px 3px 0;
  color:var(--gold-dark);
  font-size:10px;
  font-weight:950;
  letter-spacing:.13em;
}

.map-shell,
.map-state,
.map-shell iframe{
  min-height:285px;
  height:285px;
}

.button{
  min-height:50px;
  border-radius:14px;
  font-weight:900;
  touch-action:manipulation;
}

.button.primary{
  color:#fff;
  background:
    linear-gradient(
      135deg,
      #192a46,
      #081426
    );
  box-shadow:
    0 12px 26px rgba(8,20,38,.15);
}

.button.secondary{
  color:var(--navy);
  background:#edf0f4;
}

.button.success{
  background:var(--success);
}

.button.danger{
  color:var(--danger);
  background:#fff0f1;
}

.row{
  gap:10px;
  padding:12px 0;
}

.row-label{
  color:var(--muted);
}

.row-value{
  color:var(--navy);
}

.proof{
  border:1px solid transparent;
  border-radius:14px;
}

.proof.done{
  border-color:#c8e9d8;
  color:var(--success);
  background:#eef9f3;
}

.route-stop{
  border-color:var(--line);
  border-radius:15px;
}

.route-stop.current{
  border-color:var(--gold);
  box-shadow:
    0 0 0 2px rgba(197,150,51,.11);
}

.input{
  min-height:50px;
  border-color:#d6dce4;
  border-radius:14px;
  font-size:16px;
}

.input:focus{
  outline:none;
  border-color:var(--gold);
  box-shadow:
    0 0 0 4px rgba(197,150,51,.12);
}

/* Real mobile Driver navigation. */
.bottom-nav{
  position:fixed;
  z-index:70;
  left:9px;
  right:9px;
  bottom:
    max(
      7px,
      env(safe-area-inset-bottom)
    );
  width:auto;
  max-width:740px;
  margin:0 auto;
  grid-template-columns:
    repeat(5,minmax(0,1fr));
  gap:3px;
  padding:6px;
  border:
    1px solid rgba(8,20,38,.10);
  border-radius:22px;
  background:rgba(255,255,255,.97);
  box-shadow:
    0 18px 46px rgba(8,20,38,.18),
    0 2px 8px rgba(8,20,38,.055);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
}

.nav-button{
  position:relative;
  min-width:0;
  min-height:52px;
  padding:8px 2px;
  border-radius:16px;
  color:#778191;
  background:transparent;
  font-size:10px;
  font-weight:900;
  line-height:1.1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  touch-action:manipulation;
}

.nav-button.active{
  color:var(--navy);
  background:
    linear-gradient(
      180deg,
      #fffaf0,
      #f8efd9
    );
  box-shadow:
    inset 0 0 0 1px
    rgba(197,150,51,.20);
}

.nav-button.active::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:5px;
  width:17px;
  height:2px;
  border-radius:999px;
  background:var(--gold);
  transform:translateX(-50%);
}

.toast{
  z-index:100;
  bottom:
    calc(
      88px +
      env(safe-area-inset-bottom)
    );
  border-radius:14px;
  background:var(--navy);
}

/* Real R5 secure login. */
.gim-v5-login{
  min-height:100dvh;
  display:grid;
  align-items:center;
  padding:
    max(18px,env(safe-area-inset-top))
    17px
    max(24px,env(safe-area-inset-bottom));
}

.gim-v5-login-shell{
  width:min(100%,430px);
  margin:0 auto;
}

.gim-v5-login-brand{
  margin-bottom:15px;
  text-align:center;
}

.gim-v5-login-logo{
  display:block;
  width:min(180px,58vw)!important;
  height:96px!important;
  margin:0 auto 8px!important;
  object-fit:contain!important;
}

.gim-v5-login-role{
  display:inline-flex;
  margin-bottom:9px;
  padding:6px 10px;
  border:
    1px solid rgba(197,150,51,.26);
  border-radius:999px;
  color:#745519;
  background:var(--gold-soft);
  font-size:9px;
  font-weight:950;
  letter-spacing:.11em;
  text-transform:uppercase;
}

.gim-v5-login-brand h1{
  margin:0;
  color:var(--navy);
  font-size:clamp(26px,7.5vw,34px);
  line-height:1.05;
  letter-spacing:-.045em;
}

.gim-v5-login-brand p{
  max-width:310px;
  margin:8px auto 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.gim-v5-login-card{
  padding:20px;
  border:
    1px solid rgba(8,20,38,.075);
  border-radius:22px;
  background:rgba(255,255,255,.985);
  box-shadow:
    0 26px 66px rgba(8,20,38,.105);
}

.gim-v5-login-card label{
  gap:7px;
  margin-bottom:14px;
  color:#344054;
  font-size:11px;
  font-weight:900;
}

.gim-v5-login-card input{
  width:100%;
  min-height:52px;
  padding:0 14px;
  border:1px solid #d6dce4;
  border-radius:14px;
  outline:none;
  color:var(--navy);
  background:#f9fafb;
  font:inherit;
  font-size:16px;
}

.gim-v5-login-card input:focus{
  border-color:var(--gold);
  background:#fff;
  box-shadow:
    0 0 0 4px rgba(197,150,51,.12);
}

.gim-v5-login-card input:-webkit-autofill,
.gim-v5-login-card input:-webkit-autofill:hover,
.gim-v5-login-card input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--navy);
  -webkit-box-shadow:
    0 0 0 1000px #fff inset;
}

.gim-v5-login-button{
  width:100%;
  min-height:54px;
  border:0;
  border-radius:15px;
  color:#fff;
  background:
    linear-gradient(
      135deg,
      #192a46,
      #081426
    );
  font:inherit;
  font-size:14px;
  font-weight:950;
  box-shadow:
    0 15px 31px rgba(8,20,38,.18);
}

#message{
  max-height:120px;
  overflow:auto;
  word-break:break-word;
}

.gim-v5-security{
  margin-top:14px;
  color:#7b8593;
  text-align:center;
  font-size:10px;
  line-height:1.45;
}

@media(max-width:370px){
  .topbar{
    padding-left:9px;
    padding-right:9px;
  }

  .gim-r5-brand img{
    width:49px;
    height:33px;
  }

  .gim-r5-brand-copy strong{
    font-size:12px;
  }

  .badge{
    padding:4px 5px;
    font-size:8px;
  }

  .view{
    padding-left:8px;
    padding-right:8px;
  }

  .nav-button{
    font-size:9px;
  }
}

@media(display-mode:standalone){
  body{
    user-select:none;
  }

  input,
  textarea{
    user-select:text;
  }
}
