/* Yusheng additions deliberately reuse Tidal Echo tokens and component shapes. */
:root{ --ys-sidebar-width:clamp(238px,18vw,292px); --ys-sidebar-compact-width:76px; }
body{ --ys-nav-offset:var(--ys-sidebar-width); }
.ys-global-nav{
  position:fixed; z-index:245; display:flex; color:var(--text);
  background-color:var(--bg); background-image:var(--menu-wall-default);
  background-size:cover; background-position:center;
  transition:width .34s var(--ease-soft),padding .34s var(--ease-soft);
}
.ys-global-nav::before{ content:""; position:absolute; inset:0; background:var(--scrim); pointer-events:none; }
.ys-global-nav .menu-item{ position:relative; z-index:1; }
.ys-global-nav .menu-item.active{ background:var(--row-press); }
.ys-mobile-more{ position:fixed; z-index:255; }
.ys-nav-toggle{ position:fixed; z-index:260; display:grid; place-items:center; width:38px; height:38px; border:0; border-radius:50%; background:rgba(247,250,252,.58); color:var(--text-soft); box-shadow:var(--soft-shadow); backdrop-filter:blur(14px); cursor:pointer; }
.ys-nav-toggle svg{ width:20px; height:20px; }
@media (min-width: 1000px){
  .ys-global-nav{ left:0; top:0; bottom:0; width:var(--ys-sidebar-width); flex-direction:column; justify-content:center; padding:36px 24px; border-right:1px solid var(--hairline); overflow-y:auto; }
  .ys-global-nav .menu-item{ flex:0 0 auto; padding:clamp(13px,2.1vh,20px) 2px; }
  .ys-global-nav .menu-name{ font-size:clamp(18px,1.45vw,22px); }
  .ys-global-nav .menu-sub{ font-size:clamp(8.5px,.68vw,10px); }
  .ys-global-nav .ys-nav-more{ display:none; }
  .ys-mobile-more{ display:none !important; }
  .ys-nav-toggle{ left:17px; top:17px; }
  .app,.menu-page,.profile-panel{ transition:left .34s var(--ease-soft),width .34s var(--ease-soft); }
  .app{ left:var(--ys-nav-offset); width:min(calc(100vw - var(--ys-nav-offset)),var(--ref-width)); }
  .menu-page,.profile-panel{ left:var(--ys-nav-offset); }
  .ys-has-global-nav #mediaMount{ margin-left:var(--ys-nav-offset); width:calc(100% - var(--ys-nav-offset)); transition:margin-left .34s var(--ease-soft),width .34s var(--ease-soft); }
  body.ys-nav-collapsed{ --ys-nav-offset:var(--ys-sidebar-compact-width); }
  body.ys-nav-collapsed .ys-global-nav{ width:var(--ys-sidebar-compact-width); padding:68px 8px 20px; }
  body.ys-nav-collapsed .ys-global-nav .menu-item{ display:grid; grid-template-columns:1fr; place-items:center; min-height:54px; padding:10px 0; }
  body.ys-nav-collapsed .ys-global-nav .ys-nav-more{ display:none; }
  body.ys-nav-collapsed .ys-global-nav .menu-dot,
  body.ys-nav-collapsed .ys-global-nav .menu-copy,
  body.ys-nav-collapsed .ys-global-nav .menu-chev{ display:none; }
  body.ys-nav-collapsed .ys-global-nav .menu-ic{ margin:0; }
  body.ys-nav-collapsed .ys-global-nav .menu-ic svg{ width:22px; height:22px; }
  .composer{ left:var(--ys-nav-offset); right:0; width:min(calc(100vw - var(--ys-nav-offset)),var(--ref-width)); transition:left .34s var(--ease-soft),width .34s var(--ease-soft); }
}
@media (max-width: 999px){
  .ys-nav-toggle{ display:none !important; }
  .ys-global-nav{ left:0; right:0; bottom:0; height:calc(66px + env(safe-area-inset-bottom)); padding:5px 4px env(safe-area-inset-bottom); border-top:1px solid var(--hairline); backdrop-filter:blur(18px); }
  .ys-global-nav .ys-nav-item{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-width:0; padding:4px 2px; border:0; border-radius:14px; text-align:center; }
  .ys-global-nav .ys-mobile-overflow{ display:none; }
  .ys-global-nav .menu-dot,.ys-global-nav .menu-sub,.ys-global-nav .menu-chev{ display:none; }
  .ys-global-nav .menu-copy{ display:block; }
  .ys-global-nav .menu-name{ margin:0; font-size:11px; line-height:1; }
  .ys-global-nav .menu-ic svg{ width:21px; height:21px; }
  .ys-more-icon{ display:grid; place-items:center; height:21px; font:20px/1 var(--font-en); }
  .ys-mobile-more{ left:12px; right:12px; bottom:calc(72px + env(safe-area-inset-bottom)); padding:7px 18px; border:1px solid var(--card-line); border-radius:20px; background:rgba(244,248,250,.94); box-shadow:var(--shadow); backdrop-filter:blur(20px); }
  .ys-mobile-more .menu-item{ padding:14px 2px; }
  .menu-scroll{ padding-bottom:calc(env(safe-area-inset-bottom) + 86px); }
  .app .composer{ bottom:calc(66px + env(safe-area-inset-bottom)); }
  .app .scroll{ padding-bottom:calc(var(--composer-zone) + 66px); }
  .app .newmsg-pill{ bottom:calc(clamp(78px,13vw,96px) + 66px + env(safe-area-inset-bottom)); }
}
.ys-home-section{ flex:0 0 auto; margin:calc(clamp(38px,11vw,72px) * -.48) 0 clamp(28px,7vw,46px); }
.ys-home-kicker{ margin:0 0 12px; font-family:var(--font-en); font-size:10px; letter-spacing:.18em; color:var(--text-faint); }
.ys-home-residents{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.ys-home-residents button{ min-width:0; padding:10px 4px; border:1px solid var(--card-line); border-radius:14px; background:var(--card-bg); color:var(--text); font:inherit; box-shadow:var(--card-shadow); }
.ys-home-residents span{ display:grid; place-items:center; width:28px; height:28px; margin:0 auto 6px; border-radius:50%; background:var(--seg-track); font-size:13px; }
.ys-home-residents b{ display:block; overflow:hidden; text-overflow:ellipsis; font-weight:500; font-size:12px; white-space:nowrap; }
.ys-family-feed{ display:flex; gap:8px; margin-top:9px; }
.ys-family-feed button{ flex:1; padding:8px 10px; border:0; border-top:1px solid var(--hairline); background:transparent; color:var(--text-soft); font:inherit; font-size:11px; text-align:left; }
.ys-family-feed strong{ float:right; color:var(--text); font-weight:500; }
.ys-resident-frame{ position:relative; z-index:9; flex:0 0 auto; width:100%; min-height:14px; }
.ys-resident-toggle{ position:absolute; z-index:2; right:clamp(18px,4vw,42px); bottom:-3px; display:grid; place-items:center; width:34px; height:20px; border:0; background:transparent; color:var(--text-faint); font:20px/1 var(--font-en); cursor:pointer; transition:transform .22s var(--ease-soft); }
.ys-resident-toggle[aria-expanded="true"]{ transform:rotate(180deg); }
.ys-chat-panel,.ys-water-panel,.ys-window-panel{ position:fixed; z-index:170; left:50%; transform:translateX(-50%); width:min(calc(100vw - 28px),560px); border:1px solid var(--card-line); background:rgba(244,248,250,.9); box-shadow:var(--shadow); backdrop-filter:blur(22px); }
.ys-resident-switch{ width:100%; max-height:0; padding:0 12px; overflow:hidden; border-bottom:1px solid transparent; background:rgba(244,248,250,.9); opacity:0; transform:translateY(-8px); pointer-events:none; transition:max-height .34s var(--ease-soft),padding .34s var(--ease-soft),opacity .22s ease,transform .34s var(--ease-soft),border-color .22s ease; }
.ys-resident-switch.open{ max-height:150px; padding-block:12px 16px; border-bottom-color:var(--hairline); opacity:1; transform:none; pointer-events:auto; }
.ys-resident-strip{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.ys-resident-card{ min-width:0; padding:9px 4px; border:1px solid transparent; border-radius:13px; background:transparent; color:var(--text); font:inherit; }
.ys-resident-card.active{ border-color:var(--card-line); background:var(--seg-thumb); box-shadow:var(--seg-thumb-shadow); }
.ys-resident-card:disabled{ color:var(--text-faint); opacity:.62; }
.ys-resident-mark{ display:grid; place-items:center; width:28px; height:28px; margin:0 auto 5px; border-radius:50%; background:var(--seg-track); }
.ys-resident-card span:not(.ys-resident-mark),.ys-resident-card small{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ys-resident-card small{ color:var(--text-faint); font-size:9px; margin-top:2px; }
.peerpill[role="button"]{ cursor:pointer; }
.ys-connection-status.ys-status-dot{ width:8px; height:8px; margin:0; border-radius:50%; background:var(--status-dot); font-size:0; cursor:pointer; }
.ys-connection-status.ys-status-dot.warn{ background:#d3a345; }
.ys-connection-status.ys-status-dot.error{ background:#bd5c55; }
.ys-chat-panel,.ys-water-panel,.ys-window-panel{ top:calc(var(--ys-chat-header-bottom,64px) - 1px); padding:16px; border-radius:0 0 22px 22px; }
.ys-window-tools{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; margin:9px 0; }
.ys-window-tools input,.ys-window-tools button,.ys-window-rename{ box-sizing:border-box; min-height:42px; border:1px solid var(--field-line); border-radius:12px; background:var(--field-bg); color:var(--text); font:inherit; font-size:12px; }
.ys-window-tools input,.ys-window-rename{ width:100%; padding:8px 12px; outline:0; }
.ys-window-tools button{ min-width:64px; padding:8px 12px; }
.ys-window-tools button.active{ background:var(--send-bg); color:#fff; }
.ys-window-item{ display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; border-top:1px solid var(--hairline); }
.ys-window-item.active{ background:var(--row-hover); }
.ys-window-open{ display:flex; align-items:center; justify-content:space-between; min-width:0; min-height:54px; padding:8px 10px; border:0; background:transparent; color:var(--text); text-align:left; font:inherit; }
.ys-window-open span{ min-width:0; }
.ys-window-open b,.ys-window-open small{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ys-window-open b{ font-size:12px; font-weight:500; }
.ys-window-open small{ margin-top:3px; color:var(--text-faint); font-size:9px; }
.ys-window-open i{ color:var(--text-faint); font-style:normal; font-size:20px; }
.ys-window-actions{ display:flex; align-items:center; gap:2px; padding-right:5px; }
.ys-window-actions button{ min-width:44px; min-height:44px; padding:4px 6px; border:0; background:transparent; color:var(--text-soft); font:inherit; font-size:9px; }
.ys-window-rename{ grid-column:1/-1; margin:6px; }
.ys-panel-label{ margin-top:14px; }
.ys-runtime-field{ display:block; }
.ys-select-wrap{ position:relative; display:block; margin-top:6px; }
.ys-select-wrap::after{ content:"⌄"; position:absolute; top:50%; right:14px; color:var(--text-faint); font:16px/1 var(--font-en); transform:translateY(-58%); pointer-events:none; }
.ys-runtime-field select{ width:100%; min-height:42px; padding:9px 40px 9px 13px; border:1px solid var(--field-line); border-radius:12px; outline:0; background:var(--field-bg); color:var(--text); font:inherit; font-size:14px; appearance:none; -webkit-appearance:none; box-shadow:inset 0 1px 0 rgba(255,255,255,.58); cursor:pointer; }
.ys-runtime-field select:focus{ border-color:var(--accent); }
.ys-runtime-field.is-disabled{ opacity:.58; }
.ys-speed-segment{ margin-top:6px; }
.ys-speed-segment button{ min-height:42px; }
.ys-runtime-note{ margin:7px 2px 0; color:var(--text-faint); font-size:10px; line-height:1.5; }
.ys-water-row{ display:flex; justify-content:space-between; gap:12px; padding:7px 0; color:var(--text-soft); font-size:12px; }
.ys-water-row strong{ color:var(--text); font-weight:500; text-align:right; }
.ys-water-track{ height:3px; border-radius:999px; background:var(--slider-track); overflow:hidden; }
.ys-water-track i{ display:block; width:41%; height:100%; background:var(--slider-thumb); }
.ys-water-actions{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:10px 0; }
.ys-water-actions button,.ys-id-row{ width:100%; border:1px solid var(--card-line); border-radius:10px; padding:9px; background:var(--card-bg); color:var(--text); font:inherit; font-size:12px; }
.ys-id-row{ display:block; margin-top:7px; text-align:left; color:var(--text-soft); }
.ys-water-ring{ display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:conic-gradient(var(--slider-thumb) 0 41%,var(--slider-track) 41%); }
.ys-water-ring::after{ content:""; grid-area:1/1; width:24px; height:24px; border-radius:50%; background:var(--header-bg); }
.ys-water-ring i{ grid-area:1/1; z-index:1; font:8px/1 var(--font-en); color:var(--text-soft); }
.header-actions:has(.ys-window-btn){ gap:clamp(13px,3vw,28px); }
.ys-profile-systems{ display:flex; flex-direction:column; gap:10px; padding-bottom:28px; }
.ys-system-entry{ border:1px solid var(--card-line); border-radius:16px; background:var(--card-bg); box-shadow:var(--card-shadow); }
.ys-status-light{ display:inline-block; width:8px; height:8px; border-radius:50%; vertical-align:1px; }
.ys-status-light.ok{ background:var(--status-dot); }
.row.ai,.row.human{ flex-direction:column; }
.row.ai{ padding-left:0; align-items:flex-start; }
.row.human{ align-items:flex-end; }
.row.ai::before{ display:none; }
.ys-message-info{ display:flex; align-items:center; gap:5px; margin:0 3px 5px; color:var(--text-faint); font-family:var(--font-en),var(--font-cn); font-size:clamp(10px,1.2vw,12px); }
.row.human .ys-message-info{ flex-direction:row-reverse; }
.ys-message-avatar{ display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:var(--seg-track); color:var(--text-soft); font-size:10px; }
.ys-inline-quote{ display:block; margin-bottom:7px; padding:6px 9px; border-left:2px solid var(--text-faint); border-radius:6px; background:rgba(255,255,255,.2); color:var(--text-soft); font-size:.86em; }
.ys-inline-quote b{ display:block; font-weight:500; margin-bottom:2px; }
.ys-inbox-notice{ display:block; margin-top:6px; color:var(--text-faint); font-size:10px; }
.ys-voice-play{ width:26px; height:26px; margin-top:6px; border:1px solid var(--hairline); border-radius:50%; background:var(--card-bg); color:var(--accent); }
.ys-composer-popups{ position:fixed; z-index:99; left:50%; bottom:calc(var(--composer-zone) + env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(calc(100vw - 2 * var(--side-pad)),calc(var(--ref-width) - 2 * var(--side-pad))); pointer-events:none; }
.ys-composer-popups>div,.ys-composer-popups>section{ pointer-events:auto; }
.ys-plus-menu,.ys-tool-page,.ys-attachment-preview,.ys-quote-preview,.ys-branch-preview{ margin-bottom:8px; border:1px solid var(--card-line); border-radius:18px; background:rgba(244,248,250,.94); box-shadow:var(--shadow); backdrop-filter:blur(18px); }
.ys-plus-menu{ width:min(330px,88vw); padding:7px; }
.ys-plus-menu button{ display:flex; flex-direction:column; width:100%; padding:10px 12px; border:0; border-bottom:1px solid var(--hairline); background:transparent; color:var(--text); text-align:left; font:inherit; }
.ys-plus-menu button:last-child{ border-bottom:0; }
.ys-plus-menu small{ margin-top:2px; color:var(--text-faint); font-size:10px; }
.ys-plus-menu .ys-plus-sticker-entry{ flex-direction:row; align-items:center; gap:10px; }
.ys-plus-sticker-icon{ display:grid; place-items:center; flex:0 0 30px; width:30px; height:30px; color:var(--text-soft); }
.ys-plus-sticker-icon svg{ display:block; width:26px; height:26px; }
.ys-plus-sticker-copy{ display:flex; flex-direction:column; min-width:0; }
.ys-tool-shortcuts{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; padding:7px 2px 1px; }
.ys-plus-menu .ys-tool-shortcuts button{ align-items:center; min-height:62px; padding:7px 3px; border:0; border-radius:12px; background:var(--seg-track); text-align:center; }
.ys-tool-shortcuts button>span{ color:var(--accent); font-size:17px; line-height:1; }
.ys-tool-shortcuts b{ margin-top:5px; font-size:11px; font-weight:500; }
.ys-tool-shortcuts small{ margin-top:1px; font-size:8px; white-space:nowrap; }
.ys-tool-page{ width:min(430px,100%); max-height:min(68dvh,560px); padding:10px; overflow:hidden; }
.ys-tool-page-enter{ animation:ysToolSlideIn .24s var(--ease-soft); }
.ys-tool-page-head{ display:grid; grid-template-columns:44px minmax(0,1fr) 54px; align-items:center; min-height:44px; margin-bottom:8px; border-bottom:1px solid var(--hairline); }
.ys-tool-page-head>button{ min-width:44px; min-height:44px; padding:0; border:0; background:transparent; color:var(--text-soft); font:inherit; }
.ys-tool-page-head>button:first-child{ text-align:left; font-size:28px; line-height:1; }
.ys-tool-page-head>button:last-child{ text-align:right; font-size:11px; }
.ys-tool-page-head>div{ display:flex; flex-direction:column; text-align:center; }
.ys-tool-page-head b{ font-size:13px; font-weight:500; }
.ys-tool-page-head small{ margin-top:2px; color:var(--text-faint); font-size:9px; }
.ys-sticker-tabs{ display:grid; grid-template-columns:repeat(3,1fr); width:100%; margin-bottom:9px; }
.ys-sticker-tabs button{ min-height:36px; border:0; border-radius:10px; background:transparent; color:var(--text-soft); font:inherit; font-size:11px; }
.ys-sticker-tabs button.active{ background:var(--card-bg); color:var(--text); box-shadow:0 2px 8px rgba(62,75,86,.08); }
.ys-sticker-content{ overflow:hidden; }
.ys-sticker-viewport{ width:100%; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; scroll-behavior:smooth; scrollbar-width:none; -ms-overflow-style:none; touch-action:pan-x; }
.ys-sticker-viewport::-webkit-scrollbar{ display:none; }
.ys-sticker-pages{ display:flex; width:100%; }
.ys-sticker-page{ flex:0 0 100%; min-width:0; min-height:205px; display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); grid-template-rows:repeat(4,46px); align-content:start; gap:7px 4px; padding:1px; scroll-snap-align:start; scroll-snap-stop:always; }
.ys-sticker-page>button{ min-width:0; min-height:46px; padding:6px 2px; border:0; border-radius:12px; background:var(--seg-track); color:var(--text); font:inherit; font-size:19px; }
.ys-sticker-content[data-sticker-content="kaomoji"] .ys-sticker-page{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.ys-sticker-content[data-sticker-content="kaomoji"] .ys-sticker-page>button{ padding-inline:7px; overflow:hidden; font-size:12px; white-space:nowrap; text-overflow:ellipsis; }
.ys-sticker-library .ys-sticker-page{ grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(3,64px); min-height:206px; gap:7px; }
.ys-sticker-library .ys-sticker-page>button{ display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:11px; }
.ys-sticker-library .ys-sticker-page>button span{ display:grid; place-items:center; width:34px; height:34px; margin-bottom:3px; border-radius:11px; background:var(--card-bg); font-size:17px; }
.ys-sticker-library .ys-sticker-page>button small{ color:var(--text-faint); }
.ys-sticker-dots{ display:flex; justify-content:center; align-items:center; min-height:44px; }
.ys-sticker-dots button{ display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; background:transparent; }
.ys-sticker-dots button span{ width:5px; height:5px; border-radius:50%; background:var(--text-faint); opacity:.38; transition:width .2s var(--ease-soft),background .2s ease,opacity .2s ease; }
.ys-sticker-dots button.active span{ width:7px; height:7px; background:var(--accent); opacity:.78; }
.ys-sticker-library>p{ grid-column:1/-1; margin:3px 4px 0; color:var(--text-faint); font-size:9px; text-align:center; }
.ys-tool-scroll{ max-height:430px; padding-right:2px; overflow:auto; }
.ys-tool-card{ margin-bottom:8px; padding:11px; border:1px solid var(--hairline); border-radius:14px; background:var(--card-bg); }
.ys-tool-card h3{ margin:0 0 8px; font-size:12px; font-weight:500; }
.ys-tool-card label{ display:block; margin-top:7px; color:var(--text-soft); font-size:9px; }
.ys-tool-card input,.ys-memory-search-form input{ box-sizing:border-box; width:100%; min-height:38px; margin-top:4px; padding:7px 10px; border:1px solid var(--hairline); border-radius:10px; background:rgba(255,255,255,.5); color:var(--text); font:inherit; font-size:11px; }
.ys-tool-card>button,.ys-tool-button-row button,.ys-sticker-manage-sample button,.ys-memory-search-form button,.ys-memory-result button{ min-height:38px; border:1px solid var(--hairline); border-radius:10px; background:var(--seg-track); color:var(--text-soft); font:inherit; font-size:10px; }
.ys-tool-card>button{ width:100%; margin-top:9px; }
.ys-tool-button-row{ display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.ys-tool-button-row button{ padding:6px; }
.ys-tool-card p,.ys-tool-status{ margin:8px 2px 0; color:var(--text-faint); font-size:9px; line-height:1.55; }
.ys-sticker-manage-sample{ display:grid; grid-template-columns:40px 1fr auto auto; align-items:center; gap:6px; padding:9px; border:1px solid var(--hairline); border-radius:14px; }
.ys-sticker-manage-sample>span{ display:grid; place-items:center; width:40px; height:40px; border-radius:12px; background:var(--seg-track); }
.ys-sticker-manage-sample>div{ display:flex; flex-direction:column; font-size:11px; }
.ys-sticker-manage-sample small{ color:var(--text-faint); font-size:8px; }
.ys-sticker-manage-sample button{ min-width:48px; padding:5px; }
.ys-memory-search-form{ display:grid; grid-template-columns:1fr 58px; gap:7px; }
.ys-memory-search-form input{ margin:0; }
.ys-memory-scopes{ display:flex; gap:6px; margin:8px 0; }
.ys-memory-scopes button{ min-height:30px; padding:4px 13px; border:0; border-radius:99px; background:var(--seg-track); color:var(--text-soft); font:inherit; font-size:9px; }
.ys-memory-scopes button.active{ background:var(--send-bg); color:#fff; }
.ys-memory-results{ max-height:330px; overflow:auto; }
.ys-tool-empty{ padding:30px 12px; color:var(--text-faint); font-size:10px; line-height:1.6; text-align:center; }
.ys-memory-result{ margin-bottom:7px; padding:11px; border:1px solid var(--hairline); border-radius:14px; background:var(--card-bg); }
.ys-memory-result>div{ display:flex; justify-content:space-between; gap:8px; }
.ys-memory-result b{ font-size:11px; font-weight:500; }
.ys-memory-result small{ color:var(--text-faint); font-size:8px; }
.ys-memory-result p{ margin:7px 0; color:var(--text-soft); font-size:10px; line-height:1.55; }
.ys-memory-result button{ width:100%; }
.ys-fun-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.ys-fun-grid button{ display:flex; flex-direction:column; align-items:center; min-height:90px; padding:12px; border:1px solid var(--hairline); border-radius:14px; background:var(--card-bg); color:var(--text); font:inherit; }
.ys-fun-grid button span{ color:var(--accent); font-size:20px; }
.ys-fun-grid button b{ margin:7px 0 2px; font-size:11px; font-weight:500; }
.ys-fun-grid button small{ color:var(--text-faint); font-size:9px; }
@keyframes ysToolSlideIn{ from{ opacity:0; transform:translateX(18px); } to{ opacity:1; transform:none; } }
.ys-attachment-preview{ display:flex; gap:7px; max-width:100%; padding:8px; overflow-x:auto; }
.ys-preview-item{ position:relative; flex:0 0 84px; min-width:0; }
.ys-preview-item img,.ys-preview-file{ display:grid; place-items:center; width:84px; height:58px; border-radius:10px; background:var(--seg-track); object-fit:cover; }
.ys-preview-item>span:not(.ys-preview-file){ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-soft); font-size:9px; margin-top:3px; }
.ys-preview-item button{ position:absolute; right:-4px; top:-4px; width:20px; height:20px; border:0; border-radius:50%; background:var(--send-bg); color:#fff; }
.ys-quote-preview,.ys-branch-preview{ position:relative; padding:8px 42px 8px 12px; font-size:11px; }
.ys-quote-preview strong,.ys-quote-preview span,.ys-branch-preview strong,.ys-branch-preview span{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ys-quote-preview span,.ys-branch-preview span{ color:var(--text-faint); margin-top:2px; }
.ys-quote-preview button,.ys-branch-preview button{ position:absolute; right:4px; top:2px; width:40px; height:40px; border:0; background:transparent; color:var(--text-soft); }
.ys-thinking-sheet{ position:fixed; inset:0; z-index:270; pointer-events:none; }
.ys-thinking-sheet.open{ pointer-events:auto; }
.ys-thinking-scrim{ position:absolute; inset:0; background:rgba(20,30,40,.24); opacity:0; transition:opacity .25s ease; }
.ys-thinking-sheet.open .ys-thinking-scrim{ opacity:1; }
.ys-thinking-sheet section{ position:absolute; left:0; right:0; bottom:0; max-height:62vh; padding:20px 24px calc(24px + env(safe-area-inset-bottom)); border-radius:24px 24px 0 0; background:var(--composer-bg); color:var(--think-body); transform:translateY(100%); transition:transform .28s var(--ease-soft); overflow:auto; }
.ys-thinking-sheet.open section{ transform:none; }
.ys-thinking-sheet section button{ float:right; border:0; background:transparent; color:var(--text-soft); font-size:20px; }
.ys-thinking-sheet small{ display:block; color:var(--think-label); letter-spacing:.08em; margin-bottom:14px; }
.ys-thinking-sheet #ysThinkingText{ white-space:pre-wrap; line-height:1.72; }
@media (max-width:600px){
  .ys-home-residents{ grid-template-columns:repeat(4,minmax(0,1fr)); }
  .ys-resident-switch.open{ max-height:132px; padding-inline:6px; }
  .ys-resident-strip{ grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px; }
  .ys-resident-card{ padding-inline:1px; }
  .ys-resident-card small{ display:none; }
  .ys-chat-panel,.ys-water-panel,.ys-window-panel{ width:calc(100vw - 20px); }
  .ys-composer-popups{ bottom:calc(var(--composer-zone) + 66px + env(safe-area-inset-bottom)); }
  .ys-tool-page{ max-height:min(56dvh,470px); }
  .ys-tool-scroll,.ys-memory-results{ max-height:38dvh; }
  .ys-sticker-manage-sample{ grid-template-columns:40px 1fr auto; }
  .ys-sticker-manage-sample button:last-child{ display:none; }
}
@media (prefers-reduced-motion:reduce){ .ys-tool-page-enter{ animation:none; } }
@media (min-width:1000px){
  body .ys-chat-panel,
  body .ys-water-panel,
  body .ys-window-panel,
  body .ys-composer-popups,
  body .newmsg-pill{
    left:calc(50% + var(--ys-nav-offset) / 2);
    transition:left .34s var(--ease-soft);
  }
  body .topbar .ys-header-left,
  body .topbar .header-actions{
    top:env(safe-area-inset-top);
    bottom:0;
    margin-block:auto;
  }
}
