:root{
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-soft: #fafafa;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --shadow: 0 10px 28px rgba(0,0,0,0.06);
}

*{
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body{
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

body{
  display: flex;
  justify-content: center;
  align-items: center;
}

.app{
  width: 100%;
  max-width: 1000px;
  height: 100vh;
  padding: 18px;
}

.screen{
  width: 100%;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header{
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand{
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo{
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.4px;
}

.brand-text h1{
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-text p{
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--muted);
}

.content{
  flex: 1;
  overflow: auto;
  padding: 20px 28px 24px;
}

.home-view.hidden{
  display: none;
}

.search-wrap{
  margin-bottom: 14px;
}

.search{
  width: 100%;
  height: 66px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 20px;
  font-size: 22px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.search::placeholder{
  color: #9ca3af;
}

.filters{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-btn{
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  min-height: 46px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.filter-btn.active{
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.section-title{
  margin: 6px 0 14px;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.company-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.company-tile{
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 18px;
  padding: 14px 14px 14px 18px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: 0.15s ease;
  min-height: 90px;
  overflow: hidden;
}

.company-tile:hover{
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

.company-tile::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--route-color, #d1d5db);
}

.tile-logo{
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: #e5e7eb;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.tile-info h3{
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.tile-meta{
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.3;
}

.tile-route{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.route-pill-dot{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--route-color, #d1d5db);
  border: 1px solid rgba(0,0,0,0.06);
}

.empty{
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 30px 20px;
  text-align: center;
  font-size: 20px;
  color: var(--muted);
  background: #fff;
  grid-column: 1 / -1;
}

.detail-view{
  display: none;
  height: 100%;
  flex-direction: column;
}

.detail-view.active{
  display: flex;
}

.detail-layout{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  flex: 1;
}

.card{
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  padding: 22px;
}

.detail-head{
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.detail-logo{
  width: 94px;
  height: 94px;
  border-radius: 20px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  flex-shrink: 0;
  letter-spacing: 0.4px;
}

.detail-head h2{
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.1;
}

.detail-head p{
  margin: 0;
  font-size: 17px;
  color: var(--muted);
  line-height: 1.4;
}

.route-box{
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

.route-bar{
  height: 12px;
  background: var(--route-color, #d1d5db);
}

.route-content{
  padding: 18px;
}

.route-label{
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.route-title{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
}

.route-title-dot{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--route-color, #d1d5db);
  border: 1px solid rgba(0,0,0,0.06);
}

.route-text{
  font-size: 19px;
  line-height: 1.45;
  color: var(--text);
}

.info-block{
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.info-block h4{
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.info-block p,
.info-block a{
  margin: 0;
  font-size: 21px;
  line-height: 1.45;
  color: var(--text);
  text-decoration: none;
  word-break: break-word;
}

.qr-panel{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
  min-height: 100%;
}

#qrcode{
  background: #fff;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  min-width: 240px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-text{
  font-size: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.footer{
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  gap: 12px;
}

.nav-btn{
  flex: 1;
  min-height: 62px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.nav-btn.primary{
  background: #111827;
  color: #fff;
  border-color: #111827;
}

@media (max-width: 900px){
  .detail-layout{
    grid-template-columns: 1fr;
  }

  .company-grid{
    grid-template-columns: 1fr;
  }

  .detail-head h2{
    font-size: 26px;
  }

  .route-title{
    font-size: 24px;
  }
}