/*
  Tour screen: Claude (src/pages/tour-screen-claude.html, widgets/claude-app.html). The Claude desktop app at its native
  998x562 inside [data-fit]: sidebar, a chat column with the composer and the "Search and tools" menu, and the slide canvas
  that opens on the right. Warm paper palette, serif assistant text, clay accent. Light and dark follow the site theme.
  Behaviour: src/js/sections/tour-claude.js. Parts the script builds (.ca-msg, .ca-tool, .ca-thumb) are styled here too.
*/

.w-capp {
  --ca-bg: #faf9f5;
  --ca-side: #f5f4ed;
  --ca-text: #141413;
  --ca-dim: #73726c;
  --ca-line: rgba(31, 30, 29, 0.14);
  --ca-card: #ffffff;
  --ca-bubble: #f0eee6;
  --ca-accent: #c96442;
  --ca-accent-soft: #f7e9e2;
  --ca-hover: rgba(31, 30, 29, 0.06);
  --ca-green: #2d7a55;
  --ca-serif: "Tiempos Text", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --ca-shadow: 0 0 0 1px rgba(11, 27, 59, 0.12), 0 6px 18px rgba(11, 58, 140, 0.12);
}
[data-theme="dark"] .w-capp {
  --ca-bg: #262624;
  --ca-side: #1f1e1d;
  --ca-text: #faf9f5;
  --ca-dim: #a3a199;
  --ca-line: rgba(255, 255, 255, 0.13);
  --ca-card: #30302e;
  --ca-bubble: #1f1e1d;
  --ca-accent: #d97757;
  --ca-accent-soft: rgba(217, 119, 87, 0.18);
  --ca-hover: rgba(255, 255, 255, 0.07);
  --ca-green: #5fd3a0;
  --ca-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 6px 18px rgba(0, 0, 0, 0.35);
}
:where(.w-capp) p, :where(.w-capp) ul, :where(.w-capp) h3 { margin: 0; padding: 0; }
.w-capp img { -webkit-user-drag: none; }
.w-capp .i { width: 1em; height: 1em; }

.w-capp__win {
  position: relative;
  display: flex;
  width: 998px;
  height: 562px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ca-bg);
  color: var(--ca-text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  box-shadow: var(--ca-shadow);
  -webkit-user-select: none;
  user-select: none;
}

/* ── Sidebar ── */
.ca-side {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 218px;
  padding: 12px 10px 10px;
  background: var(--ca-side);
  border-right: 1px solid var(--ca-line);
}
.ca-side__top { display: flex; align-items: center; gap: 14px; padding: 2px 6px 12px; color: var(--ca-dim); font-size: 16px; }
.ca-side__word { display: inline-flex; align-items: center; gap: 6px; font-family: var(--ca-serif); font-size: 19px; letter-spacing: -0.01em; color: var(--ca-text); }
.ca-side__word img { width: 18px; height: 18px; }
.ca-side__new, .ca-side__nav { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border-radius: 8px; font-size: 13.5px; }
.ca-side__new { margin-bottom: 4px; color: var(--ca-accent); font-weight: 600; }
.ca-side__new .i { padding: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ca-accent); color: #fff; stroke-width: 2.6; }
.ca-side__nav .i { font-size: 16px; color: var(--ca-dim); }
.ca-side__head { margin: 14px 0 4px; padding: 0 8px; font-size: 11.5px; font-weight: 600; color: var(--ca-dim); }
.ca-side__recents { list-style: none; }
.ca-side__recents li { height: 28px; padding: 0 8px; border-radius: 7px; overflow: hidden; font-size: 13px; line-height: 28px; white-space: nowrap; text-overflow: ellipsis; color: var(--ca-text); }
.ca-side__recents li.is-on { background: var(--ca-hover); }
.ca-side__recents li[hidden] { display: none; }
.ca-side__me { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 8px 6px 0; border-top: 1px solid var(--ca-line); }
.ca-side__me b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e8912d; color: #fff; font-size: 11px; }
.ca-side__me span { display: grid; font-size: 13px; font-weight: 600; }
.ca-side__me i { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--ca-dim); }

/* ── Chat column ── */
.ca-chatcol { position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 0 22px 16px; }
.ca-head { display: flex; align-items: center; justify-content: center; height: 40px; flex: none; font-size: 13px; font-weight: 600; color: var(--ca-dim); }
.ca-greet { display: none; align-items: center; justify-content: center; gap: 10px; margin: 0 0 18px; }
.ca-greet img { width: 30px; height: 30px; }
.ca-greet h3 { font-family: var(--ca-serif); font-size: 32px; font-weight: 400; letter-spacing: -0.015em; }
.ca-chat { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding-bottom: 12px; }

/* Empty chat: greeting and composer centred */
.w-capp__win.is-empty .ca-chatcol { justify-content: center; padding-bottom: 60px; }
.w-capp__win.is-empty .ca-head { display: none; }
.w-capp__win.is-empty .ca-greet { display: flex; }
.w-capp__win.is-empty .ca-chat { display: none; }
.w-capp__win.is-empty .ca-comp { width: min(100%, 560px); margin: 0 auto; }

/* Messages */
.ca-msg { animation: ca-in 360ms var(--ease-out) both; }
@keyframes ca-in { from { opacity: 0; transform: translateY(6px); } }
.ca-msg--you { align-self: flex-end; max-width: 88%; padding: 8px 13px; border-radius: 14px; background: var(--ca-bubble); font-size: 13.5px; line-height: 1.45; }
.ca-msg--ai { font-family: var(--ca-serif); font-size: 14.5px; line-height: 1.55; }
.ca-msg--ai p + p { margin-top: 6px; }
.ca-think { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ca-dim); }
.ca-think img { width: 16px; height: 16px; animation: ca-spin 2.2s linear infinite; }
@keyframes ca-spin { to { transform: rotate(360deg); } }

/* "Used Layer integration" tool block */
.ca-tool { margin: 0 0 8px; border: 1px solid var(--ca-line); border-radius: 10px; font-family: var(--font-sans); overflow: hidden; }
.ca-tool__head { display: flex; align-items: center; gap: 7px; padding: 7px 10px; font-size: 12.5px; color: var(--ca-dim); }
.ca-tool__head img { width: 15px; height: 15px; border-radius: 4px; }
.ca-tool__head b { font-weight: 600; color: var(--ca-text); }
.ca-tool__head .i { margin-left: auto; font-size: 13px; transition: transform 200ms; }
.ca-tool.is-open .ca-tool__head .i { transform: rotate(90deg); }
.ca-tool__lines { display: none; padding: 2px 10px 8px; font-family: var(--font-mono); font-size: 11px; color: var(--ca-dim); border-top: 1px solid var(--ca-line); }
.ca-tool.is-open .ca-tool__lines { display: block; }
.ca-tool__lines p { display: flex; align-items: center; gap: 7px; margin-top: 4px; animation: ca-in 260ms var(--ease-out) both; }
.ca-tool__lines p::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.4px solid var(--ca-line); border-top-color: var(--ca-accent); animation: tour-spin 700ms linear infinite; }
.ca-tool__lines p.is-done::before { border: 0; background: var(--ca-green) radial-gradient(circle, #fff 0 1.2px, transparent 1.6px); animation: none; }
.ca-tool.is-busy .ca-tool__head > span::after { content: "…"; }

/* ── Composer ── */
.ca-comp { position: relative; flex: none; padding: 10px 12px 8px; border: 1px solid var(--ca-line); border-radius: 18px; background: var(--ca-card); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); transition: box-shadow 160ms, border-color 160ms; }
.ca-comp.is-focus { border-color: var(--ca-accent); box-shadow: 0 0 0 3px var(--ca-accent-soft); }
.ca-comp__input { position: relative; min-height: 38px; padding: 2px 4px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.ca-comp__ph { position: absolute; left: 4px; top: 2px; color: var(--ca-dim); }
.ca-comp__input.has-text .ca-comp__ph { display: none; }
.ca-comp__bar { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ca-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--ca-dim); font-size: 16px; transition: background-color 160ms; }
.ca-ic.is-hot { background: var(--ca-hover); color: var(--ca-text); }
.ca-pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 6px; border-radius: 12px; background: var(--ca-accent-soft); color: var(--ca-accent); font-size: 12px; font-weight: 600; animation: ca-in 360ms var(--ease-out) both; }
.ca-pill[hidden] { display: none; }
.ca-pill img { border-radius: 4px; }
.ca-comp__model { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 0 8px; height: 26px; border-radius: 8px; font-size: 12.5px; color: var(--ca-dim); }
.ca-comp__model .i { font-size: 12px; }
.ca-comp__send { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 9px; background: var(--ca-accent-soft); color: var(--ca-accent); font-size: 16px; opacity: 0.55; transition: opacity 160ms, background-color 160ms; }
.ca-comp__send.is-ready { background: var(--ca-accent); color: #fff; opacity: 1; }
.ca-comp__send.is-pressed { transform: scale(0.92); }
.ca-comp__send .i { stroke-width: 2.6; }
.ca-note { position: absolute; left: 12px; right: 12px; top: calc(100% + 10px); display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; background: var(--ca-accent-soft); color: var(--ca-text); font-size: 12.5px; animation: ca-in 360ms var(--ease-out) both; }
.ca-note[hidden] { display: none; }
.ca-note .i { color: var(--ca-green); stroke-width: 3; }

/* Search and tools menu */
.ca-menu { position: absolute; left: 6px; bottom: calc(100% + 8px); width: 250px; padding: 6px; border: 1px solid var(--ca-line); border-radius: 12px; background: var(--ca-card); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18); z-index: 6; animation: ca-in 220ms var(--ease-out) both; }
.ca-menu[hidden] { display: none; }
.ca-menu__row { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 13px; }
.ca-menu__row .i, .ca-menu__row img { flex: none; width: 16px; height: 16px; font-size: 16px; color: var(--ca-dim); }
.ca-menu__row img { border-radius: 4px; }
.ca-menu__row span { flex: 1; }
.ca-menu__row.is-hover { background: var(--ca-hover); }
.ca-menu__row--dim { color: var(--ca-dim); }
.ca-menu__sep { padding: 8px 8px 3px; font-size: 11.5px; font-weight: 600; color: var(--ca-dim); }
.ca-sw { position: relative; flex: none; width: 28px; height: 16px; border-radius: 9px; background: var(--ca-line); transition: background-color 200ms; }
.ca-sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 200ms var(--ease-out); }
.ca-sw.is-on { background: var(--ca-accent); }
.ca-sw.is-on::after { transform: translateX(12px); }

/* ── Canvas: the Layer editor ── */
.ca-canvas { position: relative; flex: none; display: flex; flex-direction: column; align-self: center; width: 672px; margin: 0 8px 0 0; border: 1px solid var(--ca-line); border-radius: 12px; background: var(--ca-card); overflow: hidden; }
.ca-canvas[hidden] { display: none; }
.ca-canvas:not([hidden]) { animation: ca-canvas 480ms var(--ease-out) both; }
@keyframes ca-canvas { from { opacity: 0; transform: translateX(32px); } }
.ca-canvas__head { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--ca-line); }
.ca-canvas__title { display: grid; flex: 1; min-width: 0; }
.ca-canvas__title b { font-size: 13px; font-weight: 600; line-height: 1.2; }
.ca-canvas__title i { font-size: 11px; font-style: normal; color: var(--ca-dim); }
.ca-seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--ca-hover); }
.ca-seg u { padding: 2px 10px; border-radius: 6px; text-decoration: none; font-size: 12px; color: var(--ca-dim); }
.ca-seg u.is-on { background: var(--ca-card); color: var(--ca-text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
/* The editor is laid out at 998x562 and drawn at 0.67: fixed, because the Claude window itself is fixed-size */
.ca-canvas__editor { width: 670px; height: 377px; overflow: hidden; background: #fff; }
.ca-canvas__editor .w-editor { width: 670px; max-width: none; }
.ca-canvas__editor [data-fit] { height: 377px !important; }
.ca-canvas__editor [data-fit] > .fit { zoom: 0.6713 !important; }
.ca-canvas__editor .w-editor__win { box-shadow: none; border-radius: 0; }
.ca-canvas__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--ca-line); }
.ca-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ca-facts li { padding: 3px 9px; border: 1px solid var(--ca-line); border-radius: 12px; font-size: 11.5px; color: var(--ca-dim); }
.ca-facts b { font-weight: 600; color: var(--ca-text); }
.ca-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ca-accent); }
.ca-hint .i { font-size: 13px; }

/* Opening the canvas folds the sidebar away, as in the app, so the editor gets room */
.ca-side { transition: width 420ms var(--ease-out), padding 420ms var(--ease-out), opacity 300ms; overflow: hidden; }
.w-capp__win.has-canvas .ca-side { width: 0; padding-left: 0; padding-right: 0; border-right-width: 0; opacity: 0; }
.w-capp__win.has-canvas .ca-chatcol { padding-left: 14px; padding-right: 10px; }

.ca-toast { position: absolute; z-index: 10; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 22px; background: #141413; color: #faf9f5; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); animation: ca-toast 380ms var(--ease-out) both; }
[data-theme="dark"] .ca-toast { background: #faf9f5; color: #141413; }
.ca-toast[hidden] { display: none; }
.ca-toast .i { font-size: 16px; color: #2bac76; }
@keyframes ca-toast { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  .ca-msg, .ca-pill, .ca-note, .ca-menu, .ca-canvas:not([hidden]), .ca-thumb, .ca-badge, .ca-toast, .ca-exmenu { animation: none; }
}
