.tsm-wrap{max-width:980px;margin:0 auto}
.tsm-card{
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  padding:18px;
  box-shadow:0 8px 30px rgba(0,0,0,.06);
  background:#fff;
}

.tsm-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.tsm-title{font-size:20px;font-weight:800;line-height:1.2}
.tsm-subtitle{font-size:14px;opacity:.75;margin-top:4px}

/* FORM (desktop) */
.tsm-form{
  display:grid;
  grid-template-columns:1fr 1fr 140px 56px;
  gap:12px;
  align-items:end;
}
.tsm-field label{display:block;font-size:12px;font-weight:700;opacity:.8;margin-bottom:6px}
.tsm-field select{
  width:100%;
  height:44px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:12px;
  padding:0 12px;
  background:#fff;
}
.tsm-field select:disabled{opacity:.6;cursor:not-allowed}

/* Button Caută */
.tsm-btn{
  height:44px;
  border-radius:12px;
  border:0;
  cursor:pointer;
  font-weight:900;
  background:#1F8DE3;
  color:#fff;
}
.tsm-btn:hover,
.tsm-btn:active,
.tsm-btn:focus{
  background:#1F8DE3;
  color:#fff;
  outline:none;
  box-shadow:none;
}

/* Switch */
.tsm-swap{
  height:44px;
  width:56px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(0,0,0,.12);
  border-radius:12px;
  cursor:pointer;
  user-select:none;
  background:#fff;
  color:#000;
  padding:0;
  appearance:none;
  -webkit-appearance:none;
  box-shadow:none !important;
  outline:none !important;
}
.tsm-swap:hover{
  background:#fff;
  border:1px solid #000;
  color:#000;
}
.tsm-swap:focus,
.tsm-swap:active{
  background:rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.12);
  color:#000 !important;
  box-shadow:none !important;
  outline:none !important;
}
.tsm-swap-icon{
  font-size:18px;
  line-height:1;
  font-weight:400;
  color:inherit !important;
}

/* mesaj */
.tsm-msg{margin-top:10px;font-size:14px}
.tsm-msg:empty{display:none}
.tsm-msg.is-error{color:#b42318}
.tsm-msg.is-ok{color:#067647}

.tsm-result{margin-top:14px}
.tsm-result[hidden]{display:none !important}

/* RESULT CARD */
.tsm-result-card{
  border:1px solid rgba(0,0,0,.10);
  border-radius:14px;
  overflow:hidden;
}
.tsm-result-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px;
  background:rgba(0,0,0,.03);
}
.tsm-result-title{font-weight:900}
.tsm-result-meta{font-size:12px;opacity:.75}

/* Tabs */
.tsm-tabs{
  display:flex;
  gap:8px;
  padding:12px 14px;
  border-top:1px solid rgba(0,0,0,.06);
}
.tsm-tab{
  border:1px solid rgba(0,0,0,.12);
  border-radius:999px;
  padding:8px 12px;
  cursor:pointer;
  background:#fff;
  font-weight:800;
  font-size:13px;
  color:#000;
  transition:all .2s ease;
}
.tsm-tab.is-active{
  background:rgba(0,0,0,.06);
  border-color:rgba(0,0,0,.12);
  color:#000;
}
.tsm-tab:hover{
  background:#fff;
  border:1px solid #000;
  color:#000;
}
.tsm-tab.is-active:hover{
  background:rgba(0,0,0,.06);
  border:1px solid #000;
  color:#000;
}
.tsm-tab:focus,
.tsm-tab:active{
  outline:none;
  box-shadow:none;
}

/* Panels */
.tsm-panel{display:none;padding:0 14px 14px}
.tsm-panel.is-active{display:block}

/* Trip item */
.tsm-trip{
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  padding:12px;
  margin-top:12px;
}
.tsm-trip-headrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.tsm-trip-times{
  display:flex;
  gap:10px;
  align-items:baseline;
}
.tsm-time{font-weight:900;font-size:16px}
.tsm-arrow{opacity:.6}

.tsm-trip-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-shrink:0;
}

.tsm-buy-small{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:32px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid transparent;
  background:#000;
  color:#fff;
  text-decoration:none;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.tsm-buy-small:hover,
.tsm-buy-small:active,
.tsm-buy-small:focus{
  background:transparent;
  color:#000;
  border:1px solid #000;
  outline:none;
  box-shadow:none;
}

.tsm-trip-info{font-size:12px;opacity:.75;margin-top:8px;line-height:1.4}
.tsm-empty{padding:14px;font-size:13px;opacity:.7}
.tsm-footnote{padding:0 14px 14px;font-size:12px;opacity:.7}

.tsm-wrap.is-loading .tsm-card{opacity:.96}

/* ===== Orar pe traseu (2 tab-uri: Dus / Intors) ===== */
.amr-browser{max-width:1200px;margin:0 auto}
.amr-browser-empty{padding:14px;border:1px dashed #d1d5db;border-radius:12px;background:#fff;color:#6b7280}
.amr-browser-single-route .amr-group-card{border:1px solid #e5e7eb;border-radius:14px;padding:14px;background:#fff;box-shadow:0 6px 18px rgba(0,0,0,.04)}
.amr-group-head{margin-bottom:12px}
.amr-group-title{font-size:20px;font-weight:800;line-height:1.2}
.amr-group-subtitle{color:#6b7280;margin-top:4px}

.amr-tabs{display:flex;gap:8px;flex-wrap:wrap}
.amr-tabs-level1{margin-bottom:12px}
.amr-tab{
  padding:8px 12px;
  border:1px solid #d1d5db;
  background:#fff;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  line-height:1.1;
}
.amr-tab.is-active{
  background:#111827;
  color:#fff;
  border-color:#111827;
}
.amr-tab-panel{display:none}
.amr-tab-panel.is-active{display:block}

.amr-route-card{border:1px solid #e5e7eb;border-radius:12px;padding:12px;background:#fff}
.amr-route-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px 16px;
  margin-bottom:12px;
  color:#374151;
  font-size:14px;
}

.amr-period-block{margin-top:14px}
.amr-period-block:first-child{margin-top:0}
.amr-period-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.amr-period-title{
  font-weight:800;
  font-size:15px;
  color:#111827;
}
.amr-period-badge{
  font-size:12px;
  font-weight:700;
  color:#374151;
  background:#f3f4f6;
  border:1px solid #e5e7eb;
  padding:4px 8px;
  border-radius:999px;
  white-space:nowrap;
}

.amr-service-status{
  margin-bottom:10px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #d1d5db;
  background:#f9fafb;
  color:#374151;
  font-weight:600;
}
.amr-service-status.is-empty{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
.amr-service-status.is-warn{background:#fffbeb;border-color:#fde68a;color:#92400e}
.amr-service-status.is-muted{background:#f3f4f6;border-color:#e5e7eb;color:#4b5563}

.amr-matrix-wrap{border:1px solid #e5e7eb;border-radius:12px;background:#fff}
.amr-matrix-scroll{overflow:auto}
.amr-matrix{
  width:100%;
  min-width:760px;
  border-collapse:separate;
  border-spacing:0;
}
.amr-matrix th,
.amr-matrix td{
  padding:8px 10px;
  border-right:1px solid #e5e7eb;
  border-bottom:1px solid #e5e7eb;
  text-align:center;
  white-space:nowrap;
  font-size:14px;
}
.amr-matrix th{
  position:sticky;
  top:0;
  background:#f9fafb;
  z-index:1;
  font-weight:800;
}
.amr-matrix th:first-child,
.amr-matrix td:first-child{
  position:sticky;
  left:0;
  background:#fff;
  z-index:2;
}
.amr-matrix thead th:first-child{
  background:#f9fafb;
  z-index:3;
}
.amr-col-trip{font-weight:700;background:#fcfcfd}
.amr-matrix tr:last-child td{border-bottom:0}
.amr-matrix th:last-child,
.amr-matrix td:last-child{border-right:0}

@media (max-width: 860px){
  .tsm-form{
    grid-template-columns: 4fr 1fr;
    grid-template-areas:
      "from from"
      "to to"
      "search swap";
    align-items:stretch;
  }
  .tsm-field-from{grid-area:from}
  .tsm-field-to{grid-area:to}
  .tsm-btn{grid-area:search;width:100%}
  .tsm-swap{
    grid-area:swap;
    width:100%;
    height:44px;
  }
}

@media (max-width:720px){
  .tsm-trip-headrow{align-items:flex-start;flex-direction:column}
  .tsm-buy-small{width:100%;text-align:center}

  .amr-group-title{font-size:18px}
  .amr-route-meta{font-size:13px}
  .amr-tab{padding:8px 10px;font-size:13px}
  .amr-period-head{align-items:flex-start;flex-direction:column}
  .amr-period-badge{align-self:flex-start}
}