:root {
  --bg: #0a0a0a;
  --bg-2: #0f0f0f;
  --surface: #151515;
  --surface-2: #1c1c1c;
  --surface-3: #242424;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3f0ea;
  --muted: #9b968d;
  --faint: #6a665f;
  --accent: #c9a46b;
  --accent-2: #e3c58f;
  --accent-ink: #1b1409;
  --ok: #5fd28a;
  --danger: #e2655b;
  --pole-red: #c0392b;
  --pole-blue: #2d4f8f;

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gothic: 'Pirata One', var(--serif);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --panel-w: 380px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- ambience ---------- */
.spotlight {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px circle at var(--mx, 70%) var(--my, 20%), rgba(201, 164, 107, 0.07), transparent 60%),
    radial-gradient(900px circle at 100% 0%, rgba(255, 255, 255, 0.035), transparent 60%);
  transition: background 0.2s;
}
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 60; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; pointer-events: auto; }
.intro-half { position: absolute; left: 0; right: 0; height: 50.5%; background: #000; transition: transform 0.9s var(--ease); }
.intro-top { top: 0; }
.intro-bot { bottom: 0; }
.intro-logo {
  position: relative; width: min(78vw, 640px); opacity: 0;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.35));
}
.intro-blade {
  position: absolute; left: 50%; top: 50%; width: 160vmax; height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent-2) 30%, #fff 50%, var(--accent-2) 70%, transparent);
  box-shadow: 0 0 14px var(--accent);
  transform: translate(-50%, -50%) rotate(-8deg) scaleX(0);
  opacity: 0;
}
.intro-skip {
  position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); right: 24px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint);
  padding: 10px 12px;
}
.intro.go .intro-logo { animation: flicker 1.3s 0.1s forwards; }
.intro.cut .intro-blade { animation: blade 0.5s var(--ease) forwards; }
.intro.open .intro-top { transform: translateY(-101%) rotate(-1.5deg); }
.intro.open .intro-bot { transform: translateY(101%) rotate(-1.5deg); }
.intro.open .intro-logo { transition: opacity 0.4s, transform 0.9s var(--ease); opacity: 0; transform: scale(1.08); animation: none; }
.intro.open .intro-blade, .intro.open .intro-skip { opacity: 0; transition: opacity 0.3s; }
.intro.done { display: none; }
@keyframes flicker {
  0% { opacity: 0; } 8% { opacity: 0.9; } 10% { opacity: 0.1; } 18% { opacity: 0.85; } 21% { opacity: 0.2; }
  35% { opacity: 1; } 38% { opacity: 0.55; } 44%, 100% { opacity: 1; }
}
@keyframes blade {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scaleX(0); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scaleX(1); }
}

/* ---------- layout ---------- */
.app {
  position: relative; z-index: 1;
  height: 100dvh;
  display: grid; grid-template-columns: var(--panel-w) 1fr;
}
.chat {
  position: relative; min-width: 0; min-height: 0;
  display: grid; grid-template-rows: auto 1fr auto;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 40%);
}

/* ---------- panel ---------- */
.panel { position: relative; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.panel-inner { padding: 24px 22px 28px; display: flex; flex-direction: column; gap: 22px; min-height: 100%; }
.panel .panel-close { display: none; }
.sign {
  margin: 0; position: relative; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 0 6px rgba(255, 255, 255, 0.02);
  transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform 0.4s var(--ease);
  will-change: transform;
}
.sign img { width: 100%; height: auto; aspect-ratio: 1800 / 1000; object-fit: cover; }
.sign-glare {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(400px circle at var(--gx, 30%) var(--gy, 0%), rgba(255, 255, 255, 0.14), transparent 50%);
}
.status {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  padding: 8px 14px 8px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13px; color: var(--muted);
}
.status b { color: var(--text); font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); position: relative; }
.status.open .status-dot { background: var(--ok); }
.status.open .status-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--ok);
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }

.panel-h {
  margin: 0 0 12px; font: 500 11px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint);
  display: flex; align-items: center; gap: 10px;
}
.panel-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.barber-list { display: grid; gap: 10px; }
.barber-mini {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 10px 10px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.barber-mini:hover { border-color: var(--line-2); transform: translateY(-1px); }
.mono {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #222, #0c0c0c); border: 1px solid var(--line-2);
  font-size: 28px; line-height: 1; color: var(--text);
}
.mono.frontera { font-family: var(--gothic); }
.mono.greg { font-family: var(--serif); font-weight: 300; }
.mono.any { font: 500 18px/1 var(--sans); color: var(--accent); }
.barber-mini .bn { font-weight: 500; }
.barber-mini .bh { font-size: 12.5px; color: var(--muted); }
.barber-links { display: flex; gap: 4px; }
.barber-links a {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.barber-links a:hover { background: var(--surface-3); color: var(--text); }
.barber-links svg { width: 17px; height: 17px; }

.price-list { list-style: none; margin: 0; padding: 0; display: grid; }
.price-list li {
  display: flex; align-items: baseline; gap: 8px; padding: 9px 0; font-size: 14px;
  border-bottom: 1px dashed var(--line);
}
.price-list li:last-child { border-bottom: 0; }
.price-list .dots { flex: 1; }
.price-list .pd { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.price-list .pp { font-family: var(--serif); font-size: 16px; color: var(--accent-2); }

.mini-bookings { display: grid; gap: 8px; }
.mini-bk {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; text-align: left;
  padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line);
}
.mini-bk .d { text-align: center; padding-right: 12px; border-right: 1px dashed var(--line-2); }
.mini-bk .d b { display: block; font: 400 22px/1 var(--serif); }
.mini-bk .d span { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }
.mini-bk .i { font-size: 13px; color: var(--muted); }
.mini-bk .i strong { color: var(--text); font-weight: 500; display: block; font-size: 14px; }

.panel-foot { margin-top: auto; padding-top: 8px; opacity: 0.35; }
.panel-logo { width: 140px; }

/* ---------- chat header ---------- */
.chat-head {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(10, 10, 10, 0.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.agent { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  background: radial-gradient(circle at 30% 25%, #2a2a2a, #0b0b0b); border: 1px solid var(--line-2); color: var(--accent-2);
}
.avatar::after {
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ok); border: 2px solid var(--bg);
}
.avatar svg { width: 19px; height: 19px; }
.agent-name { font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.agent-sub { font-weight: 400; color: var(--muted); margin-left: 4px; }
.agent-state { font-size: 12.5px; color: var(--muted); transition: color 0.2s; white-space: nowrap; }
.agent-state.typing { color: var(--accent-2); }
.head-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.only-mobile { display: none; }
.pole-line {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; opacity: 0; transition: opacity 0.3s;
  background: repeating-linear-gradient(-45deg, var(--pole-red) 0 8px, #f3f0ea 8px 16px, var(--pole-blue) 16px 24px, #f3f0ea 24px 32px);
  background-size: 45px 100%;
  animation: pole 0.7s linear infinite;
}
.chat.busy .pole-line { opacity: 0.9; }

/* ---------- thread ---------- */
.scroller { overflow-y: auto; min-height: 0; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.thread { max-width: 760px; margin: 0 auto; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 6px; }

.hero { text-align: center; padding: 6vh 0 28px; transition: opacity 0.5s, transform 0.5s var(--ease); }
.hero-logo { width: min(100%, 420px); margin: 0 auto; filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.08)); }
.hero-tag { margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.hero-tag em { font-family: var(--serif); font-style: italic; color: var(--text); font-size: 17px; }
.thread.started .hero { padding: 2vh 0 18px; }
.thread.started .hero-logo { width: min(70%, 260px); opacity: 0.55; transition: width 0.6s var(--ease), opacity 0.6s; }

.day-sep {
  align-self: center; margin: 10px 0; padding: 4px 12px; border-radius: 99px;
  font: 500 10.5px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
  border: 1px solid var(--line);
}

.msg { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.msg.user { align-items: flex-end; margin-top: 10px; }
.msg.bot { align-items: flex-start; margin-top: 4px; }
.msg.bot + .msg.bot { margin-top: 0; }
.bubble {
  max-width: min(84%, 560px); padding: 11px 15px; border-radius: 18px; word-wrap: break-word; white-space: pre-wrap;
  font-size: 15px; line-height: 1.5;
}
.msg.bot .bubble { background: var(--surface-2); border: 1px solid var(--line); border-top-left-radius: 6px; }
.msg.bot + .msg.bot .bubble { border-top-left-radius: 18px; }
.msg.user .bubble {
  background: linear-gradient(180deg, #f6f2ea, #e6dfd2); color: #121212; border-bottom-right-radius: 6px;
  box-shadow: 0 8px 24px -14px rgba(255, 255, 255, 0.35);
}
.bubble strong { font-weight: 600; }
.msg.bot .bubble strong { color: var(--accent-2); }
.meta { font: 400 11px/1 var(--mono); color: var(--faint); display: flex; align-items: center; gap: 4px; padding: 0 4px; }
.meta svg { width: 14px; height: 14px; color: var(--accent); }

.anim .bubble, .anim .block { animation: pop 0.45s var(--spring) both; }
.msg.user.anim .bubble { transform-origin: 100% 100%; }
.msg.bot.anim .bubble { transform-origin: 0 0; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: none; } }

/* typing indicator: a tiny spinning barber pole */
.typing { display: flex; align-items: center; gap: 10px; padding: 6px 2px; animation: pop 0.3s var(--ease) both; }
.pole {
  width: 12px; height: 34px; border-radius: 6px; position: relative; overflow: hidden;
  border: 1.5px solid #ddd; box-shadow: 0 0 12px rgba(192, 57, 43, 0.25);
  background: repeating-linear-gradient(-35deg, var(--pole-red) 0 5px, #f3f0ea 5px 10px, var(--pole-blue) 10px 15px, #f3f0ea 15px 20px);
  background-size: 100% 24.4px;
  animation: pole-y 0.6s linear infinite;
}
.pole::before, .pole::after { content: ''; position: absolute; left: -2px; right: -2px; height: 3px; background: #ddd; }
.pole::before { top: 0; } .pole::after { bottom: 0; }
.typing span { font-size: 13px; color: var(--muted); font-style: italic; }
@keyframes pole-y { to { background-position: 0 24.4px; } }
@keyframes pole { to { background-position: 45px 0; } }

/* ---------- blocks ---------- */
.block { width: 100%; max-width: 600px; }
.used .block, .block.used { opacity: 0.5; pointer-events: none; filter: saturate(0.4); transition: opacity 0.4s; }
.used .block.keep, .block.keep { opacity: 1; pointer-events: auto; filter: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 99px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.02); font-size: 14px; text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--spring), color 0.2s;
}
.chip svg { width: 16px; height: 16px; color: var(--accent); }
.chip:hover { background: var(--surface-2); border-color: var(--accent); }
.chip:active { transform: scale(0.95); }
.anim .chip { animation: pop 0.4s var(--spring) both; }

/* services */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.svc {
  position: relative; text-align: left; padding: 14px 14px 12px; border-radius: var(--r); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-height: 120px;
  transition: border-color 0.2s, transform 0.25s var(--spring), background 0.2s;
}
.svc:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface-2); }
.svc:active { transform: scale(0.97); }
.svc .sn { font-weight: 600; font-size: 15px; }
.svc .sd { font-size: 12.5px; color: var(--muted); line-height: 1.4; flex: 1; }
.svc .sf { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.svc .sp { font: 400 20px/1 var(--serif); color: var(--accent-2); }
.svc .sp small { font-size: 12px; color: var(--muted); margin-right: 2px; }
.svc .st { font: 400 11.5px/1 var(--mono); color: var(--faint); }
.svc.featured { border-color: rgba(201, 164, 107, 0.45); background: linear-gradient(160deg, rgba(201, 164, 107, 0.12), var(--surface) 55%); }
.svc .badge {
  position: absolute; top: 10px; right: 10px; font: 500 9.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
}
.svc.selected { border-color: var(--accent); background: var(--surface-2); opacity: 1; }

/* barbers */
.barber-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.barber-card {
  position: relative; text-align: left; border-radius: var(--r-lg); overflow: hidden; min-height: 170px;
  padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  background: radial-gradient(120% 90% at 80% 0%, #262626, #0e0e0e 70%); border: 1px solid var(--line-2);
  transition: transform 0.3s var(--spring), border-color 0.2s;
}
.barber-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.barber-card .big {
  position: absolute; top: -6px; right: 10px; font-size: 120px; line-height: 1; color: rgba(255, 255, 255, 0.07);
  transition: color 0.3s, transform 0.5s var(--ease);
}
.barber-card:hover .big { color: rgba(201, 164, 107, 0.22); transform: translateY(4px) rotate(-4deg); }
.barber-card .big.frontera { font-family: var(--gothic); }
.barber-card .big.greg { font-family: var(--serif); font-weight: 300; }
.barber-card .bname { font-size: 24px; line-height: 1.1; }
.barber-card .bname.frontera { font-family: var(--gothic); font-size: 30px; }
.barber-card .bname.greg { font-family: var(--serif); text-transform: uppercase; letter-spacing: 0.04em; }
.barber-card .btag { font-size: 12.5px; color: var(--muted); }
.barber-card .bhandle { font: 400 11.5px/1 var(--mono); color: var(--faint); margin-top: 4px; }
.any-btn { margin-top: 10px; }

/* dates */
.dates {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory;
  scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.dates::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 64px; padding: 10px 0 9px; border-radius: 14px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.25s var(--spring), border-color 0.2s, background 0.2s;
}
.day .dw { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.day .dn { font: 400 24px/1 var(--serif); }
.day .dm { font-size: 11px; color: var(--faint); }
.day .df { width: 22px; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.day .df i { display: block; height: 100%; background: var(--accent); }
.day:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.day:disabled { opacity: 0.35; cursor: not-allowed; }
.day:disabled .dn { text-decoration: line-through; text-decoration-thickness: 1px; }
.day.today { border-color: rgba(201, 164, 107, 0.5); }
.day.selected { background: var(--text); color: var(--bg); border-color: var(--text); }
.day.selected .dw, .day.selected .dm { color: #555; }

/* slots */
.slots-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.slots-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.slots-head b { font: 400 18px/1.2 var(--serif); }
.slots-head span { font: 400 11.5px/1 var(--mono); color: var(--muted); }
.slot-group + .slot-group { margin-top: 12px; }
.slot-label { font: 500 10px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.slot-label svg { width: 13px; height: 13px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.slot {
  padding: 9px 0; border-radius: 10px; font: 500 13.5px/1 var(--mono); text-align: center;
  border: 1px solid var(--line-2); background: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.2s var(--spring);
}
.slot:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: scale(1.04); }
.slot:disabled { color: var(--faint); border-color: transparent; background: rgba(255, 255, 255, 0.02); text-decoration: line-through; cursor: not-allowed; }
.slot.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.anim .slot { animation: pop 0.35s var(--spring) both; }

/* summary */
.summary {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; max-width: 420px;
}
.sum-rows { padding: 6px 16px; }
.sum-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sum-row:last-child { border-bottom: 0; }
.sum-row span { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sum-row span svg { width: 15px; height: 15px; color: var(--faint); }
.sum-row b { font-weight: 500; text-align: right; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; background: var(--bg-2); border-top: 1px dashed var(--line-2); }
.sum-total span { font: 500 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.sum-total b { font: 400 26px/1 var(--serif); color: var(--accent-2); }
.sum-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 14px;
  font-weight: 600; font-size: 14.5px; text-decoration: none;
  transition: transform 0.2s var(--spring), background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -12px rgba(201, 164, 107, 0.7); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 9px 12px; font-size: 13px; border-radius: 11px; font-weight: 500; }

/* ticket */
.ticket-wrap { max-width: 440px; position: relative; }
.ticket {
  --notch: 13px;
  position: relative; display: grid; grid-template-columns: 1fr 108px; color: #121212;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.55));
}
.t-main, .t-stub { background: linear-gradient(170deg, #f7f3ec, #e8e1d4); position: relative; }
.t-main {
  border-radius: 18px 0 0 18px; padding: 18px 18px 16px;
  -webkit-mask: radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.t-stub {
  border-radius: 0 18px 18px 0; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-left: 2px dashed rgba(0, 0, 0, 0.22);
  -webkit-mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  transform-origin: 0 50%;
}
.t-logo { width: 150px; filter: invert(1); opacity: 0.9; }
.t-ok { display: inline-flex; align-items: center; gap: 6px; font: 500 10px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: #2f7a4a; margin: 14px 0 6px; }
.t-ok svg { width: 13px; height: 13px; stroke-width: 2.4; }
.t-svc { font: 400 26px/1.1 var(--serif); }
.t-with { font-size: 13.5px; color: #555; margin-top: 2px; }
.t-with b { color: #121212; font-weight: 600; }
.t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, 0.1); }
.t-grid span { display: block; font: 500 9.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: #777; margin-bottom: 4px; }
.t-grid b { font-weight: 600; font-size: 14px; }
.t-time { font: 400 34px/1 var(--serif); }
.t-code { font: 500 12px/1 var(--mono); letter-spacing: 0.12em; writing-mode: vertical-rl; transform: rotate(180deg); color: #333; }
.t-barcode { width: 46px; height: 46px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.t-barcode i { background: #121212; border-radius: 1px; }
.t-barcode i.o { background: transparent; }
.scissors {
  position: absolute; z-index: 2; top: -16px; right: 95px; width: 26px; height: 26px; color: var(--text);
  transform: rotate(90deg); opacity: 0; pointer-events: none;
}
.scissors svg { width: 26px; height: 26px; stroke-width: 1.8; }
.anim .scissors { animation: snip-move 1.1s 0.5s var(--ease) both; }
.anim .scissors svg { animation: snip 0.18s 0.5s 6 alternate; }
.anim .t-stub { animation: stub 0.7s 1.45s var(--spring) both; }
@keyframes snip-move {
  0% { opacity: 0; top: -22px; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; top: calc(100% - 4px); }
}
@keyframes snip { from { transform: scaleX(1); } to { transform: scaleX(0.6); } }
@keyframes stub { 0% { transform: none; } 40% { transform: translateX(8px) rotate(4deg); } 100% { transform: translateX(3px) rotate(1.5deg); } }
.t-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* my bookings */
.bk-list { display: grid; gap: 10px; max-width: 480px; }
.bk {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
}
.bk-date { text-align: center; border-right: 1px dashed var(--line-2); padding-right: 12px; }
.bk-date b { display: block; font: 400 30px/1 var(--serif); }
.bk-date span { font: 500 10px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.bk-date i { display: block; font-style: normal; margin-top: 6px; font: 500 13px/1 var(--mono); color: var(--accent-2); }
.bk-info strong { font-weight: 600; }
.bk-info p { margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.bk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-danger { color: var(--danger); border: 1px solid rgba(226, 101, 91, 0.35); }
.btn-danger:hover { background: rgba(226, 101, 91, 0.1); }

/* hours & contact */
.hours { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; max-width: 360px; }
.hours-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; border-bottom: 1px solid var(--line); text-transform: capitalize; }
.hours-row:last-of-type { border-bottom: 0; }
.hours-row span:last-child { font-family: var(--mono); font-size: 13px; color: var(--muted); text-transform: none; }
.hours-row.closed span:last-child { color: var(--faint); }
.hours-row.today { color: var(--accent-2); }
.hours-row.today span:first-child::after { content: ' · hoje'; font-size: 11px; color: var(--accent); text-transform: none; }
.hours-note { font-size: 12px; color: var(--faint); padding: 8px 0 6px; }
.contact-grid { display: grid; gap: 8px; max-width: 420px; }

/* jump to bottom */
.jump {
  position: absolute; right: 22px; bottom: 112px; z-index: 4; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: pop 0.3s var(--spring);
}

/* ---------- composer ---------- */
.composer { padding: 10px 20px; padding-bottom: max(14px, env(safe-area-inset-bottom)); position: relative; z-index: 3; }
.composer::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 40px; pointer-events: none;
  background: linear-gradient(transparent, var(--bg));
}
.composer-box {
  max-width: 712px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px;
  padding: 6px 6px 6px 18px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer-box:focus-within { border-color: rgba(201, 164, 107, 0.6); box-shadow: 0 0 0 4px rgba(201, 164, 107, 0.08); }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 400 16px/1.45 var(--sans); padding: 9px 0; max-height: 140px; min-height: 24px;
}
.composer textarea::placeholder { color: var(--faint); }
.send, .mic {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  transition: transform 0.25s var(--spring), background 0.2s, opacity 0.2s, color 0.2s;
}
.send { background: var(--accent); color: var(--accent-ink); }
.send svg { stroke-width: 2.2; }
.send:disabled { background: var(--surface-3); color: var(--faint); cursor: default; }
.send:not(:disabled):hover { transform: scale(1.06) rotate(-8deg); }
.mic { color: var(--muted); }
.mic:hover { background: var(--surface-2); color: var(--text); }
.mic.rec { color: #fff; background: var(--danger); animation: rec 1.2s ease-in-out infinite; }
@keyframes rec { 50% { box-shadow: 0 0 0 8px rgba(226, 101, 91, 0.2); } }
.composer-note { max-width: 712px; margin: 7px auto 0; text-align: center; font-size: 11.5px; color: var(--faint); }

.scrim { display: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 90; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 99px; background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 500;
  animation: pop 0.3s var(--spring); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) { :root { --panel-w: 330px; } }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .chat { border-left: 0; }
  .only-mobile { display: grid; }
  .panel {
    position: fixed; top: 0; bottom: 0; right: 0; z-index: 50; width: min(92vw, 400px);
    background: var(--bg-2); border-left: 1px solid var(--line-2);
    transform: translateX(102%); transition: transform 0.45s var(--ease);
    padding-top: env(safe-area-inset-top);
  }
  .panel.open { transform: none; box-shadow: -30px 0 60px rgba(0, 0, 0, 0.6); }
  .panel .panel-close { display: grid; position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 2; background: rgba(0, 0, 0, 0.5); }
  .panel-inner { padding-top: 56px; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.3s; backdrop-filter: blur(2px); }
  .scrim.show { opacity: 1; pointer-events: auto; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .chat-head { padding: 10px var(--gutter); padding-top: max(10px, env(safe-area-inset-top)); }
  .agent-sub { display: none; }
  .thread { padding: 18px var(--gutter) 18px; }
  .hero { padding-top: 4vh; }
  .bubble { max-width: 88%; font-size: 15px; }
  .composer { padding-left: 10px; padding-right: 10px; }
  .composer-note { display: none; }
  .svc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .svc { min-height: 112px; padding: 12px; }
  .svc .sd { font-size: 12px; }
  .barber-card { min-height: 150px; padding: 14px; }
  .barber-card .big { font-size: 96px; }
  .ticket { grid-template-columns: 1fr 86px; }
  .scissors { right: 73px; }
  .t-svc { font-size: 22px; }
  .t-time { font-size: 28px; }
  .jump { bottom: 90px; right: var(--gutter); }
  .sum-actions { grid-template-columns: 1fr; }
}

@media (hover: none) { .spotlight { background: radial-gradient(700px circle at 85% -10%, rgba(201, 164, 107, 0.08), transparent 60%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .grain { animation: none; }
}
