/* /demo: the Odoo demo page. Builds on styles.css tokens; one accent, cards 14px,
   buttons and chips pills, inputs 10px. Light only. */

.demo-page .nav-links {
  gap: 24px;
}

/* Language switch: two pills in one track */
.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--pill);
  flex: none;
}
.lang button {
  border: 0;
  background: transparent;
  font: 600 13px/1 var(--mono);
  color: var(--muted);
  padding: 7px 10px;
  border-radius: var(--pill);
  cursor: pointer;
}
.lang button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--surface);
}

/* Hero */
.d-hero {
  padding: 64px 0 40px;
}
.d-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 64px;
  align-items: end;
}
.d-hero h1 {
  margin-top: 18px;
  font-size: clamp(34px, 3.7vw, 52px);
  font-weight: 740;
  font-stretch: 110%;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.d-hero-copy {
  display: grid;
  gap: 20px;
}
.d-honest {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--ink-2);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.d-honest .ico {
  color: var(--accent);
  margin-top: 1px;
}

/* Channel tabs */
.d-player {
  padding: 8px 0 88px;
}
.d-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.d-tabs [role='tab'] {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.d-tabs [role='tab']:hover {
  border-color: var(--line-2);
}
.d-tabs [role='tab'][aria-selected='true'] {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.d-tabs [role='tab'] > .ico {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.d-tab-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.d-tab-text b {
  font-size: 16px;
  font-weight: 650;
}
.d-tab-who {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The stage: conversation, work, quotation */
.d-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.78fr) minmax(0, 1fr);
  grid-template-areas: 'convo work quote';
  gap: 18px;
  align-items: start;
}
.d-convo {
  grid-area: convo;
  display: flex;
  flex-direction: column;
  height: 620px;
  overflow: hidden;
}
.d-work {
  grid-area: work;
  padding: 6px 4px;
}
.d-quote {
  grid-area: quote;
}

.d-convo-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.d-chip {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 2px 9px;
  white-space: nowrap;
}
.d-chip:empty {
  display: none;
}

/* Audio player (phone) */
.d-audio {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.d-audio[hidden] {
  display: none;
}
.d-play {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.d-play:hover {
  background: var(--accent-hover);
}
.d-play:active {
  transform: scale(0.96);
}
.d-audio-track {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}
.d-audio-bar {
  position: relative;
  height: 6px;
  border-radius: var(--pill);
  background: var(--line);
  overflow: hidden;
  cursor: pointer;
}
.d-audio-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
  border-radius: var(--pill);
}
.d-audio-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.d-audio-note {
  padding: 8px 18px;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.d-audio-note[hidden] {
  display: none;
}

/* E-mail header */
.d-email-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  background: var(--bg);
}
.d-email-head[hidden] {
  display: none;
}
.d-email-head dt {
  color: var(--muted);
}
.d-email-head dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.d-email-head .subj {
  font-weight: 650;
}

/* Conversation lines */
.d-lines {
  list-style: none;
  margin: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.d-line {
  max-width: 88%;
  display: grid;
  gap: 4px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.4s var(--ease),
    transform 0.4s var(--ease);
}
.d-line.show {
  opacity: 1;
  transform: none;
}
.d-line .who {
  font-size: 12px;
  color: var(--muted);
}
.d-line .txt {
  font-size: 15px;
  line-height: 1.45;
  padding: 10px 13px;
  border-radius: 12px;
  white-space: pre-line;
}
.d-line .tr {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  padding: 0 4px;
  white-space: pre-line;
}
.d-line.customer .txt {
  background: var(--bg-2);
  border-bottom-left-radius: 4px;
}
.d-line.agent {
  align-self: flex-end;
  justify-items: end;
}
.d-line.agent .who {
  text-align: right;
}
.d-line.agent .txt {
  background: var(--accent-soft);
  border-bottom-right-radius: 4px;
}
.d-line.now .txt {
  box-shadow: 0 0 0 2px var(--accent);
}
/* E-mails read as letters, not bubbles */
.d-convo[data-kind='email'] .d-line {
  max-width: 100%;
  align-self: stretch;
}
.d-convo[data-kind='email'] .d-line .txt {
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.d-convo[data-kind='email'] .d-line.agent .txt {
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}
.d-convo[data-kind='email'] .d-line.agent {
  justify-items: stretch;
}
.d-convo[data-kind='email'] .d-line.agent .who {
  text-align: left;
}
.d-typing {
  align-self: flex-end;
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
}
.d-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: d-blink 1.1s infinite;
}
.d-typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.d-typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes d-blink {
  50% {
    opacity: 1;
  }
}

.d-convo-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.d-link {
  border: 0;
  background: none;
  padding: 6px 2px;
  font: inherit;
  font-size: 15px;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.d-link:hover {
  color: var(--ink);
}

/* What Ana does */
.d-col-title {
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 18px;
}
.d-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.d-step {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 18px;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.d-step::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 28px;
  bottom: 2px;
  width: 1.5px;
  background: var(--line);
}
.d-step:last-child::before {
  display: none;
}
.d-step .dot {
  width: 26px;
  height: 26px;
  border-radius: var(--pill);
  border: 1.5px solid var(--line-2);
  background: var(--bg);
  display: grid;
  place-items: center;
  color: transparent;
  transition:
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease);
}
.d-step .dot .ico {
  width: 14px;
  height: 14px;
}
.d-step b {
  display: block;
  font-size: 15px;
  font-weight: 620;
  line-height: 1.3;
  padding-top: 3px;
}
.d-step .detail {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.4;
}
.d-step .at {
  font-family: var(--mono);
  font-size: 12px;
  margin-left: 6px;
  font-weight: 400;
}
.d-step.done {
  color: var(--ink);
}
.d-step.done .detail {
  color: var(--ink-2);
}
.d-step.done .at {
  color: var(--muted);
}
.d-step.done .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.d-step.done::before {
  background: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.d-step.human .dot {
  border-style: dashed;
}
.d-step.human.done .dot {
  border-style: solid;
}

/* The quotation, as Odoo holds it */
.d-quote {
  padding: 18px;
  display: grid;
  gap: 14px;
}
.d-quote-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.d-quote-app {
  font-size: 12px;
  color: var(--surface);
  background: #714b67;
  border-radius: var(--pill);
  padding: 2px 9px;
}
.d-quote-head b {
  font-size: 17px;
  font-weight: 680;
}
.d-quote-head .status {
  margin-left: auto;
}
.status.draft {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  color: var(--accent);
}
.d-quote-meta {
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 14px;
}
.d-quote-meta div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
}
.d-quote-meta dt {
  color: var(--muted);
}
.d-quote-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.d-quote-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.d-quote-lines th {
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.d-quote-lines td {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.35;
}
.d-quote-lines .num {
  text-align: right;
  white-space: nowrap;
  padding-left: 10px;
  font-family: var(--mono);
  font-size: 13px;
}
.d-quote-lines tr {
  transition: opacity 0.4s var(--ease);
}
.d-quote-lines tr.pending {
  opacity: 0;
}
.d-quote-lines .empty td {
  color: var(--muted);
  font-size: 13.5px;
  border-bottom: 0;
}
.d-quote-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--ink-2);
}
.d-quote-total b {
  font-size: 17px;
  color: var(--ink);
}
.d-approve {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}
.d-approve .btn {
  justify-content: center;
}
.d-approve .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.d-approve-note {
  font-size: 13.5px;
  color: var(--muted);
}
.d-approve-note a {
  color: var(--accent);
}

/* Odoo screenshots */
.d-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.d-shot {
  margin: 0;
  display: grid;
  gap: 12px;
}
.d-shot-wide {
  grid-column: 1 / -1;
}
.d-shot-open {
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: zoom-in;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}
.d-shot-open:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.d-shot-open img {
  width: 100%;
}
.d-shot figcaption {
  font-size: 15px;
  color: var(--ink-2);
}

.d-lightbox {
  width: min(1500px, 100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: auto;
}
.d-lightbox::backdrop {
  background: rgb(17 21 19 / 0.55);
}
.d-lightbox img {
  width: 100%;
}
.d-lightbox form {
  position: sticky;
  top: 0;
  height: 0;
  display: flex;
  justify-content: flex-end;
}
.d-lightbox-close {
  margin: 10px;
  width: 40px;
  height: 40px;
  border-radius: var(--pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* Rules */
.d-rules .rules {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}
.d-rules .rule {
  display: grid;
  gap: 10px;
  align-content: start;
}
.d-rules .rule .ico {
  width: 24px;
  height: 24px;
  color: var(--accent);
}
.d-rules .rule p {
  color: var(--ink-2);
  font-size: 16px;
}

/* Connect */
.d-connect-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.d-connect-intro {
  display: grid;
  gap: 18px;
}
.d-connect-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.d-connect-steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.d-connect-steps .num {
  width: 40px;
  height: 40px;
  border-radius: var(--pill);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
}
.d-connect-steps h3 {
  font-size: 18px;
  margin-bottom: 4px;
}
.d-connect-steps p {
  color: var(--ink-2);
  font-size: 16px;
}

.demo-page .closing h2 {
  font-size: clamp(30px, 3.6vw, 48px);
}

/* Tablet */
@media (max-width: 1080px) {
  .d-hero-grid,
  .d-connect-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .d-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'convo quote'
      'work work';
  }
  .d-rules .rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone */
@media (max-width: 768px) {
  .demo-page .lang {
    margin-left: auto;
  }
  .demo-page .nav-toggle {
    margin-left: 0;
  }
  .d-hero {
    padding: 36px 0 28px;
  }
  .d-tabs {
    gap: 6px;
  }
  .d-tabs [role='tab'] {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px;
  }
  .d-tab-who {
    display: none;
  }
  .d-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'convo'
      'work'
      'quote';
  }
  .d-convo {
    height: min(560px, 74dvh);
  }
  .d-line {
    max-width: 94%;
  }
  .d-shots,
  .d-rules .rules {
    grid-template-columns: minmax(0, 1fr);
  }
  .d-quote-meta div {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .d-player {
    padding-bottom: 80px;
  }
}
