/* Bellio demo — estilos de componente sobre los tokens de base (ver <style id="design-tokens">). */

[x-cloak] { display: none !important; }

/* Shared console: public /demo and the original standalone server. */
.standalone-demo .demo-console { max-width:1152px; margin:0 auto; padding:0 20px 64px; }
.public-site .demo-console .console-bar { height:48px; background:var(--surface); }
.public-site .demo-console .preview { background:var(--bg); }
.public-site .demo-console .preview-body { max-width:320px; padding:30px; }
.public-site .demo-console .phone { background:var(--surface-hover); }
.public-site .demo-console .sheet-row { min-height:42px; }
.public-site .demo-console .btn-primary { height:44px; }
.public-site .demo-console h2 { font-size:26px; letter-spacing:-.035em; }
.public-site .demo-console .phone h2 { font-size:22px; }
.public-site .demo-console .console-bar p { margin:0; }
.public-site .demo-console .services-editor { max-width:100%; }
.demo-console .legend { flex-wrap:wrap; }
.demo-console .sheet-row dd { overflow-wrap:anywhere; }
@media(max-width:600px) {
  .demo-console .console-bar { padding:0 14px; }
  .demo-console .live { padding:24px 16px; }
  .demo-console .sheet-row { grid-template-columns:105px minmax(0,1fr); }
  .demo-console .phone { padding:28px 20px; }
  .demo-console .btn-primary { white-space:normal; height:auto; min-height:44px; padding:10px 14px; }
}

html { scroll-behavior: smooth; }
body { font-feature-settings: "ss01", "cv11"; }
a { color: var(--ink); }

.wordmark {
  display: inline-block; width: 14px; height: 14px; border-radius: 4px;
  background: var(--ink); position: relative;
}
.wordmark::after {
  content: ""; position: absolute; inset: 4px; border-radius: 2px; background: var(--bg);
}

.eyebrow {
  font-family: "Geist Mono", monospace; font-size: 12px; letter-spacing: 0.01em;
  color: var(--text-muted);
}
.label { display: block; font-size: 13px; color: var(--text-muted); }

.nav-link {
  padding: 6px 10px; border-radius: var(--radius); color: var(--text-muted); text-decoration: none;
}
.nav-link:hover { color: var(--ink); background: var(--gray-100); }
.dark .nav-link:hover { background: var(--surface-hover); }

/* Buttons */
.btn-primary, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  border: 1px solid transparent; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-primary:hover:not(:disabled) { background: var(--btn-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); }
.dark .btn-ghost:hover:not(:disabled) { background: var(--surface-hover); }
.btn-danger { background: var(--danger-bg); color: var(--danger-fg); }
.btn-danger:hover:not(:disabled) { filter: brightness(0.97); }
.btn-primary:disabled, .btn-ghost:disabled, .btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .btn-danger:focus-visible, .input:focus-visible,
.icon-btn:focus-visible, .segmented button:focus-visible, .link-btn:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-color: var(--border-strong);
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: var(--radius); color: var(--text-muted); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: var(--gray-100); }
.dark .icon-btn:hover { background: var(--surface-hover); }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted);
  background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: var(--radius);
}
.link-btn:hover { color: var(--ink); }

/* Inputs */
.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--text-subtle); }
.input:hover { border-color: var(--border-strong); }
textarea.input { padding: 10px 12px; height: auto; resize: vertical; line-height: 1.5; }
.cell-input {
  width: 100%; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--ink); font-size: 14px;
}
.cell-input:hover { background: var(--surface-sunk); }
.cell-input:focus { outline: none; background: var(--surface); border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--focus-ring); }
.cell-input::placeholder { color: var(--text-subtle); }
input[type="number"].cell-input { -moz-appearance: textfield; }
input[type="number"].cell-input::-webkit-outer-spin-button, input[type="number"].cell-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.segmented {
  display: inline-flex; height: 40px; padding: 3px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-sunk);
}
.segmented button {
  padding: 0 12px; border-radius: 6px; border: 0; background: transparent; color: var(--text-muted);
  font-size: 13.5px; cursor: pointer;
}
.segmented button.is-on { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.chip-neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.chip-ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip-warn { background: var(--warn-bg); color: var(--warn-fg); }

/* Notices */
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-sunk); color: var(--text-muted); font-size: 14px; line-height: 1.5;
}
.notice code { font-size: 12.5px; color: var(--ink); }
.notice-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: transparent; }
.notice-danger code { color: inherit; }

/* Console */
.console {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden;
}
.console-bar {
  display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 16px;
  border-bottom: 1px solid var(--border); background: var(--surface-sunk);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray-400); display: inline-block; }
.dot-live { background: var(--ok-fg); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Phases */
.phases { display: grid; gap: 8px; font-size: 14px; color: var(--text-subtle); }
.phases li { display: flex; align-items: center; gap: 10px; transition: color .2s ease; }
.phases li.is-active { color: var(--ink); }
.phases li.is-done { color: var(--text-muted); }
.phase-mark {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: transparent;
  transition: all .2s ease;
}
.is-active .phase-mark { border-color: var(--ink); border-top-color: transparent; animation: spin .8s linear infinite; }
.is-done .phase-mark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.spinner {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Preview card on input step */
.preview {
  position: relative; height: 100%; min-height: 320px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface-sunk); overflow: hidden;
}
.preview-rings { position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; pointer-events: none; }
.preview-rings span {
  position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--border-strong); opacity: .6;
  animation: breathe 6s ease-in-out infinite;
}
.preview-rings span:nth-child(2) { inset: 40px; animation-delay: -2s; }
.preview-rings span:nth-child(3) { inset: 80px; animation-delay: -4s; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .35; } 50% { transform: scale(1.06); opacity: .7; } }
.preview-body { position: relative; padding: 24px; max-width: 300px; }

/* Phone */
.phone {
  display: flex; flex-direction: column; align-items: center; padding: 40px 28px 32px;
  border-bottom: 1px solid var(--border); text-align: center;
}
@media (min-width: 1024px) { .phone { border-bottom: 0; border-right: 1px solid var(--border); } }

.voice { position: relative; width: 168px; height: 168px; display: grid; place-items: center; --level: 0; }
.voice .avatar {
  position: relative; z-index: 2; width: 72px; height: 72px; border-radius: 50%;
  background: var(--gray-100); border: 1px solid var(--gray-200); color: var(--text-muted);
  display: grid; place-items: center; font-size: 22px; font-weight: 500; letter-spacing: -0.02em;
}
.dark .voice .avatar { background: var(--surface-sunk); border-color: var(--border-strong); }
.voice .vring {
  position: absolute; border-radius: 50%; border: 1px solid var(--border-strong);
  transition: transform .08s linear, opacity .3s ease, border-color .3s ease;
}
.voice .r1 { width: 96px; height: 96px; }
.voice .r2 { width: 128px; height: 128px; opacity: .7; }
.voice .r3 { width: 164px; height: 164px; opacity: .4; }

.voice.is-ringing .vring { animation: ringing 1.6s ease-in-out infinite; }
.voice.is-ringing .r2 { animation-delay: .12s; }
.voice.is-ringing .r3 { animation-delay: .24s; }
@keyframes ringing { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.voice.is-connecting .vring { border-style: dashed; animation: spin 6s linear infinite; }

.voice.is-live.mode-speaking .vring { border-color: var(--ink); }
.voice.is-live.mode-speaking .r1 { transform: scale(calc(1 + var(--level) * 0.10)); }
.voice.is-live.mode-speaking .r2 { transform: scale(calc(1 + var(--level) * 0.22)); }
.voice.is-live.mode-speaking .r3 { transform: scale(calc(1 + var(--level) * 0.34)); }
.voice.is-live.mode-listening .vring { border-color: var(--border-strong); }
.voice.is-live.mode-listening .avatar { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: scale(calc(1 + var(--level) * 0.12)); }
.voice.is-live.mode-listening .r1 { transform: scale(0.98); opacity: .9; }
.voice.is-live.mode-listening .r2 { transform: scale(0.96); opacity: .5; }
.voice.is-live.mode-listening .r3 { transform: scale(0.94); opacity: .25; }

.voice.is-ended .vring { opacity: .25; }
.voice.is-ended .avatar { color: var(--text-subtle); }

.ellipsis::after { content: "…"; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.5s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { width: 0; } 100% { width: 1.2em; } }

/* Live panel */
.live { padding: 24px 28px 28px; min-width: 0; }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.sheet { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sheet-row {
  display: grid; grid-template-columns: 140px 1fr; align-items: center; min-height: 38px;
  border-bottom: 1px solid var(--border); padding: 0 12px; transition: background-color .6s ease;
}
.sheet-row:last-child { border-bottom: 0; }
.sheet-row dt { font-size: 13px; color: var(--text-muted); }
.sheet-row dd { font-size: 14px; color: var(--text-subtle); margin: 0; }
.sheet-row.has-value dd { color: var(--ink); animation: fill-in .7s ease; }
@keyframes fill-in { 0% { background: var(--gray-100); } 100% { background: transparent; } }
.dark .sheet-row.has-value dd { animation-name: fill-in-dark; }
@keyframes fill-in-dark { 0% { background: var(--surface-hover); } 100% { background: transparent; } }

/* Agenda */
.legend { display: flex; gap: 12px; font-family: "Geist Mono", monospace; font-size: 11.5px; color: var(--text-subtle); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--border); }
.sw-busy { background: var(--gray-100); }
.dark .sw-busy { background: var(--surface-hover); }
.sw-offered { background: var(--warn-bg); border-color: transparent; }
.sw-booked { background: var(--ok-bg); border-color: transparent; }

.agenda-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: 520px; background: var(--surface); }
.agenda {
  display: grid; grid-template-columns: 48px repeat(var(--cols), minmax(88px, 1fr));
  min-width: 100%; font-family: "Geist Mono", monospace; font-size: 11px;
}
.agenda-corner, .agenda-day {
  position: sticky; top: 0; z-index: 1; background: var(--surface-sunk); height: 30px;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 8px; color: var(--text-muted);
}
.agenda-day.is-today { color: var(--ink); font-weight: 500; }
.agenda-day.is-today::after { content: "hoy"; margin-left: auto; font-size: 10px; color: var(--text-subtle); }
.agenda-time {
  height: 24px; border-right: 1px solid var(--border); border-bottom: 1px solid transparent;
  color: var(--text-subtle); font-size: 10.5px; display: flex; align-items: flex-start; padding: 2px 6px 0 8px;
}
.cell {
  height: 24px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: background-color .35s ease, color .35s ease, box-shadow .35s ease;
}
.cell span { overflow: hidden; text-overflow: ellipsis; }
.cell-free { background: transparent; }
.cell-busy { background: var(--gray-100); color: var(--text-muted); }
.dark .cell-busy { background: var(--surface-hover); }
.cell-closed { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--gray-100) 6px 7px); }
.dark .cell-closed { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-hover) 6px 7px); }
.cell-booked { background: var(--ok-bg); color: var(--ok-fg); font-weight: 500; animation: pop .5s ease; }
.cell.mark-requested { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.cell.mark-offered { background: var(--warn-bg); color: var(--warn-fg); }
.cell.mark-offered span:empty::before { content: "libre"; }
.agenda-nav { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; }
.sw-requested { box-shadow: inset 0 0 0 2px var(--ink); border-color: transparent; }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

/* Features */
.feature { background: var(--surface); padding: 28px 28px 30px; }
.feature i { font-size: 22px; color: var(--text-muted); }
.feature h3 { margin-top: 18px; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.feature p { margin-top: 8px; font-size: 14.5px; line-height: 1.6; color: var(--text-muted); }
.stat dt { font-family: "Geist Mono", monospace; font-size: 12px; color: var(--text-subtle); }
.stat dd { margin-top: 4px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
