/* Safe-area values are measured on the top document and forwarded into this frame.
   env() inside the iframe is otherwise zero, so the header and tab bar would sit under the notch. */
:root{--ail-sat:env(safe-area-inset-top);--ail-sab:env(safe-area-inset-bottom);--ail-sal:env(safe-area-inset-left);--ail-sar:env(safe-area-inset-right)}
#box{padding-top:calc(12px + var(--ail-sat))!important;padding-bottom:calc(112px + var(--ail-sab))!important}
#tools{top:calc(12px + var(--ail-sat))!important}
#tools .ib,#settingsBtn{width:44px!important;height:44px!important}
.dpill{min-height:44px;padding:10px 14px!important;font-size:14px!important}
.hck,.ckb{width:44px!important;height:44px!important}
.hck.on:after{left:15px;top:8px}
.ckb:after{left:16px;top:10px}
.sec{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.sec>span{flex:1 1 12rem;min-width:0}
#flAll{min-height:44px;flex:none}
.wkrow .dc{overflow:hidden;min-width:0}
.wkrow .dc.tdy{box-shadow:inset 0 0 0 2px #E0701E!important}
.wkrow .dc.tdy>i{max-width:100%;overflow:hidden}
.wkrow .dc.tdy>i::after{content:none!important}
.wkrow .dc.sel{outline:none;box-shadow:inset 0 0 0 2px #8E78F0}
#tabbar,.uni.dockbar{bottom:calc(12px + var(--ail-sab))!important}
.page{padding-top:var(--ail-sat)}
/* Small accessibility / overflow repairs only. Original colours, geometry,
   candy textures, calendar structure and navigation remain in candy-original.css. */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
button,a,input,textarea,select { -webkit-tap-highlight-color:transparent; }
button:focus-visible,a:focus-visible { outline:3px solid var(--gold,#FFC233); outline-offset:3px; }
/* Flex children may shrink; long English words must not push the action out. */
.hx,.wt,.pt,.tdt,.avm,.phead>div,.vh>div { min-width:0; }
.hx b,.wt b,.pt b,.pcard b,.thv { overflow-wrap:anywhere; }
.hx small,.wt small,.pt small,.pcard small,.dnote { overflow-wrap:anywhere; }
.hp { max-width:31%; white-space:normal; overflow-wrap:anywhere; text-align:center; line-height:1.3; }
.phead h2 { min-width:0; }
.sheet .bd { min-height:0; overscroll-behavior:contain; }
.sheet .bt .btn,.row .btn { min-width:0; overflow-wrap:anywhere; padding-inline:8px; }
.aiq input { min-width:0; }
/* Preserve three tools and three tabs. Allow longer translations to wrap. */
.tbp button { min-width:0; padding-inline:3px; }
.tbp button span { max-width:100%; white-space:normal; overflow-wrap:anywhere; line-height:1.2; }
.sec { min-width:0; }
.sec>span { min-width:0; }
html[lang=en] .fn { font-size:12px; }
html[lang=en] .hp { font-size:12px; padding-inline:10px; }
html[lang=en] .tdt b { letter-spacing:0; }
html[lang=en] .vh h2 { letter-spacing:0; }
/* iOS keyboard entry: 16px avoids automatic page zoom. */
@media(max-width:640px) {
  html,body { height:100%; height:100dvh; }
  .app { height:100%; height:100dvh; }
  .sheet { max-height:92dvh; }
  input,textarea,select,[contenteditable=true] { font-size:16px; }
  .ta,.aiq input { font-size:16.5px; }
}
/* On very narrow phones keep the original grid; shorten only action padding. */
@media(max-width:360px) {
  .hp { padding:8px 9px; font-size:12px; }
  .hrow { gap:9px; }
  .tdbar { gap:10px; padding-inline:12px; }
  .tdt b { font-size:20px; }
  .tdt small { font-size:12px; }
  .phead { gap:7px; padding-inline:7px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
/* Translated-out sheets must not be focus/scroll targets. The outer frame never scrolls;
   only the original home, note and calendar surfaces scroll. */
.sheet:not(.on){visibility:hidden;pointer-events:none}
.sheet.on{visibility:visible;pointer-events:auto}
@supports(overflow:clip){.app{overflow:clip}}
/* Desktop preview keeps the scroll affordance without a white gutter. */
#box,.page,.calbody,.sheet .bd{scrollbar-width:thin;scrollbar-color:#887b9566 transparent}

/* Keep the original candy surfaces; only the utility placement changes. */
.hd .tt{padding-right:84px}
#settingsSheet{max-height:88%;background:rgba(255,248,243,.96)}
#settingsSheet .settingsActions{border-radius:22px;background:rgba(255,255,255,.64);padding:4px 14px}
#settingsSheet .wrow,#settingsSheet .settingsAction{min-height:52px}
.settingsAction{display:flex;align-items:center;gap:12px;width:100%;border:0;border-bottom:1px solid #c9c0ca55;padding:12px 0;background:transparent;color:var(--ink,#202943);font:700 15px var(--font-b);text-align:left}
.settingsAction svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.settingsAction span{flex:1}.settingsAction i{font-style:normal;opacity:.5}
#settingsSheet #dataCard{margin:12px 0 0;background:rgba(255,255,255,.5);box-shadow:none}
#settingsSheet select{max-width:100%}
#vCal .vh{padding-right:90px}
.tdt small{white-space:nowrap;font-size:13px}
#settingsSheet #bgBtn{display:flex!important}

/* RC5 typography: system fonts, lighter hierarchy, no font download. */
:root{--font-b:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;--font-d:var(--font-b)}
.hd h1{font-family:var(--font-b);font-size:32px;font-weight:600;letter-spacing:-.04em;line-height:1.2}
.hd .sub,.hd small,#rSub{font-weight:400!important;line-height:1.5;letter-spacing:.01em}
.sec{font-weight:400;font-size:12px;line-height:1.6}.sec b{font-weight:600;font-size:14px}
.fn{font-weight:500;font-size:14px;line-height:1.5}.fn small{font-weight:400;font-size:11px;opacity:.8}
#rName{font-family:var(--font-b);font-size:24px;font-weight:600;letter-spacing:-.02em;display:inline}
.rename-library{display:block;font-size:11px;font-weight:400;color:var(--ink2);margin-top:3px;padding:3px 0}
.repo-empty{min-height:100px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:400;color:var(--ink2)}
#capSheet{padding:14px 16px max(18px,env(safe-area-inset-bottom));max-height:80%;overflow:auto}
#capSheet .ta{font-family:var(--font-b);font-size:17px;font-weight:400;line-height:1.65;padding:16px;min-height:100px;height:112px;border-radius:22px;border:1px solid #c9b6c566;box-shadow:none;outline:none}
#capSheet .ta:focus{border-color:#ee8aab}#capSheet .ta::placeholder{font-size:16px;font-weight:400;color:#918797;opacity:1}
#capCancel,#pasteB{display:none!important}#capSheet .row{justify-content:flex-end}
#capSave{flex:none!important;width:44px;min-height:44px;border-radius:50%;padding:0;font-size:24px;box-shadow:none}
#eg{font-size:12px;font-weight:400;line-height:1.7;padding-right:4px}#eg button{font-size:12px;font-weight:400;padding:5px 9px}
#capSheet .pt b{font-size:15px;font-weight:500}#capSheet .pt small{font-size:12px;font-weight:400}
.scene-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 10px}.scene-option span{display:block;height:130px;border-radius:22px;overflow:hidden;box-shadow:inset 0 1px #fff,0 6px 12px #35254512}.scene-option svg{width:100%;height:100%;object-fit:cover}.scene-option b{display:block;font-size:12px;font-weight:500;margin:7px 0}
/* RC6: isolate timeline containers from calendar cells sharing .dc. */
.dg>.dc{display:flex;flex-direction:column;gap:12px;padding:0;background:transparent;border:0;border-radius:0;overflow:visible}
.dg>.dd{align-self:start;text-align:center;padding:12px 3px;border-radius:16px;background:#fff4e3;box-shadow:0 6px 16px #211b3620;color:#28213e}
.dg>.dd b{color:#28213e}.dg>.dd small{color:#756080}
.yh{background:#f4edf5;color:#685477;border-radius:10px;margin:8px 0 14px;padding:8px 12px}
.tr+.tr{margin-top:12px}.dg>.dc>.tr+.tr{margin-top:0}

/* Give the collection name the first row, with its utility controls on the right. */
#repoPage .phead {
  display:grid;
  grid-template-columns:36px minmax(0,1fr) auto;
  gap:10px 8px;
  align-items:center;
}
#repoPage #rName {
  display:block;
  font-size:clamp(25px,8vw,34px);
  line-height:1.12;
  white-space:normal;
  overflow-wrap:anywhere;
}
.repo-actions {display:flex;align-items:center;gap:4px}
#repoPage #rSub {
  margin:0 2px 0 0;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
  font-size:11px;
}
.repo-actions .rename-library,.repo-actions #lockBtn {
  display:grid;
  place-items:center;
  width:36px;
  height:40px;
  margin:0;
  padding:0;
  border-radius:13px;
  background:#ffffff65;
  color:var(--ink);
}
.rename-library svg {
  width:19px;height:19px;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
#repoPage #vseg {grid-column:1/-1}
#repoPage #vseg button {flex:1;min-height:32px}
#rBody {padding-bottom:max(16px,env(safe-area-inset-bottom))}
#rBody .pages.single {overflow-x:hidden;scroll-snap-type:none}
#rBody .pg,#grid,.fold .mg {grid-template-columns:repeat(3,minmax(0,1fr))}
#grid,.pg {align-items:start}
#rBody .pg .fold,#grid .fold {width:100%;min-width:0}
#grid .fn,#rBody .fold .fn {white-space:normal;overflow-wrap:anywhere}
.fold .mi {min-width:0;overflow:hidden;font-size:clamp(7px,2.1vw,11px)}
#rBody .idea-blocks .pg {align-content:start;align-items:start}
#rBody .idea-blocks .nc {
  aspect-ratio:1.08;
  width:100%;
  min-width:0;
  border-radius:31% 29% 32% 28%;
  padding:10px;
  box-shadow:inset 0 2px 4px #ffffffcb,inset 0 -4px 9px #3a214117,0 6px 9px -5px var(--c2);
}
#rBody .idea-blocks .nc:nth-child(3n+2) {border-radius:28% 33% 27% 31%}
#rBody .idea-blocks .nc:nth-child(3n) {border-radius:32% 26% 32% 29%}
#rBody .nc b {word-break:normal;overflow-wrap:anywhere;-webkit-line-clamp:4}
#rBody .pgbar {margin-top:6px;justify-content:center;gap:0}
.page-dot {width:30px;height:30px;display:grid;place-items:center}
.page-dot::after {content:'';width:7px;height:7px;border-radius:50%;background:#63597777}
.page-dot[aria-current="true"]::after {width:16px;border-radius:8px;background:#29213e}
#repoPage #renameLibrary[hidden] {display:none}
#rBody:not(.blocks-view) {padding-right:28px}
#rBody>.dc {display:flex;flex-direction:column;background:transparent;gap:12px;padding:0;overflow:visible}
#rBody>.dc>.tr+.tr {margin-top:0}
#rBody .pg .fsq,#grid .fsq {width:100%}

.guide{padding:16px 18px}
.guide .gtext{margin:0 0 12px;font-size:15px;line-height:1.55;opacity:.9}
.guide .gnote{margin:8px 0 0;font-size:12px;opacity:.7}
.guide .gchips{display:grid;gap:8px}
.guide .gchip{min-height:44px;text-align:left;padding:10px 14px;border-radius:14px;border:0;background:rgba(255,255,255,.55);color:inherit;font:600 14px/1.35 inherit}
.guide .gsteps{margin:0 0 12px;padding-left:20px;display:grid;gap:8px;font-size:14px;line-height:1.5}
.guide .gbtn{min-height:44px;width:100%;margin-top:10px;border:0;border-radius:14px;padding:10px 14px;background:#1f2a44;color:#fff;font:700 15px/1.2 inherit}
.guide .gbtn.alt{background:rgba(255,255,255,.7);color:#1f2a44}
.guide[hidden]{display:none}
@media (max-width:430px){
 .wkrow .dc .k:not(.more){font-size:0!important;line-height:0;height:6px;min-height:6px;padding:0!important;margin:3px 2px 0;border-radius:3px;border-width:1px}
 .wkrow .dc .k.more{font-size:10px;line-height:1;padding:0 3px;margin:2px 2px 0;background:none}
 .wkrow .dc{padding-top:5px}
}

.nudges{display:grid;gap:12px;margin-bottom:12px}
.nudges[hidden]{display:none}
.ncard{margin:0}
.ncard .nkick{font-size:12px;opacity:.65;margin-bottom:4px}
.ncard .nhead{display:block;padding:0;font-size:17px;line-height:1.35;margin-bottom:8px;overflow-wrap:anywhere}
.ncard .gtext{margin-bottom:8px}
.ncard .nquote{margin:0 0 6px;padding:8px 12px;border-left:3px solid rgba(31,42,68,.35);background:rgba(255,255,255,.4);border-radius:0 12px 12px 0;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.ncard .nmore{min-height:44px;border:0;background:none;color:inherit;font:600 13px/1.2 inherit;text-decoration:underline;padding:0 2px;opacity:.8}
.ncard .nlist{display:grid;gap:6px;margin:0 0 6px}
.ncard .nrow{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;border:0;border-radius:12px;padding:8px 12px;background:rgba(255,255,255,.5);color:inherit;font:500 14px/1.35 inherit}
.ncard .nrow span{min-width:0;overflow-wrap:anywhere}
.ncard .nrow i{flex:none;font-style:normal;font-size:12px;opacity:.65}
.ncard .nacts{display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:8px}
.ncard .nacts .gbtn{margin-top:4px;padding:10px 6px;font-size:14px}
@media (max-width:340px){.ncard .nacts{grid-template-columns:1fr}}
.ncard .nhead.hang{text-indent:-.42em}
.nmini{min-height:44px;width:100%;margin:0;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;border:0;padding:10px 18px;color:inherit;font:600 14px/1.35 inherit}
.nmini span{min-width:0;overflow-wrap:anywhere}
.nmini i{flex:none;font-style:normal;font-size:18px;opacity:.6}
