/* CRYOTALE V3.1 deep sea: additive, scoped, no core styles replaced. */
:root.cryo-ui-v31{--cryo-v31-ice:#86e9f6;--cryo-v31-deep:#07182d;--cryo-v31-line:rgba(137,216,242,.18)}
html.cryo-ui-v31 body{font-family:system-ui,'Noto Sans CJK SC','Microsoft YaHei','PingFang SC',sans-serif;letter-spacing:.01em}
html.cryo-ui-v31[data-cryo-font="serif"] #chatMessages,html.cryo-ui-v31[data-cryo-font="serif"] #messages{font-family:'Noto Serif CJK SC','Songti SC','SimSun',serif}
html.cryo-ui-v31[data-cryo-font="mono"] #chatMessages,html.cryo-ui-v31[data-cryo-font="mono"] #messages{font-family:ui-monospace,'Cascadia Code','Microsoft YaHei',monospace}
html.cryo-ui-v31[data-cryo-size="compact"] #chatMessages,html.cryo-ui-v31[data-cryo-size="compact"] #messages{--cryo-v31-text:13px}
html.cryo-ui-v31[data-cryo-size="normal"] #chatMessages,html.cryo-ui-v31[data-cryo-size="normal"] #messages{--cryo-v31-text:15px}
html.cryo-ui-v31[data-cryo-size="large"] #chatMessages,html.cryo-ui-v31[data-cryo-size="large"] #messages{--cryo-v31-text:18px}
/* In creator cards, remove nested heavyweight panels from the conversation only. */
html.cryo-ui-v31 #chatPage .chat-main{border-color:rgba(105,193,224,.13)!important;background:rgba(7,24,44,.64)!important;box-shadow:none!important}
html.cryo-ui-v31 #chatPage .chat-character{background:rgba(8,27,48,.56)!important;border-color:var(--cryo-v31-line)!important}
html.cryo-ui-v31 #chatPage .chat-messages{gap:17px!important;scrollbar-color:#3c7895 transparent}
html.cryo-ui-v31 #chatPage .cryo-v20-message-row{align-items:flex-end!important}
html.cryo-ui-v31 #chatPage .chat-bubble{font-size:var(--cryo-v31-text,15px)!important;line-height:1.85!important;border:1px solid rgba(144,213,237,.13)!important;box-shadow:0 7px 24px rgba(0,5,16,.12)!important;border-radius:19px 19px 19px 6px!important;background:rgba(18,50,76,.73)!important;padding:11px 15px!important;max-width:78%!important}
html.cryo-ui-v31 #chatPage .chat-bubble.from-user{background:linear-gradient(130deg,rgba(32,108,139,.87),rgba(29,83,122,.87))!important;border-color:rgba(130,233,247,.22)!important;border-radius:19px 19px 6px 19px!important}
html.cryo-ui-v31 #chatPage .chat-bubble small{font-size:10px!important;opacity:.72;margin-bottom:3px!important}
html.cryo-ui-v31 #chatPage .chat-bubble.cryo-v31-narrative{max-width:min(100%,850px)!important;width:100%;border:0!important;border-left:2px solid rgba(105,211,235,.5)!important;border-radius:3px!important;background:linear-gradient(90deg,rgba(10,34,55,.36),transparent 80%)!important;box-shadow:none!important;padding:16px 17px!important;line-height:2.05!important}
html.cryo-ui-v31[data-cryo-read="bubbles"] #chatPage .chat-bubble.cryo-v31-narrative{max-width:85%!important;width:auto;border:1px solid var(--cryo-v31-line)!important;border-radius:19px!important;background:rgba(18,50,76,.75)!important;padding:13px!important}
html.cryo-ui-v31[data-cryo-read="novel"] #chatPage .chat-bubble.from-role{max-width:100%!important;width:100%;border:0!important;border-left:2px solid rgba(105,211,235,.5)!important;border-radius:2px!important;background:rgba(9,26,46,.25)!important;box-shadow:none!important;line-height:2.05!important}
html.cryo-ui-v31 #chatPage .chat-composer{background:rgba(8,27,47,.63)!important;backdrop-filter:blur(16px)}
html.cryo-ui-v31 #chatPage .chat-inputrow textarea{border-radius:21px!important;background:rgba(6,26,47,.82)!important;font-size:15px!important}
html.cryo-ui-v31 #chatPage .chat-inputrow #chatSend{border-radius:18px!important}
/* Conversational recent list */
html.cryo-ui-v31 #chatPage .cryo-v23-role-pick{padding:13px 10px;background:transparent;border:0;border-bottom:1px solid var(--cryo-v31-line);border-radius:3px;gap:12px;min-height:80px;transition:background .2s}
html.cryo-ui-v31 #chatPage .cryo-v23-role-pick:hover{background:rgba(43,111,146,.21)}
html.cryo-ui-v31 #chatPage .cryo-v23-role-avatar{width:52px;height:52px;flex-basis:52px;border-radius:17px;border:1px solid rgba(112,212,241,.35)}
html.cryo-ui-v31 #chatPage .cryo-v23-role-labels strong{font-size:15px;line-height:1.3}
html.cryo-ui-v31 #chatPage .cryo-v23-role-labels small{font-size:11px;margin:4px 0 2px}
html.cryo-ui-v31 #chatPage .cryo-v31-last-line{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#d1e6ef;font-size:12px;opacity:.85}
html.cryo-ui-v31 #chatPage .chat-sidebar{border-color:var(--cryo-v31-line)!important;background:rgba(8,29,49,.65)!important;box-shadow:none!important}
html.cryo-ui-v31 #chatPage .chat-side-note{display:none}
html.cryo-ui-v31 #chatPage .session-item{background:rgba(15,44,69,.5);border:1px solid var(--cryo-v31-line);border-radius:16px}
html.cryo-ui-v31 #chatPage .chat-headtools #chatRename,html.cryo-ui-v31 #chatPage .chat-headtools #chatDelete{display:none!important}
/* Slim immersive header - menu stays in +, story switch optionally top right */
.cryo-v31-conversation-top{display:none;pointer-events:none}
.cryo-v31-conversation-top[hidden]{display:none!important}
.cryo-v31-title-picker{pointer-events:auto;border:1px solid #6dcae64d;background:#0d344fcf;color:#c2f2ff;font-size:22px;width:42px;height:42px;border-radius:15px;cursor:pointer}
/* Modal: no full-screen page transition. */
.cryo-v31-sheet-backdrop{position:fixed;inset:0;z-index:12050;display:flex;align-items:flex-end;justify-content:center;background:rgba(1,10,21,.65);backdrop-filter:blur(9px);padding:16px;box-sizing:border-box}
.cryo-v31-sheet{background:linear-gradient(148deg,#143d58 0%,#0b203a 77%);border:1px solid rgba(137,230,245,.36);width:min(560px,100%);max-height:min(84dvh,730px);overflow-y:auto;border-radius:24px;color:#eaf8ff;padding:22px;box-shadow:0 23px 90px #0008;box-sizing:border-box}
.cryo-v31-sheet-head{display:flex;justify-content:space-between;gap:16px;align-items:center}
.cryo-v31-sheet-head h2{font-size:23px;letter-spacing:.03em;margin:0}
.cryo-v31-sheet-close{font-size:27px;background:#1b4461;color:#e8f8ff;border:1px solid #588ca5;border-radius:13px;width:43px;height:43px}
.cryo-v31-sheet-kicker{color:#9abfd1;font-size:12px;margin:8px 0 20px}
.cryo-v31-story-list{display:grid;gap:8px}
.cryo-v31-story-item{display:block;width:100%;background:rgba(8,28,49,.75);border:1px solid rgba(114,179,213,.21);border-radius:14px;color:#e7f6ff;text-align:left;padding:14px 16px}
.cryo-v31-story-item.is-active{border-color:#8ce8ed;background:rgba(29,90,117,.51)}
.cryo-v31-story-item strong,.cryo-v31-story-item span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cryo-v31-story-item strong{font-size:15px}.cryo-v31-story-item span{font-size:12px;color:#a7c8d8;margin-top:7px}
.cryo-v31-story-new{margin-top:16px;width:100%;border:0;border-radius:15px;color:#0a2e44;background:linear-gradient(110deg,#6ce2eb,#8cbafa);min-height:50px;font-weight:800}
.cryo-v31-pref-group{margin-top:22px}.cryo-v31-pref-group h3{margin:0 0 9px;font-size:14px}
.cryo-v31-pref-options{display:flex;gap:7px;flex-wrap:wrap}.cryo-v31-pref-options button{border:1px solid #4c7794;color:#d4f3ff;background:#112d47;padding:10px 12px;border-radius:11px}.cryo-v31-pref-options button.selected{background:#205c78;border-color:#7de6f4}
/* Deep-sea icon dock both app zones. */
html.cryo-ui-v31 .mobile-switch{border:1px solid rgba(127,222,240,.29)!important;border-radius:27px!important;background:linear-gradient(150deg,rgba(10,37,58,.94),rgba(5,20,38,.97))!important;backdrop-filter:blur(22px)!important;box-shadow:0 16px 55px #0008,0 0 22px rgba(38,138,184,.15);gap:4px!important}
html.cryo-ui-v31 .mobile-switch button{font-size:0!important;border:0!important;background:transparent!important;border-radius:19px!important;color:#9ac8d9!important;min-width:0;line-height:1!important}
html.cryo-ui-v31 .mobile-switch button span{font-size:25px!important;display:block!important;text-shadow:0 0 12px rgba(81,180,220,.38)}
html.cryo-ui-v31 .mobile-switch button.chosen{color:#91f0fc!important;background:rgba(34,118,153,.33)!important;box-shadow:inset 0 0 0 1px rgba(124,230,244,.27)}
#cryoV31OfficialDock{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(14px + env(safe-area-inset-bottom,0px));z-index:120;width:min(92vw,410px);height:66px;padding:7px;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;align-items:stretch;border:1px solid rgba(127,222,240,.28);background:linear-gradient(135deg,rgba(13,51,75,.94),rgba(4,22,39,.96));box-shadow:0 12px 50px #0009;border-radius:25px;backdrop-filter:blur(20px)}
#cryoV31OfficialDock[hidden]{display:none!important}
#cryoV31OfficialDock button{border:0;border-radius:18px;color:#b4d7e5;background:transparent;font-size:24px;cursor:pointer}
#cryoV31OfficialDock button.selected{background:rgba(38,127,158,.33);color:#9af4ff;box-shadow:inset 0 0 0 1px rgba(132,226,247,.3)}
@media(max-width:770px){
 html.cryo-ui-v31 .mobile-switch{left:12px!important;right:12px!important;bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;height:62px!important;padding:5px!important}
 html.cryo-ui-v31 #chatPage.mobile-list .chat-sidebar{padding:12px 16px!important}
 html.cryo-ui-v31 #chatPage.mobile-list .chat-sidehead{margin-bottom:14px}
 html.cryo-ui-v31 #chatPage.mobile-list #chatSideTitle{font-size:23px;margin:10px 0 12px}
 html.cryo-ui-v31 #chatPage.cryo-immersive-active .chat-messages{padding-top:calc(84px + env(safe-area-inset-top,0px))!important}
 html.cryo-ui-v31 #chatPage.cryo-immersive-active .cryo-v20-message-row .chat-bubble{max-width:calc(100% - 42px)!important}
 html.cryo-ui-v31 #chatPage.cryo-immersive-active .chat-bubble.cryo-v31-narrative{max-width:100%!important}
 .cryo-v31-conversation-top:not([hidden]){display:flex;z-index:11;position:fixed;top:calc(12px + env(safe-area-inset-top,0px));left:60px;right:12px;align-items:center;gap:6px;justify-content:space-between;pointer-events:none}
 .cryo-v31-title{font-size:13px;color:#e4f8ff;font-weight:700;text-shadow:0 0 6px #061c30;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 html.cryo-ui-v31 #chatPage.cryo-immersive-active .chat-bubble.cryo-v31-narrative{padding:12px!important}
 #cryoV31OfficialDock{bottom:calc(9px + env(safe-area-inset-bottom,0px));}
 html.cryo-ui-v31 #chat-view:not(.hidden) #chat-scroll{padding-bottom:95px!important}
}
@media(min-width:771px){
 html.cryo-ui-v31 #chatPage{gap:8px!important;grid-template-columns:minmax(245px,300px) minmax(0,1fr) minmax(190px,230px)}
 html.cryo-ui-v31 #chatPage .chat-messages{max-height:min(72vh,830px)!important;padding:23px 25px!important}
 html.cryo-ui-v31 .mobile-switch{display:none!important}
 #cryoV31OfficialDock{left:auto;right:20px;transform:none;width:300px;height:60px}
}
@media(max-width:520px){.cryo-v31-sheet-backdrop{padding:0}.cryo-v31-sheet{width:100%;border-radius:27px 27px 0 0;max-height:86dvh;padding:22px 18px calc(24px + env(safe-area-inset-bottom,0px))}}
@media(prefers-reduced-motion:reduce){html.cryo-ui-v31 #chatPage *{transition:none!important}}
/* Remove repetitive explanatory copy, not errors or payment alerts. */
html.cryo-ui-v31 #chatPage .chat-composer>p,html.cryo-ui-v31 #chatPage .chat-side-note,
html.cryo-ui-v31 #chatPage .chat-subnote,html.cryo-ui-v31 #chat-view .composer-footer{display:none!important}
/* Official AI section: same airy long-form reading and ice-glass short chat style. */
html.cryo-ui-v31 #chat-view .conversation-feed{border:0!important;border-radius:8px!important;background:rgba(7,23,43,.18)!important}
html.cryo-ui-v31 #chat-view .conversation-feed .message.bot .message-content{max-width:calc(100% - 47px);background:rgba(14,42,66,.36)!important;border:0!important;border-left:2px solid rgba(106,208,235,.34)!important;border-radius:4px!important;box-shadow:none!important;line-height:1.93;padding:13px 16px!important}
html.cryo-ui-v31 #chat-view .message.user .message-content{background:linear-gradient(145deg,rgba(28,103,135,.85),rgba(27,73,116,.85))!important;border:1px solid rgba(140,227,246,.23)!important;border-radius:19px 19px 6px 19px!important}
html.cryo-ui-v31 #chat-view .message-text{font-size:var(--cryo-v31-text,15px)!important;line-height:1.95}
@media(max-width:770px){html.cryo-ui-v31 #chat-view:not(.hidden) .composer-wrap{padding-bottom:calc(74px + env(safe-area-inset-bottom,0px))!important}}

/* V3.1.1: icon dock is PHONE/TABLET-MOBILE only. Desktop keeps the original navigation. */
@media (min-width:771px){
  #cryoV31OfficialDock{display:none!important;pointer-events:none!important}
  html.cryo-ui-v31 .mobile-switch{display:none!important}
  html.cryo-ui-v31 #chatPage .chat-sidebar{display:flex!important;flex-direction:column;min-width:0}
  html.cryo-ui-v31 #chatPage .chat-sessionlist{display:grid!important;align-content:start;gap:6px}
  html.cryo-ui-v31 #chatPage .cryo-v23-role-pick.selected{background:rgba(34,115,151,.2);box-shadow:inset 2px 0 0 #76e3ef}
}
/* Role-specific story management moves to + > Storylines on every screen. */
html.cryo-ui-v31 .cryo-v31-story-entry{display:flex;gap:8px;align-items:stretch;border:1px solid rgba(114,179,213,.23);border-radius:15px;background:rgba(8,28,49,.70);overflow:hidden}
html.cryo-ui-v31 .cryo-v31-story-entry.is-active{border-color:rgba(140,232,237,.8);background:rgba(29,90,117,.42)}
html.cryo-ui-v31 .cryo-v31-story-entry .cryo-v31-story-item{flex:1;min-width:0;border:0;border-radius:0;background:transparent;text-align:left}
html.cryo-ui-v31 .cryo-v31-story-actions{display:flex;align-items:center;gap:4px;padding:0 9px 0 0}
html.cryo-ui-v31 .cryo-v31-story-actions button{font-size:17px;min-width:33px;height:35px;border-radius:10px;border:1px solid rgba(142,203,226,.34);background:rgba(18,53,75,.7);color:#d0f3fd;cursor:pointer}
html.cryo-ui-v31 .cryo-v31-story-actions .cryo-v31-story-delete{color:#ffc5cc;border-color:rgba(248,149,168,.28)}
html.cryo-ui-v31 #chatPage .chat-side-note:empty{display:none!important}
html.cryo-ui-v31 #chatPage #mobileSessionToggle{display:none!important}
