/* Yopori: a quiet personal space, a future Agent world, and a human community.
   Load after experience.css. These components do not change existing routes. */

.home-hero,
.home-entry-card,
.agent-chat-panel,
.agent-profile-summary,
.world-preview {
  --space-ink:var(--text,#f0f2fa);
  --space-muted:var(--muted,#a8b3ca);
  --space-line:var(--line,#293247);
  --space-lilac:var(--accent,#c4b5fa);
  --space-mint:var(--mint,#b9e5d7);
  color:var(--space-ink);
  min-width:0;
}

.home-hero {
  position:relative;
  isolation:isolate;
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(240px,.8fr);
  align-items:center;
  gap:24px;
  min-height:260px;
  margin:24px 0 32px;
  padding:32px 40px;
  overflow:hidden;
  border:1px solid var(--space-line);
  border-radius:16px;
  background:radial-gradient(ellipse at 88% 15%,#8579b819,transparent 58%),var(--surface,#141b2b);
}
.home-hero::after {
  content:"";
  position:absolute;
  inset:auto 0 0;
  height:1px;
  background:linear-gradient(90deg,transparent,#c6b8f366,transparent);
  pointer-events:none;
}
.home-hero-copy { position:relative; z-index:1; min-width:0; }
#app .home-hero h1 { max-width:17em; margin:0; font-size:32px; font-weight:600; line-height:1.35; text-wrap:balance; }
#app .home-hero p { max-width:38em; margin:16px 0 0; color:var(--space-muted); font-size:15px; line-height:1.7; text-wrap:pretty; }
.home-hero-actions,
.home-hero .actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:24px; }
.home-hero .button { min-height:48px; padding:12px 20px; }
.home-hero .button:not(.secondary):not(.quiet) { color:#222638; background:var(--space-lilac); }
.home-hero .button:not(.secondary):not(.quiet):hover { background:#d5c9fd; }
.home-community-link { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:8px 0; color:#c4cce0; }
.home-community-link:hover { color:var(--space-ink); }
.home-community-link svg { width:16px; height:16px; }
.home-hero.returning { min-height:208px; }
.home-hero.returning .home-orbit { width:176px; }

/* Static light and geometry, with no attention-seeking orbit animation. */
.home-orbit { position:relative; width:216px; aspect-ratio:1; max-width:100%; justify-self:center; pointer-events:none; opacity:.86; }
.home-orbit::before { content:""; position:absolute; inset:6%; border-radius:50%; background:radial-gradient(circle,#aaa4ee2e,transparent 69%); filter:blur(12px); }
.home-orbit::after { content:""; position:absolute; width:5px; height:5px; top:23%; right:18%; border-radius:50%; background:#ded3ff; box-shadow:0 0 14px #cfc2ff9c, -196px 102px 0 -1px #b9e8e0, -45px 168px 0 -1px #c9c3e088; }
.home-orbit-core { position:absolute; inset:27%; z-index:1; border-radius:50%; background:radial-gradient(circle at 30% 25%,#f0e9ff 0,#bcb4ea 18%,#7e8cb5 43%,#34476e 68%,#1e2b4a 89%); box-shadow:inset -12px -14px 24px #0d183a8c,inset 4px 4px 14px #f4eaff55,0 0 48px #9c9ce734; }
.home-orbit-core::after { content:""; position:absolute; inset:0; border-radius:inherit; background:linear-gradient(150deg,transparent 45%,#b5d8ed25 48%,transparent 54%); }
.home-orbit-ring { position:absolute; inset:21% 1%; border:1px solid #aeb3e28c; border-radius:50%; transform:rotate(-30deg) scaleY(.45); box-shadow:0 0 12px #a9a3eb14; }
.home-orbit-ring::after { content:""; position:absolute; inset:-20%; border:1px solid #abb8e324; border-radius:50%; }

.home-entry-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; margin:0 0 40px; }
.home-entry-card { position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:16px; padding:32px; border:1px solid var(--space-line); border-radius:16px; background:var(--surface,#141b2b); transition:background .18s,border-color .18s; }
a.home-entry-card:hover { border-color:#a997cf75; background:var(--raised,#1c2538); }
.home-entry-card:focus-visible { outline:3px solid #b7e9dc; outline-offset:4px; }
.home-entry-icon { display:flex; align-items:center; justify-content:center; width:48px; height:48px; border-radius:16px; color:#d0c2ff; background:#b9a2ef12; }
.home-entry-card:nth-child(2) .home-entry-icon { color:#b5e3dc; background:#8dd6ca0e; }
.home-entry-icon svg { width:24px; height:24px; }
#app .home-entry-card h2 { margin:0; font-size:24px; line-height:1.4; text-wrap:balance; }
#app .home-entry-card p { max-width:32em; margin:0; color:var(--space-muted); font-size:15px; line-height:1.7; }
.home-entry-card>svg { position:absolute; right:32px; top:32px; width:20px; height:20px; color:#b3bed6; }
.home-entry-card .home-status { margin-top:0; }
.home-entry-link { display:flex; align-items:center; gap:12px; margin-top:auto; padding-top:8px; color:#d4c9f7; }
#app .home-entry-link { font-size:15px; line-height:1.6; }
.home-entry-link svg { width:18px; height:18px; }
.home-section-title { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; margin:40px 0 24px; }
#app .home-section-title h2 { margin:0; font-size:24px; }
#app .home-section-title p { margin:8px 0 0; color:#b4bbd2; font-size:15px; }
#app .home-status { display:inline-flex; align-items:center; gap:8px; width:fit-content; font-size:13px; line-height:1.5; font-weight:400; color:var(--muted,#a8b3ca); }
.home-status::before { content:""; width:6px; height:6px; flex:0 0 6px; border-radius:50%; background:#9ba7c4; }
#app .home-status.available { color:var(--mint,#b9e5d7); }
.home-status.available::before { background:var(--mint,#b9e5d7); }
#app .home-status.planned { color:#c2b6d8; }
.home-status.planned::before { background:#a394bc; }

/* Real conversation is the main task; profile and confirmed memory stay secondary. */
.agent-home-layout { display:grid; grid-template-columns:minmax(0,1fr) 256px; align-items:start; gap:16px; margin:0 0 40px; }
.agent-home-layout>* { min-width:0; }
.agent-chat-panel { display:flex; flex-direction:column; min-height:720px; overflow:hidden; border:1px solid var(--space-line); border-radius:16px; background:var(--surface,#141b2b); }
.agent-chat-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; padding:24px 24px 16px; }
#app .agent-chat-heading h2 { margin:0; font-size:20px; }
#app .agent-chat-heading p { margin:8px 0 0; color:var(--space-muted); font-size:13px; }
.agent-quick-tools { display:flex; align-items:center; flex-wrap:wrap; gap:4px; padding:0 16px 12px; border-bottom:1px solid var(--space-line); }
.agent-quick-tools .button { min-height:44px; padding:10px 12px; background:transparent; border-color:transparent; }
#app .agent-quick-tools .button { color:#c4cce0; font-size:14px; }
.agent-quick-tools .button:hover { background:var(--raised,#1c2538); }
.agent-quick-tools svg { width:17px; height:17px; }
.agent-chat-log { display:flex; flex:1 1 auto; flex-direction:column; gap:32px; min-height:220px; height:clamp(220px,calc(100dvh - 680px),360px); max-height:360px; padding:24px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#526079 transparent; scroll-padding:24px; }
.agent-chat-message { display:grid; grid-template-columns:minmax(0,1fr); align-self:flex-start; align-items:center; gap:10px; max-width:92%; min-width:0; padding:0; overflow-wrap:anywhere; }
.agent-chat-message.user { align-self:flex-end; padding:16px 18px 8px; border:0; border-radius:16px 16px 4px 16px; background:#c4b5fa; color:#211d34; }
.agent-chat-message.assistant { padding:16px 18px 8px; border-radius:4px 16px 16px; background:var(--raised,#1c2538); color:var(--text,#f0f2fa); }
.agent-chat-message>header { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 12px; min-width:0; margin:0; grid-column:1; grid-row:1; }
#app .agent-chat-message>header strong { font-size:13px; font-weight:500; color:#c4cce0; }
#app .agent-chat-message>header time { margin:0; font-size:13px; color:var(--muted,#a8b3ca); }
#app .agent-chat-message.user>header :is(strong,time) { color:#403950; }
#app .agent-chat-message p { grid-column:1/-1; margin:0; max-width:68ch; font-size:15px; line-height:1.75; white-space:pre-wrap; }
#app .agent-chat-message p+p { margin-top:16px; }
#app .agent-chat-message :is(small,time,.agent-chat-role) { display:block; margin-bottom:8px; color:#aeb8d0; font-size:13px; line-height:1.5; }
.agent-chat-message>.button { grid-column:1; grid-row:3; justify-self:start; min-height:44px; padding:8px 0; margin:0; white-space:nowrap; }
#app .agent-chat-message>.button { font-size:13px; color:#b9c3d9; }
#app .agent-chat-message.user>.button { color:#403950; }
.agent-chat-message>.button svg { width:16px; height:16px; }
.agent-chat-message>.button:hover { color:var(--text,#f0f2fa); background:#c0b4ed0b; }
#app .agent-chat-message.user>.button:hover { color:#211d34; background:#211d340a; }
.agent-chat-message pre { max-width:100%; overflow:auto; white-space:pre-wrap; }
.agent-chat-empty { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; min-height:260px; max-width:440px; padding:24px 16px; margin:auto; text-align:center; }
.agent-chat-empty .home-orbit { width:128px; flex:0 0 auto; margin-bottom:16px; }
#app .agent-chat-empty h2 { margin:0 0 16px; font-size:24px; line-height:1.4; text-wrap:balance; }
#app .agent-chat-empty p { margin:0; color:var(--space-muted); font-size:15px; line-height:1.75; }
.agent-chat-empty .button { margin-top:24px; }
.agent-chat-starters { display:flex; flex-direction:column; align-items:stretch; gap:12px; width:100%; max-width:344px; margin-top:24px; }
.agent-chat-starters .button { justify-content:center; min-height:44px; padding:12px 16px; margin:0; white-space:normal; text-align:center; }
.agent-chat-empty>.agent-avatar { --avatar-size:88px; flex:0 0 auto; margin:0 0 12px; }
.agent-chat-log:has(.agent-chat-empty) { padding-top:16px; padding-bottom:16px; }
.agent-chat-composer { flex:0 0 auto; display:grid; gap:14px; margin:16px 24px 8px; padding:16px; border:1px solid var(--space-line); border-radius:12px; background:var(--bg,#0c101b); }
.agent-chat-composer textarea { min-height:80px; max-height:200px; padding:4px 0; resize:vertical; color:var(--text,#f0f2fa); background:transparent; border-color:transparent; border-radius:4px; caret-color:var(--accent,#c4b5fa); }
#app .agent-chat-composer textarea { font-size:16px; line-height:1.6; }
.agent-chat-composer textarea::placeholder { color:var(--muted,#a8b3ca); }
.agent-chat-consent { display:flex; align-items:flex-start; gap:12px; min-height:44px; color:#b4bfd5; cursor:pointer; }
.agent-chat-consent input[type=checkbox] { width:18px; height:18px; min-height:18px; flex:0 0 18px; margin:3px 0 0; accent-color:#c4b6fa; }
#app .agent-chat-consent,#app .agent-chat-consent :is(span,p,small) { font-size:13px; line-height:1.65; }
.agent-chat-consent>span { min-width:0; margin:0; }
.agent-chat-consent a { text-decoration:underline; text-underline-offset:3px; }
.agent-chat-actions { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.agent-chat-actions .button { min-height:44px; padding:12px 20px; }
#app .agent-chat-actions>p,#app .agent-chat-actions>small { margin:0; color:#aeb8d0; font-size:13px; }
.agent-chat-actions>.button:only-child { margin-left:auto; }
.agent-chat-status:empty { display:none; }
#app .agent-chat-status { max-width:36em; color:#b8c4dc; font-size:13px; line-height:1.65; }
.agent-chat-composer .form-error { margin:0; padding:12px 16px; border-radius:12px; }
.agent-chat-privacy { flex:0 0 auto; padding:0 24px 12px; background:var(--surface,#141b2b); }
.agent-chat-privacy summary { display:list-item; min-height:44px; padding:12px 0; color:#bbc5dc; cursor:pointer; }
#app .agent-chat-privacy summary { font-size:13px; line-height:1.6; }
#app .agent-chat-privacy p { margin:0 0 16px; color:#aeb9d1; font-size:15px; line-height:1.75; }
#app .agent-chat-privacy>a { display:inline-block; min-height:44px; padding:8px 0; color:#d0c2f7; font-size:13px; text-decoration:underline; text-underline-offset:4px; }

.agent-profile-summary { min-width:0; padding:24px 20px; border:1px solid var(--space-line); border-radius:16px; background:var(--surface,#141b2b); }
.agent-profile-identity { display:flex; flex-direction:column; align-items:center; padding:0 0 24px; text-align:center; }
.agent-profile-identity>.agent-avatar { --avatar-size:112px; margin-bottom:20px; }
#app .agent-profile-summary h2 { margin:0 0 8px; font-size:20px; overflow-wrap:anywhere; }
#app .agent-profile-summary h3 { margin:0 0 16px; font-size:16px; }
#app .agent-profile-summary p { margin:0 0 16px; color:var(--space-muted); font-size:15px; line-height:1.7; overflow-wrap:anywhere; }
.agent-side-memory,.agent-side-usage { min-width:0; padding:24px 0 16px; border-top:1px solid var(--space-line); }
.agent-side-memory>header { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
#app .agent-memory-count { flex:0 0 auto; color:var(--muted,#a8b3ca); font-size:13px; font-variant-numeric:tabular-nums; }
.agent-memory-preview { display:grid; gap:12px; }
.agent-memory-preview-item { display:block; min-width:0; padding:12px 0; border-bottom:1px solid var(--space-line); }
.agent-memory-preview-item:first-child { padding-top:0; }
#app .agent-memory-preview-item strong { display:block; margin:0 0 6px; color:var(--text,#f0f2fa); font-size:14px; font-weight:500; overflow-wrap:anywhere; }
#app .agent-memory-preview-item p { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; margin:0; font-size:13px; line-height:1.65; }
.agent-memory-preview-item:hover strong { color:var(--accent,#c4b5fa); }
#app .agent-profile-summary .agent-memory-empty { font-size:14px; }
#app .agent-profile-summary .agent-usage-quota { color:var(--text,#f0f2fa); font-size:14px; font-variant-numeric:tabular-nums; }
#app .agent-profile-summary .agent-usage-state { font-size:14px; }
.agent-profile-summary .button { min-height:44px; margin:0 8px 8px 0; }
.agent-profile-summary .home-status { margin-bottom:16px; }
.agent-profile-summary dl { display:grid; gap:16px; margin:0 0 24px; }
.agent-profile-summary dd { margin:4px 0 0; overflow-wrap:anywhere; }
.agent-profile-summary dt { color:#aeb8d0; }
.agent-profile-summary hr { margin:24px 0; border-color:var(--space-line); }
.agent-profile-summary details { padding:0; border:0; }
.agent-profile-summary summary { min-height:44px; padding:8px 0; cursor:pointer; }
.agent-profile-summary details p { margin:8px 0; }
.agent-side-links { display:flex; flex-direction:column; align-items:stretch; gap:8px; margin:8px 0 0; }
.agent-side-links .button { justify-content:flex-start; margin:0; padding:12px; white-space:normal; border-color:transparent; background:transparent; }
.agent-side-links .button:hover { background:var(--raised,#1c2538); }
.agent-settings .button { justify-content:flex-start; white-space:normal; }
.agent-secondary-links { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:24px 0 32px; }
.agent-secondary-links p { margin:0; max-width:42em; }
.agent-connection-options { display:grid; grid-template-columns:1.15fr 1fr; gap:24px; margin-bottom:40px; }
.agent-connection-options .home-entry-card { padding:24px; }
.agent-connection-options .home-entry-card:first-child { grid-row:span 2; align-self:start; }
.agent-connection-options .home-entry-card:first-child>.button { margin-top:24px; }
.agent-connection-options .home-entry-card:not(:first-child) { border:0; border-radius:0; border-bottom:1px solid var(--line,#293247); background:transparent; padding:8px 0 24px; }
#app .agent-connection-options h2 { font-size:22px; }
.agent-connection-options .home-entry-card>.button { margin-top:auto; white-space:normal; }
#app .agent-connection-options .field-help { color:#acb7cf; font-size:13px; line-height:1.7; }
.agent-memory-list { display:grid; gap:16px; padding:0; margin:24px 0; list-style:none; }
.agent-memory-item { padding-bottom:16px; border-bottom:1px solid #aab7df20; overflow-wrap:anywhere; }
#app .agent-memory-item p { margin:0 0 8px; font-size:15px; }
#app .agent-memory-item small { color:#acb7cf; font-size:13px; }

/* A clearly marked future place. There are no invented activity indicators. */
.world-hero { max-width:800px; padding:32px 0; }
#app .world-hero h1 { margin:16px 0; font-size:32px; line-height:1.4; text-wrap:balance; }
#app .world-hero p { max-width:42em; margin:0; color:var(--muted,#a8b3ca); font-size:15px; line-height:1.75; }
.world-hero .button { margin:24px 12px 0 0; }
.world-preview { position:relative; isolation:isolate; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:center; gap:24px; min-height:360px; padding:40px 32px; margin-bottom:40px; overflow:hidden; border:1px solid var(--space-line); border-radius:16px; background:linear-gradient(180deg,#141b30a6,#10192ddd),url('./assets/yopori-horizon.webp') center 58%/cover; }
.world-preview::before { content:""; position:absolute; width:64%; height:56%; left:18%; top:18%; border:1px solid #c2c4f23b; border-radius:50%; transform:rotate(-9deg); box-shadow:0 0 0 48px #bbc6f205,0 0 0 96px #bbc6f203; z-index:-1; }
.world-place { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; min-width:0; padding:16px 0; color:#e4e5f5; text-align:center; }
.world-place:nth-child(2) { transform:translateY(-16px); }
.world-place:nth-child(3) { transform:translateY(16px); }
.world-place>svg { display:none; }
.world-place::before { content:""; display:block; width:56px; height:56px; border-radius:50%; background:radial-gradient(circle at 30% 25%,#ece0ff,#8589b2 40%,#334966 74%); box-shadow:0 0 32px #b2ade336; }
.world-place:nth-child(2)::before { width:72px; height:72px; background:radial-gradient(circle at 30% 25%,#e3eff9,#a9bfda 35%,#50638a 65%,#263853); }
.world-place:nth-child(3)::before { background:radial-gradient(circle at 30% 25%,#d6f0e9,#88aaa9 40%,#324e61 74%); }
#app .world-place :is(h2,h3,strong) { margin:0; font-size:20px; font-weight:500; line-height:1.5; }
#app .world-place p { margin:0; max-width:18em; color:#c2c9df; font-size:15px; line-height:1.7; }
#app .world-place :is(small,span) { margin:0; color:#bdc4dd; font-size:13px; line-height:1.5; }
#app .world-place .home-status.available { color:#c2ece1; }
.world-preview-caption { position:absolute; left:24px; right:24px; bottom:16px; color:#bdc4dd; text-align:center; }
#app .world-preview-caption { font-size:13px; }
.world-principles { max-width:42em; padding-top:32px; margin:32px 0; border-top:1px solid var(--line,#293247); }
#app .world-principles :is(h2,h3) { margin:0 0 16px; font-size:22px; }
#app .world-principles p { margin:0 0 16px; color:#b4bbd2; font-size:15px; line-height:1.75; }
.world-entry-list { display:flex; flex-wrap:wrap; gap:12px; padding:0; margin:0 0 40px; list-style:none; }
.world-entry-list .button { min-height:44px; white-space:normal; }
.top-messages { position:relative; width:44px; height:44px; padding:12px !important; flex:0 0 44px; }
.top-messages .nav-unread { position:absolute; right:-2px; top:-2px; }

@media(max-width:1100px) {
  .home-hero { padding:32px; grid-template-columns:minmax(0,1.3fr) minmax(200px,.7fr); gap:24px; }
  .home-orbit { width:200px; }
  .agent-home-layout { grid-template-columns:minmax(0,1fr) 256px; gap:16px; }
  .agent-profile-summary { padding:24px 20px; }
  .agent-connection-options { gap:16px; }
}
@media(max-width:900px) {
  .agent-home-layout { grid-template-columns:minmax(0,1fr); }
  .agent-profile-summary { padding:24px; }
  .agent-chat-panel { min-height:520px; max-height:none; }
  .agent-chat-log { max-height:360px; }
  .agent-connection-options { grid-template-columns:minmax(0,1fr); }
  .agent-connection-options .home-entry-card:first-child { grid-row:auto; }
}
@media(max-width:620px) {
  .home-hero,.home-hero.returning { display:block; min-height:210px; margin:24px 0; padding:24px; border-radius:16px; }
  #app .home-hero h1 { max-width:12em; font-size:28px; line-height:1.4; }
  #app .home-hero p { max-width:28em; margin-top:16px; font-size:15px; }
  .home-hero .home-orbit { position:absolute; width:220px; right:-92px; top:-76px; opacity:.32; z-index:-1; }
  .home-hero-actions,.home-hero .actions { gap:8px 16px; margin-top:20px; }
  .home-hero .button { padding:12px 16px; }
  #app .home-community-link { font-size:14px; }
  .home-entry-grid { grid-template-columns:minmax(0,1fr); gap:16px; margin-bottom:32px; }
  .home-entry-card { padding:24px; gap:16px; border-radius:16px; }
  .home-entry-card>svg { right:24px; top:24px; }
  #app .home-entry-card h2 { font-size:22px; }
  .home-section-title { margin:32px 0 24px; }
  #app .home-section-title h2 { font-size:22px; }
  .agent-home-layout { gap:24px; margin-bottom:24px; }
  .route-assistant>.page-head { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:8px 12px; padding:16px 0; }
  .route-assistant>.page-head>div { display:contents; }
  .route-assistant>.page-head h1 { grid-column:1; grid-row:1; align-self:center; }
  .route-assistant>.page-head p { grid-column:1/-1; grid-row:2; margin:0; }
  .route-assistant>.page-head>.button { grid-column:2; grid-row:1; min-height:44px; padding:8px 10px; border-color:transparent; background:transparent; }
  #app .route-assistant>.page-head>.button { font-size:13px; }
  .agent-chat-panel { min-height:0; border-radius:16px; }
  .agent-chat-heading { flex-wrap:nowrap; align-items:flex-start; gap:12px; padding:12px 16px 8px; }
  .agent-chat-heading>div:first-child { min-width:0; }
  .agent-quick-tools { gap:0; padding:0 8px; }
  .agent-quick-tools .button { gap:6px; padding:10px 8px; }
  #app .agent-quick-tools .button { font-size:13px; }
  .agent-chat-log { flex:0 1 auto; gap:16px; min-height:120px; height:clamp(120px,calc(100dvh - 700px),180px); max-height:180px; padding:12px 16px; }
  .agent-chat-message { max-width:100%; gap:8px 12px; }
  .agent-chat-message.user,.agent-chat-message.assistant { padding:12px 14px 4px; }
  .agent-chat-empty { min-height:0; padding:8px 0; }
  .agent-chat-empty>.agent-avatar { display:none; }
  #app .agent-chat-empty h2 { font-size:20px; margin-bottom:8px; }
  .agent-chat-starters { margin-top:16px; gap:8px; }
  .agent-chat-starters .button { min-height:44px; padding:10px 12px; }
  .agent-chat-composer { margin:8px 12px 4px; padding:12px; gap:10px; }
  .agent-chat-composer textarea { min-height:64px; height:64px; }
  .agent-chat-privacy { padding:0 16px 8px; }
  .agent-chat-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; }
  .agent-chat-actions>p,.agent-chat-actions>small { min-width:0; }
  .agent-profile-summary { display:block; padding:20px; }
  .agent-profile-identity { display:grid; grid-template-columns:48px minmax(0,1fr); gap:0 16px; padding:0 0 20px; text-align:left; }
  .agent-profile-identity>.agent-avatar { --avatar-size:48px; grid-column:1; grid-row:1/3; align-self:center; margin:0; }
  #app .agent-profile-identity>h2 { grid-column:2; margin:0; font-size:18px; }
  #app .agent-profile-identity>p { grid-column:2; margin:4px 0 0; font-size:13px; }
  .agent-side-memory,.agent-side-usage { padding-top:20px; }
  .agent-profile-summary .agent-side-links { display:flex; margin:8px 0 0; }
  .agent-profile-summary .agent-side-links .button { padding:10px 8px; }
  .world-hero { padding:32px 0 24px; }
  #app .world-hero h1 { font-size:28px; }
  #app .world-hero p { font-size:15px; }
  .world-preview { grid-template-columns:minmax(0,1fr); gap:32px; min-height:0; padding:32px 24px; border-radius:16px; margin-bottom:32px; }
  .world-preview::before { left:16%; top:15%; width:68%; height:65%; transform:rotate(-25deg); }
  .world-place { align-items:flex-start; min-height:112px; padding:0 0 0 80px; gap:8px; text-align:left; }
  .world-place:nth-child(2),.world-place:nth-child(3) { transform:none; }
  .world-place::before { position:absolute; top:4px; left:0; width:48px; height:48px; }
  .world-place:nth-child(2)::before { width:60px; height:60px; }
  .world-preview-caption { left:16px; right:16px; bottom:16px; }
  .world-principles { padding-top:24px; margin:24px 0 32px; }
  #app .world-principles :is(h2,h3) { font-size:20px; }
  .agent-secondary-links { flex-direction:column; align-items:flex-start; }
  .bottom-nav { grid-template-columns:repeat(4,minmax(0,1fr)); padding-left:0; padding-right:0; }
  .bottom-nav a { min-width:0; padding-left:0; padding-right:0; }
  #app .bottom-nav a,#app .bottom-nav a>span { font-size:13px; white-space:nowrap; }
  .top-actions { gap:6px; }
  .top-actions .top-publish { min-width:44px; width:44px; padding:10px !important; gap:0; }
  .top-actions .top-messages { margin:0; }
  .mobile-brand { gap:6px; }
  .mobile-brand .brand-english { display:none; }
  .mobile-brand .brand-mark { width:28px; height:28px; }
}
@media(prefers-reduced-motion:reduce) {
  .home-entry-card { transition:none; }
  .agent-chat-log { scroll-behavior:auto; }
}

/* Memory is deliberately authored; history is an optional, separate archive. */
.notebook-section { margin:0 0 40px; }
.notebook-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:24px; margin-bottom:24px; }
#app .notebook-heading h2 { margin:0 0 8px; font-size:24px; }
#app .notebook-heading p { margin:0; color:#b4bbd2; font-size:15px; line-height:1.7; }
.notebook-heading>.button { flex-shrink:0; }
.notebook-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,28rem),1fr)); align-items:start; gap:20px; }
.notebook-card { display:flex; flex-direction:column; min-width:0; padding:24px 28px; border:1px solid var(--line,#293247); border-radius:16px; background:var(--surface,#141b2b); }
.notebook-card>header { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; margin-bottom:16px; }
#app .notebook-card h3 { margin:0; font-size:18px; line-height:1.5; overflow-wrap:anywhere; }
#app .notebook-card time,#app .notebook-count { color:var(--muted,#a8b3ca); font-size:13px; line-height:1.6; font-variant-numeric:tabular-nums; }
#app .notebook-preview { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; max-width:70ch; margin:0 0 16px; color:#d4dbee; font-size:15px; line-height:1.75; white-space:pre-wrap; overflow-wrap:anywhere; }
.notebook-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:auto; }
.notebook-actions .button { min-height:44px; }
.notebook-empty { grid-column:1/-1; padding:40px 0; border:0; border-top:1px solid var(--line,#293247); border-bottom:1px solid var(--line,#293247); border-radius:0; background:transparent; }
#app .notebook-empty h3 { margin:0 0 16px; font-size:20px; }
#app .notebook-empty p { margin:0; max-width:40em; color:#b4bbd2; font-size:15px; line-height:1.75; }
.notebook-footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; margin:12px 0 20px; }
.notebook-section>.field-help { margin:0; }
.notebook-section>.field-help a { color:#d2c5f7; text-decoration:underline; text-underline-offset:3px; }
.notebook-editor-dialog { max-width:620px; }
.notebook-editor-form { display:grid; gap:24px; }
.notebook-editor-form>p { margin:0; }
.notebook-editor-form :is(input:not([type=checkbox]),textarea) { min-height:48px; background:var(--bg,#0c101b); border-color:#394258; border-radius:12px; caret-color:var(--accent,#c4b5fa); }
.notebook-editor-form textarea { min-height:176px; resize:vertical; }
.notebook-editor-form :is(input,textarea)::placeholder { color:var(--muted,#a8b3ca); }
.notebook-editor-form .dialog-actions { margin-top:0; }
#dialogs .notebook-character-count { margin-top:-16px; text-align:right; color:#aab5cf; font-size:13px; }
.notebook-confirm { display:flex; align-items:flex-start; gap:12px; min-height:44px; color:#c2cce0; cursor:pointer; }
.notebook-confirm input { flex:0 0 18px; width:18px; height:18px; min-height:18px; margin-top:3px; accent-color:#c4b6fa; }
.notebook-confirm>span { margin:0; }
#dialogs .notebook-confirm { font-size:14px; line-height:1.6; }
.memory-interview { margin:32px 0 40px; border-top:1px solid var(--line,#293247); }
.memory-interview>summary { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 24px; min-height:72px; padding:24px 0; cursor:pointer; }
.memory-interview>summary::after { content:""; width:12px; height:12px; flex:0 0 12px; background:linear-gradient(var(--accent,#c4b5fa),var(--accent,#c4b5fa)) center/12px 1px no-repeat,linear-gradient(var(--accent,#c4b5fa),var(--accent,#c4b5fa)) center/1px 12px no-repeat; }
.memory-interview[open]>summary::after { background-size:12px 1px,0 0; }
#app .memory-interview>summary>span:first-child { font-size:18px; font-weight:500; }
#app .memory-interview>summary>span:nth-child(2) { margin-left:auto; color:#aeb8d0; font-size:13px; }
.memory-interview[open]>summary { margin-bottom:8px; }
.agent-chat-head-actions { display:flex; flex-wrap:wrap; gap:8px; flex-shrink:0; }
.agent-chat-head-actions .button { min-height:44px; }
.agent-recall { width:100%; padding:16px 0 0; border-top:1px solid #aab7df22; }
.agent-recall summary { min-height:44px; padding:12px 0; color:#bfc9e1; cursor:pointer; }
#app .agent-recall summary,#app .agent-recall li { font-size:13px; line-height:1.7; }
.agent-recall ul { display:grid; gap:8px; margin:8px 0 16px; padding-left:20px; color:#b4bbd2; }
.agent-recall a { color:#d1c4f6; text-decoration:underline; text-underline-offset:3px; }
.agent-history-settings { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:0 0 24px; margin-bottom:24px; border:0; border-bottom:1px solid var(--line,#293247); border-radius:0; background:transparent; }
.agent-history-settings>div { min-width:0; }
#app .agent-history-settings p { margin:12px 0 0; color:#b4bbd2; font-size:15px; line-height:1.7; }
.agent-history-settings .button { flex-shrink:0; min-height:44px; }
.agent-history-search { display:flex; gap:12px; margin:0 0 16px; }
.agent-history-search input { min-width:0; flex:1; color:var(--text,#f0f2fa); background:var(--surface,#141b2b); border-color:#394258; caret-color:var(--accent,#c4b5fa); }
.agent-history-search input::placeholder { color:var(--muted,#a8b3ca); }
.agent-history-search button { flex-shrink:0; min-height:48px; }
#app .agent-history-count { margin:16px 0 24px; color:#acb7cf; font-size:13px; line-height:1.6; }
.agent-history-list { display:grid; gap:0; max-width:42em; }
.agent-history-message { min-width:0; padding:24px 0; border-bottom:1px solid var(--line,#293247); }
.agent-history-message>header { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; margin-bottom:16px; }
#app .agent-history-message strong { color:#d6c9f8; font-size:15px; font-weight:500; }
#app .agent-history-message time { color:#acb7cf; font-size:13px; }
#app .agent-history-message p { margin:0; color:#e0e5f2; font-size:15px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.agent-history-message .button { min-height:44px; margin-top:8px; }
.agent-history-actions { display:flex; justify-content:space-between; flex-wrap:wrap; gap:16px; margin:32px 0 40px; }
.agent-history-actions .button { min-height:44px; }
:is(.agent-chat-panel,.agent-profile-summary,.notebook-section,.agent-history-settings,.agent-history-list,.notebook-editor-dialog) :is(button,a,input,textarea,summary):focus-visible { outline:2px solid var(--mint,#b9e5d7); outline-offset:4px; }
:is(.agent-chat-panel,.agent-profile-summary,.notebook-section,.agent-history-list) .button:active:not(:disabled) { transform:translateY(1px); }
:is(.agent-chat-panel,.notebook-section,.agent-history-list) ::selection { color:var(--text,#f0f2fa); background:#77699a66; }
@media(max-width:900px) {
  .notebook-list { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:620px) {
  .notebook-heading { gap:16px; }
  #app .notebook-heading h2 { font-size:22px; }
  .notebook-card { padding:20px; }
  .notebook-list { gap:16px; }
  .notebook-empty { padding:32px 0; }
  .notebook-editor-form { gap:20px; }
  .memory-interview>summary { gap:8px; }
  #app .memory-interview>summary>span:nth-child(2) { order:3; flex-basis:100%; margin-left:0; }
  .memory-interview>summary::after { margin-left:auto; }
  .agent-chat-head-actions { gap:4px; width:auto; }
  .agent-chat-head-actions>.button { padding:8px; }
  .agent-history-settings { align-items:flex-start; flex-direction:column; padding:0 0 24px; gap:16px; }
  .agent-history-search { gap:8px; }
  .agent-history-search button { padding:12px; }
  .agent-history-message { padding:16px 0 24px; }
}
