/* Living Website: ハルの身体(粒子)・声の帯・会話で組み変わるページ。
   既存の style.css (ブランドの基調) の上に重ねる。配色・書体はテーマごとの変数で切り替え、レイアウトは data-layout ごとに別の構造を持つ。 */

@property --bg1 { syntax: "<color>"; inherits: true; initial-value: #000; }
@property --bg2 { syntax: "<color>"; inherits: true; initial-value: #000; }
@property --bg3 { syntax: "<color>"; inherits: true; initial-value: #000; }
@property --lv  { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
  --st-fg: #f5f5f7; --st-mut: #a1a1a6; --st-card: rgba(255,255,255,.055); --st-line: rgba(255,255,255,.14);
  --st-acc: #c9ab63; --st-acc2: #f2dfae; --st-on-acc: #141006;
  --st-font: var(--font); --st-head: var(--font); --st-radius: 22px;
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Noto Sans JP", monospace;
  --px: 50vw; --py: 30vh;
  transition: --bg1 1s var(--ease), --bg2 1s var(--ease), --bg3 1s var(--ease);
}
/* 配色 */
html[data-palette=gold]    { --bg1: #000; --bg2: #14110a; --bg3: #060a10; }
html[data-palette=paper]   { --bg1: #f3eee3; --bg2: #e9e1d0; --bg3: #f8f5ee; --st-fg: #1b1a17; --st-mut: #5f594c; --st-card: rgba(255,255,255,.62); --st-line: rgba(27,26,23,.16); --st-acc: #8a6a1c; --st-acc2: #5c4410; --st-on-acc: #fff; }
html[data-palette=cyan]    { --bg1: #03080b; --bg2: #06202a; --bg3: #020405; --st-fg: #d9f3f5; --st-mut: #7fa3a8; --st-card: rgba(80,200,220,.06); --st-line: rgba(110,220,235,.22); --st-acc: #58d3e4; --st-acc2: #c8f7ee; --st-on-acc: #021013; }
html[data-palette=sunrise] { --bg1: #1a0b2e; --bg2: #5a1a4a; --bg3: #0d2a52; --st-fg: #fff8ee; --st-mut: #e2c9d6; --st-card: rgba(255,255,255,.10); --st-line: rgba(255,255,255,.24); --st-acc: #ffb347; --st-acc2: #ff6f91; --st-on-acc: #2a0d1f; }
html[data-palette=wood]    { --bg1: #1c120a; --bg2: #3a2413; --bg3: #120b06; --st-fg: #f6ecdc; --st-mut: #c8b08d; --st-card: rgba(255,240,215,.07); --st-line: rgba(236,201,140,.26); --st-acc: #e3b872; --st-acc2: #f8e3bb; --st-on-acc: #20140a; }
html[data-palette=mono]    { --bg1: #0b0b0c; --bg2: #1a1a1c; --bg3: #050505; --st-acc: #f5f5f7; --st-acc2: #fff; --st-on-acc: #000; }
html[data-palette=magenta] { --bg1: #12040f; --bg2: #3d0b33; --bg3: #08060f; --st-fg: #ffeef8; --st-mut: #d6a9c6; --st-card: rgba(255,120,200,.08); --st-line: rgba(255,140,210,.28); --st-acc: #ff7ac3; --st-acc2: #ffd1ea; --st-on-acc: #25051b; }
/* 書体 */
html[data-type=serif]   { --st-font: var(--serif); --st-head: var(--serif); }
html[data-type=mono]    { --st-font: var(--mono); --st-head: var(--mono); }
html[data-type=display] { --st-head: "Inter", "Noto Sans JP", sans-serif; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--gold2); color: #000; padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 60px; }
:where(a, button, input, [tabindex]):focus-visible { outline: 2px solid var(--st-acc2); outline-offset: 3px; border-radius: 6px; }

/* ---------- 背景: テーマの地 + 声に反応する光 + 粒子 ---------- */
#backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .8s;
  background: radial-gradient(70% 55% at 78% 8%, var(--bg2), transparent 70%), radial-gradient(60% 50% at 8% 92%, var(--bg3), transparent 72%), var(--bg1); }
#backdrop::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .8s; }
#backdrop::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--px) var(--py), color-mix(in srgb, var(--st-acc) calc(var(--lv) * 46%), transparent), transparent calc(26% + var(--lv) * 22%)); }
html.living-on #backdrop { opacity: 1; }
html[data-theme=lab] #backdrop::before { opacity: 1; background: linear-gradient(rgba(110,220,235,.07) 1px, transparent 1px) 0 0 / 100% 44px, linear-gradient(90deg, rgba(110,220,235,.07) 1px, transparent 1px) 0 0 / 44px 100%; }
html[data-theme=bookstore] #backdrop::before { opacity: 1; background: repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 2px, transparent 2px 180px), repeating-linear-gradient(0deg, rgba(255,220,170,.035) 0 1px, transparent 1px 7px); }
html[data-theme=studio] #backdrop::before { opacity: 1; background: radial-gradient(38% 34% at 18% 22%, rgba(255,111,145,.5), transparent 70%), radial-gradient(42% 38% at 84% 70%, rgba(255,179,71,.42), transparent 70%), radial-gradient(34% 30% at 60% 12%, rgba(90,160,255,.4), transparent 70%); animation: blobs 18s ease-in-out infinite alternate; }
html[data-theme=editorial] #backdrop::before { opacity: 1; background: repeating-linear-gradient(0deg, rgba(27,26,23,.028) 0 1px, transparent 1px 4px); }
@keyframes blobs { to { transform: translate(-3%, 2%) scale(1.08); } }

/* 粒子は帯やカードの上を通る(クリックは通す)。ハルが画面全体にいるように見せるため。 */
#presence { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 16; pointer-events: none; opacity: 0; transition: opacity 1.2s; }
.presence-on #presence { opacity: 1; }
main { z-index: 2; }
.ft { z-index: 2; }
/* 粒子が使えない環境: ロゴそのものが静かに光る */
.presence-fallback .agent .shape { background: url(../img/logo-mark.png) center / 72% no-repeat; filter: drop-shadow(0 0 calc(10px + var(--lv) * 46px) var(--st-acc)); transform: scale(calc(1 + var(--lv) * .06)); }

/* ---------- ハル: ホームでは画面中央の主役、会話が始まると全幅の帯になる ---------- */
.agent { gap: 0; }
.agent .shape { transition: width .7s var(--ease); }
.agent-name { display: flex; gap: 12px; align-items: baseline; justify-content: center; font-size: 12px; letter-spacing: .22em; color: var(--st-mut); margin-top: 26px; }
.agent-name b { color: var(--st-acc); font-weight: 700; }
.agent-name span { letter-spacing: .06em; }
html[data-agent=thinking] .agent-name span, html[data-agent=composing] .agent-name span { animation: think 1.1s ease-in-out infinite alternate; }
@keyframes think { to { opacity: .35; } }
.voice { width: min(900px, 100%); min-height: 0; }
.said { font-size: clamp(19px, 2.5vw, 30px); font-weight: 600; line-height: 1.55; margin-top: 10px; color: var(--st-fg); min-height: 1.55em;
  text-shadow: 0 0 calc(var(--lv) * 26px) color-mix(in srgb, var(--st-acc) 70%, transparent); text-wrap: balance; }
.said:empty { min-height: 0; margin-top: 0; }
.said .w { animation: word .34s var(--ease) backwards; display: inline; }
@keyframes word { from { opacity: 0; filter: blur(6px); } }
.heard { font-size: 13.5px; color: var(--st-mut); margin-top: 6px; min-height: 0; }
.talk { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin-top: 26px; width: min(760px, 100%); }
.mic { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px 0 18px; border-radius: 999px; border: 1px solid var(--st-acc); background: transparent; color: var(--st-fg);
  font: 600 16px var(--font); cursor: pointer; transition: background .3s, color .3s, transform .3s var(--ease), box-shadow .2s; }
.mic:hover { transform: scale(1.03); }
.mic[aria-pressed=true] { background: linear-gradient(100deg, var(--st-acc2), var(--st-acc)); color: var(--st-on-acc); box-shadow: 0 0 0 calc(var(--lv) * 16px) color-mix(in srgb, var(--st-acc) 28%, transparent); }
.mic:disabled { opacity: .5; cursor: default; }
.mic-ic { width: 12px; height: 19px; border-radius: 7px; background: currentColor; position: relative; }
.mic-ic::after { content: ""; position: absolute; left: -5px; right: -5px; top: 8px; bottom: -5px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 12px 12px; }
html:not(.voice-ok) .mic { border-color: var(--st-line); color: var(--st-mut); }
.ask { flex: 1 1 300px; display: flex; align-items: center; min-height: 52px; border-radius: 999px; border: 1px solid var(--st-line); background: color-mix(in srgb, var(--st-fg) 7%, transparent); padding: 0 6px 0 22px; transition: border-color .3s; }
.ask:focus-within { border-color: var(--st-acc); }
.ask input { flex: 1; min-width: 0; height: 50px; border: 0; background: none; color: var(--st-fg); font: 500 16px var(--font); outline: none; }
.ask input::placeholder { color: var(--st-mut); }
.ask button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--st-fg); color: var(--bg1); font-size: 18px; font-weight: 700; cursor: pointer; }
.ask button:disabled, .ask input:disabled { opacity: .45; cursor: default; }
.home-btn, .views button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--st-line); background: none; color: var(--st-fg); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: border-color .25s, background .25s; }
.home-btn:hover, .views button:hover, .starts button:hover { border-color: var(--st-acc); background: color-mix(in srgb, var(--st-acc) 14%, transparent); }
.starts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.starts button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: rgba(245,245,247,.86); font: 500 14.5px var(--font); cursor: pointer; transition: border-color .25s, background .25s; }
.views { display: flex; gap: 8px; }
.quota { font-size: 12px; color: var(--st-mut); margin-top: 16px; min-height: 1.4em; }
.busy .ask button, .busy .starts button { opacity: .5; pointer-events: none; }
.agent-offline .starts, .agent-offline .mic { display: none; }
/* 混雑時: 会話の操作部ごと見えなくする。席が空くと戻る。 */
.talk-closed .voice, .talk-closed .talk .mic, .talk-closed .talk .ask, .talk-closed .starts, .talk-closed .quota { display: none; }
.talk-closed:not(.living-on) .talk { display: none; }

html.living-on .agent { min-height: 0; position: sticky; top: 52px; z-index: 15; padding: 12px var(--gut) 10px; display: grid; text-align: left; align-items: center; justify-content: stretch;
  grid-template-columns: 76px minmax(0, 1fr) minmax(280px, 40%); grid-template-areas: "shape voice talk" "shape views quota"; column-gap: 20px; row-gap: 6px;
  background: color-mix(in srgb, var(--bg1) 74%, transparent); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--st-acc) calc(18% + var(--lv) * 70%), transparent); color: var(--st-fg); }
html.living-on .agent .shape { grid-area: shape; width: 76px; margin: 0; }
html.living-on .hero-copy, html.living-on .starts { display: none; }
html.living-on .voice { grid-area: voice; width: auto; }
html.living-on .agent-name { justify-content: flex-start; margin-top: 0; font-size: 11px; }
html.living-on .said { font-size: clamp(15px, 1.5vw, 19px); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.living-on .heard { font-size: 12px; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.living-on .talk { grid-area: talk; margin: 0; width: auto; flex-wrap: nowrap; justify-content: flex-end; }
html.living-on .mic { min-height: 44px; padding: 0 16px 0 14px; font-size: 14px; }
html.living-on .mic-label { white-space: nowrap; }
html.living-on .ask { min-height: 44px; flex: 1 1 160px; }
html.living-on .ask input { height: 42px; font-size: 15px; }
html.living-on .ask button { width: 34px; height: 34px; }
html.living-on .views { grid-area: views; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
html.living-on .views button, html.living-on .home-btn { min-height: 34px; font-size: 13px; padding: 0 13px; }
html.living-on .quota { grid-area: quota; margin: 0; text-align: right; }
html.living-on #home { display: none; }

/* ---------- 生成されるページ ---------- */
#stage { position: relative; z-index: 2; min-height: 78vh; padding: clamp(28px, 5vw, 70px) var(--gut) 90px; color: var(--st-fg); font-family: var(--st-font); outline: none; }
#stage[hidden] { display: none; }
.page { width: min(1240px, 100%); margin-inline: auto; }
.page-head { margin-bottom: clamp(26px, 4vw, 56px); }
.kicker { font: 600 13px var(--font); letter-spacing: .28em; color: var(--st-acc); }
.page-title { font-family: var(--st-head); font-size: clamp(34px, 6.4vw, 92px); font-weight: 700; line-height: 1.12; letter-spacing: -.015em; margin-top: 10px; text-wrap: balance; }
.continuity { margin-top: 14px; font-size: 14px; color: var(--st-mut); }
.page-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(22px, 3.4vw, 52px) clamp(18px, 2.6vw, 40px); }
.sect { grid-column: 1 / -1; min-width: 0; }
.sect-title { font-family: var(--st-head); font-size: clamp(19px, 2vw, 26px); font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 14px; }
.sect-title::after { content: ""; flex: 1; height: 1px; background: var(--st-line); }
.card { background: var(--st-card); border: 1px solid color-mix(in srgb, var(--st-acc) calc(var(--lv) * 38%), var(--st-line)); border-radius: var(--st-radius); overflow: hidden; }
.ghost { z-index: 30; pointer-events: none; overflow: hidden; border-radius: var(--st-radius); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font: 500 12.5px var(--font); color: var(--st-mut); letter-spacing: .03em; }
.meta .site { color: var(--st-acc); }
.meta .near { border: 1px solid var(--st-line); border-radius: 999px; padding: 0 8px; }
.src { font: 400 12px/1.6 var(--font); color: var(--st-mut); margin-top: 10px; }
.src a, .out, .page-src a, .repos a, .mentions a { color: var(--st-acc); text-underline-offset: 3px; }
.spk { display: inline-block; font-size: 11px; border-radius: 999px; padding: 0 8px; border: 1px solid var(--st-line); }
.spk.self { border-color: var(--st-acc); color: var(--st-acc); }
.quote { margin: 12px 0 0; padding-left: 14px; border-left: 2px solid var(--st-acc); font-size: .95em; line-height: 1.75; }
.out { display: inline-block; margin-top: 12px; font: 600 13.5px var(--font); text-decoration: none; }
.out::after { content: " ›"; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags span { font: 500 11.5px var(--font); padding: 2px 9px; border-radius: 999px; border: 1px solid var(--st-line); color: var(--st-mut); }
.open { all: unset; cursor: pointer; }
.open:hover { text-decoration: underline; text-decoration-color: var(--st-acc); text-underline-offset: 4px; }
.open:focus-visible { outline: 2px solid var(--st-acc2); outline-offset: 3px; }

/* 記事 */
.articles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.art { display: flex; flex-direction: column; }
.art-fig { aspect-ratio: 16 / 9; overflow: hidden; background: color-mix(in srgb, var(--st-fg) 8%, transparent); }
.art-fig img { width: 100%; height: 100%; object-fit: cover; }
.no-media .art-fig, .no-media .wk-fig { display: none; }
.art-body { padding: 20px 22px 22px; }
.art h3 { font-family: var(--st-head); font-size: 18px; line-height: 1.5; margin-top: 8px; font-weight: 700; }
.art .sum { font-size: 14px; line-height: 1.75; color: var(--st-mut); margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.art.lead { grid-column: 1 / -1; flex-direction: row; }
.art.lead .art-fig { flex: 0 0 52%; aspect-ratio: 16 / 10; }
.art.lead .art-body { padding: clamp(22px, 3vw, 44px); align-self: center; }
.art.lead h3 { font-size: clamp(24px, 3vw, 40px); line-height: 1.32; }
.art.lead .sum { font-size: 16px; -webkit-line-clamp: 5; }

/* 写真 */
.shots { columns: 3 260px; column-gap: 18px; }
.shot { break-inside: avoid; margin: 0 0 18px; }
.shot img { width: 100%; }
.shot figcaption { padding: 10px 14px 12px; font: 400 12px/1.6 var(--font); color: var(--st-mut); }
.shot figcaption b { display: block; color: var(--st-fg); font-weight: 600; font-size: 13px; }
.shot figcaption a { color: inherit; }
.no-media.shot { display: none; }

/* 動画 */
.vids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.vid { border: 0; background: none; }

/* 実績・作品 */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.work { display: flex; flex-direction: column; }
.wk-fig { aspect-ratio: 16 / 9; overflow: hidden; }
.wk-fig img { width: 100%; height: 100%; object-fit: cover; }
.wk-body { padding: 22px 24px 24px; }
.work .no { font: 600 12px var(--font); letter-spacing: .14em; color: var(--st-acc); }
.work h3 { font-family: var(--st-head); font-size: clamp(20px, 2.2vw, 28px); line-height: 1.35; margin-top: 8px; }
.work .txt, .fact .txt { font-size: 14.5px; line-height: 1.85; margin-top: 10px; color: color-mix(in srgb, var(--st-fg) 82%, transparent); }

/* 事実・主張 */
.facts, .quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.fact { padding: 22px 24px; }
.fact h3 { font-family: var(--st-head); font-size: 19px; }
.fact .yr { font: 700 13px var(--font); color: var(--st-acc); letter-spacing: .1em; }
.fact .theme { font: 600 12px var(--font); color: var(--st-mut); margin-top: 2px; }
.k-claim .quote { font-size: clamp(17px, 1.8vw, 22px); line-height: 1.7; border: 0; padding: 0; margin-top: 10px; font-weight: 600; }

/* 年表 */
.tl { list-style: none; padding: 0; margin: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--st-line); }
.tl li { position: relative; margin: 0 0 14px 30px; padding: 16px 20px; }
.tl li::before { content: ""; position: absolute; left: -29px; top: 22px; width: 13px; height: 13px; border-radius: 50%; background: var(--st-acc); box-shadow: 0 0 0 4px var(--bg1); }
.tl time { font: 700 clamp(20px, 2.2vw, 30px) var(--st-head); color: var(--st-acc); letter-spacing: -.01em; }
.tl h3 { font-size: 16.5px; margin-top: 2px; }
.tl p { font-size: 14px; line-height: 1.75; color: var(--st-mut); margin-top: 4px; }

/* 見開き(1つを大きく開く) */
.spread { position: relative; background: var(--st-card); border: 1px solid var(--st-acc); border-radius: 28px; padding: clamp(22px, 3.4vw, 52px); margin-bottom: clamp(26px, 4vw, 52px); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sp-close { position: absolute; right: 18px; top: 18px; min-height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--st-line); background: none; color: var(--st-fg); font: 500 13px var(--font); cursor: pointer; }
.sp-head h2 { font-family: var(--st-head); font-size: clamp(26px, 3.6vw, 50px); line-height: 1.3; margin: 8px 0 20px; max-width: 22em; text-wrap: balance; }
.spread > img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 18px; margin-bottom: 22px; }
.sp-body { max-width: 46em; font-size: 16.5px; line-height: 2; }
.sp-body h3 { font-family: var(--st-head); font-size: 21px; margin: 26px 0 8px; }
.sp-body p + p { margin-top: 1em; }
.sp-more { color: var(--st-mut); font-size: 13px; margin: 14px 0 18px !important; }
.sp-h { font-family: var(--st-head); font-size: 18px; margin: 34px 0 14px; }
.spread .shots, .spread .articles { margin-top: 26px; }
.spread .book { border: 0; background: none; }
.mentions { list-style: none; padding: 0; display: grid; gap: 14px; }
.sp-body .btn { text-decoration: none; }

.page-src { margin-top: clamp(40px, 6vw, 80px); padding-top: 22px; border-top: 1px solid var(--st-line); font: 400 12.5px/1.8 var(--font); color: var(--st-mut); }
.page-src h2 { font-size: 12px; letter-spacing: .2em; color: var(--st-acc); margin-bottom: 8px; }
.page-src ul { display: flex; flex-wrap: wrap; gap: 4px 22px; }

/* ================= レイアウトごとの構造 ================= */

/* 人物特集: 雑誌の特集記事 */
.l-profile .page-head, .l-essay .page-head, .l-company .page-head { border-top: 6px solid var(--st-fg); border-bottom: 1px solid var(--st-fg); padding: 18px 0 22px; }
.l-profile .page-title { font-size: clamp(44px, 9vw, 132px); letter-spacing: -.03em; }
.l-profile .s-profile { grid-column: 1 / -1; }
.prof { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(22px, 4vw, 60px); align-items: start; }
.portrait { margin: 0; position: sticky; top: 190px; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; filter: grayscale(.35) contrast(1.05); }
.portrait figcaption { font: 400 11.5px var(--font); color: var(--st-mut); margin-top: 8px; }
.prof .lede { font-size: clamp(18px, 2vw, 25px); line-height: 2; font-weight: 500; }
.prof .lede::first-letter { font-size: 3.4em; float: left; line-height: 1; padding: .06em .12em 0 0; font-weight: 700; color: var(--st-acc); }
.prof .fact { margin-top: 18px; border-radius: 4px; border-width: 0 0 0 3px; border-color: var(--st-acc); background: none; padding: 4px 0 4px 18px; }
.l-profile .s-timeline { grid-column: span 5; }
.l-profile .s-works { grid-column: span 7; }
.l-profile .s-works .works { grid-template-columns: 1fr; }
.l-profile .work { flex-direction: row; border-radius: 4px; }
.l-profile .wk-fig { flex: 0 0 38%; aspect-ratio: auto; }
.l-profile .s-articles .articles { grid-template-columns: 1fr; gap: 0; counter-reset: toc; }
.l-profile .art, .l-essay .art { flex-direction: row; border-radius: 0; border-width: 0 0 1px; background: none; counter-increment: toc; align-items: baseline; }
.l-profile .art::before, .l-essay .art::before { content: counter(toc, decimal-leading-zero); font: 700 clamp(22px, 2.6vw, 36px) var(--st-head); color: var(--st-acc); flex: 0 0 2.4em; }
.l-profile .art .art-fig, .l-essay .art .art-fig { display: none; }
.l-profile .art .art-body, .l-essay .art .art-body { padding: 18px 0; }
.l-profile .art.lead h3, .l-essay .art.lead h3 { font-size: 22px; }
.l-profile .card, .l-essay .card, .l-company .card { border-radius: 4px; }

/* 思想: 引用を年とともに読む */
.l-essay .quotes { grid-template-columns: 1fr; gap: 0; }
.l-essay .k-claim { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); column-gap: 26px; padding: 26px 0; background: none; border-width: 0 0 1px; border-radius: 0; }
.l-essay .k-claim .yr { grid-row: span 4; font: 700 clamp(26px, 3.2vw, 44px) var(--st-head); letter-spacing: -.02em; }
.l-essay .k-claim .quote { font-size: clamp(19px, 2.3vw, 29px); margin-top: 6px; }
.l-essay .s-articles .articles { grid-template-columns: 1fr; gap: 0; counter-reset: toc; }

/* 会社 */
.l-company .s-facts .facts { grid-template-columns: 1fr; }
.l-company .s-works { grid-column: span 7; }
.l-company .s-timeline { grid-column: span 5; }
.l-company .s-works .works { grid-template-columns: 1fr; }

/* 研究室: 技術ダッシュボード */
.l-lab .page-title { font-size: clamp(28px, 4.6vw, 62px); }
.l-lab .page-title::before { content: "> "; color: var(--st-acc); }
.l-lab .card { border-radius: 6px; }
.l-lab .s-articles { grid-column: span 7; }
.l-lab .s-dashboard { grid-column: span 5; }
.l-lab .articles { grid-template-columns: 1fr; gap: 0; }
.l-lab .art { border-width: 0 0 1px; border-radius: 0; background: none; }
.l-lab .art .art-fig { display: none; }
.l-lab .art-body { padding: 14px 4px; display: grid; grid-template-columns: 8.2em minmax(0, 1fr); column-gap: 14px; }
.l-lab .art .meta { grid-row: span 4; flex-direction: column; gap: 2px; }
.l-lab .art h3 { margin-top: 0; font-size: 15.5px; }
.l-lab .art .sum { font-size: 12.5px; -webkit-line-clamp: 2; }
.l-lab .art .tags, .l-lab .art .out { margin-top: 6px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile-n { padding: 14px 14px 12px; display: grid; }
.tile-n .num { font: 700 clamp(26px, 3vw, 40px) var(--mono); color: var(--st-acc2); line-height: 1.1; }
.tile-n .unit { font-size: 10.5px; color: var(--st-mut); }
.tile-n .lbl { font-size: 12.5px; margin-top: 6px; }
.dash .note { font-size: 11px; color: var(--st-mut); margin: 8px 0 20px; }
.diagram { display: grid; gap: 0; }
.dg-node { position: relative; border: 1px solid var(--st-line); border-radius: 6px; padding: 9px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 20px; background: var(--st-card); }
.dg-node b { color: var(--st-acc2); font-size: 14px; }
.dg-node span { font-size: 11.5px; color: var(--st-mut); text-align: right; }
.dg-node:not(:last-child)::after { content: ""; position: absolute; left: 50%; bottom: -20px; height: 19px; width: 1px; background: var(--st-acc); animation: flowdown 1.6s linear infinite; animation-delay: calc(var(--i) * .3s); }
@keyframes flowdown { from { clip-path: inset(0 0 100% 0); } 50% { clip-path: inset(0 0 0 0); } to { clip-path: inset(100% 0 0 0); } }
.dash h4 { font-size: 12px; color: var(--st-mut); margin: 6px 0 8px; letter-spacing: .08em; }
.repos { list-style: none; padding: 0; font-size: 12.5px; display: grid; gap: 8px; }
.repos .repo { display: block; font-weight: 700; text-decoration: none; }
.repos .repo::before { content: "$ git clone "; color: var(--st-mut); font-weight: 400; }
.repos .from, .repos li > a:not(.repo) { color: var(--st-mut); font-size: 11.5px; }
.l-lab .quotes { grid-template-columns: 1fr; gap: 8px; }
.l-lab .k-claim { padding: 12px 16px; display: grid; grid-template-columns: 4em 9em minmax(0, 1fr); column-gap: 12px; align-items: baseline; }
.l-lab .k-claim .quote { grid-column: 3; font-size: 14.5px; margin: 0; font-weight: 500; }
.l-lab .k-claim .txt { display: none; }
.l-lab .k-claim .src { grid-column: 3; margin-top: 4px; }
.l-lab .works { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.l-lab .work h3 { font-size: 15px; }
.l-lab .work .txt { font-size: 12.5px; line-height: 1.7; }
.l-lab .wk-body { padding: 14px 16px 16px; }

/* イベントスタジオ: 大きく、にぎやかに */
.l-studio .page-title { font-weight: 900; font-size: clamp(42px, 9.6vw, 140px); letter-spacing: -.035em; line-height: 1; background: linear-gradient(100deg, #fff, var(--st-acc) 45%, var(--st-acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.l-studio .works { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; }
.l-studio .work { grid-column: span 2; border-radius: 30px; border: 0; background: rgba(255,255,255,.12); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.l-studio .work:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.l-studio .work:nth-child(1) .wk-fig { aspect-ratio: 16 / 10; }
.l-studio .work:nth-child(1) h3 { font-size: clamp(26px, 3.6vw, 46px); font-weight: 900; }
.l-studio .work:nth-child(4) { grid-column: span 3; }
.l-studio .work:nth-child(5) { grid-column: span 3; }
.l-studio .work:nth-child(even) { transform: rotate(.6deg); }
.l-studio .work:nth-child(3n) { transform: rotate(-.8deg); }
.l-studio .work .no { color: var(--st-acc); }
.l-studio .s-videos { grid-column: span 7; }
.l-studio .s-gallery { grid-column: span 5; }
.l-studio .s-gallery .shots { columns: 2 150px; }
.l-studio .shot { border: 6px solid #fff; border-bottom-width: 0; border-radius: 4px; background: #fff; color: #222; box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.l-studio .shot:nth-child(odd) { transform: rotate(-1.6deg); }
.l-studio .shot:nth-child(even) { transform: rotate(1.3deg); }
.l-studio .shot figcaption, .l-studio .shot figcaption b { color: #333; }
.l-studio .art { border-radius: 26px; border: 0; background: rgba(255,255,255,.12); }
.l-studio .articles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.l-studio .art.lead { grid-column: auto; flex-direction: column; }
.l-studio .art.lead .art-fig { flex: none; aspect-ratio: 16 / 9; }
.l-studio .art.lead .art-body { padding: 20px 22px 22px; align-self: auto; }
.l-studio .art.lead h3 { font-size: 18px; }
.l-studio .art.lead .sum { font-size: 14px; -webkit-line-clamp: 3; }

/* 書店: 本棚 */
.l-bookstore .page-title { font-size: clamp(30px, 5vw, 70px); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 34px 30px; }
.book { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 22px; padding: 0 0 22px; background: none; border-width: 0 0 10px; border-radius: 0; overflow: visible;
  border-image: linear-gradient(180deg, #7a5226, #4a2f14) 1; }
.cover { all: unset; cursor: pointer; box-sizing: border-box; width: 148px; aspect-ratio: 148 / 212; display: grid; grid-template-rows: 1fr auto; padding: 14px 12px 12px 18px; border-radius: 3px 6px 6px 3px; position: relative; align-self: end;
  background: linear-gradient(90deg, rgba(0,0,0,.34), transparent 9%, rgba(255,255,255,.10) 11%, transparent 15%), linear-gradient(160deg, hsl(var(--h) 36% 34%), hsl(calc(var(--h) + 24) 42% 18%));
  color: #fbf4e4; box-shadow: 8px 10px 22px rgba(0,0,0,.5); transform-origin: 50% 100%; transition: transform .45s var(--ease), box-shadow .45s; }
.cover:hover, .cover:focus-visible { transform: translateY(-10px) rotate(-2deg); box-shadow: 14px 22px 34px rgba(0,0,0,.55); }
.cover:focus-visible { outline: 2px solid var(--st-acc2); outline-offset: 4px; }
.cv-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: #fff; }
.cover.has-img { background: #fff; padding: 0; }
.cover.has-img .cv-title, .cover.has-img .cv-author { visibility: hidden; }
.cv-title { writing-mode: vertical-rl; font: 700 16px/1.35 var(--serif); letter-spacing: .06em; overflow: hidden; justify-self: end; max-height: 100%; }
.cv-author { font: 500 10.5px var(--font); opacity: .82; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bk-info { min-width: 0; }
.rel { display: inline-block; font: 600 11.5px var(--font); letter-spacing: .04em; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--st-line); color: var(--st-mut); }
.rel.recommended, .rel.authored { background: var(--st-acc); border-color: var(--st-acc); color: var(--st-on-acc); }
.rel.positive_mention { border-color: var(--st-acc); color: var(--st-acc); }
.book h3 { font-family: var(--st-head); font-size: 19px; line-height: 1.45; margin-top: 8px; }
.book .author { font: 400 12.5px var(--font); color: var(--st-mut); margin-top: 2px; }
.level { display: flex; align-items: center; gap: 8px; font: 500 12px var(--font); color: var(--st-mut); margin-top: 8px; }
.lv-dots { width: 40px; height: 8px; background: radial-gradient(circle 4px at 4px 4px, var(--st-acc) 98%, transparent) 0 0 / 16px 8px repeat-x; opacity: .95; -webkit-mask: linear-gradient(90deg, #000 var(--n, 33%), rgba(0,0,0,.2) 0); mask: linear-gradient(90deg, #000 var(--n, 33%), rgba(0,0,0,.2) 0); }
.book[data-level=intermediate] .lv-dots { --n: 66%; }
.book[data-level=advanced] .lv-dots { --n: 100%; }
.reason { font-size: 14.5px; line-height: 1.8; margin-top: 10px; }
.book .quote { font-size: 13px; color: color-mix(in srgb, var(--st-fg) 78%, transparent); }
.audience { font-size: 12.5px; color: var(--st-mut); margin-top: 8px; }
.buy { display: inline-flex; align-items: center; min-height: 40px; padding: 0 20px; margin-top: 14px; border-radius: 999px; background: linear-gradient(100deg, var(--st-acc2), var(--st-acc)); color: var(--st-on-acc); font: 700 14px var(--font); text-decoration: none; transition: transform .3s var(--ease); }
.buy:hover { transform: scale(1.04); }
.buy[data-affiliate]::after { content: "PR"; font-size: 10px; margin-left: 8px; padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; }
.nobuy { font-size: 12px; color: var(--st-mut); margin-top: 12px; }
.disclosure { font: 400 12px var(--font); color: var(--st-mut); margin-top: 18px; }
.previous { opacity: .82; }
.previous .shelf { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.previous .book { grid-template-columns: 74px minmax(0, 1fr); gap: 14px; border-bottom-width: 6px; padding-bottom: 12px; }
.previous .cover { width: 74px; padding: 8px 6px 6px 10px; }
.previous .cv-title { font-size: 10.5px; }
.previous .cv-author, .previous .reason, .previous .quote, .previous .audience, .previous .src, .previous .level, .previous .nobuy { display: none; }
.previous .book h3 { font-size: 14px; }
.previous .buy { min-height: 32px; font-size: 12px; padding: 0 14px; margin-top: 8px; }
.l-bookstore .s-articles .articles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.l-bookstore .art.lead { grid-column: auto; flex-direction: column; }
.l-bookstore .art.lead .art-fig { flex: none; aspect-ratio: 16 / 9; }
.l-bookstore .art.lead .art-body { padding: 20px 22px 22px; align-self: auto; }
.l-bookstore .art.lead h3 { font-size: 18px; }

/* 相談: お問い合わせシートを主役に、横に「相談できること」 */
.l-contact .page-title { font-size: clamp(30px, 5vw, 64px); }
.l-contact .s-inquiry { grid-column: span 7; }
.l-contact .s-facts { grid-column: span 5; }
.l-contact .s-facts .facts { grid-template-columns: 1fr; }
.l-contact .s-works .works { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.l-contact .work h3 { font-size: 18px; }
.sheet { padding: clamp(22px, 3vw, 40px); border-color: color-mix(in srgb, var(--st-acc) 60%, var(--st-line)); background: color-mix(in srgb, var(--st-fg) 6%, transparent); }
.sheet form select { display: block; width: 100%; margin-top: 8px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: #1c1c1e; color: var(--fg); font: inherit; font-size: 16px; }
.sheet form textarea { min-height: 96px; }
.sheet form input:not(:placeholder-shown), .sheet form textarea:not(:placeholder-shown) { border-color: color-mix(in srgb, var(--st-acc) 55%, transparent); }
.sheet .hp { position: absolute; left: -9999px; }
.sheet-done { font-size: clamp(18px, 2vw, 24px); font-weight: 600; color: var(--st-acc2); padding: 20px 0; }

/* 記事アーカイブ / 写真 */
.l-archive .s-gallery .shots { columns: 4 200px; }
.l-gallery .shots { columns: 4 220px; }

/* ---------- 画面幅 ---------- */
@media (max-width: 1100px) {
  html.living-on .agent { grid-template-columns: 60px minmax(0, 1fr); grid-template-areas: "shape voice" "talk talk" "views views"; }
  html.living-on .agent .shape { width: 60px; }
  html.living-on .quota { display: none; }
  html.living-on .talk { justify-content: stretch; }
  .l-lab .works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-studio .articles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .page-body { display: block; }
  .sect { margin-bottom: 40px; }
  .l-contact .s-works .works, .articles, .works, .vids, .facts, .quotes, .l-studio .works, .l-studio .articles, .l-bookstore .s-articles .articles, .l-lab .works { grid-template-columns: 1fr; }
  .l-studio .work, .l-studio .work:nth-child(n) { grid-column: auto; grid-row: auto; transform: none; }
  .art.lead { flex-direction: column; }
  .art.lead .art-fig { flex: none; }
  .prof { grid-template-columns: 1fr; }
  .portrait { position: static; max-width: 300px; }
  .l-profile .work { flex-direction: column; }
  .l-profile .wk-fig { flex: none; aspect-ratio: 16 / 9; }
  .shots, .l-studio .s-gallery .shots, .l-archive .s-gallery .shots, .l-gallery .shots { columns: 2 140px; column-gap: 12px; }
  .shot { margin-bottom: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-lab .art-body { grid-template-columns: 1fr; }
  .l-lab .art .meta { flex-direction: row; grid-row: auto; margin-bottom: 4px; }
  .l-lab .k-claim, .l-essay .k-claim { grid-template-columns: 1fr; }
  .l-lab .k-claim .quote, .l-lab .k-claim .src { grid-column: auto; }
  .l-essay .k-claim .yr { grid-row: auto; }
  .book { grid-template-columns: 104px minmax(0, 1fr); gap: 16px; }
  .cover { width: 104px; padding: 10px 8px 8px 13px; }
  .cv-title { font-size: 13px; }
  .talk { gap: 10px; }
  .mic { flex: 1 1 100%; justify-content: center; }
  html.living-on .mic { flex: 0 0 auto; }
  html.living-on .mic-label { display: none; }
  html.living-on .mic { padding: 0; width: 44px; justify-content: center; }
  html.living-on .home-btn { padding: 0 10px; }
  html.living-on .agent { top: 52px; padding: 8px var(--gut); row-gap: 6px; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; }
  html.living-on .agent .shape { width: 44px; }
  html.living-on .said { -webkit-line-clamp: 2; font-size: 14px; line-height: 1.5; }
  html.living-on .heard { display: none; }
  html.living-on .agent-name { font-size: 10px; }
  html.living-on .views button, html.living-on .home-btn { min-height: 32px; font-size: 12.5px; }
  html.living-on .mic, html.living-on .ask { min-height: 40px; }
  html.living-on .ask input { height: 38px; }
  .book .cover { align-self: start; }
  .starts button { font-size: 13.5px; padding: 0 14px; }
  #stage { padding-top: 26px; }
  .spread { padding: 54px 18px 22px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  :root, #backdrop, #backdrop::before, .agent .shape, .cover, .mic { transition: none; }
  #backdrop::before, .said .w, .dg-node::after, .agent-name span { animation: none !important; }
  .l-studio .work, .l-studio .shot { transform: none !important; }
}

/* ---------- 入力は常に画面のいちばん下（全幅の帯。右下に浮く小窓ではない） ---------- */
html .talk, html.living-on .talk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 18; width: auto; margin: 0; grid-area: auto;
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 10px;
  padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg1) 80%, transparent); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid color-mix(in srgb, var(--st-acc) calc(22% + var(--lv) * 70%), transparent); color: var(--st-fg); }
html .talk .ask, html.living-on .talk .ask { flex: 1 1 auto; max-width: 760px; min-height: 48px; }
html .talk .ask input { height: 46px; font-size: 16px; }
html .talk .mic, html.living-on .talk .mic { flex: 0 0 auto; min-height: 48px; }
html .talk .home-btn { flex: 0 0 auto; min-height: 44px; }
html.talk-closed .talk { display: none; }
body { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
html.talk-closed body { padding-bottom: 0; }
.hero.agent { padding-bottom: 96px; }
html.living-on .agent { grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-areas: "shape voice quota" "shape views views"; }
html.living-on .quota { align-self: start; }
@media (max-width: 1100px) {
  html.living-on .agent { grid-template-columns: 60px minmax(0, 1fr); grid-template-areas: "shape voice" "views views"; }
}
@media (max-width: 860px) {
  html .talk .mic, html.living-on .talk .mic { width: 48px; padding: 0; justify-content: center; flex: 0 0 48px; }
  html .talk .mic-label { display: none; }
  html .talk .home-btn { padding: 0 10px; font-size: 12.5px; }
  html.living-on .agent { grid-template-columns: 44px minmax(0, 1fr); }
}

/* 質問に触れている箇所の抜粋を、カードの本文として先に見せる */
.art .hit { font-size: 14.5px; line-height: 1.8; margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--st-acc); color: color-mix(in srgb, var(--st-fg) 88%, transparent); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.art.lead .hit { font-size: 16.5px; -webkit-line-clamp: 6; }
/* 一覧型のレイアウトでも記事の画像を出す */
.l-profile .art:not(.no-media) .art-fig, .l-essay .art:not(.no-media) .art-fig { display: block; order: 3; flex: 0 0 clamp(120px, 18vw, 220px); aspect-ratio: 16 / 9; border-radius: 6px; margin-left: 20px; align-self: center; }
.l-lab .art:not(.no-media) { display: grid; grid-template-columns: minmax(0, 1fr) 150px; column-gap: 16px; align-items: center; }
.l-lab .art:not(.no-media) .art-fig { display: block; order: 2; aspect-ratio: 16 / 9; border-radius: 4px; }
@media (max-width: 860px) {
  .l-profile .art:not(.no-media) .art-fig, .l-essay .art:not(.no-media) .art-fig { flex-basis: 96px; margin-left: 12px; }
  .l-lab .art:not(.no-media) { grid-template-columns: minmax(0, 1fr) 96px; }
}
html .talk .ask, html.living-on .talk .ask { min-width: 0; }
html .talk .ask input { width: 100%; }
/* 回答は切らずに全部見せる。長いときは枠の中でスクロールでき、話している間は最新の言葉を追う。 */
html .said, html.living-on .said { display: block; -webkit-line-clamp: unset; overflow-y: auto; max-height: 38vh; overscroll-behavior: contain; scrollbar-width: thin; }
html.living-on .said { max-height: 30vh; }
@media (max-width: 860px) { html.living-on .said { max-height: 24vh; } }

/* ---------- 会話は画面の下に集約: ゼットの返答・聞き取った言葉・入力を一つの帯に ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 18; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom, 0px)); color: var(--st-fg);
  background: color-mix(in srgb, var(--bg1) 84%, transparent); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid color-mix(in srgb, var(--st-acc) calc(22% + var(--lv) * 70%), transparent); }
html.talk-closed .dock { display: none; }
html .dock .talk, html.living-on .dock .talk { position: static; width: min(980px, 100%); padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
html .dock .voice, html.living-on .dock .voice { width: min(980px, 100%); text-align: left; grid-area: auto; }
html .dock .agent-name, html.living-on .dock .agent-name { justify-content: flex-start; margin: 0; font-size: 11px; }
html .dock .heard, html.living-on .dock .heard { display: block; font-size: 12.5px; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html .dock .heard:empty { display: none; }
html .dock .said, html.living-on .dock .said { font-size: clamp(15px, 1.5vw, 19px); line-height: 1.6; font-weight: 600; margin: 2px 0 0; min-height: 0; max-height: 26vh; overflow-y: auto; text-wrap: pretty; }
body { padding-bottom: var(--dock-h, 120px); }
html.talk-closed body { padding-bottom: 0; }
.hero.agent { padding-bottom: 40px; }
/* 上の帯はゼットの姿とページ切り替えだけ */
html.living-on .agent { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "shape views quota"; padding: 8px var(--gut); }
html.living-on .agent .shape { width: 56px; }
html.living-on .quota { align-self: center; }
@media (max-width: 1100px) { html.living-on .agent { grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "shape views"; } html.living-on .agent .shape { width: 48px; } }
@media (max-width: 860px) {
  html .dock .said, html.living-on .dock .said { font-size: 14.5px; max-height: 22vh; }
  html.living-on .agent { grid-template-columns: 40px minmax(0, 1fr); }
  html.living-on .agent .shape { width: 40px; }
}
/* 会話の順番どおり: 自分の言葉 → ゼットの返答 → 入力 */
html .dock .voice { display: flex; flex-direction: column; }
html .dock .heard { order: -1; margin: 0 0 4px; }

/* ---------- 会話の履歴: 画面の下およそ1/4。過去のやり取りをさかのぼれる。ボタンで全画面に広げられる ---------- */
html .dock .voice { display: flex; flex-direction: column; min-height: 0; }
.voice-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.log-full { min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--st-line); background: none; color: var(--st-mut); font: 500 12px var(--font); cursor: pointer; white-space: nowrap; }
.log-full:hover, .log-full[aria-pressed=true] { border-color: var(--st-acc); color: var(--st-fg); }
.log { height: calc(25vh - 96px); min-height: 84px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin-top: 6px; padding-right: 6px; display: flex; flex-direction: column; gap: 10px; outline-offset: 2px; }
.log:empty { display: none; }
.turn { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); column-gap: 12px; align-items: baseline; }
.turn .who { font: 600 11px var(--font); letter-spacing: .06em; color: var(--st-mut); }
.turn.z .who { color: var(--st-acc); }
html .dock .turn .said, html.living-on .dock .turn .said { margin: 0; max-height: none; overflow: visible; font-size: clamp(14.5px, 1.35vw, 17px); line-height: 1.65; font-weight: 500; text-shadow: none; }
.turn.me .said { color: var(--st-mut); font-weight: 400 !important; }
.turn.z:last-child .said { font-weight: 600 !important; text-shadow: 0 0 calc(var(--lv) * 22px) color-mix(in srgb, var(--st-acc) 60%, transparent) !important; }
.turn.note .said { color: var(--st-acc2); }
/* 全画面: 帯がヘッダーの下いっぱいに広がり、履歴だけを読む */
html.log-open .dock { top: 52px; justify-content: flex-end; background: color-mix(in srgb, var(--bg1) 96%, transparent); }
html.log-open .dock .voice { flex: 1 1 auto; }
html.log-open .log { flex: 1 1 auto; height: auto; padding: 10px 6px 10px 0; }
html.log-open body { overflow: hidden; }
@media (max-width: 860px) {
  .log { height: calc(25vh - 88px); min-height: 72px; }
  .turn { grid-template-columns: 3.4em minmax(0, 1fr); column-gap: 8px; }
}

/* ロゴ本体を粒子の下にはっきり置く（高解像度の画面でも薄くならない）。考えている間だけ粒子にゆずる。 */
.agent .shape::before { content: ""; position: absolute; inset: 0; background: url(../img/logo-mark.png) center / contain no-repeat; opacity: .96;
  filter: drop-shadow(0 0 calc(6px + var(--lv) * 28px) color-mix(in srgb, var(--st-acc) 70%, transparent)); transition: opacity .45s var(--ease); }
html[data-agent=thinking] .agent .shape::before, html[data-agent=composing] .agent .shape::before { opacity: .22; }
html[data-agent=speaking] .agent .shape::before { opacity: .82; transform: scale(calc(1 + var(--lv) * .05)); }
html[data-palette=paper] .agent .shape::before { filter: brightness(.55) saturate(1.3); }
.presence-fallback .agent .shape { background: none; }
@media (prefers-reduced-motion: reduce) { .agent .shape::before { transition: none; transform: none !important; } }

/* ゼルペムと清水亮の関係 */
.relation dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0; }
.relation dl > div { padding: 24px 26px; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.relation dt { font-weight: 700; font-size: 18px; color: var(--gold2); }
.relation dd { margin: 8px 0 0; font-size: 15.5px; line-height: 1.85; color: rgba(245,245,247,.86); }
.relation a, .company-note a { color: var(--gold2); text-underline-offset: 3px; }
.relation dd a { display: inline-block; margin-left: 6px; white-space: nowrap; }
.relation-bio { margin-top: 26px; font-size: 14.5px; line-height: 1.9; color: var(--mut); max-width: 60em; }
.relation-bio b { color: var(--fg); }
@media (max-width: 860px) { .relation dl { grid-template-columns: 1fr; } }
.head-btns { display: flex; gap: 8px; align-items: center; flex: none; }
.views[hidden], .starts[hidden], .home-btn[hidden], .log-full[hidden] { display: none; }
.faq-list dt { font-size: 17px; line-height: 1.6; }
.faq-list dd a { margin-left: 8px; }
.sec.faq { padding-top: 0; }
/* 元サイトの背景パーティクル（#gpu）: ホームでは出す。組み上がったページの間は消して、文字を読みやすくする */
html.living-on #gpu { opacity: 0; }

/* ---------- 進行の図（研修の流れ） ---------- */
.flows { display: grid; gap: 18px; }
.flow { padding: 26px 28px; }
.flow h3 { font-family: var(--st-head); font-size: 22px; }
.flow .txt { font-size: 15px; line-height: 1.9; margin-top: 10px; color: color-mix(in srgb, var(--st-fg) 84%, transparent); max-width: 60em; }
.flow-bar { display: flex; gap: 6px; margin-top: 22px; }
.flow-step { flex: 1 1 0; min-width: 0; padding: 16px 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--st-acc) 20%, transparent); border: 1px solid color-mix(in srgb, var(--st-acc) 55%, transparent); display: flex; flex-direction: column; gap: 4px; position: relative; }
.flow-step.first { background: color-mix(in srgb, var(--st-fg) 9%, transparent); border-color: var(--st-line); }
.flow-step b { font: 700 17px var(--st-head); color: var(--st-fg); }
.flow-min { font: 700 13px var(--font); color: var(--st-acc); letter-spacing: .06em; }
.flow-detail { font-size: 13px; line-height: 1.6; color: color-mix(in srgb, var(--st-fg) 74%, transparent); }
.flow-step + .flow-step::before { content: "→"; position: absolute; left: -13px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--st-acc); width: 20px; text-align: center; }
.flow-total { margin-top: 12px; font-size: 13.5px; color: var(--st-mut); }
@media (max-width: 760px) {
  .flow { padding: 20px 18px; }
  .flow-bar { flex-direction: column; }
  .flow-step { flex: none !important; }
  .flow-step + .flow-step::before { content: "↓"; left: 50%; top: -13px; transform: translateX(-50%); }
}

/* 書影と題名は Amazon へのリンク（購入リンクが確認できている本） */
a.cover { text-decoration: none; }
.book h3 a.bk-title { color: inherit; text-decoration: none; }
.book h3 a.bk-title:hover, .book h3 a.bk-title:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.bk-more { display: inline-block; margin: 10px 0 0 12px; padding: 0; border: 0; background: none; color: var(--st-mut); font: 500 13px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bk-more:hover { color: var(--st-fg); }

/* メモリの少ない端末: マイクは使えない旨を会話欄に出す */
.mic-note { width: min(980px, 100%); margin: 0; font: 500 12px/1.6 var(--font); color: var(--st-mut); text-align: center; }
.mic-note[hidden] { display: none; }
html.voice-lowmem .mic { opacity: .45; cursor: not-allowed; }
