/* Level 4: templates. Page layouts that place organisms. The workspace layout uses a
   container query, so the same markup becomes the phone layout in a narrow frame (UX-12). */

.app{container:app/inline-size;position:relative;display:grid;grid-template-rows:auto 1fr;height:720px;min-height:520px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg);overflow:hidden}
.app__bar{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:1px solid var(--border);background:var(--surface);min-width:0}
.app__project{display:grid;min-width:0;margin-right:auto}
.app__project-kicker{font-size:var(--text-xs);color:var(--text-2)}
.app__project-name{font-family:var(--font-serif);font-size:var(--text-lg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app__switch{display:none}
.app__main{display:grid;grid-template-columns:minmax(260px,38%) 1fr;min-height:0}
.app__file{display:grid;grid-template-rows:auto 1fr;min-height:0;border-right:1px solid var(--border);background:var(--surface-2)}
.app__ws{position:relative;display:grid;grid-template-rows:auto 1fr;min-height:0;min-width:0}
.app__ws-top{display:grid;gap:var(--space-2);padding:var(--space-2);border-bottom:1px solid var(--border);background:var(--bg);min-width:0}
.app__ws-head{display:flex;align-items:center;gap:var(--space-2);min-width:0}
.app__ws-head .ws-title{min-width:0;flex:0 1 auto}
.app__ctx{position:absolute;left:var(--space-3);right:var(--space-3);top:calc(var(--ws-top,120px) + var(--space-2));z-index:10;display:flex;justify-content:center;pointer-events:none}
.app__ctx>*{pointer-events:auto}
.app__surface{min-height:0;height:100%}
.app__overlay{position:absolute;left:0;right:0;bottom:var(--space-4);z-index:12;display:flex;justify-content:center;pointer-events:none;padding:0 var(--space-3)}
.app__overlay>*{pointer-events:auto}
.app__zoom{position:absolute;right:var(--space-3);bottom:var(--space-3);z-index:11}
.app__overlay:not(:empty)~.app__zoom{bottom:76px}

/* File pane (mock PDF page) */
.file-head{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2);border-bottom:1px solid var(--border);background:var(--surface);min-width:0}
.file-head select{min-height:var(--target);max-width:100%;flex:1;min-width:0;padding:0 var(--space-2);border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);font-size:var(--text-sm)}
.file-body{overflow:auto;padding:var(--space-4)}
.pdf-page{max-width:520px;margin:0 auto;padding:var(--space-6) var(--space-5);background:#FFFFFF;color:#1E1E1E;box-shadow:var(--shadow-2);font-family:var(--font-serif);font-size:var(--text-sm);line-height:1.6;display:grid;gap:var(--space-3)}
.pdf-page__meta{font-family:var(--font-sans);font-size:var(--text-xs);color:#5B5B5B;display:flex;justify-content:space-between}
.pdf-page h3{font-size:var(--text-md);text-align:center;text-transform:uppercase;letter-spacing:.05em}
.pdf-page mark{background:rgba(221,165,52,.38);color:inherit;padding:0 1px;scroll-margin:80px}
.pdf-page mark.is-flash{outline:3px solid #1F5C9E;outline-offset:2px}

/* Phone layout: one pane at a time, visible File / Workspace switch (UX12-R5) */
@container app (max-width: 900px){
  .app__bar{flex-wrap:wrap;padding:var(--space-2)}
  .app__project{flex:1 1 100%;margin-right:0}
  .app__switch{display:flex;flex:1 1 100%}
  .app__switch .segmented{width:100%}
  .app__switch .segmented__item{flex:1;justify-content:center;min-width:0;overflow:hidden}
  .app__switch .segmented__item span{overflow:hidden;text-overflow:ellipsis}
  .app__main{grid-template-columns:1fr}
  .app[data-view="workspace"] .app__file{display:none}
  .app[data-view="file"] .app__ws{display:none}
  .app__file{border-right:0}
  .tool-row .tool--secondary{display:none}
  .tool-row .tool-row__more{display:inline-flex}
  .tool-row .tool{min-width:var(--target);padding:var(--space-1) 6px}
  .tool-row .undo-pair .tool{min-width:var(--target)}
  .tool-row .undo-pair__action{display:none}
  .tool-row{overflow:visible}
  .tool-row .tool-row__end{border-left:0;padding-left:0}
  .app__zoom .zoom__value{min-width:44px}
  .sel-bar{max-width:calc(100cqw - 24px)}
  .ws-title__kicker{display:none}
}

/* Template wireframe regions (templates page only) */
.wire{display:grid;place-items:center;min-height:48px;padding:var(--space-2);border:1.5px dashed var(--border-strong);border-radius:var(--radius-sm);background:var(--surface);color:var(--text-2);font-size:var(--text-xs);font-weight:var(--weight-strong);text-align:center}
.wire--fill{height:100%}
.wire--accent{border-color:var(--accent);background:var(--accent-wash);color:var(--accent-text)}
.wire--sel{border-color:var(--selection);background:var(--selection-wash);color:var(--text)}

/* Phone frame */
.phone{width:390px;max-width:100%;margin:0 auto;padding:10px;border-radius:36px;background:#0B1520;box-shadow:var(--shadow-3)}
.phone .app{height:760px;border-radius:28px;border:0}
.phone--sm{width:360px}

/* Mock placement helpers (templates level) */
.tpl-ws-body{display:grid;grid-template-rows:auto 1fr auto;gap:var(--space-2);padding:var(--space-2);min-height:0}
.tpl-wide{display:block}
.tpl-wide .app{height:560px}
.phone .tpl-ws-body{min-height:420px}
.tpl-empty{top:var(--ws-top,120px)}
.tpl-hint{left:var(--space-3);bottom:var(--space-4);max-width:min(340px,calc(100% - 140px))}
.app__overlay:not(:empty)~.tpl-hint{bottom:84px}
.tpl-textarea{min-height:120px;padding:var(--space-2) var(--space-3);resize:vertical;line-height:var(--leading-body)}
.tpl-quote{margin:0;padding:var(--space-3) var(--space-4);border-left:3px solid var(--accent);background:var(--surface-2);font:var(--text-lg)/1.5 var(--font-serif);user-select:text;-webkit-user-select:text}

/* Phone: tool row wraps instead of hiding tools off-screen */
@container app (max-width: 900px){
  .tool-row{flex-wrap:wrap}
  .tool-row .tool-group{padding:0 2px}
  .tool-row .tool-row__end{margin-left:auto}
}

/* Compact chrome: one app bar, tools in a side rail (phone: bottom bar) */
.app__bar{gap:var(--space-1);padding:var(--space-1) var(--space-2);min-height:52px}
.app__project-name{flex:0 1 auto;min-width:0;font-family:var(--font-serif);font-size:var(--text-md);color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:28%}
.app__crumb{color:var(--text-2)}
.app__bar .ws-title{min-width:0;border-color:transparent;background:transparent}
.app__bar .ws-title:hover{border-color:var(--border)}
.app__bar .app__switch{margin-left:auto}
.app__main{grid-template-columns:minmax(240px,32%) 1fr}
.app__ws{--rail:54px;--dock:0px;grid-template-columns:auto minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.app__ctx{top:var(--space-2);left:calc(var(--rail) + var(--space-3))}
.tpl-empty{top:0;left:var(--rail)}
.tpl-hint{left:calc(var(--rail) + var(--space-3));bottom:calc(var(--dock) + var(--space-4))}
.app__overlay{bottom:calc(var(--dock) + var(--space-4));left:var(--rail)}
.app__zoom{bottom:calc(var(--dock) + var(--space-3))}
.app__overlay:not(:empty)~.app__zoom{bottom:calc(var(--dock) + 76px)}
.app__overlay:not(:empty)~.tpl-hint{bottom:calc(var(--dock) + 84px)}
.ws-page .app{height:clamp(560px,calc(100vh - 24px),920px)}
.ws-page .stage--phone .app{height:780px}

@container app (max-width: 900px){
  .app__bar{flex-wrap:nowrap;padding:var(--space-1)}
  .app__project-name,.app__crumb,.app__bar .ws-title__kicker{display:none}
  .app__bar .ws-title{flex:1 1 auto;padding:0 var(--space-2)}
  .app__switch{display:flex;flex:none}
  .app__switch .segmented{width:auto}
  .app__switch .segmented__item{flex:none;padding:0 var(--space-2)}
  .app__switch-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .app__ws{--rail:0px;--dock:56px;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
  .tool-row--rail{order:2;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;overflow:visible;border-right:0;border-top:1px solid var(--border);padding:var(--space-1)}
  .tool-row--rail .tool-group{flex-direction:row;padding:0}
  .tool-row--rail .tool-group+.tool-group{border-top:0;border-left:0}
  .tool-row--rail .tool-row__end{flex-direction:row;margin:0;padding:0;border-top:0}
  .tool-row--rail .tool-row__hide{display:none}
  .tool-row--rail .tool[aria-pressed="true"]::after{left:10px;right:10px;top:auto;bottom:2px;width:auto;height:3px}
  .app__surface{order:1}
}

/* Selection controls and Link banner live in the app bar: no space taken from the notes */
.app__bar .app__ctx{position:static;flex:1 1 auto;min-width:0;display:flex;justify-content:flex-end;pointer-events:auto}
.app__bar .sel-bar,.app__bar .mode-banner{flex-wrap:nowrap;border:0;box-shadow:none;background:var(--selection-wash);padding:2px}
.app__bar .mode-banner{padding-left:var(--space-3)}
.app__bar .app__switch{margin-left:var(--space-1)}
.app__bar .app__ctx:empty{display:none}
.app__bar .app__ctx:empty~.app__switch{margin-left:auto}
@container app (max-width: 1100px){
  .app__bar .sel-bar .btn:not(.btn--icon) .i+*{font-size:var(--text-xs)}
}
@container app (max-width: 900px){
  .app__bar .app__ctx{position:absolute;top:auto;align-items:flex-end;left:var(--space-2);right:var(--space-2);bottom:calc(56px + var(--space-2));z-index:12;justify-content:center}
  .app[data-view="file"] .app__ctx{display:none}
  .app__bar .sel-bar,.app__bar .mode-banner{flex-wrap:wrap;border:1px solid var(--border);box-shadow:var(--shadow-2);background:var(--surface)}
  .app__bar .app__ctx .menu{top:auto;bottom:calc(100% + 4px)}
  .app__bar .app__ctx:not(:empty)~.app__switch{margin-left:auto}
}
.app__bar .ws-title{flex:0 0 auto;max-width:260px}
.app__bar .sel-bar__count{font-size:var(--text-xs)}
@container app (max-width: 900px){.app__bar .ws-title{flex:1 1 auto;max-width:none}}
@container app (max-width: 900px){
  .app__main{grid-template-columns:minmax(0,1fr)}
  .tpl-hint{max-width:calc(100% - 24px);left:var(--space-3)}
  .app__bar .sel-bar{justify-content:center}
}
.tpl-ws{grid-template-columns:auto minmax(0,1fr)}
.tpl-rail{writing-mode:horizontal-tb;width:54px;height:100%;border-radius:0}
.tpl-grow{flex:1}
.phone .tpl-ws{grid-template-columns:minmax(0,1fr);grid-template-rows:1fr auto}
.tpl-rail-demo{height:620px;display:flex;border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}

/* Workspace name and menu sit at the right of the bar, over the workspace (tablet and desktop) */
@container app (min-width: 901px){
  .app__bar .app__crumb{display:none}
  .app__bar .app__ctx{order:2;justify-content:flex-start}
  .app__bar .ws-title{order:3;margin-left:auto}
  .app__bar>.menu-wrap{order:4}
  .app__bar>#ws-tools-restore{order:5}
  .app__bar>.menu-wrap .menu{left:auto;right:0}
}

/* Tool rail on the outer (right) edge: the file and the workspace meet directly */
.app__ws{grid-template-columns:minmax(0,1fr) auto}
.app__surface{order:1}
.tool-row--rail{order:2;border-right:0;border-left:1px solid var(--border)}
.tool-row--rail .tool[aria-pressed="true"]::after{left:auto;right:-5px}
.menu--side{left:auto;right:calc(100% + 6px)}
.app__ctx{left:var(--space-3);right:calc(var(--rail) + var(--space-3))}
.tpl-empty{left:0;right:var(--rail)}
.tpl-hint{left:var(--space-3)}
.app__overlay{left:0;right:var(--rail)}
.app__zoom{right:calc(var(--rail) + var(--space-3))}
.tpl-ws{grid-template-columns:minmax(0,1fr) auto}
@container app (max-width: 900px){
  .tool-row--rail{border-left:0}
  .tool-row--rail .tool[aria-pressed="true"]::after{left:10px;right:10px}
}

/* ===== Pane headers replace the app bar (one row of chrome), and width tiers ===== */
.app{grid-template-rows:minmax(0,1fr)}
.app__bar{min-height:52px}
.file-head{gap:var(--space-2)}
.file-head .app__project-name{max-width:40%}
.file-head select{min-width:0}
.app__ws{grid-template-areas:"head head" "surface rail";grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr)}
.app__ws>.ws-head{grid-area:head}
.app__ws>.app__surface{grid-area:surface}
.app__ws>.tool-row--rail{grid-area:rail}
.ws-head{flex-wrap:wrap;row-gap:2px}
.tpl-empty{top:52px}
.app__switch{display:none}
/* hide the kicker and icon while a selection needs the room */
.ws-head:has(.app__ctx:not(:empty)) .ws-title__kicker,.ws-head:has(.app__ctx:not(:empty)) .ws-title>.i-workspaces{display:none}
.ws-head:has(.app__ctx:not(:empty)) .ws-title{max-width:180px}

/* Medium (tablet portrait, small laptop) */
@container app (max-width: 1100px){
  .app__main{grid-template-columns:minmax(220px,34%) minmax(0,1fr)}
  .file-head .app__project-name{display:none}
  .ws-title__kicker{display:none}
  .sel-bar .btn:not(.btn--icon):not([data-act="move-to"]):not([data-act="delete"]){font-size:var(--text-xs)}
}
@container app (max-width: 860px){
  .app__main{grid-template-columns:minmax(200px,30%) minmax(0,1fr)}
  .sel-bar__label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
}

/* Phone: one pane at a time */
@container app (max-width: 900px){
  .app__main{grid-template-columns:minmax(0,1fr)}
  .app__ws{grid-template-areas:"head" "surface" "rail";grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}
  .app__switch{display:flex;margin-left:auto}
  .ws-head{flex-wrap:nowrap}
  .ws-head .ws-title{flex:1 1 auto;max-width:none;margin-left:0}
  .ws-head .app__ctx{position:absolute;top:auto;bottom:calc(56px + var(--space-2));left:var(--space-2);right:var(--space-2);z-index:12}
  .ws-head:has(.app__ctx:not(:empty)) .ws-title{max-width:none}
  .tpl-empty{top:52px;right:0}
}
.ws-head .app__ctx{flex:1 1 0;min-width:0}
.ws-head .ws-title,.ws-head>.menu-wrap{flex:none}
@container app (max-width: 900px){.ws-head .ws-title{flex:1 1 auto}}
.app__bar{min-height:56px}
.ws-head .app__ctx{container:ctx/inline-size}
@container ctx (max-width: 720px){
  .sel-bar .btn:not([data-act="delete"]) .sel-bar__label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .sel-bar .btn:not([data-act="delete"]):not(.btn--icon){width:40px;min-width:40px;padding:0}
}
@container ctx (max-width: 470px){
  .sel-bar .btn .sel-bar__label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .sel-bar .btn:not(.btn--icon){width:40px;min-width:40px;padding:0}
}
@container app (max-width: 900px){
  .app__ws:has(.app__ctx:not(:empty)) .app__zoom{bottom:calc(56px + 76px)}
  .app__ws:has(.app__ctx:not(:empty)) .tpl-hint{bottom:calc(56px + 76px)}
}
@container app (min-width: 520px) and (max-width: 900px){
  .tool-row .tool--secondary{display:inline-flex}
  .tool-row .tool-row__more{display:none}
}
@container app (max-width: 519px){
  .app__ws:has(.app__ctx:not(:empty)) .app__zoom,.app__ws:has(.app__ctx:not(:empty)) .tpl-hint{bottom:calc(56px + 120px)}
}

/* ===== Divider along the full height, file head, return chip (UX18-R4, R8) ===== */
.app__main{grid-template-columns:minmax(220px,var(--file-w,32%)) 10px minmax(0,1fr)}
.app__file{border-right:0}
.app__divider{position:relative;cursor:col-resize;background:var(--bg);border-left:1px solid var(--border);border-right:1px solid var(--border);touch-action:none}
.app__divider::after{content:"";position:absolute;left:50%;top:50%;width:4px;height:40px;margin:-20px 0 0 -2px;border-radius:2px;background:var(--border-strong)}
.app__divider:hover,.app__divider:focus-visible,.app__divider.is-dragging{background:var(--selection-wash)}
.app__file{position:relative}
.file-head .app__project-name{display:none}
.file-head select{flex:1}
.file-head .btn--icon{flex:none}
.file-head__count{position:absolute;top:4px;right:2px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:var(--primary);color:var(--text-on-primary);font-size:11px;font-weight:var(--weight-strong);line-height:18px;text-align:center}
.file-head .btn{position:relative}
.file-body{position:relative;padding-left:var(--space-7);padding-right:var(--space-7)}
@container app (max-width: 900px){
  .app__main{grid-template-columns:minmax(0,1fr)}
  .app__divider{display:none}
  .file-body{padding-left:var(--space-6);padding-right:var(--space-6)}
}
@container app (max-width: 900px){
  .file-head [data-act="projects"]{font-size:0;gap:0;padding:0;width:var(--target)}
  .file-head select{min-width:110px}
  .page-dot{left:-28px}
}

/* Workspace on the shared core: the canvas fills the workspace surface */
.core-surface{position:relative;overflow:hidden;grid-area:surface}
.core-canvas{display:block;width:100%;height:100%;touch-action:none;cursor:default}
.core-fallback{margin:0 0 var(--space-4);padding:var(--space-4);border:1px solid var(--danger);border-left:4px solid var(--danger);border-radius:var(--radius-md);background:var(--danger-wash);display:grid;gap:var(--space-2)}
.core-fallback h2{font-size:var(--text-lg)}

/* Links on the core page: the core's display list is painted on a canvas over both panes, as iOS
   draws links on LinkDrawingSurface above the file and the workspace. It never takes input. */
#core-app .app__main{position:relative}
.link-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:16}
/* Messages as the iOS workbench status label (WorkbenchController.swift:290-292): caption text in the
   secondary label colour on the secondary background, radius 8, centred 8 pt above the bottom. */
.core-status{position:absolute;left:50%;bottom:8px;transform:translateX(-50%);z-index:30;max-width:calc(100% - 24px);margin:0;padding:2px 8px;
  border-radius:8px;background:var(--surface-2,#F2F2F7);color:var(--text-2);font:400 12px/16px var(--font-sans);text-align:center;pointer-events:none;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.core-status[hidden]{display:none}
.file-body.is-inking .pdf-sheet{touch-action:none;cursor:crosshair;-webkit-user-select:none;user-select:none}

/* ---- iPad reader + workspace screen (WorkbenchController.swift). Points map 1:1 to CSS px. ---- */
.ipad-page .ds-main{max-width:none;padding:0}
.ipad-stage{display:flex;justify-content:center;background:var(--sys-bg-2);padding:16px}
.ipad{position:relative;display:flex;flex-direction:column;width:min(1032px,100%);height:min(1300px,calc(100vh - 140px));min-height:640px;overflow:hidden;background:var(--sys-bg);color:var(--sys-label);font:17px/1.3 var(--font-ui);border-radius:18px;box-shadow:0 0 0 1px var(--sys-separator)}
.ipad-bar{position:relative;z-index:30;display:flex;align-items:center;gap:12px;height:68px;padding:6px 10px;background:var(--sys-bg);border-bottom:.5px solid var(--sys-separator)}
.ipad-cap{display:flex;align-items:center;gap:4px;height:44px;padding:0 4px;border-radius:22px;background:var(--sys-bg);box-shadow:0 2px 10px rgba(0,0,0,.08),0 0 0 .5px rgba(0,0,0,.04)}
.ipad-cap--tools{margin-left:auto;gap:8px;padding:0 6px}
.ipad-title{font:600 17px/1 var(--font-ui);letter-spacing:0;color:var(--sys-label);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:8px}
.sticky-slots{display:flex;gap:20px;margin-left:8px}
.ipad.is-chrome-hidden .ipad-bar{display:none}
.ipad-showbar{position:absolute;top:4px;right:8px;z-index:31;width:40px;height:40px;border:0;border-radius:18px;background:var(--sys-bg);box-shadow:0 2px 8px rgba(0,0,0,.15);display:grid;place-items:center;color:var(--sys-label);cursor:pointer}
.ipad-split{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:var(--file-w,1fr) 1px var(--ws-w,1fr)}
.ipad.is-source-right .ipad-split{direction:rtl}.ipad.is-source-right .ipad-split>*{direction:ltr}
.ipad.is-above .ipad-split{grid-template-columns:1fr;grid-template-rows:var(--file-w,1fr) 1px var(--ws-w,1fr)}
.ipad-file{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--sys-bg)}
.qn-strip{display:flex;align-items:center;gap:8px;padding:4px 12px;min-height:52px}
.qn-strip__label{font:15px var(--font-ui);color:var(--sys-label)}
.qn-strip__btn{flex:1;min-height:44px;padding:0 12px;border:0;border-radius:22px;background:var(--sys-accent-wash);color:var(--sys-accent);font:17px var(--font-ui);text-align:left;cursor:pointer}
.qn-strip__btn:disabled{background:var(--sys-fill-4);color:var(--sys-label-3);cursor:default}
.sticky-panel{display:flex;flex-direction:column;gap:4px;padding:0 0 4px}
.sticky-panel__text{height:128px;overflow:auto;padding:8px 5px;border-radius:8px;background:var(--wash);font:17px/1.3 var(--font-ui);color:var(--sys-label)}
.ipad-file__view{position:relative;flex:1;min-height:0}
.ipad-pdf{position:absolute;inset:0;overflow:auto;background:var(--sys-bg-2);padding:6px 0 24px 16px}
.ipad-pdf .pdf-sheet{position:relative;margin:0 0 10px;background:#fff;color:#1d1d1f;box-shadow:none;border-radius:0;max-width:none}
.ipad-pdf .pdf-page__meta span:last-child{position:absolute;top:10px;right:10px;min-width:24px;height:20px;padding:0 6px;border-radius:4px;background:rgba(255,255,255,.72);color:rgba(0,0,0,.45);font:500 12px/20px var(--font-ui-mono);text-align:center}
.sel-actions{position:absolute;top:8px;right:8px;z-index:6;display:flex;gap:4px;padding:4px 4px 4px 8px;min-height:44px;align-items:center;border-radius:10px;background:var(--sys-grouped-2);box-shadow:0 2px 10px rgba(0,0,0,.12)}
.ipad-divider{position:relative;background:var(--sys-separator);cursor:col-resize;z-index:8}
.ipad-divider span{position:absolute;left:50%;top:50%;width:4px;height:48px;transform:translate(-50%,-50%);border-radius:2px;background:var(--sys-label-3)}
.ipad-divider::before{content:"";position:absolute;left:-12px;right:-12px;top:50%;height:96px;transform:translateY(-50%)}
.ipad.is-above .ipad-divider{cursor:row-resize}
.ipad.is-above .ipad-divider span{width:48px;height:4px}
.ipad-ws{position:relative;min-width:0;min-height:0;background:var(--paper-white)}
.ipad-ws .core-surface{position:absolute;inset:0}
.ipad-ws .core-canvas{width:100%;height:100%;display:block;touch-action:none}
.ipad-hint{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);z-index:20;padding:2px 8px;border-radius:6px;background:color-mix(in srgb,var(--sys-bg) 80%,transparent);color:var(--sys-label-2);font:15px var(--font-ui);white-space:nowrap;pointer-events:none}
.ipad .core-status{position:absolute;left:50%;bottom:8px;transform:translateX(-50%);z-index:21;max-width:80%;padding:6px 10px;border-radius:8px;background:var(--sys-bg-2);color:var(--sys-label-2);font:12px/1.3 var(--font-ui)}
.ios-search{top:62px;right:10px;width:620px;height:500px;max-width:calc(100% - 20px);padding:12px 20px}
.ios-search__head{display:flex;justify-content:flex-end}
.ios-search__field{display:flex;align-items:center;gap:8px;height:44px;margin-top:8px;padding:0 14px;border-radius:22px;background:var(--sys-fill-4)}
.ios-search__field input{flex:1;border:0;background:none;font:17px var(--font-ui);color:var(--sys-label);outline:0}
.ios-search__results{list-style:none;margin:12px 0 0;padding:0;overflow:auto;max-height:360px;font:15px/1.35 var(--font-ui)}
.ios-search__results li{padding:10px 4px;border-bottom:.5px solid var(--sys-separator)}
.ios-search__results button{border:0;background:none;text-align:left;font:inherit;color:inherit;cursor:pointer;width:100%}
.ios-search__results small{display:block;color:var(--sys-label-2);font-size:13px}
.note-editor{position:absolute;z-index:25;display:flex;flex-direction:column;border-radius:14px;background:var(--sys-bg);box-shadow:0 0 0 2.5px var(--sys-accent)}
.note-editor textarea{flex:1;min-height:120px;margin:8px;border:0;resize:none;font:17px/1.3 var(--font-ui);color:var(--sys-label);background:var(--sys-bg);outline:0}
.note-editor__bar{display:flex;align-items:center;padding:2px 6px;border-top:.5px solid var(--sys-separator);background:var(--sys-bg-2);border-radius:0 0 14px 14px}
.note-editor__flex{flex:1}
.ipad-notes{max-width:1032px;margin:16px auto 32px;padding:0 16px}

/* ---- iPad Home (HomeController.swift): grouped background, 220 pt sidebar, browser margins 24 ---- */
.home{background:var(--sys-grouped)}
.home-nav{display:flex;align-items:center;gap:12px;height:68px;padding:6px 10px}
.home-circle{width:44px;height:44px;border-radius:22px;border:0;background:var(--sys-grouped-2);box-shadow:0 2px 10px rgba(0,0,0,.08);display:grid;place-items:center;color:var(--sys-label);cursor:pointer}
.home-search{flex:1;display:flex;align-items:center;gap:8px;height:44px;padding:0 14px;border-radius:22px;background:var(--sys-fill-4);color:var(--sys-label)}
.home-search input{flex:1;border:0;background:none;font:17px var(--font-ui);color:var(--sys-label);outline:0}
.home-search input::placeholder{color:var(--sys-label-2)}
.home-pill{height:44px;padding:0 16px;border-radius:22px;border:0;background:var(--sys-grouped-2);box-shadow:0 2px 10px rgba(0,0,0,.08);font:17px var(--font-ui);color:var(--sys-label);cursor:pointer}
.home-body{flex:1;min-height:0;display:grid;grid-template-columns:220px 1fr}
.home.is-sidebar-hidden .home-body{grid-template-columns:1fr}.home.is-sidebar-hidden .home-side{display:none}
.home-side{display:flex;flex-direction:column;gap:6px;padding:24px 12px 20px;min-height:0;overflow:auto}
.home-brand{height:48px;display:flex;align-items:center;padding-left:0;font:600 20px var(--font-ui);color:var(--sys-label)}
.home-route{display:flex;align-items:center;gap:14px;min-height:48px;padding:12px 12px 12px 16px;border:0;border-radius:999px;background:none;color:var(--sys-label);font:17px var(--font-ui);text-align:left;cursor:pointer}
.home-route .i{width:24px;height:24px}
.home-route[aria-pressed="true"]{background:var(--sys-accent-wash);color:var(--sys-accent)}
.home-route--plain{color:var(--sys-accent);min-height:0}
.home-route--new{gap:12px;padding:12px}
.home-side__flex{flex:1}
.home-browser{display:flex;flex-direction:column;gap:18px;padding:22px 24px 12px;min-height:0;overflow:auto}
.home-head{display:flex;align-items:center;gap:8px}
.home-head h1{flex:1;font:600 26px var(--font-ui);letter-spacing:0;color:var(--sys-label)}
.home-btn{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:0;border-radius:8px;font:17px var(--font-ui);cursor:pointer}
.home-btn .i{width:20px;height:20px}
.home-btn--tinted{background:var(--sys-accent-wash);color:var(--sys-accent);border-radius:22px}
.home-btn--filled{background:var(--sys-accent);color:var(--sys-on-accent)}
.home-more{width:44px;height:44px;border:0;background:none;color:var(--sys-accent);display:grid;place-items:center;cursor:pointer}
.home-feedback{display:flex;align-items:center;justify-content:center;gap:10px;min-height:44px;border:0;border-radius:22px;background:var(--sys-feedback);color:#fff;font:17px var(--font-ui);cursor:pointer}
.home-feedback .i{width:26px;height:26px}
.home-continue h2{font:600 15px var(--font-ui);letter-spacing:0;color:var(--sys-label);margin-bottom:14px}
.home-cards{display:flex;gap:14px;overflow-x:auto;height:204px}
.home-card{flex:none;width:220px;height:204px;display:flex;flex-direction:column;border-radius:12px;border:1px solid var(--sys-separator);background:var(--sys-grouped-2);overflow:hidden;text-decoration:none;color:var(--sys-label)}
.home-card .home-thumb{height:120px;flex:none}
.home-card__meta{display:flex;flex-direction:column;gap:5px;padding:9px 12px 10px}
.home-card__title{font:500 14px var(--font-ui);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.home-card__detail{font:11px var(--font-ui);color:var(--sys-label-2)}
.home-thumb{position:relative;display:block;background:#fff;color:#1d1d1f;padding:10px 14px;overflow:hidden}
.home-thumb__bar{display:block;width:14px;height:2px;background:#5266E8;margin-bottom:5px}
.home-thumb__kicker{display:block;font:5px var(--font-ui);color:#5266E8;letter-spacing:.04em;margin-bottom:6px}
.home-thumb__title{display:block;font:9px var(--font-ui);margin-bottom:6px}
.home-thumb__rule{display:block;height:.5px;background:#ddd;margin-bottom:6px}
.home-thumb__line{display:block;height:2.5px;background:#d6d6d6;margin-bottom:4px;border-radius:1px}
.home-thumb__line--short{width:60%}
.home-table{border-radius:12px;background:var(--sys-grouped-2);flex:1;min-height:200px;padding-bottom:8px}
.home-table__head{display:grid;grid-template-columns:1fr 150px 50px 82px;gap:18px;align-items:center;height:48px;padding:0 18px 0 18px;font:500 13px var(--font-ui);color:var(--sys-label-2)}
.home[data-route="projects"] .home-table__head{grid-template-columns:1fr auto}
.home-link{border:0;background:none;color:var(--sys-accent);font:15px var(--font-ui);cursor:pointer}
.home-row{position:relative}
.home-row__open,.home-row--project{display:grid;grid-template-columns:34px 1fr 150px 50px 82px;gap:14px;align-items:center;min-height:68px;padding:0 18px 0 14px;text-decoration:none;color:var(--sys-label)}
.home-row--project{grid-template-columns:34px 1fr}
.home-row+.home-row::before,.home-row--project+.home-row--project::before{content:"";position:absolute;left:62px;right:18px;top:0;height:.5px;background:var(--sys-separator)}
.home-row--project{position:relative}
.home-row__thumb{width:34px;height:40px;border-radius:4px;overflow:hidden;box-shadow:0 0 0 .5px var(--sys-separator)}
.home-row__thumb .home-thumb{width:220px;height:258px;transform:scale(.155);transform-origin:0 0}
.home-row__name{font:500 14px var(--font-ui);display:flex;flex-direction:column}
.home-row__name small{font:12px var(--font-ui);color:var(--sys-label-2);margin-top:3px}
.home-row__col{font:12px var(--font-ui);color:var(--sys-label-2)}
.home-row__num{text-align:center}
.home-row__icon{color:var(--sys-accent);display:grid;place-items:center}
.home-empty{padding:24px 18px;color:var(--sys-label-2);font:15px var(--font-ui)}
.home-status{font:13px var(--font-ui);color:var(--sys-label-2);min-height:18px}
.home-sheet-scrim{position:absolute;inset:0;z-index:50;background:rgba(0,0,0,.2)}
.home-action{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:51;width:320px}
.home-action__card{display:flex;flex-direction:column;border-radius:14px;background:color-mix(in srgb,var(--sys-bg) 94%,transparent);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);overflow:hidden;font-family:var(--font-ui);color:var(--sys-label);box-shadow:0 10px 40px rgba(0,0,0,.2)}
.home-action__title{padding:16px 16px 2px;font:600 13px var(--font-ui);text-align:center;color:var(--sys-label-2)}
.home-action__msg{padding:2px 16px 12px;font:13px var(--font-ui);text-align:center;color:var(--sys-label-2);white-space:pre-line}
.home-action__field{margin:0 16px 12px}
.home-action__btn{min-height:50px;border:0;border-top:.5px solid var(--sys-separator);background:none;font:17px var(--font-ui);color:var(--sys-accent);cursor:pointer}
.home-action__btn--bold,.home-action__btn--cancel{font-weight:600}
.home-action__btn--danger{color:var(--sys-red)}
/* Narrow Home (HomeController.swift:143-145, 180, 205, 463-470): under 760 pt no sidebar ("Browse" sheet instead),
   heading stacked, 16 pt margins, 214 pt cards, rows show "<project> · <n> pages" under the name */
.home-row__meta{display:none}
.home.is-narrow .home-body{grid-template-columns:1fr}.home.is-narrow .home-side{display:none}.home.is-narrow .home-browser{padding:22px 16px 12px}
.home.is-narrow .home-table__head span:not(:first-child),.home.is-narrow .home-row__col{display:none}
.home.is-narrow .home-row__open{grid-template-columns:34px 1fr}.home.is-narrow .home-table__head{grid-template-columns:1fr}
.home.is-narrow .home-row__meta{display:block}
.home-head__actions{display:flex;align-items:center;gap:8px}
.home.is-narrow .home-head{flex-direction:column;align-items:stretch;gap:12px}.home.is-narrow .home-head__actions{justify-content:flex-end}
.home.is-narrow .home-card{flex:0 0 214px;width:214px}
/* A PDF keeps its own typeface whatever the app chrome uses */
.pdf-page{font-family:"DS Newsreader",Georgia,"Times New Roman",serif}
.pdf-page .pdf-page__meta{font-family:var(--font-ui)}
.clip-box{position:absolute;z-index:7;border:1.5px dashed var(--sys-accent);background:rgba(10,87,209,.08);pointer-events:none}
.clip-bar{position:absolute;top:8px;right:8px;z-index:8;display:flex;flex-direction:column;gap:8px;padding:8px;border-radius:10px;background:var(--sys-grouped-2);box-shadow:0 2px 10px rgba(0,0,0,.12)}
.clip-bar .ios-tinted{min-height:44px}
.clip-bar__hint{font:13px var(--font-ui);color:var(--sys-label-2)}
.ipad[data-tool="clip"] .ipad-pdf{user-select:none;-webkit-user-select:none;cursor:crosshair}
/* iOS modal screens on Home: Quick Note editor, Recycle Bin */
.ios-modal{position:absolute;inset:0;z-index:60;display:flex;flex-direction:column;background:var(--sys-bg);font-family:var(--font-ui);color:var(--sys-label)}
.ios-modal__bar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;height:56px;padding:0 12px;border-bottom:.5px solid var(--sys-separator)}
.ios-modal__bar h2{font:600 17px var(--font-ui);letter-spacing:0}
.ios-modal__right{justify-self:end;display:flex;gap:4px;align-items:center}
.ios-modal__btn{border:0;background:none;color:var(--sys-accent);font:17px var(--font-ui);min-height:44px;padding:0 8px;cursor:pointer;justify-self:start}
.ios-modal__btn:disabled{color:var(--sys-label-3);cursor:default}
.ios-modal__btn--bold{font-weight:600}.ios-modal__btn--danger{color:var(--sys-red)}
.ios-modal__icon{width:44px;height:44px;border:0;background:none;color:var(--sys-accent);display:grid;place-items:center;cursor:pointer}
.ios-modal__icon--danger{color:var(--sys-red)}
.qn-editor{display:flex;flex-direction:column;gap:12px;padding:12px 16px;overflow:auto;flex:1}
.qn-editor__title{height:36px;border:0;font:600 17px var(--font-ui);background:none;color:var(--sys-label);outline:0}
.qn-editor__body{height:120px;border:0;border-radius:10px;padding:8px;background:var(--sys-bg-2);font:17px var(--font-ui);color:var(--sys-label);resize:none}
.qn-editor__tools{display:flex;gap:8px;align-items:center}.qn-editor__tools .ios-segmented{flex:1;height:36px}
.qn-editor__canvas{width:100%;aspect-ratio:3/4;background:#fff;border:.5px solid var(--sys-separator);touch-action:none}
.qn-editor__status{font:12px var(--font-ui);color:var(--sys-label-2)}
.bin-list{flex:1;overflow:auto;padding:20px;background:var(--sys-grouped)}
.bin-group{border-radius:10px;background:var(--sys-grouped-2);overflow:hidden}
.bin-row{display:flex;align-items:center;gap:12px;min-height:76px;padding:0 8px 0 16px}
.bin-row+.bin-row{border-top:.5px solid var(--sys-separator)}
.bin-row__icon{color:var(--sys-accent)}
.bin-row__text{flex:1;display:flex;flex-direction:column;font:17px var(--font-ui)}
.bin-row__text small{font:15px var(--font-ui);color:var(--sys-label-2)}
.bin-footer{margin:8px 16px;font:13px var(--font-ui);color:var(--sys-label-2)}
.bin-empty{text-align:center;margin-top:120px;color:var(--sys-label-2);font:17px var(--font-ui)}
.qn-editor>*{flex:none}

/* 14 Nov, from the simulator: clip bar stack under the sticky note; clip outline solid while drawing,
   dashed with a light fill once drawn; selection actions at 17 pt; PDF page fills the pane width. */
.ipad-file>.clip-bar{position:static;display:flex;flex-direction:column;gap:8px;padding:0 0 6px;border-radius:0;background:none;box-shadow:none}
.ipad-file>.clip-bar[hidden]{display:none}
.clip-bar__hint{font:15px var(--font-ui);color:var(--sys-label-2);padding:2px 0}
.clip-box{border:2.5px solid var(--sys-accent);background:none}
.clip-box.is-done{border:2px dashed var(--sys-accent);background:rgba(10,87,209,.10);pointer-events:auto;cursor:grab}
.clip-box.is-ghost{position:absolute;z-index:50;opacity:.7;pointer-events:none}
.sel-actions{padding:0;background:none;box-shadow:none;gap:8px}
.sel-actions .ios-tinted{min-height:44px;padding:0 14px;font-size:17px;border-radius:10px;gap:8px}
.sel-actions .ios-tinted .i{width:22px;height:22px}
.ipad-pdf{padding:0 0 24px 6px;background:var(--sys-bg-2);container-type:inline-size}
.ipad-pdf .pdf-sheet{width:100%;max-width:none;min-height:calc(100cqw * 1.294);margin:0 0 10px;padding:9cqw 11cqw;font-size:3.1cqw;line-height:1.55;gap:2.4cqw}
.ipad-pdf .pdf-sheet h3{font-size:4.6cqw}
.ipad-pdf .pdf-page__meta{font-size:2.3cqw}
.ipad-pdf .pdf-page__meta span:last-child{position:static;min-width:0;height:auto;padding:0;background:none;color:inherit;font:inherit}
/* Second workspace pane: stacked under the first (fillEqually, spacing 1) */
.ipad-ws.has-pane2{display:grid;grid-template-rows:1fr 1fr;row-gap:1px;background:var(--sys-separator)}
.ipad-ws.has-pane2>.core-surface{position:relative;inset:auto;background:var(--paper-white)}
.ws-pane2{position:relative;display:flex;flex-direction:column;background:var(--paper-white);min-height:0}
.ws-pane2__bar{position:absolute;top:4px;right:4px;z-index:3;display:flex;align-items:center;gap:4px;padding:0 0 0 12px;border-radius:22px;background:color-mix(in srgb,var(--sys-bg) 85%,transparent);box-shadow:0 2px 8px rgba(0,0,0,.1);font:13px var(--font-ui);color:var(--sys-label-2)}
.ws-pane2 .core-surface{position:relative;flex:1;min-height:0}
.ws-pane2 .core-canvas{width:100%;height:100%;display:block;touch-action:none}
/* Liquid-glass capsules: translucent white, blur, a soft drop shadow and a light rim */
.ipad-cap{height:48px;border-radius:24px;background:color-mix(in srgb,var(--sys-bg) 72%,transparent);backdrop-filter:blur(18px) saturate(1.6);-webkit-backdrop-filter:blur(18px) saturate(1.6);box-shadow:0 6px 18px rgba(0,0,0,.08),0 0 0 .5px rgba(0,0,0,.06),inset 0 0 0 1px rgba(255,255,255,.6)}
.ipad-cap--tools{gap:10px;padding:0 8px}
.ipad-bar{height:72px;border-bottom:.5px solid var(--sys-separator)}
.ipad-ws.has-pane2{grid-template-rows:minmax(0,1fr) minmax(0,1fr)}
.ipad-ws.has-pane2>.core-surface{grid-row:1;grid-column:1;min-height:0;overflow:hidden}
.ipad-ws.has-pane2>.ws-pane2{grid-row:2;grid-column:1;overflow:hidden}
.ipad-ws.has-pane2>.core-surface .core-canvas{position:absolute;inset:0;width:100%;height:100%}
.ws-pane2__bar{display:none} /* iPad hides workspace pane headers (WorkspaceController.swift:364, 392); close it from the menu */
.ios-modal--sheet{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:min(580px,90%);height:min(1040px,82%);border-radius:28px;background:var(--sys-grouped);box-shadow:0 20px 60px rgba(0,0,0,.25);overflow:hidden}
.ios-modal--sheet .ios-modal__bar{border-bottom:0;height:64px;padding:8px 12px}
.ios-modal-scrim{z-index:59}
.ios-pill--danger{color:var(--sys-red)}.ios-pill:disabled{color:var(--sys-label-3)}
.ios-done{width:44px;height:44px;border-radius:22px;border:0;background:var(--sys-accent);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.ios-done .i{width:22px;height:22px}
.ios-modal--sheet .bin-list{padding:24px 20px;background:var(--sys-grouped)}
.ios-modal--sheet .bin-footer{margin:0 8px 16px}
.bin-empty{margin-top:240px}
/* Documents / outline sidebar (280 pt, inset grouped), rich note editor, link alert, Paper sheet */
.ipad.has-sidebar .ipad-split{grid-template-columns:280px var(--file-w,1fr) 1px var(--ws-w,1fr)}
.ipad-sidebar{display:flex;flex-direction:column;gap:10px;padding:10px 12px;background:var(--sys-grouped);border-right:.5px solid var(--sys-separator);overflow:auto;min-height:0}
.ipad-sidebar[hidden]{display:none}
.ipad-sidebar__filter{display:flex;align-items:center;gap:6px;height:36px;padding:0 10px;border-radius:10px;background:var(--sys-fill-3);color:var(--sys-label-2)}
.ipad-sidebar__filter input{flex:1;border:0;background:none;font:17px var(--font-ui);color:var(--sys-label);outline:0}
.ipad-sidebar__list{display:flex;flex-direction:column;border-radius:10px;background:var(--sys-grouped-2);overflow:hidden}
.side-head{padding:12px 16px 6px;font:13px var(--font-ui);color:var(--sys-label-2);text-transform:uppercase;background:var(--sys-grouped)}
.side-row{display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 12px 8px 16px;border:0;border-top:.5px solid var(--sys-separator);background:none;text-align:left;font:17px var(--font-ui);color:var(--sys-label);cursor:pointer}
.side-row .i{color:var(--sys-accent);flex:none}
.side-row>span:nth-child(2){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.side-row--add{color:var(--sys-accent)}
.side-row__del{display:grid;place-items:center;width:32px;height:32px;color:var(--sys-red)}
.side-row__del .i{color:var(--sys-red)}
.side-empty{padding:12px 16px;font:15px var(--font-ui);color:var(--sys-label-2)}
.note-editor__text{flex:1;min-height:120px;margin:8px;outline:0;font:17px/1.3 var(--font-ui);color:var(--sys-label);overflow:auto}
.fmt-b{font-weight:700}.fmt-i{font-style:italic}.fmt-u{text-decoration:underline}.fmt-s{text-decoration:line-through}.fmt-u.fmt-s{text-decoration:underline line-through}.fmt-code{font-family:var(--font-ui-mono);font-size:.9em}
.note-editor__text a{color:var(--sys-accent);text-decoration:underline}
.note-list{position:relative;padding-left:22px}
.note-list--bullet::before{content:"•";position:absolute;left:6px}
.note-list--numbered::before{content:attr(data-n) ".";position:absolute;left:0}
.ios-menu--up{top:auto;bottom:calc(100% + 6px);right:auto;left:0}
.ios-menu--left{right:auto;left:0}
.ios-alert{width:300px;padding:18px 0 0;border:0;border-radius:14px;background:color-mix(in srgb,var(--sys-bg) 94%,transparent);color:var(--sys-label);font-family:var(--font-ui);text-align:center;box-shadow:0 10px 40px rgba(0,0,0,.2)}
.ios-alert::backdrop{background:rgba(0,0,0,.2)}
.ios-alert h2{font:600 17px var(--font-ui);letter-spacing:0;margin:0 16px}
.ios-alert p{font:13px var(--font-ui);margin:4px 16px 12px}
.ios-alert .ios-field{width:calc(100% - 32px);margin:0 16px 16px;height:32px}
.ios-alert__actions{display:flex;flex-direction:column}
.ios-alert__actions button{min-height:44px;border:0;border-top:.5px solid var(--sys-separator);background:none;font:17px var(--font-ui);color:var(--sys-accent);cursor:pointer}
.ios-alert__actions button[data-link="add"]{font-weight:600}
.ios-sheet--paper{width:min(600px,92vw);height:min(600px,86vh);background:var(--sys-grouped)}
.paper-rows{margin:12px 20px 20px;border-radius:10px;background:var(--sys-grouped-2);overflow:hidden}
.paper-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:6px 16px;border-top:.5px solid var(--sys-separator);font:17px var(--font-ui)}
.paper-row:first-child{border-top:0}
.paper-row select,.paper-row input[type=range]{width:130px}.paper-row select{border:0;background:none;color:var(--sys-accent);font:17px var(--font-ui);text-align:right}
.paper-row input[type=color]{width:32px;height:32px;border:0;padding:0;background:none}
.ios-pill--bold{font-weight:600}
.ov-outline{position:absolute;z-index:4;border:2px solid #5856D6;background:rgba(88,86,214,.06);pointer-events:none}
/* Note formatting bar: iOS shows it at the bottom of the screen as glass capsules ([B I U] [Format] … [Save]), not on the card */
.ipad>#core-note-bar{position:absolute;left:16px;right:16px;bottom:16px;z-index:40;display:flex;align-items:center;gap:12px;padding:0;border:0;background:none;border-radius:0}
.ipad>#core-note-bar[hidden]{display:none}
.glass-cap{display:inline-flex;align-items:center;gap:2px;height:48px;padding:0 6px;border-radius:24px;background:color-mix(in srgb,var(--sys-bg) 82%,transparent);-webkit-backdrop-filter:blur(20px) saturate(1.6);backdrop-filter:blur(20px) saturate(1.6);box-shadow:0 4px 16px rgba(0,0,0,.12),0 0 0 .5px rgba(0,0,0,.06)}
.glass-cap .ios-kb{min-width:40px;height:40px;border-radius:20px;background:none}
.ios-round--glass{background:var(--sys-bg);box-shadow:0 2px 10px rgba(0,0,0,.12)}
/* Paper sheet controls as UIKit draws them: colour wells in a spectrum ring, switches */
.ios-colorwell{position:relative;display:inline-grid;place-items:center;width:32px;height:32px;border-radius:50%;background:conic-gradient(#ff3b30,#ffcc00,#34c759,#00c7be,#007aff,#af52de,#ff2d55,#ff3b30)}
.ios-colorwell::before{content:"";width:22px;height:22px;border-radius:50%;background:var(--well,#fff);box-shadow:0 0 0 2.5px var(--sys-grouped-2)}
.ios-colorwell input[type=color]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.ios-switch{appearance:none;-webkit-appearance:none;position:relative;width:51px;height:31px;margin:0;border-radius:16px;background:var(--sys-fill-3,rgba(120,120,128,.16));cursor:pointer;transition:background .2s}
.ios-switch::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:#fff;box-shadow:0 3px 8px rgba(0,0,0,.15),0 1px 1px rgba(0,0,0,.16);transition:transform .2s}
.ios-switch:checked{background:#34c759}.ios-switch:checked::after{transform:translateX(20px)}
/* Quick Note editor as iOS 26 shows it: no bar rule, round ✓, glass Share and Add to project, a taller body box,
   the drawing area without a frame, "Saved on this device" at the bottom-left */
.ios-modal--qn .ios-modal__bar{border-bottom:0;height:64px;padding:8px 12px}
.ios-modal--qn .ios-modal__right{gap:10px}
.ios-pill--glass,.ios-round--glass{background:var(--sys-bg);box-shadow:0 2px 10px rgba(0,0,0,.12)}
.ios-modal--qn .qn-editor{position:relative;padding-bottom:40px}
.ios-modal--qn .qn-editor__body{height:190px;padding:10px 6px}
.ios-modal--qn .qn-editor__canvas{border:0;flex:1 1 auto;aspect-ratio:auto;min-height:300px}
.ios-modal--qn .qn-editor__status{position:absolute;left:16px;bottom:14px}
/* Quick Notes popover from the sidebar row: title, then capsule rows */
.home-action--popover{transform:none;width:290px}
.home-action--popover .home-action__card{padding:0 16px 14px;gap:10px;border-radius:26px}
.home-action--popover .home-action__title{padding:18px 0 4px;font:17px var(--font-ui);color:var(--sys-label)}
.home-action--popover .home-action__btn{min-height:48px;border:0;border-radius:24px;background:var(--sys-fill-4);color:var(--sys-label);font:500 17px var(--font-ui)}
/* Sidebar as the iPad workbench draws it: the open file's title, segments, a filter, the project header, an inset grouped list */
.ipad-sidebar__title{margin:2px 4px 0;font:600 20px/1.2 var(--font-ui);letter-spacing:0;color:var(--sys-label)}
.ipad-sidebar__head{margin:8px 16px -4px;font:17px var(--font-ui);color:var(--sys-label-2)}
.ipad-sidebar__head[hidden]{display:none}
.ipad-sidebar__list{border-radius:20px}
.side-row{min-height:52px;padding:10px 12px 10px 16px}
.side-row:first-child{border-top:0}
.side-row__text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.side-row__text>span{white-space:normal}
.side-row__text small{font:15px var(--font-ui);color:var(--sys-label-2)}
.side-row.is-current{background:var(--sys-accent-wash,rgba(10,87,209,.14))}
.side-row__more{display:grid;place-items:center;width:32px;height:32px;color:var(--sys-accent)}
.side-row--empty{cursor:default}
html:not(.show-proposed) .proposed-only{display:none}
.show-proposed .proposed-only{outline:1.5px dashed var(--sys-red);outline-offset:-2px;border-radius:6px}
.side-row--add{color:var(--sys-label)}
/* Search as SearchController: Select beside ×, "N results", the scope segment, inset grouped results, a selection toolbar */
.ios-search{display:flex;flex-direction:column}
.ios-search__head{gap:10px;align-items:center}
.ios-search__prompt{margin:4px 0 0;text-align:center;font:13px var(--font-ui);color:var(--sys-label-2)}
.ios-search__prompt[hidden],.ios-search__scope[hidden],.ios-search__toolbar[hidden]{display:none}
.ios-search__scope{margin-top:12px}
.ios-search__results{flex:1;max-height:none;margin-top:12px;border-radius:12px;background:var(--sys-grouped-2)}
.ios-search__results li{padding:10px 16px;border-bottom:.5px solid var(--sys-separator)}
.ios-search__results li:last-child{border-bottom:0}
.ios-search__results button{display:flex;gap:12px;align-items:flex-start;font:17px/1.3 var(--font-ui)}
.ios-search__text{flex:1;min-width:0}
.ios-search__results small{font-size:15px;white-space:pre-line}
.ios-search__check{display:none;flex:none;width:22px;height:22px;margin-top:2px;border-radius:50%;border:1.5px solid var(--sys-label-3)}
.ios-search.is-selecting .ios-search__check{display:block}
.ios-search__results li.is-selected .ios-search__check{border-color:var(--sys-accent);background:var(--sys-accent) url("/design/icons/check.svg") center/14px no-repeat}
.ios-search__toolbar{display:flex;justify-content:space-between;align-items:center;margin-top:8px}
.ios-menu--end{right:0;left:auto}
/* Image pages (the /try demo): a pre-rendered page and an invisible text layer of word boxes, for selection,
   link contacts and Collect text. Font sizes are in page points scaled by the sheet's width (612 pt). */
.ipad-pdf .img-sheet{display:block;padding:0;min-height:0;container-type:inline-size;overflow:hidden}
.img-sheet .page-img{position:absolute;inset:0;width:100%;height:100%;-webkit-user-select:none;user-select:none;pointer-events:none}
.img-sheet .text-layer{position:absolute;inset:0;font-size:0;line-height:1;color:transparent;white-space:pre}
.img-sheet .text-layer span{position:absolute;font-family:"Times New Roman",Times,serif;font-size:calc(var(--fs) * 100cqw / 612);line-height:1;white-space:pre;transform-origin:0 0;transform:scaleX(var(--sx));cursor:text}
.img-sheet .text-layer ::selection{background:rgba(10,87,209,.3);color:transparent}
/* Compact layout (WorkbenchController.swift:39, 460-479): under 900 pt More + one drawing-tool menu on the right,
   the sticky-note slots leave the toolbar; under 720 pt one pane at a time behind Read | Paper, sidebar as a sheet. */
.ipad:not(.is-compact) .ipad-compact-only{display:none!important}
.ipad.is-compact .ipad-cap--tools>[data-core-act="undo"],.ipad.is-compact .ipad-cap--tools>.ios-seg,.ipad.is-compact .ipad-cap--tools>[data-core-act="search"],.ipad.is-compact .ipad-cap--tools>.menu-wrap:has(#core-ws-menu),.ipad.is-compact .sticky-slots{display:none}
.ios-menu__trail{margin-left:auto;width:18px;height:18px;flex:none;color:var(--sys-label)}
.ios-menu__check{width:16px;height:16px;visibility:hidden}
[aria-checked="true"]>.ios-menu__lead>.ios-menu__check{visibility:visible}
.ipad-focus{margin:0 auto;height:32px;min-width:150px;flex:none}
.ipad-focus[hidden]{display:none}
.ipad.is-narrow .ipad-split{grid-template-columns:1fr!important;grid-template-rows:1fr!important}
.ipad.is-narrow .ipad-divider{display:none}
.ipad.is-narrow[data-focus="0"] .ipad-ws,.ipad.is-narrow[data-focus="1"] .ipad-file,.ipad.is-narrow[data-focus="2"] .ipad-file{display:none}
.ipad.is-narrow[data-focus="1"] .ipad-ws.has-pane2>.ws-pane2{display:none}
.ipad.is-narrow[data-focus="1"] .ipad-ws.has-pane2,.ipad.is-narrow[data-focus="2"] .ipad-ws.has-pane2{grid-template-rows:1fr!important;grid-template-columns:1fr!important}
.ipad.is-narrow[data-focus="2"] .ipad-ws.has-pane2>:not(.ws-pane2){display:none}
.ipad.is-narrow[data-focus="2"] .ipad-ws.has-pane2>.ws-pane2{grid-row:1;grid-column:1}
.ipad-sidebar__sheethead{display:none}
.ipad-sidebar.is-sheet{position:absolute;inset:0;z-index:60;border-right:0}
.ipad-sidebar.is-sheet .ipad-sidebar__sheethead{display:flex;justify-content:flex-end}
.ipad-sidebar.is-sheet .ios-segmented{display:none}
.ipad.is-narrow .ipad-bar{gap:6px;padding:6px}
.ipad.is-narrow .ipad-focus{min-width:0;flex:1 1 auto;max-width:220px}
.ipad.is-narrow .ipad-cap--tools{margin-left:0}
.ipad.is-narrow .ipad-hint{white-space:normal;width:max-content;max-width:calc(100% - 32px);text-align:center}
/* iOS alert in the top layer, so it also sits over the sticky editor and paper sheets */
dialog.core-alert{position:fixed;inset:0;margin:auto;height:fit-content;padding:0;border:0;background:none;overflow:visible;transform:none}
dialog.core-alert::backdrop{background:rgba(0,0,0,.2)}
.ios-sheet--typed{width:min(540px,calc(100vw - 32px))}
.ios-sheet--typed .ios-segmented{margin:14px 20px 0}
.typed-editor{display:block;box-sizing:border-box;width:calc(100% - 40px);height:180px;margin:14px 20px 20px;padding:8px;border:0;border-radius:10px;background:var(--sys-fill-4);color:var(--sys-label);font:17px var(--font-ui);resize:none}
.img-sheet{position:relative}
.page-num{position:absolute;top:10px;right:10px;z-index:2;min-width:24px;height:20px;padding:0 4px;box-sizing:border-box;border-radius:4px;background:rgba(255,255,255,.72);color:rgba(0,0,0,.45);font:500 12px/20px var(--font-ui);font-variant-numeric:tabular-nums;text-align:center;pointer-events:none;user-select:none}
.qn-strip__wrap{flex:1;min-width:0;display:flex}
.qn-strip__wrap .qn-strip__btn{flex:1;min-width:0;display:flex;align-items:center;gap:8px}
.qn-strip__text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
.clip-box.is-done{background:rgba(10,87,209,.12)}

/* Home parity (round 5): launch cover, pushed Project overview, inset grouped sheets, Library organizer,
   alerts and menus as UIKit draws them, Welcome, Feedback. Overlays stack: overview 30, modal sheets 60,
   Welcome 70, alerts 80, menus 85, the launch cover 100. */
.launch-cover{position:absolute;inset:0;z-index:100;container-type:size;overflow:hidden}
.launch-cover__half{position:absolute;top:0;bottom:0;width:50%;overflow:hidden;background:#101A3D}
.launch-cover__half--left{left:0}.launch-cover__half--right{right:0}
.launch-cover__brand{position:absolute;top:0;bottom:0;left:0;width:100cqw;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;transform:translateY(-8px);font-family:var(--font-ui)}
.launch-cover__half--right .launch-cover__brand{left:auto;right:0}
.launch-cover__mark{position:relative;display:block;width:min(max(46cqw,152px),232px,calc((100cqh - 32px) * .4));aspect-ratio:1}
.launch-cover__glow{position:absolute;inset:-65%;border-radius:50%;background:radial-gradient(circle closest-side,rgba(255,199,89,.2),rgba(255,199,89,0))}
.launch-cover__logo{position:relative;display:block;width:100%;height:100%;border-radius:22%;animation:lc-logo .4s ease-out both}
.launch-cover__title{margin:0;font:700 min(max(15.5cqw,52px),76px,calc((100cqh - 32px) * .17))/1.1 var(--font-ui);letter-spacing:0;color:#fff;white-space:nowrap;animation:lc-fade .4s ease-out both}
.launch-cover__note{color:#FFD16B}
.launch-cover__greeting{margin:0;width:min(620px,calc(100cqw - 48px));text-align:center;font:500 23px/1.25 var(--font-ui);color:rgba(255,255,255,.82);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;animation:lc-fade .4s ease-out both}
@container (max-width:599px){.launch-cover__greeting{font-size:19px}}
@container (max-height:392px){.launch-cover__brand{gap:12px}}
@keyframes lc-logo{from{opacity:.25;transform:scale(.96)}}
@keyframes lc-fade{from{opacity:0}}
.launch-cover.is-exiting .launch-cover__half{transition:transform .6s ease-in-out}
.launch-cover.is-exiting .launch-cover__half--left{transform:translateX(calc(-100% - 1px))}
.launch-cover.is-exiting .launch-cover__half--right{transform:translateX(calc(100% + 1px))}
.launch-cover.is-fading{transition:opacity .25s ease-in-out;opacity:0}
@media (prefers-reduced-motion:reduce){.launch-cover__logo,.launch-cover__title,.launch-cover__greeting{animation:none}}

/* Alerts and action sheets */
#home-scrim{z-index:79}
.home-action{z-index:80}
.home-action__head{padding:16px 16px 12px}
.home-action__head .home-action__title{padding:0 0 2px}.home-action__head .home-action__msg{padding:2px 0 0}
.home-action__btns{display:flex;flex-direction:column}
.home-action__btn:disabled{color:var(--sys-label-3);cursor:default}
.home-action--alert{width:300px}
.home-action--alert .home-action__head{padding:20px 16px 16px}
.home-action--alert .home-action__title{font:600 17px var(--font-ui);color:var(--sys-label)}
.home-action--alert .home-action__msg{font:13px/1.35 var(--font-ui);color:var(--sys-label)}
.home-action--alert .home-action__btn--cancel{font-weight:400}
.home-action--alert .home-action__btn--bold{font-weight:600}
.home-action__btns--row{flex-direction:row}
.home-action__btns--row .home-action__btn{flex:1;min-width:0}
.home-action__btns--row .home-action__btn+.home-action__btn{border-left:.5px solid var(--sys-separator)}
.home-action--popover .home-action__btns{gap:10px}
.home-action--popover .home-action__head{padding:18px 0 4px}
.home-action--popover .home-action__head .home-action__title{padding:0;font:600 15px var(--font-ui);color:var(--sys-label-2)}
.home-action--popover .home-action__msg{padding:2px 0 0;color:var(--sys-label-2)}
.home-action--popover .home-action__btn--danger{color:var(--sys-red)}
.home-action--sheet .home-action__card{max-height:min(640px,calc(100cqh - 24px));overflow:auto}
.home.is-narrow .home-action--sheet,#core-app.is-narrow .home-action--sheet{top:auto;bottom:12px;transform:translateX(-50%);width:calc(100% - 16px);max-width:420px}
.home-menu-catcher{position:absolute;inset:0;z-index:84}
.home-menu{position:absolute;z-index:85;top:0;right:auto;min-width:250px;max-width:320px}
.home-menu .ios-menu__item--danger .ios-menu__trail{color:currentColor}
.home-menu .ios-menu__text{white-space:normal}
.home-menu__back{color:var(--sys-label-2)}
.home-menu__backicon{width:16px;height:16px}
.home-row,.home-row--project,.ios-row,.org-item,.home-card{-webkit-touch-callout:none}
.home-row,.home-row--project,.ios-row,.org-item{-webkit-user-select:none;user-select:none}
.is-lifted{position:relative;z-index:86;transform:scale(1.02);border-radius:12px;background:var(--sys-grouped-2);box-shadow:0 10px 32px rgba(0,0,0,.2);transition:transform .15s}
button.home-row--project{width:100%;border:0;background:none;font:inherit;text-align:left;cursor:pointer}

/* Inset grouped tables (sheets and the Project overview) */
.ios-modal__scroll{flex:1;min-height:0;overflow:auto;padding:4px 20px 24px}
.ios-modal--form{width:min(560px,92%);height:min(680px,88%)}
.ios-modal--plain{background:var(--sys-bg)}
.ios-modal--org{width:min(820px,94%);height:min(720px,90%)}
.home.is-narrow .ios-modal--sheet{left:0;right:0;top:auto;bottom:0;width:100%;height:calc(100% - 10px);transform:none;border-radius:14px 14px 0 0}
.ios-modal__icon:disabled{color:var(--sys-label-3);cursor:default}
.ios-group__head{margin:18px 16px 7px;font:13px var(--font-ui);color:var(--sys-label-2);text-transform:uppercase}
.ios-group{border-radius:12px;background:var(--sys-grouped-2);overflow:hidden}
.ios-group__foot{margin:7px 16px 0;font:13px/1.35 var(--font-ui);color:var(--sys-label-2)}
.ios-row{position:relative;display:flex;align-items:center}
.ios-row+.ios-row::before{content:"";position:absolute;top:0;left:56px;right:0;height:.5px;background:var(--sys-separator)}
.ios-row__main{flex:1;min-width:0;display:flex;align-items:center;gap:16px;min-height:44px;padding:11px 16px;border:0;background:none;text-align:left;font:17px/1.3 var(--font-ui);color:var(--sys-label)}
button.ios-row__main{cursor:pointer}
button.ios-row__main:active{background:var(--sys-fill-3)}
.ios-row__icon{width:24px;flex:none;display:grid;place-items:center;color:var(--sys-accent)}
.ios-row__text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;overflow-wrap:anywhere}
.ios-row__text small{font:15px/1.3 var(--font-ui);color:var(--sys-label-2)}
.ios-row__title.is-danger{color:var(--sys-red)}.ios-row__title.is-tint{color:var(--sys-accent)}
.ios-row__check{width:20px;height:20px;color:var(--sys-accent)}
.ios-row__chev{width:14px;height:14px;color:var(--sys-label-3)}
.ios-row__more{flex:none;width:44px;height:44px;margin-right:4px;border:0;background:none;color:var(--sys-accent);display:grid;place-items:center;cursor:pointer}
.ios-row__swatch{display:block;width:22px;height:22px;border-radius:50%}
.qn-editor__color,.usage-color{position:absolute;width:1px;height:1px;padding:0;border:0;opacity:0;pointer-events:none}
[data-q="color"]{position:relative}
.ios-modal--qn .qn-editor__body{height:120px}

/* Project overview: pushed in the navigation stack (back, title, Share / Import files / Rename project, a prompt) */
.home-push{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;background:var(--sys-grouped);color:var(--sys-label);font-family:var(--font-ui)}
.home-push.is-entering{animation:hp-in .35s cubic-bezier(.2,.8,.2,1)}
.home-push.is-leaving{transition:transform .3s ease-in;transform:translateX(100%)}
@keyframes hp-in{from{transform:translateX(100%)}}
.home-push__bar{padding:6px 10px 4px}
.home-push__prompt{margin:0;padding:4px 16px 2px;text-align:center;font:13px/1.3 var(--font-ui);color:var(--sys-label-2)}
.home-push__prompt[hidden]{display:none}
.home-push__row{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px;min-height:56px}
.home-push__back{justify-self:start;display:flex;align-items:center;gap:2px;max-width:100%;height:44px;padding:0 14px 0 8px;border:0;border-radius:22px;background:var(--sys-grouped-2);box-shadow:0 2px 10px rgba(0,0,0,.08);color:var(--sys-label);font:17px var(--font-ui);cursor:pointer}
.home-push__back span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-push__back .i{width:20px;height:20px}
.home-push__title{min-width:0;margin:0;font:600 17px var(--font-ui);letter-spacing:0;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-push__actions{justify-self:end;display:flex;align-items:center;height:44px;padding:0 4px;border-radius:22px;background:var(--sys-grouped-2);box-shadow:0 2px 10px rgba(0,0,0,.08)}
.home-push__btn{height:44px;padding:0 10px;border:0;background:none;color:var(--sys-label);font:17px var(--font-ui);white-space:nowrap;cursor:pointer}
.home-push__icon{width:40px;height:44px;border:0;background:none;color:var(--sys-label);display:grid;place-items:center;cursor:pointer}
.home-push__btn:disabled,.home-push__icon:disabled{color:var(--sys-label-3);cursor:default}
.home-push__body{flex:1;min-height:0;overflow:auto;padding:0 max(20px,calc((100% - 760px) / 2)) 32px}
.home.is-narrow .home-push__row{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"back actions" "title title"}
.home.is-narrow .home-push__back{grid-area:back;max-width:120px}.home.is-narrow .home-push__actions{grid-area:actions;justify-self:end}
.home.is-narrow .home-push__title{grid-area:title;padding:2px 0 4px}
.home.is-narrow .home-push__btn{padding:0 7px;font-size:15px}

/* Library organizer (page sheet): Up, title, Folder / Select / Done; search; All / Starred / Archived; list or tiles; toolbar */
.ios-modal--org .ios-modal__bar{grid-template-columns:auto 1fr auto}
.org-title{text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.org-search{display:flex;align-items:center;gap:6px;height:36px;margin:0 16px;padding:0 10px;border-radius:10px;background:var(--sys-fill-3);color:var(--sys-label-2)}
.org-search input{flex:1;min-width:0;border:0;background:none;font:17px var(--font-ui);color:var(--sys-label);outline:0}
.org-filter{margin:8px 16px 4px;height:36px}
.org-list.ios-modal__scroll{padding:8px 16px}
.org-rows{border-radius:12px;background:var(--sys-grouped-2);overflow:hidden}
.org-item{position:relative;display:flex;align-items:center}
.org-rows .org-item+.org-item::before{content:"";position:absolute;top:0;left:56px;right:0;height:.5px;background:var(--sys-separator)}
.org-item__main{flex:1;min-width:0;display:flex;align-items:center;gap:14px;min-height:56px;padding:8px 16px;border:0;background:none;text-align:left;font:17px/1.3 var(--font-ui);color:var(--sys-label);cursor:pointer}
.org-item__icon{width:24px;flex:none;display:grid;place-items:center;color:var(--sys-accent)}
.org-item__text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;overflow-wrap:anywhere}
.org-item__text small{font:15px/1.3 var(--font-ui);color:var(--sys-label-2)}
.org-item__chev{width:14px;height:14px;color:var(--sys-label-3)}
.org-item__more{flex:none;width:44px;height:44px;border:0;background:none;color:var(--sys-accent);display:grid;place-items:center;cursor:pointer}
.org-item__check{display:none;flex:none;width:22px;height:22px;border-radius:50%;border:1.5px solid var(--sys-label-3)}
.org-list.is-selecting .org-item__check{display:block}
.org-item.is-selected .org-item__check{border-color:var(--sys-accent);background:var(--sys-accent)}
.org-rows .org-item.is-selected{background:var(--sys-fill-4)}
.org-item.is-drop{box-shadow:inset 0 0 0 2px var(--sys-accent);background:var(--sys-accent-wash)}
.org-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(218px,calc(50% - 6px)),1fr));gap:12px}
.org-tiles .org-item{height:188px;align-items:stretch;border-radius:14px;background:var(--sys-grouped-2);overflow:hidden}
.org-tiles .org-item__main{flex-direction:column;align-items:flex-start;gap:8px;padding:16px}
.org-tiles .org-item__icon{width:auto;height:64px}.org-tiles .org-item__icon .i{width:56px;height:56px}
.org-tiles .org-item__title{font:600 17px/1.25 var(--font-ui);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.org-tiles .org-item__text small{font:12px/1.3 var(--font-ui);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.org-tiles .org-item__chev{display:none}
.org-tiles .org-item__check{position:absolute;top:12px;right:12px}
.org-tiles .org-item.is-selected{box-shadow:0 0 0 2px var(--sys-accent)}
.org-tiles .org-item__more{position:absolute;top:4px;right:4px}
.org-status{margin:0;padding:4px 20px;min-height:18px;font:13px var(--font-ui);color:var(--sys-label-2)}
.org-toolbar{display:flex;align-items:center;gap:2px;padding:4px 10px 10px;border-top:.5px solid var(--sys-separator)}
.org-toolbar__flex{flex:1}

/* Welcome / sign-in (HomeController.swift:7-48) */
.home-welcome{position:absolute;inset:0;z-index:70;overflow:auto;display:flex;align-items:center;justify-content:center;padding:24px 20px;background:var(--sys-grouped);font-family:var(--font-ui);color:var(--sys-label)}
.home-welcome__card{display:flex;flex-direction:column;gap:18px;width:100%;max-width:560px;margin:auto;padding:28px 28px 24px;border-radius:24px;background:var(--sys-grouped-2)}
.home-welcome__id{display:flex;align-items:center;gap:10px;font:20px var(--font-ui)}
.home-welcome__id .i{width:28px;height:32px;color:var(--sys-accent)}
.home-welcome h1{margin:0;font:600 34px/1.15 var(--font-ui);letter-spacing:0}
.home-welcome__detail{margin:0;font:17px/1.35 var(--font-ui);color:var(--sys-label-2)}
.home-welcome__art{display:block;width:100%;height:144px}
.home-welcome__art .w-bg{fill:var(--sys-grouped)}
.home-welcome__art .w-card{fill:var(--sys-grouped-2);stroke:var(--sys-separator);stroke-width:1}
.home-welcome__art .w-hl{fill:var(--sys-accent-wash)}
.home-welcome__art .w-line{fill:none;stroke:var(--sys-label-2);stroke-opacity:.6;stroke-width:3;stroke-linecap:round}
.home-welcome__art .w-link{fill:none;stroke:var(--sys-accent);stroke-width:2}
.home-welcome__art .w-dot{fill:var(--sys-accent)}
.home-welcome__actions{display:flex;flex-direction:column;gap:6px}
.home-welcome__actions button{border:0;background:none;color:var(--sys-accent);font:17px var(--font-ui);cursor:pointer}
.home-welcome__google{min-height:48px}.home-welcome__email{min-height:44px}
.home-welcome__actions .home-welcome__create{min-height:52px;border-radius:10px;background:var(--sys-accent);color:var(--sys-on-accent)}
.home-welcome__actions button:disabled{opacity:.5;cursor:default}
.home-welcome__status{margin:0;text-align:center;font:13px/1.35 var(--font-ui);color:var(--sys-label-2)}

/* Feedback & requests (FeedbackController.swift) */
.fb-form{display:flex;flex-direction:column;gap:16px;padding:12px 0}
.fb-form p{margin:0;font:17px/1.35 var(--font-ui)}
.fb-subject{width:100%;box-sizing:border-box;border-radius:8px}
.fb-message{min-height:180px;padding:8px;border:0;border-radius:10px;background:var(--sys-bg-2);font:17px var(--font-ui);color:var(--sys-label);resize:vertical}
.fb-form .fb-status{font:13px/1.35 var(--font-ui)}
.fb-send{min-height:44px;border:0;border-radius:10px;background:var(--sys-feedback);color:#fff;font:17px var(--font-ui);cursor:pointer}
.fb-copy{min-height:44px;border:0;background:none;color:var(--sys-accent);font:17px var(--font-ui);cursor:pointer}
#home-scrim.is-clear{background:none}
/* Dark: sheets, alerts, popovers and menus use the elevated surfaces, as UIKit does */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .ios-modal--sheet{--sys-grouped:#1C1C1E;--sys-grouped-2:#2C2C2E;--sys-bg:#1C1C1E}
  :root:not([data-theme="light"]) .home-action__card,:root:not([data-theme="light"]) .home-menu{background:color-mix(in srgb,#2C2C2E 94%,transparent)}
  :root:not([data-theme="light"]) .home-sheet-scrim{background:rgba(0,0,0,.45)}
}
:root[data-theme="dark"] .ios-modal--sheet{--sys-grouped:#1C1C1E;--sys-grouped-2:#2C2C2E;--sys-bg:#1C1C1E}
:root[data-theme="dark"] .home-action__card,:root[data-theme="dark"] .home-menu{background:color-mix(in srgb,#2C2C2E 94%,transparent)}
:root[data-theme="dark"] .home-sheet-scrim{background:rgba(0,0,0,.45)}
#home-scrim.is-clear{background:none}
.ios-modal--qn .qn-editor__canvas{background:var(--sys-bg)}
.home-search{min-width:0}.home-search input{min-width:0;width:100%}.home-pill{flex:none}
.is-lifted{z-index:83}
/* iPhone pane header (SourceReaderController.swift:352-370): 36 pt row, 4 pt spacing, radius 10, secondary background at .92 */
.pane-head{display:flex;align-items:center;gap:4px;height:36px;margin:8px 8px 4px;padding:0 4px;border-radius:10px;background:color-mix(in srgb,var(--sys-bg-2) 92%,transparent)}
.pane-head[hidden]{display:none}
.pane-head__grip{width:28px;display:grid;place-items:center;color:var(--sys-label-2)}
.pane-head__btn{height:36px;border:0;background:none;color:var(--sys-accent);font:15px var(--font-ui);cursor:pointer;padding:0}
.pane-head__src{flex:1;min-width:0;display:flex}
.pane-head__title{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pane-head__page{width:60px;font:12px var(--font-mono,ui-monospace,monospace);font-variant-numeric:tabular-nums}
.pane-head__icon{width:36px;display:grid;place-items:center}
.pane-head__btn:disabled{color:var(--sys-label-3)}
.core-float-menu{position:absolute;z-index:70}
.ios-sheet--bookmarks{width:min(560px,calc(100vw - 16px));height:min(640px,86vh);background:var(--sys-grouped)}
.bm-sheet__list{display:flex;flex-direction:column;margin:16px;border-radius:10px;overflow:hidden;background:var(--sys-grouped-2)}
.bm-sheet__row{min-height:44px;padding:0 16px;border:0;border-bottom:.5px solid var(--sys-separator);background:none;color:var(--sys-label);font:17px var(--font-ui);text-align:left;cursor:pointer}
.bm-sheet__empty{margin:40px 16px;text-align:center;white-space:pre-line;color:var(--sys-label);font:17px var(--font-ui)}
/* Enlarge source · restore layout (WorkbenchController.swift:579-587) */
.ipad.is-enlarged .ipad-ws,.ipad.is-enlarged .ipad-divider{display:none}
.ipad.is-enlarged .ipad-split{grid-template-columns:1fr!important}.ipad.is-enlarged.has-sidebar .ipad-split{grid-template-columns:280px 1fr!important}
.home-push.is-leaving{pointer-events:none}
.ipad.is-pdf-only .ipad-ws,.ipad.is-pdf-only .ipad-divider{display:none!important}
.ipad.is-pdf-only .ipad-file{display:flex!important}
/* Grouped-list sheets (Import into project, Export PDFs) */
.ios-sheet--list{width:min(600px,calc(100vw - 16px));height:min(620px,88vh);background:var(--sys-grouped);display:none;flex-direction:column}
.ios-sheet--list[open]{display:flex}
.list-sheet__head{text-align:center}.list-sheet__head h2{margin:0}
.list-sheet__prompt{margin:0 0 2px;font:13px var(--font-ui);color:var(--sys-label-2)}
.list-sheet__body{flex:1;overflow:auto;padding:8px 16px 16px;display:flex;flex-direction:column}
.list-sheet__header{margin:16px 16px 6px;font:13px var(--font-ui);text-transform:uppercase;color:var(--sys-label-2)}
.list-sheet__footer{margin:6px 16px 0;font:13px var(--font-ui);color:var(--sys-label-2)}
.list-sheet__group{margin-top:12px;border-radius:10px;overflow:hidden;background:var(--sys-grouped-2)}
.list-sheet__row{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:8px 16px;border:0;border-bottom:.5px solid var(--sys-separator);background:none;color:var(--sys-label);font:17px var(--font-ui);text-align:left;cursor:pointer}
.list-sheet__row:last-child{border-bottom:0}
.list-sheet__icon{width:22px;height:22px;color:var(--sys-accent);flex:none}
.list-sheet__text{flex:1;min-width:0;display:flex;flex-direction:column}.list-sheet__text small{font:13px var(--font-ui);color:var(--sys-label-2);margin-top:2px}
.list-sheet__acc{display:flex;align-items:center;gap:10px;flex:none}
.list-sheet__chev{width:14px;height:14px;color:var(--sys-label-3)}.list-sheet__check{width:18px;height:18px;color:var(--sys-accent)}
.list-sheet__order{display:flex;align-items:center;gap:10px}.list-sheet__order b{font:600 16px var(--font-ui);font-variant-numeric:tabular-nums;color:var(--sys-accent)}
.list-sheet__order .i{width:24px;height:24px;color:var(--sys-label-2)}.list-sheet__order .i.is-on{color:var(--sys-accent)}
.list-sheet__intro{margin:8px 0 0;font:17px var(--font-ui);color:var(--sys-label)}
.list-sheet__foot{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.list-sheet__summary{margin:0;font:15px var(--font-ui);color:var(--sys-label-2)}
.list-sheet__empty{margin:40px 0;text-align:center;color:var(--sys-label)}
.ios-filled{min-height:44px;border:0;border-radius:10px;background:var(--sys-accent);color:#fff;font:600 17px var(--font-ui);cursor:pointer}.ios-filled:disabled{opacity:.4}
.ipad-sidebar.is-sheet .ipad-sidebar__filter{display:none}
.ipad-sidebar.is-sheet .ipad-sidebar__sheethead{position:absolute;top:10px;right:12px}
.ipad-sidebar.is-sheet .ipad-sidebar__title{text-align:center;font-size:17px}
.passage-ghost{position:absolute;z-index:80;max-width:260px;padding:8px 10px;border-radius:10px;background:var(--sys-bg);box-shadow:0 6px 20px rgba(0,0,0,.2);font:13px var(--font-ui);color:var(--sys-label);pointer-events:none;opacity:.92}
/* Rails show only while fingers draw (DrawingInputPolicy; SourceReaderController.swift:400-416, WorkspaceController.swift:405-423) */
.ipad:not(.draws-with-finger) .nav-rail{display:none}
.ipad.draws-with-finger .nav-rail--leading{pointer-events:auto;cursor:ns-resize;touch-action:none}
.nav-rail.is-dragging .nav-rail__thumb{background:var(--sys-accent)}
/* Sticky slot magnified preview (StickyNoteMagnifiedPaperView): 156×126, 18 pt folded corner, shadow r10 .2 */
.sticky-preview{position:absolute;z-index:65;width:156px;height:126px;filter:drop-shadow(0 5px 10px rgba(0,0,0,.2));pointer-events:none}
.sticky-preview__paper{width:100%;height:100%;box-sizing:border-box;padding:10px 12px;background:var(--fill,#fbe7b5);clip-path:polygon(0 0,calc(100% - 18px) 0,100% 18px,100% calc(100% - 2px),0 100%)}
.sticky-preview[hidden]{display:none}
.sticky-preview b{display:block;height:20px;font:600 13px/20px var(--font-ui);color:#333}
.sticky-preview p{margin:6px 0 0;width:132px;font:13px/19.5px var(--font-ui);color:#3b3b3b;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
@media (prefers-reduced-motion:reduce){.sticky-slot:hover{transform:none}.sticky-slot:active{opacity:.78}}
/* Reader annotations from the core (state.sourceAnnotations): SVG in page points over each page */
.pdf-sheet > .pdf-marks{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1;overflow:visible}
.pdf-sheet > .page-sticky{z-index:2}
.pdf-mark-text__body{box-sizing:border-box;width:100%;height:100%;padding:1px 2px;overflow:hidden;font:13px/1.2 -apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",system-ui,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere}
.nav-rail__density{position:absolute;left:14px;width:6px;border-radius:2px;background:var(--sys-accent);opacity:.12;transition:opacity .15s}
.nav-rail.is-revealed .nav-rail__density{opacity:.55}
/* PDF modes from Source tools › Annotate: Rectangle, Ellipse, Arrow, PDF text; Hand scrolls the pages */
.ipad[data-source-mode] .file-body .pdf-sheet{cursor:crosshair;touch-action:none;-webkit-user-select:none;user-select:none}
.ipad[data-tool="hand"]:not([data-source-mode]) .file-body .pdf-sheet{cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none}
/* Source comment draft (SourceCommentOverlay): bottom-trailing, ≤ 300 wide, radius 14 */
.source-comment{position:absolute;right:12px;bottom:12px;z-index:7;box-sizing:border-box;width:min(300px,calc(100% - 24px));display:flex;flex-direction:column;gap:6px;padding:12px;border:1px solid var(--sys-separator);border-radius:14px;background:var(--sys-bg-2);color:var(--sys-label);cursor:grab;touch-action:none}
.source-comment__hint{margin:0;font:12px var(--font-ui);color:var(--sys-label-2);-webkit-user-select:none;user-select:none}
.source-comment__text{box-sizing:border-box;height:100px;resize:none;border:0;padding:0;background:transparent;color:var(--sys-label);font:17px var(--font-ui);cursor:text;outline:none}
.source-comment__row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.source-comment__row .ios-link-btn{min-height:32px;padding:0}
.source-comment__close{display:grid;place-items:center;width:32px;height:32px;border:0;padding:0;background:none;color:var(--sys-accent);cursor:pointer}
.source-comment__close .i{width:16px;height:16px}
/* Passage tags sheet: the remove control stands in for the swipe */
.list-sheet__remove{font:15px var(--font-ui);color:var(--sys-red);cursor:pointer;padding:4px 0}
.ipad.is-phone .page-num{display:none}
/* Hide top toolbar also hides the pane chrome (WorkbenchController.swift:124-130; SourceReaderController.setChromeHidden) */
.ipad.is-chrome-hidden .pane-head,.ipad.is-chrome-hidden .qn-strip,.ipad.is-chrome-hidden .sticky-slots{display:none}
/* ---------- Round 2 on the core: folded reading, Organize pages, Compare, Focus, documents ---------- */
.i-sf-rotate-right{--i:url("/design/icons/sf-rotate-right.svg")}.i-sf-number{--i:url("/design/icons/sf-number.svg")}.i-sf-arrow-left{--i:url("/design/icons/sf-arrow-left.svg")}.i-sf-arrow-right{--i:url("/design/icons/sf-arrow-right.svg")}.i-sf-doc-badge-arrow-up{--i:url("/design/icons/sf-doc-badge-arrow-up.svg")}.i-sf-pencil-tip-crop-circle{--i:url("/design/icons/sf-pencil-tip-crop-circle.svg")}.i-sf-circle{--i:url("/design/icons/sf-circle.svg")}.i-sf-checkmark-circle-fill{--i:url("/design/icons/sf-checkmark-circle-fill.svg")}.i-sf-chevron-up-circle-fill{--i:url("/design/icons/sf-chevron-up-circle-fill.svg")}.i-sf-exclamationmark-triangle{--i:url("/design/icons/sf-exclamationmark-triangle.svg")}
/* A page turned by Organize pages › Rotate: image, text and marks turn together inside the page */
.img-sheet[data-rot] > .page-rot{position:absolute;left:50%;top:50%;width:100cqw;height:calc(100cqw * var(--ar,1.294));container-type:inline-size;transform:translate(-50%,-50%) rotate(var(--turn,0deg))}
.img-sheet[data-rot="90"] > .page-rot,.img-sheet[data-rot="270"] > .page-rot{width:calc(100cqw / var(--ar,1.294));height:100cqw}
.img-sheet[data-rot="90"]{--turn:90deg}.img-sheet[data-rot="180"]{--turn:180deg}.img-sheet[data-rot="270"]{--turn:270deg}
.page-rot .page-img,.page-rot .text-layer{position:absolute;inset:0;width:100%;height:100%}
.page-rot .text-layer{font-size:0;line-height:1;color:transparent;white-space:pre}
.page-rot .text-layer span{position:absolute;font-family:"Times New Roman",Times,serif;font-size:calc(var(--fs) * 100cqw / 612);line-height:1;white-space:pre;transform-origin:0 0;transform:scaleX(var(--sx));cursor:text}
.page-rot > .pdf-marks{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1;overflow:visible}
/* Folded reading (FoldSourceController): root stack inset 12, spacing 8; slices fill the pane at equal heights */
.ipad.has-fold .ipad-file__view > :not(.fold-view){display:none!important}
.fold-view{position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--sys-bg);color:var(--sys-label);font-family:var(--font-ui);overflow:hidden}
.fold-bar{display:flex;align-items:center;gap:10px;min-height:44px}
.fold-title{margin:0;font:600 17px var(--font-ui);letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.fold-flex{flex:1}
.fold-icon{display:grid;place-items:center;width:36px;height:36px;border:0;padding:0;background:none;color:var(--sys-accent);cursor:pointer}.fold-icon .i{width:22px;height:22px}
.fold-link{border:0;padding:0;background:none;color:var(--sys-accent);font:17px var(--font-ui);cursor:pointer;min-height:36px}.fold-link:disabled{color:var(--sys-label-3);cursor:default}.fold-link[hidden]{display:none}
.fold-context{display:flex;align-items:center;gap:8px}.fold-context span{font:12px var(--font-ui);color:var(--sys-label)}.fold-context input{flex:1;accent-color:var(--sys-accent)}
.fold-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px}
.fold-view--gathered .fold-body{overflow:auto;min-height:240px}
.fold-gap{flex:none;height:30px;min-height:30px;justify-content:center;padding:0 10px}
.fold-pane{flex:1 1 0;min-height:0;display:flex;flex-direction:column;gap:5px}
.fold-view--gathered .fold-pane{flex:none;height:280px}
.fold-pdf{flex:1;min-height:100px;overflow:auto;background:var(--sys-bg-2)}
.fold-page{position:relative;width:100%;background:#fff;container-type:inline-size;overflow:hidden}
.fold-page.is-unavailable{background:var(--sys-bg-2)}
.fold-canvas{position:absolute;inset:0;width:100%;height:100%}
.fold-page .text-layer{position:absolute;inset:0;font-size:0;line-height:1;color:transparent;white-space:pre}
.fold-page .text-layer span{position:absolute;font-family:"Times New Roman",Times,serif;font-size:calc(var(--fs) * 100cqw / var(--cw,612));line-height:1;white-space:pre;transform-origin:0 0;transform:scaleX(var(--sx));cursor:text}
.fold-page .text-layer ::selection{background:rgba(10,87,209,.3);color:transparent}
.fold-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:1}
.fold-dot{pointer-events:auto;cursor:pointer}
.fold-view[data-mode]:not([data-mode="read"]) .fold-page{cursor:crosshair;touch-action:none;-webkit-user-select:none;user-select:none}
.fold-slicebar{display:flex;align-items:center;gap:6px;flex:none}
.fold-label{font:12px var(--font-ui);color:var(--sys-label);font-variant-numeric:tabular-nums}
.fold-handle{flex:1;min-width:40px;accent-color:var(--sys-accent)}
.fold-slicebar .ios-tinted{min-height:30px;padding:4px 10px}
.ios-sheet--fold{width:min(900px,calc(100vw - 16px));height:min(900px,88vh);max-height:none;background:var(--sys-bg)}
.ios-sheet--fold[open]{display:flex}
.ios-sheet--fold .fold-view{position:relative;flex:1}
/* EndpointPreviewController: inset 24, radius 16, 1 pt separator border, not interactive */
.endpoint-preview{position:absolute;inset:24px;z-index:8;display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid var(--sys-separator);border-radius:16px;background:var(--sys-bg);box-shadow:0 10px 30px rgba(0,0,0,.18);pointer-events:none;overflow:hidden}
.endpoint-preview__head{margin:0;font:600 17px var(--font-ui);color:var(--sys-label)}
.endpoint-preview__page{position:relative;width:100%;max-height:100%;background:#fff;overflow:hidden}
.endpoint-preview__page canvas,.endpoint-preview__sel{position:absolute;inset:0;width:100%;height:100%}
.endpoint-preview__idea{padding:12px;border:1px solid var(--sys-separator);border-radius:14px;background:var(--sys-grouped-2);font:17px/1.3 var(--font-ui);color:var(--sys-label);white-space:pre-wrap}
/* Large page sheets (Organize pages, Compare sources, Focus source material) */
.ios-sheet--pages,.ios-sheet--compare,.ios-sheet--focus{max-height:none;background:var(--sys-bg)}
.ios-sheet--pages[open],.ios-sheet--compare[open],.ios-sheet--focus[open]{display:flex;flex-direction:column}
.ios-sheet--pages{width:min(850px,calc(100vw - 16px));height:min(760px,92vh)}
.ios-sheet--compare{width:min(1100px,calc(100vw - 16px));height:min(900px,92vh)}
.ios-sheet--focus{width:min(720px,calc(100vw - 16px));height:min(900px,92vh)}
.ios-sheet .sheet-left,.ios-sheet .sheet-right{display:flex;min-width:44px}.ios-sheet .sheet-right{justify-content:flex-end}
.ios-pill:disabled{color:var(--sys-label-3);cursor:default}
.sheet-body{flex:1;min-height:0;display:flex;flex-direction:column}
.ios-sheet .core-status{z-index:9}
/* Organize pages (PageEditorController): title, "n pages · k selected", four tinted actions, the page grid, the status */
.pages-body{gap:10px;padding:12px 14px 8px}
.pages-title{margin:0;font:600 17px var(--font-ui);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pages-selection{display:flex;align-items:center;gap:12px}
.pages-count{flex:1;min-width:0;font:15px var(--font-ui);color:var(--sys-label-2)}
.pages-all{min-height:32px;padding:0 4px}
.pages-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.pages-actions .menu-wrap{position:relative;display:block;min-width:0}
.pages-act{display:flex;align-items:center;justify-content:center;gap:5px;width:100%;min-width:0;padding:8px 5px;border:0;border-radius:8px;background:var(--sys-accent-wash);color:var(--sys-accent);font:13px var(--font-ui);cursor:pointer}
.pages-act .i{width:15px;height:15px}.pages-act .btn-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pages-act--danger{color:var(--sys-red);background:color-mix(in srgb,var(--sys-red) 15%,transparent)}
.pages-act:disabled{color:var(--sys-label-3);background:var(--sys-fill-4);cursor:default}
.pages-grid{position:relative;flex:1;min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(var(--cols,2),minmax(0,1fr));grid-auto-rows:var(--tile-h,221px);gap:12px;align-content:start;padding:8px 4px 16px;border-radius:12px;background:var(--sys-grouped)}
.pages-tile{position:relative;box-sizing:border-box;display:flex;flex-direction:column;gap:4px;padding:10px;border-radius:12px;background:var(--sys-grouped-2);cursor:pointer;touch-action:pan-y;-webkit-user-select:none;user-select:none;outline-offset:2px}
.pages-tile[aria-selected="true"]{box-shadow:inset 0 0 0 2px var(--sys-accent)}
.pages-tile__img{flex:1;min-height:0;display:grid;place-items:center}
.pages-tile__img canvas{max-width:100%;max-height:100%;box-shadow:0 0 0 .5px var(--sys-separator)}
.pages-tile__warn{width:28px;height:28px;color:var(--sys-label-3)}
.pages-tile__cap{font:12px var(--font-ui);text-align:center;color:var(--sys-label)}
.pages-tile__prov{font:11px var(--font-ui);text-align:center;color:var(--sys-label-2)}
.pages-tile__check{position:absolute;top:7px;right:7px;width:22px;height:22px;color:var(--sys-accent)}
.pages-ghost{position:absolute;z-index:10;padding:6px 10px;border-radius:10px;background:var(--sys-bg);box-shadow:0 6px 20px rgba(0,0,0,.2);font:13px var(--font-ui);color:var(--sys-label);pointer-events:none}
.pages-drop{position:absolute;width:3px;border-radius:2px;background:var(--sys-accent);pointer-events:none}
.pages-status{margin:0;font:12px var(--font-ui);color:var(--sys-label-2)}
/* Compare sources: two equal panes, each a source menu, Collect selection, Show in reader and a PDF */
.compare-body{flex-direction:row;gap:8px;padding:8px}
.compare-pane{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:8px}
.compare-pane .menu-wrap{position:relative;display:block}
.compare-select{width:100%;min-height:34px;border:0;background:none;color:var(--sys-accent);font:17px var(--font-ui);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.compare-btn{justify-content:center}
.compare-pdf{position:relative;flex:1;min-height:0}
.compare-pdf__scroll.ipad-pdf{padding:0;background:var(--sys-bg-2)}
/* Focus source material (ContextReadingController) */
.focus-body{gap:10px;padding:12px}
.focus-hint{margin:0;font:12px var(--font-ui);color:var(--sys-label)}
.focus-context{width:100%;accent-color:var(--sys-accent)}
.focus-range{display:flex;align-items:center;gap:8px}
.focus-num{width:70px;box-sizing:border-box;text-align:center}
.focus-scroll{flex:1;min-height:0;overflow:auto}
.focus-paper{display:flex;flex-direction:column;gap:16px;padding:10px}
.focus-row{display:flex;flex-direction:column;gap:6px}
.focus-btn{justify-content:center}
.focus-strip{display:block;width:100%;height:auto;background:#fff}
.focus-empty{margin:0;font:17px var(--font-ui);color:var(--sys-label)}
/* Documents sidebar: folders, an open file's page list, the pinned close header */
.side-row--page{padding-left:30px}
.side-row__thumb{flex:none;max-width:82px;max-height:108px;width:auto;height:auto;background:#fff;box-shadow:0 0 0 .5px var(--sys-separator)}
.side-row__check{width:16px;height:16px;color:var(--sys-accent)!important}
.side-row__chev{width:13px;height:13px;color:var(--sys-label-3)!important}
.side-pinned{position:sticky;top:0;z-index:3;flex:none;display:flex;align-items:center;gap:8px;height:68px;margin-bottom:-78px;padding:10px 12px;border:0;border-radius:12px;background:var(--sys-grouped-2);box-shadow:0 4px 14px rgba(0,0,0,.12);color:var(--sys-label);text-align:left;cursor:pointer}
.side-pinned[hidden]{display:none}
.side-pinned__text{flex:1;min-width:0;display:flex;flex-direction:column}.side-pinned__text>span{font:17px var(--font-ui);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.side-pinned__text small{font:15px var(--font-ui);color:var(--sys-label-2)}
.side-pinned .i{width:22px;height:22px;color:var(--sys-accent)}
/* Pasted source links in a note (NativeNoteText: systemBlue) */
.note-citation{color:#007AFF}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .note-citation{color:#0A84FF}}
:root[data-theme="dark"] .note-citation{color:#0A84FF}
@media (max-width:600px){.compare-body{gap:6px;padding:6px}.compare-select{font-size:15px}}
.ipad-sidebar__list,.ipad-sidebar > *{flex-shrink:0} /* a long document list scrolls the sidebar instead of clipping */
/* Home round 3 */
/* Previews (HomeController.swift:221-245, 440-470): the file's first visible page. Cards: the top 360 x 242 of the
   page on white, aspect fill in a 120 pt image view; rows: the whole page, aspect fit in 34 x 40. Both on the Home
   background; a page turned 90 or 270 degrees is drawn landscape. */
.home-page{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;background:var(--sys-grouped)}
.home-page__frame{position:relative;display:block;flex:none;overflow:hidden;background:#fff}
.home-page__sheet{position:relative;display:block;width:100%;aspect-ratio:1700/2200;background:#fff}
.home-page__sheet img{display:block;width:100%;height:100%;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
.home-page.is-rot180 .home-page__sheet img{transform:rotate(180deg)}
.home-page.is-rot90 .home-page__sheet,.home-page.is-rot270 .home-page__sheet{aspect-ratio:2200/1700}
.home-page.is-rot90 .home-page__sheet img,.home-page.is-rot270 .home-page__sheet img{position:absolute;left:50%;top:50%;width:77.2727%;height:auto;transform:translate(-50%,-50%) rotate(90deg)}
.home-page.is-rot270 .home-page__sheet img{transform:translate(-50%,-50%) rotate(-90deg)}
.home-page--card{height:120px;flex:none}
.home-page--card .home-page__frame{width:max(100%,178.5px);aspect-ratio:360/242}
.home-page--row{width:34px;height:40px;border-radius:4px}
.home-page--row .home-page__frame{height:100%;aspect-ratio:1700/2200}
.home-page--row.is-rot90 .home-page__frame,.home-page--row.is-rot270 .home-page__frame{width:100%;height:auto;aspect-ratio:2200/1700}
.home-row__thumb:has(.home-page){box-shadow:none}
/* Demo messages where the app opens a system sheet: like the workbench's message label, near the bottom, 5 s */
.home-note{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);z-index:90;max-width:min(80%,520px);margin:0;padding:6px 10px;border-radius:8px;background:var(--sys-bg-2);color:var(--sys-label-2);font:12px/1.3 var(--font-ui);text-align:center;pointer-events:none;box-shadow:0 2px 10px rgba(0,0,0,.08)}
.home-note[hidden]{display:none}
.home-welcome .home-note{position:fixed}
/* Welcome: Export deleted-account documents, and Home replacing Welcome (setViewControllers, animated) */
.home-welcome__actions .home-welcome__export{min-height:44px}
.home-welcome__actions button[hidden]{display:none}
.home-welcome.is-leaving{z-index:1;animation:hw-leave .35s cubic-bezier(.25,.8,.25,1) both;pointer-events:none}
.home.is-arriving>.home-nav,.home.is-arriving>.home-body{position:relative;z-index:2;background:var(--sys-grouped);animation:hw-arrive .35s cubic-bezier(.25,.8,.25,1) both}
@keyframes hw-leave{to{transform:translateX(-30%);filter:brightness(.92)}}
@keyframes hw-arrive{from{transform:translateX(100%)}}
/* Home -> reader (the demo): the Workbench is pushed: it slides in from the right over Home, which moves a third left */
html.is-pushing .try-views{view-transition-name:vn-stack}
html.is-pushing::view-transition-group(root){animation:none}
html.is-pushing::view-transition-image-pair(vn-stack){overflow:hidden}
html.is-pushing::view-transition-old(vn-stack),html.is-pushing::view-transition-new(vn-stack){mix-blend-mode:normal;animation-duration:.35s;animation-timing-function:cubic-bezier(.25,.8,.25,1);animation-fill-mode:both}
html.is-pushing::view-transition-old(vn-stack){animation-name:vn-push-out}
html.is-pushing::view-transition-new(vn-stack){animation-name:vn-push-in;box-shadow:-6px 0 18px rgba(0,0,0,.12)}
@keyframes vn-push-out{to{transform:translateX(-30%);filter:brightness(.92)}}
@keyframes vn-push-in{from{transform:translateX(100%)}}
@media (prefers-reduced-motion:reduce){.home-welcome.is-leaving,.home.is-arriving>.home-nav,.home.is-arriving>.home-body{animation:none}}
/* iPadOS pointer effects with a trackpad or mouse (system defaults, no custom hover): bar buttons and sidebar
   rows highlight (a grey platter), the round bar buttons and the Continue reading cards lift */
@media (hover:hover) and (pointer:fine){
  .home-circle,.home-pill,.home-card{transition:transform .18s ease,box-shadow .18s ease}
  .home-route,.home-more,.home-link,.home-btn,.home-feedback{transition:background-color .15s ease,filter .15s ease}
  .home-circle:hover,.home-pill:hover{transform:scale(1.06);box-shadow:0 6px 18px rgba(0,0,0,.16)}
  .home-route:not([aria-pressed="true"]):hover,.home-more:hover,.home-link:hover{background:var(--sys-fill-3)}
  .home-link{border-radius:8px}.home-more{border-radius:22px}
  .home-btn:hover,.home-feedback:hover{filter:brightness(1.06)}
  .home-card:hover{transform:scale(1.03);box-shadow:0 10px 26px rgba(0,0,0,.16)}
}

/* Reader round 3 */
.i-sf-chevron-up{--i:url("/design/icons/sf-chevron-up.svg")}.i-sf-hand-draw{--i:url("/design/icons/sf-hand-draw.svg")}.i-sf-note-text-badge-plus{--i:url("/design/icons/sf-note-text-badge-plus.svg")}
.i-sf-bold{--i:url("/design/icons/sf-bold.svg")}.i-sf-italic{--i:url("/design/icons/sf-italic.svg")}.i-sf-underline{--i:url("/design/icons/sf-underline.svg")}
.ios-kb .i{width:20px;height:20px}
/* the source side: the main reader and up to 3 pinned readers, stacked or side by side (ReaderPaneStack, spacing 1) */
.ipad-file{flex-direction:column}
.ipad-file.is-split-h{flex-direction:row}
.reader-pane{position:relative;display:flex;flex-direction:column;flex:1 1 0;min-width:0;min-height:0;background:var(--sys-bg)}
.reader-pane[hidden]{display:none}
.ipad-file>.reader-pane~.reader-pane{border-top:1px solid var(--sys-separator)}
.ipad-file.is-split-h>.reader-pane~.reader-pane{border-top:0;border-left:1px solid var(--sys-separator)}
.reader-pane>.clip-bar{position:static;display:flex;flex-direction:column;gap:8px;padding:0 0 6px;border-radius:0;background:none;box-shadow:none}
.reader-pane>.clip-bar[hidden]{display:none}
.reader-pane--parallel>.pane-head{display:none}
.ipad.is-phone .reader-pane--parallel>.pane-head{display:flex}
.ipad.is-chrome-hidden .reader-pane--parallel>.pane-head,.ipad.is-chrome-hidden .reader-pane--parallel>.qn-strip{display:none}
.pane-head__title .btn-text,.pane-head__page .btn-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pane-head__close{width:36px;flex:none}
.pane-head__grip{touch-action:none;cursor:grab}
.parallel-body .pdf-sheet{-webkit-user-select:text;user-select:text}
.pane-drop-preview{position:absolute;z-index:30;background:rgba(10,132,255,.15);border:2px solid #0A84FF;pointer-events:none}
.pane-drop-preview[hidden]{display:none}
/* reader zoom: a scale factor set by a pinch (PDFView scaleFactor 0.2…6); pages narrower than the pane centre */
.ipad-pdf.is-scaled .pdf-sheet{width:var(--sheet-w)!important;min-height:0;margin-left:auto;margin-right:auto}
/* palette: the custom gamut and hue slider (DrawingToolPalette, 402 tall with them) */
.ios-palette{overflow-y:auto;box-sizing:border-box}
.ios-gamut{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.ios-gamut[hidden]{display:none}
.ios-gamut__field{display:block;width:100%;height:96px;border-radius:8px;touch-action:none;cursor:crosshair}
.ios-gamut__hue{width:100%;accent-color:var(--sys-accent)}
/* Recognized text (RecognizedTextController): guidance, then selectable text on secondary background, radius 12, insets 16/12 */
.recognized-body{display:flex;flex-direction:column;gap:12px;padding:12px 16px;min-height:0}
.recognized-guide{font:15px/1.35 var(--font-ui);color:var(--sys-label-2);margin:0}
.recognized-text{flex:1;min-height:200px;overflow:auto;white-space:pre-wrap;padding:16px 12px;border-radius:12px;background:var(--sys-bg-2);color:var(--sys-label);font:17px/1.4 var(--font-ui);-webkit-user-select:text;user-select:text}
/* the reader's sticky strip (compact): 40 pt, 6 pt apart */
.sticky-strip{display:flex;align-items:stretch;gap:6px;height:40px;overflow-x:auto;scrollbar-width:none;padding:0 8px;flex:none}
.sticky-strip[hidden]{display:none}
.sticky-tab{flex:none;border:0;border-radius:6px;background:var(--tab);color:var(--sys-accent);font:17px var(--font-ui);cursor:pointer}
.sticky-strip__icon,.sticky-strip .menu-wrap>button{flex:none;width:44px;border:0;background:none;color:var(--sys-accent);display:grid;place-items:center;cursor:pointer}
.ipad.is-compact .sticky-slots{display:none}
/* swipe to delete (UITableView trailing action) */
.swipe-row{position:relative;overflow:hidden}
.swipe-row__main{position:relative;z-index:1;width:100%;background:var(--sys-bg-2);transition:transform .2s}
.swipe-row__delete{position:absolute;top:0;right:0;bottom:0;width:88px;border:0;background:#FF3B30;color:#fff;font:17px var(--font-ui);cursor:pointer}
.swipe-row:not(.is-open) .swipe-row__delete{visibility:hidden}
/* the canvas's accessible elements: invisible, focusable */
.ws-a11y{position:absolute;inset:0;pointer-events:none;z-index:6}
.ws-a11y__el{position:absolute;padding:0;margin:0;border:0;background:none;opacity:0;pointer-events:none}
.ws-a11y__el:focus-visible{opacity:1;outline:3px solid var(--sys-accent);outline-offset:2px;border-radius:6px}
/* the paper rail: thumb (44×44) and the 16 pt edge take a press */
.nav-rail__edge,.nav-rail__grab{position:absolute;pointer-events:none;touch-action:none;cursor:ns-resize}
.nav-rail__edge{top:0;bottom:0;right:0;width:16px}
.nav-rail__grab{right:0;width:44px;height:44px}
.ipad.draws-with-finger .nav-rail--trailing .nav-rail__edge,.ipad.draws-with-finger .nav-rail--trailing .nav-rail__grab{pointer-events:auto}
.nav-rail:focus-visible{outline:2px solid var(--sys-accent);outline-offset:-2px}
/* a workspace pane that would take a dragged selection: 3 pt accent at 0.6 */
.core-surface.is-drop-target{box-shadow:inset 0 0 0 3px color-mix(in srgb,var(--sys-accent) 60%,transparent)}
/* Search on a compact width: the popover adapts to a sheet */
.ipad.is-phone .ios-search,.ipad.is-narrow .ios-search{top:10px;left:0;right:0;bottom:0;width:auto;height:auto;max-width:none;border-radius:10px 10px 0 0}
.reader-pane--parallel .pane-head>.pane-head__srcwrap{flex:1 1 auto;min-width:0}
.reader-pane--parallel .pane-head__title{max-width:100%;display:flex;min-width:0}
/* UIAlertController action sheet: a popover on iPad, a bottom sheet with Cancel apart on a compact width */
.action-sheet{position:fixed;margin:0;padding:0;border:0;width:300px;border-radius:14px;background:var(--sys-bg-2);color:var(--sys-label);box-shadow:var(--sys-shadow-pop);font-family:var(--font-ui)}
.action-sheet::backdrop{background:transparent}
.action-sheet--bottom{left:8px;right:8px;top:auto;bottom:8px;width:auto;background:none;box-shadow:none;display:flex;flex-direction:column;gap:8px}
.action-sheet--bottom::backdrop{background:rgba(0,0,0,.2)}
.action-sheet__group{display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:var(--sys-bg-2)}
.action-sheet__title{margin:0;padding:12px 16px;text-align:center;font:600 13px var(--font-ui);color:var(--sys-label-2);border-bottom:.5px solid var(--sys-separator)}
.action-sheet__btn{min-height:56px;border:0;border-bottom:.5px solid var(--sys-separator);background:none;color:var(--sys-accent);font:20px var(--font-ui);cursor:pointer}
.action-sheet__group .action-sheet__btn:last-child{border-bottom:0}
.action-sheet__cancel{border-radius:14px;background:var(--sys-bg-2);font-weight:600;border:0}
.endpoint-preview__paper{flex:1;min-height:180px;border-radius:8px;overflow:hidden;background:var(--sys-bg)}
.endpoint-preview__canvas{display:block;width:100%;height:100%;min-height:180px}
.pages-tile.is-lifted{transform:scale(1.04);box-shadow:0 8px 24px rgba(0,0,0,.2)}

/* Round 4 */
/* A Pen or Highlighter stroke from an embedded fold is drawn on the workbench link surface (the core's live trace) */
.fold-draft--routed{display:none}

/* Bug fixes: Home */
/* HB-02: a presented layer takes focus on its own container, which shows no ring */
.ios-modal:focus,.home-push:focus,.home-welcome:focus,.home-action:focus{outline:none}
/* HB-09: the Quick Note page is 1200 x 1600 at 1:1 in its own scroll view (QuickNotes.swift:77); Scroll lets a finger pan */
.qn-editor__scroll{flex:1 1 auto;min-height:200px;overflow:auto;overscroll-behavior:contain;border:.5px solid var(--sys-separator);background:var(--sys-bg)}
.ios-modal--qn .qn-editor__scroll{flex:1 1 0;min-height:160px;border:0}
.qn-editor__scroll .qn-editor__canvas,.ios-modal--qn .qn-editor__scroll .qn-editor__canvas{display:block;flex:none;width:1200px;height:1600px;min-height:0;max-width:none;aspect-ratio:auto;border:0;touch-action:none}
.qn-editor__scroll.is-scroll .qn-editor__canvas{touch-action:pan-x pan-y}
/* HB-20: while typing with the on-screen keyboard the drawing tools and area hide and the text takes the room (QuickNotes.swift:88-93) */
.ios-modal--qn.is-typing .qn-editor__tools,.ios-modal--qn.is-typing .qn-editor__scroll{display:none}
.ios-modal--qn.is-typing .qn-editor__body{flex:1 1 auto;height:auto;min-height:44px}
/* HB-15: Empty Bin is a plain red bar button at the leading edge (RecycleBinController.swift:13-14) */
.ios-modal__bar>.ios-pill--danger{justify-self:start;height:44px;padding:0 8px;background:none;color:var(--sys-red);font:17px var(--font-ui)}
.ios-modal__bar>.ios-pill--danger:disabled{color:var(--sys-label-3)}
/* HB-19: sidebar items keep their height (at least 48 pt, HomeController.swift:117-123); the sidebar scrolls instead */
.home-side>*{flex-shrink:0}
/* PB-10: the file table grows with its rows; the browser scrolls (no row spills over the footer) */
.home-table{flex:1 0 auto}
/* PB-21: ✓ Done keeps the accent's own foreground (dark: black on the light accent) */
.ios-done{color:var(--sys-on-accent)}
/* PB-22: on a phone the Quick Note bar keeps one line; the title gives way first */
@media (max-width:560px){
  .ios-modal--qn .ios-modal__bar{grid-template-columns:auto minmax(0,1fr) auto;column-gap:8px}
  .ios-modal--qn .ios-modal__bar h2{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
  .ios-modal--qn .ios-pill--glass{padding:0 14px}
}
.ios-modal--qn .ios-pill--glass{white-space:nowrap}
/* HB-12 (Feedback message, FeedbackController.swift:17 .secondarySystemBackground) and PB-21 (Quick Note glass buttons):
   elevated dark surfaces, so the field and the pills stay visible on the dark sheet */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .fb-message,:root:not([data-theme="light"]) .ios-modal--qn .ios-pill--glass,:root:not([data-theme="light"]) .ios-modal--qn .ios-round--glass{background:var(--sys-bg-3)}
}
:root[data-theme="dark"] .fb-message,:root[data-theme="dark"] .ios-modal--qn .ios-pill--glass,:root[data-theme="dark"] .ios-modal--qn .ios-round--glass{background:var(--sys-bg-3)}

/* Bug fixes: reader */
/* Menus fit the window or scroll (UIMenu); a scrolling menu's submenus, and every submenu on iPhone, open inline below their row */
#core-app .ios-menu.is-fit-scroll{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
#core-app .ios-menu.ios-menu--inline{position:static;inset:auto;translate:none;min-width:0;max-width:none;margin:0 0 4px;padding:0 0 0 14px;border-radius:0;background:none;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;border-left:2px solid var(--sys-separator)}
/* PB-06: with Draw with touch, one finger draws the clip rectangle, as it draws a pen stroke (DrawingInputPolicy) */
#core-app.draws-with-finger[data-tool="clip"] .file-body .pdf-sheet,#core-app .clip-box.is-done{touch-action:none}
/* RB-13: the pending clip and its bar never start a text selection */
#core-app .clip-box,#core-app .clip-bar{-webkit-user-select:none;user-select:none}
/* RB-09: the selection actions are one stack on an opaque surface, radius 10 (SourceReaderController.swift:389) */
#core-app .sel-actions{gap:4px;padding:4px 4px 4px 8px;border-radius:10px;background:var(--sys-grouped-2);box-shadow:0 2px 10px rgba(0,0,0,.12)}
/* PB-09: Read | Paper | Paper 2 apportioned by content, each on one line (apportionsSegmentWidthsByContent, WB:468-469) */
#core-app .ipad-focus{grid-auto-columns:auto}
#core-app .ipad-focus button{white-space:nowrap;padding:0 10px}
#core-app.is-narrow .ipad-focus{max-width:none;flex:0 1 auto}
#core-app .ios-menu [data-inline-hidden]{display:none}
/* PB-12: the status label is two lines, cleanly truncated (WorkbenchController.swift:290): no third line in the padding */
/* the inset is a transparent border, outside the overflow clip, so the clamped text never runs into it */
.ipad .core-status,.ios-sheet .core-status{padding:0 4px;border:6px solid transparent;background-clip:border-box}
/* PB-23: while a modal sheet or alert is open the page behind it, the demo bar included, takes no taps: the bar looks it */
body:has(dialog:modal) .try-bar{opacity:.4;transition:opacity .15s}
/* PB-21: the search palette's Select pill keeps a visible pill in dark mode (a raised system bar button) */
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) #core-search .ios-pill--glass{background:var(--sys-bg-3)}}
:root[data-theme="dark"] #core-search .ios-pill--glass{background:var(--sys-bg-3)}

/* ---- Browser, mouse and keyboard only (UX audit, 15 Nov; screens.md "Browser, mouse and keyboard only").
   html[data-input] is the last pointer used (core-page.js); a finger or a Pencil keeps the iOS look. ---- */
html:not([data-input="mouse"]) .desk-only{display:none!important}
/* 8: fields whose own input has no outline show the ring on the field */
.ios-search__field:has(input:focus-visible),.home-search:has(input:focus-visible),.ipad-sidebar__filter:has(input:focus-visible),.org-search:has(input:focus-visible){outline:3px solid var(--focus);outline-offset:2px}
.note-editor:has(.note-editor__text:focus-visible){outline:2px solid var(--focus);outline-offset:2px}
/* 12: hover on the iPad-style buttons, only where there is real hover */
@media (hover:hover) and (pointer:fine){
  .ipad-btn:not(:disabled):hover,.ios-seg__btn:not([aria-pressed="true"]):hover,.ios-kb:hover{background:var(--sys-fill-4)}
  .ios-segmented button:not([aria-checked="true"]):hover{background:var(--sys-fill-4)}
  .side-row:hover{background:var(--sys-fill-4)}
}
/* 11: the canvas cursor says what a press will do */
html[data-input="mouse"] [data-tool="pen"] .core-canvas,html[data-input="mouse"] [data-tool="highlighter"] .core-canvas,html[data-input="mouse"] [data-tool="clip"] .core-canvas{cursor:crosshair}
html[data-input="mouse"] [data-tool="eraser"] .core-canvas{cursor:cell}
html[data-input="mouse"] [data-tool="hand"] .core-canvas{cursor:grab}
/* 11: the status for a mouse and keyboard reads at body size, with its action */
html[data-input="mouse"] .ipad .core-status{font-size:14px}
.core-status__act{margin-left:6px;padding:2px 8px;border:0;border-radius:6px;background:var(--sys-fill-3);color:var(--sys-accent);font-family:var(--font-ui);font-weight:600;font-size:inherit;line-height:1.3;cursor:pointer}
/* 9: the bookmark row and its delete button side by side */
.side-row-wrap{display:flex;align-items:stretch}
.side-row-wrap>.side-row{flex:1;min-width:0}
.side-row-wrap>.side-row__del{border:0;background:none;cursor:pointer;align-self:center}
/* A text draft at a link's end (owner, 16 Nov): small, grows with the text, with a quiet placeholder */
.note-editor.is-draft .note-editor__text{min-height:24px;margin:8px 12px}
.note-editor.is-draft{position:absolute}
.note-editor.is-draft.is-empty .note-editor__text::before{content:"Type a note…";position:absolute;color:var(--sys-label-3);pointer-events:none}
/* Mouse and keyboard: the formatting capsules sit under the editor */
.ipad>#core-note-bar.is-near{right:auto;bottom:auto;width:max-content}
/* A finger after a link to blank paper: Type / Draw beside the endpoint */
.type-or-draw{position:absolute;z-index:41;display:flex;gap:2px;padding:4px;border-radius:22px;background:color-mix(in srgb,var(--sys-bg) 86%,transparent);-webkit-backdrop-filter:blur(20px) saturate(1.6);backdrop-filter:blur(20px) saturate(1.6);box-shadow:var(--sys-shadow-pop)}
.type-or-draw[hidden]{display:none}
.type-or-draw button{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border:0;border-radius:18px;background:none;color:var(--sys-accent);font:500 15px var(--font-ui);cursor:pointer}
.type-or-draw button .i{width:18px;height:18px}
.type-or-draw button:active{background:var(--sys-fill-3)}
