:root {
  color-scheme: dark;
  --bg: #171821;
  --bg2: #252338;
  --bg3: #312447;
  --card: rgba(255, 255, 255, 0.09);
  --card2: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --yellow: #ffd166;
  --pink: #ff6b6b;
  --green: #5dffb8;
  --dark: #090a12;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 650;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 107, 107, 0.26), transparent 30%),
    radial-gradient(circle at 78% 34%, rgba(255, 209, 102, 0.18), transparent 28%),
    linear-gradient(145deg, var(--bg), var(--bg2) 52%, var(--bg3));
  -webkit-font-smoothing: antialiased;
}

a, button, input, select { color: inherit; font: inherit; min-width: 0; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

body[data-authed="false"] .app-shell {
  grid-template-columns: 1fr;
}

body[data-authed="false"] .app-rail,
body[data-authed="false"] .mobile-top,
body[data-menu="hidden"] .app-rail,
body[data-menu="hidden"] .mobile-top,
[hidden] {
  display: none;
}

.app-rail {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(9, 10, 18, 0.42);
  backdrop-filter: blur(28px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 900;
}
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(255, 209, 102, 0.18);
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}
.side-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 850;
}
.side-nav a:hover, .side-nav a:focus-visible, .side-nav a.active {
  outline: none;
  border-color: rgba(255, 209, 102, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.download-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
}
.download-card a, .download-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.workspace {
  min-width: 0;
  padding: clamp(14px, 3vw, 34px);
}
.mobile-top { display: none; }

.hero {
  min-height: 330px;
  display: grid;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: clamp(24px, 5vw, 54px);
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(180deg, transparent, rgba(9, 10, 18, 0.74)),
    radial-gradient(circle at 18% 12%, rgba(255, 209, 102, 0.24), transparent 30%),
    radial-gradient(circle at 82% 56%, rgba(255, 107, 107, 0.28), transparent 30%),
    rgba(255, 255, 255, 0.08);
}
.hero::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: 36px;
  top: 34px;
  border-radius: 42px;
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  opacity: 0.16;
  transform: rotate(12deg);
}
.eyebrow, .metrics span, .download-card small {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
h1 {
  max-width: 920px;
  margin-top: 12px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.92;
  font-weight: 900;
}
h2 {
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1;
  font-weight: 900;
}
.summary, small, .panel p, .booking-row small, .step-grid p, .service-grid p { color: var(--muted); }

.auth-grid {
  min-height: calc(100svh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 470px);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
}
.auth-copy {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.auth-logo {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 209, 102, 0.36);
  border-radius: 30px;
  background: var(--dark);
  box-shadow: 0 24px 54px rgba(255, 209, 102, 0.14);
}
.auth-logo img { width: 68px; height: 68px; }
.auth-copy h1 { margin-top: 0; }
.auth-panel {
  min-width: 0;
  border-radius: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(9, 10, 18, 0.48);
  backdrop-filter: blur(20px);
  display: grid;
  gap: 20px;
}
.auth-panel .panel { background: transparent; border: 0; padding: 0; }
.signup-panel {
  border-top: 1px solid var(--line) !important;
  padding-top: 20px !important;
}
.form-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  text-align: center;
}
.form-footer button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--yellow);
  font-weight: 900;
}
.slide-dots {
  display: flex;
  gap: 8px;
}
.slide-dots span {
  width: 34px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}
.slide-dots span:first-child {
  width: 58px;
  background: linear-gradient(135deg, var(--pink), var(--yellow));
}
.phone-preview {
  min-width: 0;
  min-height: 520px;
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(9, 10, 18, 0.64);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
}
.phone-top {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
}
.phone-top span {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(93, 255, 184, 0.13);
  color: var(--green);
  font-size: 12px;
}
.phone-card {
  min-height: 112px;
  display: grid;
  align-content: end;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.08);
}
.phone-card.hot {
  min-height: 172px;
  background:
    linear-gradient(180deg, transparent, rgba(9, 10, 18, 0.74)),
    linear-gradient(135deg, rgba(255, 107, 107, 0.88), rgba(255, 209, 102, 0.82));
}
.auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.auth-actions button:not(.primary) {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.metrics article, .panel, .step-grid article, .service-grid article {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
}
.metrics article {
  min-height: 126px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
}
.metrics strong {
  overflow-wrap: anywhere;
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 900;
}
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px;
  min-width: 0;
}
.panel.wide, .wide-form { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 900; }
input, select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(255, 209, 102, 0.52);
}
.primary, .panel button:not(.booking-row), .step-grid button, .service-grid button {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  color: #171821;
  font-weight: 900;
}
.action-row, .row-actions, .download-links { display: flex; flex-wrap: wrap; gap: 10px; }
.action-row button { flex: 1 1 180px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.booking-list { display: grid; gap: 10px; }
.booking-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}
.booking-row > span { display: grid; gap: 4px; }
.booking-row > span, .booking-row strong, .booking-row small { min-width: 0; overflow-wrap: anywhere; }
.booking-row > span:last-child { text-align: right; }
.booking-row b { color: var(--green); }
.row-actions { justify-content: flex-end; }
.row-actions i {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.step-grid, .service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.step-grid article, .service-grid article {
  min-height: 210px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 22px;
}
.step-grid article.done {
  border-color: rgba(93, 255, 184, 0.42);
  background: rgba(93, 255, 184, 0.08);
}
.step-grid span, .service-grid span { color: var(--yellow); font-weight: 900; }
.service-grid article { min-height: 170px; }
.pill-list, .payout-steps { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-list span, .payout-steps span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 900;
}
.chat-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.conversation-list, .chat-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
}
.conversation-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}
.conversation-tools {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
#conversationItems {
  display: grid;
  gap: 8px;
}
.conversation-card {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}
.conversation-card:hover, .conversation-card:focus-visible, .conversation-card.active {
  outline: none;
  border-color: rgba(255, 209, 102, 0.3);
  background: rgba(255, 255, 255, 0.1);
}
.conversation-card span {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.conversation-card span:last-child {
  justify-items: end;
  text-align: right;
}
.conversation-card strong, .conversation-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-card b {
  color: var(--green);
  font-size: 12px;
}
.conversation-card i {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--yellow);
  color: #171821;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.avatar {
  width: 44px;
  height: 44px;
  display: grid !important;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  color: #171821;
  font-weight: 900;
}
.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto;
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}
.chat-header > div {
  min-width: 0;
}
.chat-header button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}
.chat-feed {
  min-height: 340px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.05);
  overflow-y: auto;
}
.bubble {
  max-width: 76%;
  display: grid;
  gap: 4px;
  border-radius: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}
.bubble.mine {
  justify-self: end;
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  color: #171821;
}
.bubble.mine span { color: rgba(23, 24, 33, 0.72); }
.bubble small { color: var(--muted); font-size: 11px; }
.bubble.mine small { color: rgba(23, 24, 33, 0.66); }
.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  border-radius: 999px;
  padding: 12px 16px;
  background: #fff;
  color: #171821;
  font-weight: 900;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 236px minmax(0, 1fr); }
  .app-rail { padding: 18px; }
  .hero { min-height: 280px; }
  h1 { font-size: clamp(38px, 6vw, 72px); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; padding-bottom: 78px; }
  body[data-authed="false"] .app-shell,
  body[data-menu="hidden"] .app-shell { padding-bottom: 0; }
  .app-rail {
    position: fixed;
    inset: auto 12px 12px;
    z-index: 10;
    height: auto;
    display: block;
    max-width: calc(100vw - 24px);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 8px;
    background: rgba(9, 10, 18, 0.82);
  }
  .app-rail .brand, .download-card { display: none; }
  .side-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .side-nav a {
    flex: 0 0 auto;
    min-height: 44px;
    padding-inline: 14px;
    font-size: 13px;
  }
  .mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }
  .mobile-top select { width: min(190px, 48vw); }
  .auth-grid, .content-grid, .chat-layout { grid-template-columns: 1fr; }
  .conversation-list { max-height: 320px; overflow-y: auto; }
  .phone-preview { min-height: auto; }
}

@media (max-width: 640px) {
  .workspace { padding: 12px; }
  .hero { min-height: 0; border-radius: 24px; padding: 20px; }
  h1 { font-size: clamp(34px, 11vw, 50px); line-height: 0.98; }
  h2 { font-size: clamp(22px, 7vw, 32px); }
  .auth-grid { min-height: auto; gap: 18px; }
  .auth-logo { width: 86px; height: 86px; border-radius: 24px; }
  .auth-logo img { width: 58px; height: 58px; }
  .auth-panel, .panel, .metrics article, .step-grid article, .service-grid article { border-radius: 22px; }
  .form-grid, .chat-input { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics article { min-height: 112px; padding: 16px; }
  .content-grid, .step-grid, .service-grid { gap: 10px; }
  .panel { padding: 18px; }
  .action-row button { flex-basis: 100%; }
  .booking-row { align-items: flex-start; flex-direction: column; }
  .booking-row > span:last-child { text-align: left; }
  .row-actions { justify-content: flex-start; }
  .bubble { max-width: 92%; }
  .chat-header { align-items: flex-start; flex-direction: column; }
  .chat-panel { grid-template-rows: auto minmax(280px, 1fr) auto; }
  .conversation-card { grid-template-columns: 40px minmax(0, 1fr); }
  .conversation-card span:last-child { grid-column: 2; justify-items: start; text-align: left; }
}

@media (max-width: 420px) {
  .workspace { padding: 10px; }
  .auth-panel, .panel { padding: 16px; }
  .metrics { grid-template-columns: 1fr; }
  .download-links a, .pill-list span, .payout-steps span { width: 100%; }
  .side-nav a { padding-inline: 12px; font-size: 12px; }
  .conversation-list, .chat-panel { border-radius: 20px; }
  .chat-feed { padding: 12px; }
}
