/* Green Automations: "See it work" demos. Loaded after styles.css, reuses its tokens. */

/* ---------- Page bands ---------- */
.demos-intro { background: var(--cream-100); padding: 40px 0 6px; }
.demos-intro h2 { font-size: clamp(28px, 2.8vw, 38px); font-weight: 500; max-width: 24ch; }
.demos-intro p { color: var(--ink-soft); font-size: 17px; margin: 10px 0 22px; max-width: 58ch; }
.demo-nav { display: grid; gap: 18px; align-content: start; min-height: 843px; }
.nav-group h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.nav-group ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 600px) { .demo-nav { min-height: 735px; } .nav-group ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .demo-nav { min-height: 346px; }
  .nav-group { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: center; gap: 16px; }
  .nav-group h3 { margin: 0; font-size: 16px; }
  .nav-group ul { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.group-head { padding: 26px 0 2px; }
.group-head:first-child { padding-top: 6px; }
.group-head h2 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 500; }
.group-head p { color: var(--ink-soft); font-size: 17px; margin-top: 6px; }
.demo-nav a {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 12px; border-radius: 999px; line-height: 1.2;
  background: var(--white); border: 1px solid var(--line); text-decoration: none; font-size: 15px; color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.demo-nav a .icon { width: 19px; height: 19px; color: var(--green-800); }
.demo-nav a:hover { border-color: var(--green-700); transform: translateY(-1px); }
.demo-nav a:focus-visible { outline: 3px solid var(--sunset); outline-offset: 2px; }
.demos { background: var(--cream-100); padding: 28px 0 64px; }
#demo-list { display: grid; gap: 28px; min-height: 1400px; }
#demo-list.ready { min-height: 0; }
.noscript { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px 24px; color: var(--ink-soft); }

/* ---------- One demo ---------- */
.demo {
  display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); grid-template-rows: auto 1fr;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-card); scroll-margin-top: 20px;
}
.demo-top { grid-area: 1 / 1; padding: 34px 32px 0; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.demo-side { grid-area: 2 / 1; padding: 18px 32px 30px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.demo-title { display: flex; gap: 14px; align-items: center; }
.demo-title .icon-bubble { width: 54px; height: 54px; }
.demo-title .icon-bubble .icon { width: 25px; height: 25px; }
.demo-title h3 { font-size: clamp(24px, 2.1vw, 30px); font-weight: 600; line-height: 1.1; text-wrap: balance; }
.moment { font-size: 18px; line-height: 1.45; }

.ctl { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.ctl legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chips.trade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chips.trade .chip span { width: 100%; justify-content: center; padding: 0 4px; font-size: 14px; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--cream-50); font-size: 15px; transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover span { border-color: var(--green-700); }
.chip input:checked + span { background: var(--green-800); border-color: var(--green-800); color: var(--white); }
.chip input:focus-visible + span { outline: 3px solid var(--sunset); outline-offset: 2px; }
.field-l { display: block; margin-top: 12px; }
.field-l span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field-l input {
  width: 100%; font: 400 16px var(--font); color: var(--ink); background: var(--cream-50);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
.field-l input::placeholder { color: #66706a; opacity: 1; }
.field-l input:focus { outline: 3px solid var(--sunset); outline-offset: 1px; border-color: var(--green-800); }
.ctl > .field-l:first-child { margin-top: 0; }
.star-pick { display: flex; gap: 2px; }
.star-l { position: relative; cursor: pointer; padding: 6px; margin: -1px; border-radius: 10px; display: grid; place-items: center; }
.star-l input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-l .icon { width: 32px; height: 32px; color: var(--sunset-deep); }
.star-l.on .icon { fill: var(--sunset); }
.star-l:focus-within { outline: 3px solid var(--sunset); outline-offset: 1px; }

.connects-h { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.connects ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.connects li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 10px; border-radius: 999px; background: var(--green-100); color: var(--green-800); font-size: 14px; }
.connects li .icon { width: 17px; height: 17px; }
.demo-cta { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-cta p { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.demo-cta .btn { font-size: 16px; padding: 15px 24px; }
.fine { font-size: 13px; color: var(--ink-soft); }

/* ---------- Stage ---------- */
.stage {
  position: relative; container-type: inline-size; isolation: isolate; min-width: 0; color: var(--white);
  background: #3a2a2a url("../img/hero-sunset.jpg") center var(--bg-y, 40%) / cover no-repeat;
  padding: 20px 24px 22px; display: flex; flex-direction: column; gap: 14px; grid-area: 1 / 2 / 3 / 3;
}
.stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(30, 18, 20, 0.3), rgba(30, 18, 20, 0.55)); }
.stage-label {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.93); color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.2;
}
.stage-label .icon { width: 16px; height: 16px; color: var(--green-800); }
.dev-tabs { display: none; flex-wrap: wrap; gap: 8px; }
.dev-tabs button {
  position: relative; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; font: 500 14.5px var(--font);
  border: 1.5px solid rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.22); color: var(--white);
}
.dev-tabs button[aria-pressed="true"] { background: var(--cream-200); color: var(--ink); border-color: transparent; }
.dev-tabs button.dot i { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--sunset); border: 2px solid var(--white); }
.dev-tabs button:focus-visible, .pbtn:focus-visible, .tick:focus-visible, .stage-play:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }

.dev-area { position: relative; }
.devices { display: flex; justify-content: center; align-items: stretch; gap: 18px; height: 540px; transition: opacity .3s ease; }
.is-fresh .devices { opacity: 0.5; }
.dev { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; height: 100%; }
.dev-phone { flex: 0 0 262px; }
.dev-cal, .dev-doc { flex: 1 1 270px; max-width: 340px; min-width: 240px; }
.dev-sheet { flex: 1.3 1 340px; max-width: 420px; min-width: 260px; }
.dev-body { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.dev figcaption { flex: none; font-size: 13px; line-height: 1.3; text-align: center; color: rgba(255, 255, 255, 0.95); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55); }
.stage-play {
  display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 30px 0 24px; border-radius: 999px; border: 0; cursor: pointer; font: 600 18px var(--font);
  background: var(--sunset-deep); color: var(--white); box-shadow: 0 14px 40px rgba(20, 6, 2, 0.45); transition: transform .15s ease;
}
.stage-play .icon { width: 22px; height: 22px; fill: currentColor; }
.stage-play:hover { transform: translate(-50%, -50%) scale(1.03); }
.is-fresh .stage-play { display: inline-flex; }

/* Phone */
.phone { width: 262px; height: min(100%, 502px); background: #171211; border-radius: 40px; padding: 8px; box-shadow: 0 30px 60px rgba(20, 8, 4, 0.5), inset 0 0 0 1.5px rgba(255, 255, 255, 0.14); }
.ph-screen { position: relative; height: 100%; border-radius: 32px; background: var(--cream-50); color: var(--ink); overflow: hidden; display: flex; flex-direction: column; }
.ph-screen::before { content: ""; position: absolute; z-index: 2; top: 7px; left: 50%; width: 68px; height: 17px; border-radius: 12px; background: #171211; transform: translateX(-50%); }
.ph-status { flex: none; height: 30px; padding: 8px 20px 0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; }
.ph-bat { width: 20px; height: 9px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; opacity: 0.85; }
.ph-bat::after { content: ""; position: absolute; inset: 1px 4px 1px 1px; background: currentColor; border-radius: 1px; }
.ph-head { flex: none; display: flex; gap: 10px; align-items: center; padding: 6px 14px 10px; border-bottom: 1px solid var(--line); }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.avatar .icon { width: 18px; height: 18px; }
.ph-name { font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.ph-sub { font-size: 12px; color: var(--ink-soft); }
.pm-app .ph-head, .pm-call .ph-head { border-bottom: 0; color: var(--white); }
.pm-app .ph-head { background: var(--green-800); }
.pm-call .ph-head { background: #3b2430; }
.pm-app .ph-sub, .pm-call .ph-sub { color: rgba(255, 255, 255, 0.8); }
.pm-app .avatar, .pm-call .avatar { background: rgba(255, 255, 255, 0.16); color: var(--white); }
.ph-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 12px; display: flex; flex-direction: column-reverse; }
.ph-stack { display: flex; flex-direction: column; gap: 8px; }
.ph-body::-webkit-scrollbar { display: none; }
.ph-foot { flex: none; padding: 8px 12px 14px; }
.ph-foot span { display: block; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 12.5px; color: #66706a; background: var(--white); }

.msg { position: relative; max-width: 86%; padding: 9px 12px; border-radius: 18px; font-size: 13.5px; line-height: 1.38; overflow-wrap: anywhere; }
.msg.in, .say.ai .msg { align-self: flex-start; background: var(--cream-200); border-bottom-left-radius: 6px; }
.msg.out, .say.caller .msg { align-self: flex-end; background: var(--sunset-deep); color: var(--white); border-bottom-right-radius: 6px; }
.say { display: flex; flex-direction: column; gap: 3px; max-width: 90%; }
.say.ai { align-self: flex-start; }
.say.caller { align-self: flex-end; align-items: flex-end; }
.say .msg { max-width: 100%; }
.say.ai .msg { background: var(--green-100); }
.say .who { font-size: 11px; color: var(--ink-soft); padding: 0 6px; }
.dots { position: absolute; left: 14px; top: 13px; display: flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #8a8f8b; animation: blink 1s infinite both; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
.typing .txt { animation: reveal .3s both; animation-delay: calc(var(--d, 0ms) + 800ms); }
.typing .dots { animation: hide .01s both; animation-delay: calc(var(--d, 0ms) + 800ms); }
.msg.typing, .say.typing .msg { overflow: hidden; animation: grow .3s both; animation-delay: calc(var(--d, 0ms) + 800ms); }
.msg.typing.is-new { animation: pop .42s cubic-bezier(.2, .8, .2, 1) both, grow .3s both; animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + 800ms); }
.say.typing.is-new { animation: pop .42s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }

.ph-stamp { align-self: center; font-size: 11px; color: var(--ink-soft); }
.ph-call { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.ph-call .icon { flex: none; width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: var(--green-100); color: var(--green-800); }
.ph-call.missed .icon { background: #fbe3d2; color: var(--sunset-deep); }
.ph-call strong { display: block; font-size: 13.5px; line-height: 1.25; }
.ph-call span { font-size: 12px; color: var(--ink-soft); }
.ph-call.missed span { color: var(--sunset-deep); font-weight: 600; }
.ph-tool { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; line-height: 1.25; background: var(--green-100); color: var(--green-800); padding: 5px 11px 5px 8px; border-radius: 999px; }
.ph-tool .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.ph-sys { align-self: center; font-size: 12px; font-style: italic; color: var(--ink-soft); text-align: center; }
.ph-stars { align-self: flex-end; display: flex; gap: 2px; padding: 8px 12px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.ph-stars .icon, .bk-stars .icon { width: 20px; height: 20px; color: var(--sunset-deep); }
.ph-stars .icon.on, .bk-stars .icon.on { fill: var(--sunset); }
.ph-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 13px; }
.ph-card dl { margin: 6px 0 0; }
.ph-card dl div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.ph-card dt { color: var(--ink-soft); font-size: 12px; flex: none; }
.ph-card dd { margin: 0; text-align: right; font-weight: 500; }
.ph-note { background: #fffdf5; border: 1px solid #efe5c8; border-left: 3px solid var(--sunset); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; }
.ph-buttons { display: grid; gap: 8px; margin-top: 6px; }
.ph-buttons button { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--green-800); background: var(--white); color: var(--green-800); font: 600 14px var(--font); cursor: pointer; transition: background-color .15s ease; }
.ph-buttons button:hover { background: var(--green-100); }
.ph-buttons button.on { background: var(--green-800); color: var(--white); }
.ph-buttons button:focus-visible { outline: 3px solid var(--sunset); outline-offset: 2px; }

/* Owner lock screen */
.owner .ph-screen { background: linear-gradient(175deg, #2c1d28 0%, #7a3a2c 52%, #d9793f 100%); color: var(--white); }
.owner .ph-screen::before { background: #0d0908; }
.lock { flex: none; text-align: center; padding: 6px 12px 12px; }
.lock-date { font-size: 13px; opacity: 0.92; }
.lock-clock { font-size: 56px; font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
.notifs { flex: 1; min-height: 0; overflow: hidden; padding: 4px 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.notifs-empty { margin: auto; padding: 0 18px; font-size: 13px; text-align: center; opacity: 0.88; }
.notif { flex: none; background: rgba(255, 255, 255, 0.92); color: var(--ink); border-radius: 16px; padding: 9px 12px 10px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.notif.alert { box-shadow: inset 4px 0 0 var(--sunset-deep); }
.n-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); margin-bottom: 3px; }
.n-app { display: inline-flex; align-items: center; gap: 6px; }
.n-app i { width: 16px; height: 16px; border-radius: 5px; background: var(--green-800); color: var(--white); display: grid; place-items: center; }
.n-app i .icon { width: 11px; height: 11px; stroke-width: 2; }
.notif.alert .n-app i { background: var(--sunset-deep); }
.n-title { font-weight: 600; font-size: 13px; line-height: 1.25; }
.n-text { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }

/* Card devices: calendar, sheet, document */
.card-dev { width: 100%; max-height: 100%; background: var(--white); color: var(--ink); border-radius: 20px; box-shadow: 0 24px 50px rgba(20, 8, 4, 0.45); overflow: hidden; display: flex; flex-direction: column; font-size: 13px; }
.cd-bar { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--cream-50); }
.cd-bar strong { font-size: 14px; }
.cd-bar span { font-size: 12px; color: var(--ink-soft); }
.cd-bar.browser { justify-content: flex-start; background: #f1ede4; }
.dots3 { display: inline-flex; gap: 5px; }
.dots3 i { width: 9px; height: 9px; border-radius: 50%; background: #cfc8b9; }
.cd-bar .url { flex: 1; min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-icon .icon { width: 18px; height: 18px; color: var(--green-800); }
.cd-bar:has(.sh-icon) { justify-content: flex-start; }

.cal-body { display: flex; overflow: hidden; }
.cal-hours { flex: none; width: 52px; font-size: 10.5px; color: var(--ink-soft); }
.cal-day { height: 28px; display: grid; place-items: center; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.cal-hour { padding: 3px 6px 0 0; text-align: right; box-sizing: border-box; border-bottom: 1px solid transparent; }
.cal-cols { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.cal-col { border-left: 1px solid var(--line); min-width: 0; }
.cal-lane { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--H) - 1px), #efe9dd calc(var(--H) - 1px), #efe9dd var(--H)); }
.cal-ev { position: absolute; left: 3px; right: 3px; padding: 4px 6px; border-radius: 8px; border-left: 3px solid; font-size: 11px; line-height: 1.25; overflow: hidden; }
.cal-ev strong { display: block; font-weight: 600; }
.cal-ev span { display: block; font-size: 10.5px; opacity: 0.88; }
.cal-ev.new { background: #fbe3d2; border-color: var(--sunset); color: #5a2a10; }
.cal-ev.confirmed { background: #dcebd9; border-color: #4c7a54; color: #1c3a24; }
.cal-ev.moved { background: #fff0c2; border-color: #c99a2e; color: #5c4510; }
.cal-ev.busy { background: #eeebe4; border-color: #b9b3a6; color: #5f655f; }

.sh-scroll { flex: 1; min-height: 0; overflow: auto; }
.sh-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11.5px; }
.sh-table th { background: #f1ede4; text-align: left; font-weight: 600; padding: 6px 8px; border: 1px solid #e4ddd1; border-top: 0; }
.sh-table td { padding: 7px 7px; border: 1px solid #e9e3d8; overflow-wrap: anywhere; line-height: 1.3; height: 29px; vertical-align: top; }
.sh-table .rn { width: 28px; padding: 6px 0; text-align: center; background: #f1ede4; color: var(--ink-soft); font-weight: 400; }
.sh-table tr.new td:not(.rn) { background: #fff4d6; }
.sh-table tr.good td:not(.rn) { background: #e1f0dd; }
.sh-table tr.alert td:not(.rn) { background: #fde0d3; }
.sh-table tr.muted td:not(.rn) { background: #f6f3ee; color: #565c58; }
.sh-tabs { flex: none; display: flex; gap: 6px; padding: 7px 8px; background: #f6f3ee; border-top: 1px solid var(--line); }
.sh-tab { position: relative; min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font: 500 12px var(--font); cursor: pointer; }
.sh-tab::after { content: ""; position: absolute; inset: -6px -3px; }
.sh-tab.on { background: var(--white); color: var(--green-800); font-weight: 600; box-shadow: 0 1px 3px rgba(29, 38, 33, 0.15); }
.sh-tab:focus-visible { outline: 3px solid var(--sunset); outline-offset: 1px; }

.doc-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; min-height: 200px; }
.bk-h strong { display: block; font-size: 17px; line-height: 1.2; }
.bk-h span { font-size: 12.5px; color: var(--ink-soft); }
.bk-kv { margin: 0; }
.bk-kv div { display: grid; grid-template-columns: 82px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.bk-kv dt { color: var(--ink-soft); font-size: 12px; }
.bk-kv dd { margin: 0; font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.bk-text em { display: block; font-style: normal; font-weight: 600; font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; }
.bk-text p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.bk-text.small p { font-size: 12px; color: var(--ink-soft); }
.chip-s { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 9px; border-radius: 999px; background: #e1f0dd; color: var(--green-800); font-size: 12.5px; font-weight: 600; }
.chip-s.new { background: #fbe3d2; color: #8a3f1c; }
.chip-s .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.bk-fields { display: flex; flex-direction: column; gap: 9px; }
.bk-fields span { display: block; font-size: 11.5px; color: var(--ink-soft); margin-bottom: 3px; }
.bk-fields label div { border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 13.5px; background: var(--cream-50); }
.fake-btn { margin-top: 4px; text-align: center; padding: 11px; border-radius: 999px; background: var(--green-800); color: var(--white); font-weight: 600; font-size: 13.5px; }
.fake-btn.pressed { background: var(--sunset-deep); }
.bk-banner { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #fff3cf; border: 1px solid #ecd48a; color: #5c4510; font-size: 12px; font-weight: 600; line-height: 1.3; }
.bk-banner .icon { width: 16px; height: 16px; flex: none; }
button.fake-btn { display: block; width: 100%; border: 0; font: 600 13.5px var(--font); cursor: pointer; }
button.fake-btn:not(.pressed):hover { background: var(--green-900); }
button.fake-btn:focus-visible { outline: 3px solid var(--sunset); outline-offset: 2px; }
.bk-lead { display: flex; flex-direction: column; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-card); }
.bk-lead .badge { align-self: flex-start; background: #e1f0dd; color: var(--green-800); font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; margin-bottom: 4px; }
.bk-lead span:last-child { font-size: 12.5px; color: var(--ink-soft); }
.bk-stars { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bk-stars > span { display: inline-flex; }
.bk-draft { border: 1.5px dashed var(--sunset); border-radius: 14px; padding: 12px; background: #fff8f1; }
.bk-draft em { display: block; font-style: normal; font-weight: 600; font-size: 12px; color: #a94f22; margin-bottom: 4px; }
.bk-draft p { margin: 0; font-size: 13px; line-height: 1.45; }
.draft-btns { display: flex; gap: 8px; margin-top: 10px; }
.draft-btns span { padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 12.5px; background: var(--white); }
.draft-btns .go { background: var(--green-800); border-color: var(--green-800); color: var(--white); }

/* Entrance animations (only for what just changed) */
.is-new { animation: pop .42s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.notif.is-new { animation-name: drop; }
tr.is-new { animation: fade .5s ease both; animation-delay: var(--d, 0ms); }
.ph-buttons.is-new { animation: none; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes hide { from { opacity: 1; } to { opacity: 0; } }
@keyframes grow { from { max-height: 36px; } to { max-height: 600px; } }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* ---------- Caption + controls ---------- */
.cap-wrap { padding: 16px 18px 12px; border-radius: 20px; background: linear-gradient(160deg, rgba(40, 22, 18, 0.62), rgba(40, 22, 18, 0.5)); }
.caption { display: flex; gap: 12px; align-items: flex-start; min-height: 4.5em; font-size: 16px; line-height: 1.45; }
.cap-time { flex: none; background: var(--sunset-deep); color: var(--white); font-weight: 600; font-size: 13px; line-height: 1; padding: 6px 11px; border-radius: 999px; white-space: nowrap; margin-top: 1px; }
.cap-text { color: rgba(255, 255, 255, 0.97); }
.cap-text strong { font-weight: 600; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.bar-gap { flex: 1; min-width: 0; }
[data-branches] { display: contents; }
.pbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.75); background: rgba(0, 0, 0, 0.2); color: var(--white); font: 500 15px var(--font);
  transition: background-color .15s ease, transform .15s ease;
}
.pbtn .icon { width: 18px; height: 18px; }
.pbtn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.pbtn.primary { background: var(--cream-200); color: var(--ink); border-color: transparent; min-width: 112px; justify-content: center; }
.pbtn.primary:hover:not(:disabled) { background: var(--white); }
.pbtn:disabled { opacity: 0.45; cursor: default; }
.pbtn.branch { background: var(--sunset-deep); border-color: transparent; }
.pbtn.branch:hover:not(:disabled) { background: #a24f22; }
.pbtn.branch.used { background: #4b6b4f; opacity: 1; }
.pbtn.branch:disabled:not(.used) { background: rgba(0, 0, 0, 0.2); border: 1.5px solid rgba(255, 255, 255, 0.45); }
.ticks { display: flex; gap: 0; list-style: none; margin: 8px 0 0; padding: 0; }
.ticks li { flex: 1; min-width: 0; }
.tick { width: 100%; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 5px; align-items: flex-start; padding: 0; background: none; border: 0; cursor: pointer; color: rgba(255, 255, 255, 0.85); font: 500 11px/1.2 var(--font); }
.tick-bar { display: block; width: calc(100% - 4px); height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); transition: background-color .2s ease; }
.tick.done .tick-bar { background: var(--white); }
.tick.now .tick-bar { background: #f2a56f; height: 7px; }
.tick-t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Responsive ---------- */
@container (max-width: 900px) {
  .stage[data-n="3"] .dev-tabs, .stage[data-n="4"] .dev-tabs { display: flex; }
  .stage[data-n="3"] .dev:not(.is-active), .stage[data-n="4"] .dev:not(.is-active) { display: none; }
  .stage[data-n="3"] .dev, .stage[data-n="4"] .dev { flex: 0 1 380px; }
}
@container (max-width: 640px) {
  .stage[data-n="2"] .dev-tabs { display: flex; }
  .stage[data-n="2"] .dev:not(.is-active) { display: none; }
  .stage[data-n="2"] .dev { flex: 0 1 380px; }
}
@container (max-width: 560px) {
  .pbtn { padding: 0 11px; gap: 6px; font-size: 14.5px; }
  .pbtn.primary { min-width: 98px; }
  .tick-t { display: none; }
  .caption { flex-direction: column; gap: 8px; min-height: 11em; }
  .cap-wrap { padding: 14px 14px 10px; }
}
@media (max-width: 1180px) {
  .demo { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .demo-top { grid-area: auto; padding: 30px 28px 22px; }
  .stage { grid-area: auto; order: 2; }
  .demo-side { grid-area: auto; order: 3; padding: 24px 28px 26px; }
  .demo-cta { margin-top: 4px; }
  .demo-side .connects, .demo-side .demo-cta { max-width: 640px; }
}
@media (max-width: 640px) {
  #demo-list { gap: 20px; }
  .demo-top { padding: 24px 18px 18px; }
  .demo-side { padding: 22px 18px 22px; }
  .stage { padding: 16px 12px 18px; }
  .devices { height: 520px; }
  .moment { font-size: 17px; }
  .stage-label { font-size: 12.5px; }
  .demo-nav a { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-new, .is-new *, .typing, .typing * { animation: none !important; }
  .dots { display: none; }
  .devices, .tick-bar, .chip span { transition: none; }
  .stage-play:hover { transform: translate(-50%, -50%); }
}

/* Links from the demos intro to the trade pages */
.demo-trades { margin-top: 18px; color: var(--ink-soft); font-size: 15px; }
.demo-trades a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--sunset); text-underline-offset: 3px; }
.demo-trades a:hover, .demo-trades a:focus-visible { color: var(--sunset-deep); }


/* ---------- "Don't see your problem?" finder (assets/js/problem-finder.js) ---------- */
.demo-find { margin: 0 0 22px; }
.demos-intro .demo-find { margin: 0 0 22px; }
.find-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 18px; border-radius: 999px;
  background: var(--cream-200); border: 1px solid var(--line); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.find-chip .icon { width: 18px; height: 18px; color: var(--sunset-deep); }
.find-chip:hover { border-color: var(--sunset-deep); transform: translateY(-1px); }
.find-chip:focus-visible { outline: 3px solid var(--sunset); outline-offset: 2px; }

.finder { background: var(--cream-50); padding: 56px 0 64px; scroll-margin-top: 12px; }
.finder-head { margin-bottom: 26px; }
.finder-head h2 { font-size: clamp(28px, 3vw, 40px); font-weight: 500; margin: 10px 0 12px; max-width: 24ch; text-wrap: balance; }
.finder-head p:last-child { color: var(--ink-soft); font-size: 17px; max-width: 54ch; }
.finder-card {
  display: grid; gap: 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 24px 18px 26px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "pick" "matches" "extra" "custom";
}
.pf-pick { grid-area: pick; }
.pf-matches { grid-area: matches; }
.pf-extra { grid-area: extra; }
.pf-custom { grid-area: custom; }
.pf-set { margin-bottom: 18px; }
.pf-extra .pf-set:last-child { margin-bottom: 0; }
.pf-set legend { font-size: 15px; }
.chip input[type="checkbox"]:checked + span::before { content: "\2713"; margin-right: 8px; font-weight: 600; }
.pf-matches { background: var(--cream-100); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 16px 18px; min-height: 150px; }
.pf-h { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.pf-status { color: var(--ink-soft); font-size: 15.5px; line-height: 1.45; }
.pf-cards { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.pf-cards:empty { margin: 0; }
.pf-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 2px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.pf-card .icon-bubble { grid-row: 1 / 3; width: 40px; height: 40px; }
.pf-card .icon-bubble .icon { width: 19px; height: 19px; }
.pf-card-title { font-size: 15.5px; font-weight: 600; line-height: 1.25; }
.pf-watch {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 14.5px; font-weight: 600;
  color: var(--green-800); text-decoration: underline; text-decoration-color: var(--sunset); text-underline-offset: 3px;
}
.pf-watch .icon { width: 15px; height: 15px; }
.pf-watch:hover { color: var(--sunset-deep); }
.pf-watch:focus-visible { outline: 3px solid var(--sunset); outline-offset: 2px; border-radius: 4px; }
.pf-custom .field-l { margin-top: 0; }
.pf-custom textarea {
  width: 100%; min-height: 140px; resize: vertical; font: 400 16px/1.5 var(--font); color: var(--ink); background: var(--cream-50);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.pf-custom textarea::placeholder { color: #66706a; opacity: 1; }
.pf-custom textarea:focus { outline: 3px solid var(--sunset); outline-offset: 1px; border-color: var(--green-800); }
.pf-custom .btn { margin-top: 16px; font-size: 16.5px; padding: 16px 26px; }
.pf-custom .fine { margin-top: 12px; }
.pf-honest { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 600; }
@media (min-width: 600px) {
  .finder-card { padding: 30px 28px 32px; }
  .pf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .finder { padding: 72px 0 80px; }
  .finder-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; padding: 36px 38px 40px; align-items: start;
    grid-template-areas: "pick matches" "extra matches" "extra custom";
  }
  .pf-matches { min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  .find-chip, .find-chip:hover { transition: none; transform: none; }
}

/* Smaller sunset photo on phones and tablets (same file the hero uses there, so it downloads once) */
@media (max-width: 960px) {
  .stage { background-image: url("../img/hero-sunset-1100.jpg"); }
}
