/* Try page: a chat window, and the Clype popup drawn like the Windows app at its base size.
   Every popup number below comes from clype_app: styles.py (build_main_style, build_action_btn_style),
   ui/popup.py (layout, glide, slide) and ui/widgets.py (ShineLabel, ThinkingIndicator, DashedButton). */

body.try-page { min-height: 100vh; min-height: 100dvh; }

/* ── The page and the chat window ─────────────────────────────────────── */
.tp { max-width: 420px; margin: 0 auto; padding: 14px 14px 40px; }
.tp-home { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; text-decoration: none; }
.tp-home img { border-radius: 6px; }
.tp-tip { min-height: 2.8em; margin: 18px 2px 4px; color: var(--muted); font-size: 18px; line-height: 1.4; transition: opacity .2s ease; }
.tp-tip b { color: var(--text); font-weight: 600; }
.tp-tip.is-swap { opacity: 0; }
.tp-alt {                                                          /* a real button, so it looks tappable */
  display: inline-flex; align-items: center; gap: 7px; margin: 6px 0 14px; padding: 9px 15px;
  border: 1px solid #3a3a42; border-radius: 999px; background: #17171a;
  color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .2s ease, background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.tp-alt::before {
  content: ""; width: 15px; height: 15px; flex: none; transition: opacity .2s ease;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4d4d8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E");
}
.tp-alt[data-mode="paste"] { border-color: #5a2bd9; background: #5a2bd9; color: #fff; }
.tp-alt[data-mode="paste"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");
}
@media (hover: hover) { .tp-alt:hover { background: #1d1d22; border-color: #4b1dbb; } .tp-alt[data-mode="paste"]:hover { background: #6a3cf0; border-color: #6a3cf0; } }
.tp-alt:active { transform: scale(.96); }
.tp-alt.is-gone { opacity: 0; pointer-events: none; }

.ms {
  display: flex; flex-direction: column; height: 400px; overflow: hidden;
  border: 1px solid #26262c; border-radius: 12px; background: #0b141a; color: #e9edef;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8);
}
.ms-title { flex: none; display: flex; align-items: center; gap: 12px; height: 28px; padding: 0 12px; background: #111b21; color: #8696a0; font-size: 12px; }
.ms-title span { flex: 1; }
.ms-title i { width: 9px; height: 9px; border-radius: 50%; background: #2a3942; }
.ms-head { flex: none; display: flex; align-items: center; gap: 9px; padding: 7px 12px; background: #1f2c34; }
.ms-ava { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #6b7c85; color: #fff; font-size: 14px; font-weight: 600; }
.ms-who { flex: 1; min-width: 0; line-height: 1.2; }
.ms-who b { display: block; font-size: 14.5px; font-weight: 600; }
.ms-who small { display: block; color: #8696a0; font-size: 11.5px; }
.ms-tools { display: flex; gap: 16px; color: #aebac1; }
.ms-tools svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* chat wallpaper: a quiet doodle pattern */
.ms-body {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 10px;
  background: #0b141a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110' viewBox='0 0 120 120' fill='none' stroke='%23ffffff' stroke-opacity='.03' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='20' cy='22' r='7'/%3E%3Cpath d='M70 14l8 8-8 8-8-8z'/%3E%3Cpath d='M98 60c6-6 14 2 8 8s-14-2-8-8z'/%3E%3Cpath d='M14 80h16M22 72v16'/%3E%3Cpath d='M56 92c4-8 12-8 16 0'/%3E%3Crect x='86' y='94' width='14' height='10' rx='3'/%3E%3Cpath d='M44 46l6 10h-12z'/%3E%3C/svg%3E");
}
.ms-day { align-self: center; margin: 2px 0 8px; }
.ms-day span { display: inline-block; padding: 3px 9px; border-radius: 7px; background: #182229; color: #8696a0; font-size: 11.5px; }
.bub { position: relative; max-width: 80%; padding: 5px 8px 6px; border-radius: 8px; font-size: 13.5px; line-height: 1.35; box-shadow: 0 1px .5px rgba(0, 0, 0, .25); }
.bub p { display: inline; margin: 0; }
.bub time { float: right; margin: 6px 0 -4px 9px; color: rgba(233, 237, 239, .6); font-size: 10.5px; line-height: 1; white-space: nowrap; }
.bub.in { align-self: flex-start; margin-top: 6px; background: #1f2c34; border-top-left-radius: 0; }
.bub.out { align-self: flex-end; margin-top: 6px; background: #005c4b; border-top-right-radius: 0; }
.bub.cont { margin-top: 0; border-radius: 8px; }
.bub.in:not(.cont)::before, .bub.out:not(.cont)::before { content: ""; position: absolute; top: 0; width: 7px; height: 12px; }
.bub.in:not(.cont)::before { left: -7px; background: #1f2c34; clip-path: polygon(100% 0, 0 0, 100% 100%); }
.bub.out:not(.cont)::before { right: -7px; background: #005c4b; clip-path: polygon(0 0, 100% 0, 0 100%); }
.ticks { display: inline-block; width: 15px; height: 10px; margin-left: 3px; vertical-align: -1px; fill: none; stroke: #53bdeb; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bub.is-new { animation: bub-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes bub-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

.ms-bar { flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 6px 7px 7px; background: #0b141a; }
.ms-field { flex: 1; display: flex; align-items: flex-end; gap: 7px; min-height: 40px; padding: 0 12px 0 9px; border-radius: 20px; background: #1f2c34; }
.ms-ico { flex: none; width: 22px; height: 22px; margin-bottom: 9px; fill: none; stroke: #8696a0; stroke-width: 1.7; stroke-linecap: round; }
#draft {
  flex: 1; min-width: 0; margin: 0; padding: 10px 0; border: 0; resize: none; overflow: hidden;
  background: none; color: #e9edef; font: inherit; font-size: 14px; line-height: 20px;
  -webkit-user-select: none; user-select: none; caret-color: transparent; pointer-events: none;
  transition: opacity .16s ease;
}
#draft.is-swap { opacity: 0; }
#draft:focus { outline: none; }
.ms-field.is-pulse { animation: field-pulse 2s ease-out infinite; }
@keyframes field-pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 168, 132, .5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(0, 168, 132, 0); } }
.ms-send { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #00a884; color: #0b141a; cursor: pointer; transition: transform .18s ease, opacity .2s ease; }
.ms-send svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
.ms-send:disabled { opacity: .45; cursor: default; }
.ms-send.is-ready { animation: send-pop .5s ease; }
.ms-send:active:not(:disabled) { transform: scale(.9); }
@keyframes send-pop { 40% { transform: scale(1.15); } }

/* ── The ending sheet ─────────────────────────────────────────────────── */
.tp-sheet {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); text-align: center;
  border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; background: #0f0f11;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .55);
  transform: translateY(105%); transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.tp-sheet.is-in { transform: none; }
.tp-sheet img { border-radius: 10px; }
.tp-sheet h1 { margin: 8px 0 0; font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.tp-sheet > p { margin: 6px auto 0; max-width: 320px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.tp-sheet .dl-link { margin-top: 14px; }
.tp-fine { margin: 10px auto 0; max-width: 320px; color: var(--faint); font-size: 12.5px; line-height: 1.4; }
.dl-link.is-sent ~ .tp-fine { display: none; }
.tp-sheet .dl-link-lead { display: none; }
.tp-win { display: none; margin-top: 16px; padding: 11px 20px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
[data-device="windows"] .tp-win { display: inline-flex; }
.tp-again { display: block; margin: 10px auto 0; padding: 6px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ── The Clype popup: 260 px wide, margins 10/12/12/12, 7 px between everything ── */
.cp {
  position: fixed; z-index: 21; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 7px;
  width: 260px; box-sizing: border-box; overflow: hidden;
  padding: 10px 12px 12px; border: 1px solid #26262a; border-radius: 12px;
  background: #0b0b0d; color: #e8e8e8; font-size: 13px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .6);
  transform: translateY(calc(115% + 30px)) scale(1.15); transform-origin: right bottom;   /* 15% bigger than the app, from the corner */
  /* slide: the app moves 18% of the remaining distance every 8 ms, a fast start that eases out */
  transition: transform .5s cubic-bezier(.12, .82, .22, 1);
}
.cp.is-in { transform: scale(1.15); }
.cp[hidden], .cp [hidden] { display: none !important; }      /* the parts use display:flex, which would beat hidden */
.cp.is-gliding { transition: transform .5s cubic-bezier(.12, .82, .22, 1), height .2s cubic-bezier(.33, 1, .68, 1); }   /* OutCubic, 0.2 s */

.cp-head { flex: none; display: flex; align-items: flex-end; height: 38px; }
.cp-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 1px; color: #fff; line-height: 38px; }
/* "| Free": the bar solid cyan, the word cyan with a white metallic shine sweeping across it (1.4 s, then 1.8 s pause) */
.cp-tier { display: flex; align-items: center; gap: 3px; margin: 0 0 9px 4px; font-size: 13px; font-weight: 400; line-height: 1; }
.cp-tier i { width: 1.2px; height: 17px; margin-top: -1px; background: #1fbded; }
.cp-tier span {
  margin-bottom: 1px;
  background: linear-gradient(100deg, #1fbded 0%, #1fbded 40%, #f2fdff 49%, #ffffff 50%, #f2fdff 51%, #1fbded 60%, #1fbded 100%) 0 0 / 320% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #1fbded;
  background-position: 100% 0;
  animation: cp-shine 3.2s .6s infinite;
}
@keyframes cp-shine {
  0% { background-position: 100% 0; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }   /* InOutSine */
  43.75%, 100% { background-position: 0% 0; }
}
.cp-icons { display: flex; gap: 4px; margin: 0 0 5px auto; }
/* SettingsButton: 28 px, the icon drawn 5 px in (18 px), stroke 1.6, white; hover adds a soft light box */
.cp-icons svg { width: 28px; height: 28px; padding: 5px; box-sizing: border-box; border-radius: 4px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: background-color .15s ease; }
@media (hover: hover) { .cp-icons svg:hover { background: rgba(255, 255, 255, .2); } }
/* CloseButton: 28 px, a 19 px icon in the middle, stroke 2 */
.cp-close { margin: 0 0 5px 4px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.cp-close svg { display: block; width: 28px; height: 28px; padding: 4.5px; box-sizing: border-box; border-radius: 4px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: background-color .15s ease; }
.cp-close:hover svg { background: rgba(255, 255, 255, .2); }

/* preview: first line, cut to 24 characters in code (like show_with_text) */
.cp-preview { flex: none; display: flex; align-items: center; height: 30px; box-sizing: border-box; margin: 0; padding: 0 8px; border: 1px solid #222226; border-radius: 6px; background: #151517; color: #888; font-size: 13px; line-height: 1; white-space: nowrap; overflow: hidden; }

.cp-actions { display: flex; flex-direction: column; gap: 7px; }
.cp-act {                                                            /* build_action_btn_style: hover is instant, press flashes purple */
  position: relative; display: block; width: 100%; height: 34px; box-sizing: border-box;
  padding: 0 34px 0 9px; border: 1px solid #222226; border-radius: 8px; background: #17171a;
  color: #d4d4d8; font: inherit; font-size: 13px; font-weight: 560; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cp-del {                                                            /* DeleteButton: 22 px, 6 px from the right */
  position: absolute; right: 6px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  border-radius: 5px; background: rgba(255, 255, 255, .055);
  transition: background-color .14s cubic-bezier(.33, 1, .68, 1);
}
.cp-del svg { display: block; width: 22px; height: 22px; fill: none; stroke: rgb(140, 140, 150); stroke-width: 1.4; stroke-linecap: round; transition: stroke .14s cubic-bezier(.33, 1, .68, 1); }
@media (hover: hover) {
  .cp-del:hover { background: rgba(255, 90, 90, .19); }
  .cp-del:hover svg { stroke: rgb(255, 120, 120); }
}
.cp-del:active { background: rgba(255, 90, 90, .29); }
@media (hover: hover) { .cp-act:hover { background: #1d1d22; border-color: #4b1dbb; color: #fff; } }
.cp-act:active { background: #5a2bd9; border-color: #5a2bd9; color: #fff; }
.cp.is-busy .cp-act { background: #141416; border-color: #1c1c20; color: #4a4a50; pointer-events: none; }

.cp-create {                                                         /* DashedButton: 32 px, 12 px medium text */
  flex: none; display: flex; align-items: center; justify-content: center; gap: 5px; height: 32px; box-sizing: border-box;
  border: 1.5px dashed #303036; border-radius: 7px; color: #555560; font-size: 12px; font-weight: 500;
}
.cp-create svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* thinking: 78 px; a pulsing caption and three bars with one shared light sweeping across them */
.cp-think { flex: none; height: 78px; }
.cp-think p { height: 18px; margin: 0 0 10px 2px; color: rgb(141, 141, 148); font-size: 12px; font-weight: 500; line-height: 18px; animation: cp-pulse 1.96s ease-in-out infinite; }
@keyframes cp-pulse { 0%, 100% { opacity: .82; } 50% { opacity: .59; } }
.cp-bars i {
  display: block; height: 9px; margin-bottom: 8px; border-radius: 4.5px; background-color: #1b1b20;
  background-image: linear-gradient(90deg, #1b1b20 0, #2e2e37 50%, #1b1b20 100%);
  background-size: 106px 100%; background-repeat: no-repeat;
  animation: cp-sweep 1.5s linear infinite;
}
.cp-bars i:nth-child(2) { width: 86%; }
.cp-bars i:nth-child(3) { width: 58%; }
@keyframes cp-sweep { from { background-position: -106px 0; } to { background-position: 342px 0; } }

/* the answer: a 90 px box (scrolls inside), then Copy result + the square report button */
.cp-result {
  flex: none; height: 90px; box-sizing: border-box; overflow-y: auto;
  padding: 9px 14px 9px 10px; border: 1px solid #222226; border-radius: 8px; background: #151517;   /* 6 px + Qt's own 4 px document margin */
  color: #e0e0e0; font-size: 13px; line-height: 1.4; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .13) transparent;
}
.cp-result .w { color: rgba(224, 224, 224, 0); transition: color .1s linear; }
.cp-result .w.on { color: #e0e0e0; }
.cp-copyrow { flex: none; display: flex; gap: 6px; margin-top: 3px; }
.cp-copy {
  flex: 1; height: 31px; padding: 0 14px; border: 0; border-radius: 8px; background: #5a2bd9;
  color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .cp-copy:hover { background: #6a3cf0; } }
.cp-copy.is-done { background: #7d55f5; }
.cp-flag { flex: none; display: grid; place-items: center; width: 31px; height: 31px; box-sizing: border-box; border: 1px solid #303037; border-radius: 8px; background: #16161a; }
.cp-flag svg { width: 14px; height: 14px; fill: none; stroke: #8a8a90; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

@media (prefers-reduced-motion: reduce) {
  .cp, .tp-sheet, .bub, .ms-field, .cp-tier span, .cp-think p, .cp-bars i { transition: none; animation: none; }
}
