/* DriveOS cockpit — fonts & tokens from payment-app */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500&display=swap");

:root {
  --bg: #050608;
  --panel: #101217;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #747c89;
  --text: #f5f7fa;
  --green: #66edc5;
  --blue: #80a7ff;
  --danger: #ff7777;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 50% -10%, #202631 0, #090b0f 40%, #050608 75%);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

.cockpit {
  min-height: 100vh;
  padding: 28px 48px 42px;
  max-width: 1280px;
  margin: 0 auto;
}

/* —— Header (payment-app) —— */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 42px;
  margin-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 500;
}

.drive-pill {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #8b929c;
  letter-spacing: 0.08em;
}

.drive-pill i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.meta {
  justify-self: end;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* —— Voice shell (expandable history) —— */
.voice-shell {
  max-width: 1160px;
  margin: 18px auto 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 17, 22, 0.62);
  backdrop-filter: blur(28px);
  overflow: hidden;
  transition: border-color 0.2s;
}

.voice-shell.open {
  border-color: rgba(102, 237, 197, 0.22);
}

.voice-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 18px;
}

.orb {
  width: 47px;
  height: 47px;
  border-radius: 50%;
  position: relative;
  flex: none;
  background: radial-gradient(circle at 35% 30%, #d5fff3, #60e7c1 27%, #233c3a 58%, #11151a 76%);
  box-shadow: 0 0 34px rgba(102, 237, 197, 0.19);
}

.orb span {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(102, 237, 197, 0.18);
  border-radius: 50%;
  animation: pulse 2.2s infinite;
}

.orb span:nth-child(2) {
  animation-delay: 0.6s;
}
.orb span:nth-child(3) {
  animation-delay: 1.2s;
}

@keyframes pulse {
  70%,
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.orb.processing,
.orb.speaking {
  background: radial-gradient(circle at 35% 30%, #eff3ff, #80a7ff 30%, #252b48 65%);
  box-shadow: 0 0 34px rgba(128, 167, 255, 0.22);
}

.orb.processing span,
.orb.speaking span {
  border-color: rgba(128, 167, 255, 0.25);
}

.orb.error {
  background: radial-gradient(circle at 35% 30%, #ffe3e3, #ff7777 35%, #401d26 70%);
  box-shadow: 0 0 34px rgba(255, 119, 119, 0.22);
}

.orb.error span {
  border-color: rgba(255, 119, 119, 0.3);
  animation: none;
}

.voice-copy {
  flex: 1;
  min-width: 0;
}

.voice-copy .state {
  display: block;
  font-size: 9px;
  letter-spacing: 0.17em;
  color: var(--muted);
}

.voice-copy .assistant {
  font-size: 22px;
  font-weight: 300;
  margin: 4px 0 0;
  letter-spacing: -0.025em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.voice-copy .heard {
  font-size: 11px;
  color: #6d7580;
  margin: 4px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-history {
  border-top: 1px solid var(--line);
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 18px 14px;
  animation: rise 0.25s ease;
}

.voice-history .history-line {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 11px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.voice-history .history-line:last-child {
  border-bottom: 0;
}

.voice-history .role {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-top: 3px;
}

.voice-history .empty {
  padding: 12px 0 4px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-primary {
  background: rgba(102, 237, 197, 0.1);
  border-color: rgba(102, 237, 197, 0.35);
  color: #d5fff3;
}

.btn-primary:hover:not(:disabled) {
  background: rgba(102, 237, 197, 0.18);
}

.btn-danger {
  background: rgba(255, 119, 119, 0.14);
  border-color: rgba(255, 119, 119, 0.4);
}

.btn-ghost {
  background: transparent;
}

/* —— Panels (deal-card language) —— */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(27, 31, 39, 0.84), rgba(11, 13, 17, 0.94));
  padding: 22px 24px;
  min-height: 280px;
}

.panel-label {
  font-size: 9px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.item.selected {
  border-color: rgba(102, 237, 197, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.item .title {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.item .sub {
  margin-top: 5px;
  font-size: 11px;
  color: #7a828d;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.detail-title {
  font-size: 28px;
  font-weight: 200;
  margin: 0 0 10px;
  letter-spacing: -0.035em;
}

.detail-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #7a828d;
  white-space: pre-wrap;
}

/* —— Confirm overlay —— */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 40;
  animation: fade-in 0.25s ease;
}

.confirm-card {
  width: min(440px, 90vw);
  padding: 28px 30px;
  border-radius: 22px;
  border: 1px solid rgba(102, 237, 197, 0.28);
  background: linear-gradient(145deg, rgba(27, 31, 39, 0.96), rgba(11, 13, 17, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: rise 0.3s ease;
}

.confirm-card .panel-label {
  color: var(--green);
}

.confirm-card p {
  font-size: 24px;
  font-weight: 200;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
  line-height: 1.25;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

.preview-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15, 17, 22, 0.9);
  backdrop-filter: blur(16px);
}

/* —— Tabs (payment-app journey nav) —— */
.tabs {
  height: 40px;
  display: flex;
  justify-content: center;
  gap: 48px;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 22px;
}

.tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 12px 2px;
  position: relative;
  font-family: inherit;
  font-size: 9px;
  font-weight: 400;
  color: #555d68;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

.tabs button.active {
  color: #e9edf2;
}

.tabs button.active::after {
  content: "";
  position: absolute;
  height: 1px;
  left: 0;
  right: 0;
  bottom: -1px;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
}

.view {
  animation: enter 0.35s ease;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

.view-center {
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* —— Pay —— */
.wallet {
  text-align: center;
}

.wallet-logo {
  font-size: 38px;
  font-weight: 500;
  margin-bottom: 24px;
}

.wallet > small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.17em;
  color: var(--muted);
}

.wallet h2 {
  font-size: 36px;
  font-weight: 200;
  margin: 10px 0;
  letter-spacing: -0.03em;
}

.payment-total {
  font-size: 72px;
  font-weight: 200;
  letter-spacing: -0.075em;
  line-height: 1;
}

.card {
  width: 330px;
  text-align: left;
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, #1a1e26, #0f1115);
}

.card span {
  font-size: 10px;
  letter-spacing: 0.16em;
}

.card strong {
  font-weight: 400;
}

.card small {
  grid-column: 1 / -1;
  color: #68717c;
  font-size: 11px;
}

.voice-prompt {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 330px;
  margin: 20px auto 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.mini-orb {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d5fff3, #60e7c1 35%, #18312d 72%);
}

.voice-prompt small {
  display: block;
  color: #6b7480;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.voice-prompt strong {
  font-weight: 400;
  font-size: 13px;
}

/* —— Navigation —— */
.drive-layout {
  display: grid;
  grid-template-columns: 1.55fr 0.55fr;
  gap: 16px;
}

.map {
  height: 560px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 73% 15%, rgba(128, 167, 255, 0.14), transparent 32%),
    #0c0f14;
}

.map > svg {
  width: 100%;
  height: 100%;
}

.road {
  fill: none;
  stroke: #252b34;
  stroke-width: 27;
  stroke-linecap: round;
}

.route {
  fill: none;
  stroke: url(#route);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 14 5;
}

.car {
  fill: #f4f6fa;
  stroke: #0c0f14;
  stroke-width: 5;
}

.dest-ring {
  fill: rgba(102, 237, 197, 0.1);
  stroke: rgba(102, 237, 197, 0.5);
  stroke-width: 2;
}

.dest {
  fill: var(--green);
}

.turn {
  position: absolute;
  left: 24px;
  top: 24px;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(8, 10, 13, 0.84);
}

.turn > span {
  font-size: 32px;
  color: var(--green);
}

.turn small {
  display: block;
  color: #737b86;
  font-size: 8px;
  letter-spacing: 0.13em;
}

.turn strong {
  font-weight: 350;
  font-size: 16px;
}

.route-destination {
  position: absolute;
  left: 26px;
  bottom: 24px;
  font-size: 12px;
  color: #7f8894;
}

.drive-info {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.drive-info > div {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(15, 17, 22, 0.78);
}

.drive-info small {
  font-size: 9px;
  letter-spacing: 0.17em;
  color: var(--muted);
}

.drive-info strong {
  display: block;
  font-size: 22px;
  font-weight: 300;
  margin-top: 7px;
}

.drive-info > div:first-child strong {
  font-size: 42px;
  font-weight: 200;
}

.drive-info span,
.drive-info p {
  display: block;
  color: #7b8490;
  font-size: 11px;
  margin-top: 5px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.progress-head strong {
  font-size: 13px;
  margin: 0;
}

.progress {
  height: 3px;
  background: #282e36;
  margin: 19px 0 10px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.5s;
}

.code {
  text-align: center;
}

.code strong {
  font-size: 34px;
  letter-spacing: 0.2em;
  font-weight: 300;
}

@media (max-width: 860px) {
  .cockpit {
    padding: 20px;
  }
  .panels,
  .drive-layout {
    grid-template-columns: 1fr;
  }
  .map {
    height: 360px;
  }
  .tabs {
    gap: 28px;
  }
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    height: auto;
  }
  .drive-pill,
  .meta {
    justify-self: start;
    text-align: left;
  }
  .voice-shell {
    margin: 18px 0;
  }
  .voice-main {
    flex-wrap: wrap;
  }
  .payment-total {
    font-size: 56px;
  }
}

/* —— Primary control: the orb is the mic —— */
.orb-btn {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.18s;
  /* Large enough to hit without looking away from the road. */
  min-width: 84px;
  min-height: 84px;
  justify-content: center;
}

.orb-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
}

.orb-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.orb-btn:focus-visible {
  outline: 1px solid rgba(102, 237, 197, 0.55);
  outline-offset: 3px;
}

.orb-caption {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.orb.idle,
.orb.offline,
.orb.connecting {
  background: radial-gradient(circle at 35% 30%, #dfe4ec, #8b939f 30%, #1b1f26 68%);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.07);
}

.orb.idle span,
.orb.offline span {
  border-color: rgba(255, 255, 255, 0.1);
  animation: none;
}

.orb.muted {
  background: radial-gradient(circle at 35% 30%, #4a5058, #2b3037 40%, #14181d 72%);
  box-shadow: none;
}

.orb.muted span {
  border-color: rgba(255, 255, 255, 0.07);
  animation: none;
}

.voice-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chevron {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: #8b929c;
  font-size: 12px;
  cursor: pointer;
}

.chevron:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

/* —— Status banner: its own slot, never the assistant line —— */
.status-banner {
  border-top: 1px solid var(--line);
  padding: 9px 18px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--blue);
  background: rgba(128, 167, 255, 0.06);
}

.drive-pill.warn i {
  background: #ffcc66;
  box-shadow: 0 0 10px #ffcc66;
}

/* —— Detail metadata as a definition list —— */
.detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  font-size: 11px;
}

.detail-meta dt {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-meta dd {
  margin: 0;
  color: var(--text);
}

/* —— Honest empty states instead of demo fixtures —— */
.empty-state {
  margin: auto;
  max-width: 420px;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: -0.02em;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.map-note {
  position: absolute;
  left: 18px;
  bottom: 14px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.28);
}

@media (max-width: 720px) {
  .cockpit {
    padding: 16px 14px 28px;
  }
  .voice-main {
    flex-wrap: wrap;
  }
  .voice-copy {
    order: 3;
    flex-basis: 100%;
  }
}
