.markdown h2.outline-chapter{font-size:17px;margin-top:36px}
:root{
 --navy-deep:#061428;--navy:#071A33;--navy-mid:#0A1B34;--navy-low:#0B1F3A;--navy-ink:#10213D;
 --cyan:#54D3EA;--cyan-soft:#BDEEFB;--on-navy:#F3F8FF;--on-navy-muted:#B8C7D9;
 --canvas:#F6F9FC;--surface:#FFFFFF;--surface-low:#EEF3F8;--toolbar:#EAF1F7;
 --ink:#0F172A;--muted:#475569;--subtle:#5F6F86;
 --primary:#0E7BA3;--primary-hover:#0B4F8A;
 --selected:#D8F1F9;--on-selected:#071A33;--tonal:#BDEEFB;--on-tonal:#071A33;
 --line:#E2E8F0;--card-line:#D4E1EC;--input-line:#7B8AA0;--paper-line:#CBD5E1;
 --hover:rgba(7,26,51,.07);
 --shadow-card:0 1px 2px rgba(7,26,51,.06),0 8px 24px rgba(7,26,51,.08);
 --radius-control:8px;--radius-card:12px;
 --error:#B3261E;--error-bg:#F9DEDC;
 --added-bg:#E6F4EA;--added-ink:#137333;--removed-bg:#FCE8E6;--removed-ink:#C5221F;
 --menu-shadow:0 1px 2px rgba(0,0,0,.3),0 2px 6px 2px rgba(0,0,0,.15);
 --header-height:64px;
 font-family:"Meiryo UI",Meiryo,"Hiragino Kaku Gothic ProN","Yu Gothic UI","Noto Sans JP",sans-serif;
 font-size:14px;line-height:1.5;color:var(--ink);background:var(--canvas);
}
*{box-sizing:border-box}
body{margin:0;min-width:0}
[hidden]{display:none!important}
a{color:var(--primary);text-underline-offset:3px}
a:hover{text-decoration:underline}
button,input,textarea,select{font:inherit;color:inherit}
button,.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;border:0;border-radius:var(--radius-control);padding:8px 24px;background:var(--primary);color:var(--surface);font-weight:500;text-decoration:none;cursor:pointer;vertical-align:middle;transition:background-color 120ms}
button:has(.icon),.button:has(.icon){padding-left:16px}
button:hover,.button:hover{background:var(--primary-hover);text-decoration:none}
.tonal{background:var(--tonal);color:var(--on-tonal)}
.tonal:hover{background:var(--selected)}
.quiet,.text-button{background:transparent;color:var(--primary)}
.quiet:hover,.text-button:hover{background:var(--hover)}
.icon{display:inline-block;width:20px;height:20px;flex:0 0 auto;fill:currentColor;vertical-align:middle}
.icon-button,button.icon-button{width:40px;height:40px;min-height:40px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;text-decoration:none;flex-shrink:0}
.icon-button:hover{background:var(--hover)}
:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
:target{scroll-margin-top:160px}
button:disabled,select:disabled{opacity:.38;cursor:default}
button:disabled:hover{background:transparent}
h1,h2,h3{color:var(--navy-ink);font-weight:500;line-height:1.5;overflow-wrap:anywhere}
h1{font-size:22px;font-weight:700;margin:0 0 24px}
h2{font-size:16px;margin:24px 0 12px}
h3{font-size:14px;margin:20px 0 8px}
p{overflow-wrap:anywhere}
label{display:block;font-size:12px;color:var(--muted);margin:16px 0 12px}
input,textarea,select{display:block;width:100%;min-width:0;margin-top:4px;padding:8px 12px;background:var(--surface);border:1px solid var(--input-line);border-radius:4px;font-size:14px;font-weight:400}
input,select{height:40px}
input:focus,textarea:focus,select:focus{outline:2px solid var(--primary);outline-offset:-2px}
textarea{min-height:96px;resize:vertical;line-height:1.7}
input[type=checkbox]{appearance:auto;width:18px;height:18px;margin:2px 0 0;accent-color:var(--primary);flex-shrink:0}
.check{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 8px;align-items:start;font-size:14px;color:var(--ink)}
.check .form-error{grid-column:2;margin:0}
fieldset{min-width:0;border:1px solid var(--line);border-radius:8px;padding:16px;margin:24px 0}
legend{font-size:14px;font-weight:500;padding:0 4px}
summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:8px;min-height:32px;font-weight:500}
summary::-webkit-details-marker{display:none}
details>summary:after{content:"";width:6px;height:6px;flex-shrink:0;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin-left:auto;margin-right:8px}
details[open]>summary:after{transform:rotate(225deg)}
details.account-menu>summary:after,details.more-menu>summary:after,details.version-menu>summary:after,.tree details>summary:after{display:none}
dl{display:grid;grid-template-columns:92px minmax(0,1fr);gap:8px 12px}
dt{color:var(--subtle);font-size:12px}
dd{margin:0;overflow-wrap:anywhere}
pre{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--surface-low);padding:16px;border-radius:8px;font-family:Consolas,"Courier New",monospace}
.site-header{height:64px;position:sticky;top:0;z-index:50;display:grid;grid-template-columns:auto minmax(120px,720px) auto;align-items:center;gap:24px;padding:8px 24px;background:#000;border-bottom:1px solid #1E293B}
/* The header is black with a slate rule, the same as the Legal Leap header (owner's instruction, 2026-11-14). */
.site-header .brand{color:#FFF}
.site-header :focus-visible{outline-color:var(--cyan)}
.brand{display:flex;align-items:center;gap:8px;min-width:0;color:var(--navy-ink);font-size:18px;font-weight:700;text-decoration:none;white-space:nowrap}
.brand:hover{text-decoration:none}
.brand-mark{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex:0 0 32px;border-radius:8px;background:linear-gradient(160deg,var(--navy-deep),var(--navy-low));box-shadow:inset 0 0 0 1px rgba(84,211,234,.4)}
.brand-mark>.brand-logo{width:24px;height:24px;color:var(--cyan)}
.brand span{overflow:hidden;text-overflow:ellipsis}
.header-search{position:relative;display:flex;align-items:center;gap:16px;min-width:0;border-radius:10px;height:48px;background:rgba(255,255,255,.12);color:var(--on-navy);padding:0 20px}
.header-search:focus-within{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px #0003}
.header-search input{border:0;outline:none;background:transparent;color:inherit;margin:0;padding:0;height:100%}
.header-search input::placeholder{color:var(--on-navy-muted);opacity:1}
.header-search:focus-within input::placeholder{color:var(--subtle)}
.header-search input:focus{outline:none}
.search-suggest{position:absolute;left:0;top:calc(100% + 4px);z-index:70;width:100%;max-width:calc(100vw - 32px);max-height:60vh;overflow:auto;margin:0;padding:8px 0;list-style:none;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface);color:var(--ink);box-shadow:var(--menu-shadow)}
.search-suggest [role=option]{padding:10px 16px;cursor:pointer;overflow-wrap:anywhere}
.search-suggest [role=option]:hover,.search-suggest [aria-selected=true]{background:var(--selected)}
.search-suggest-title{display:block}
.search-suggest small{display:block;color:var(--subtle);font-size:12px}
.search-suggest mark{color:var(--ink);background:var(--tonal);font-weight:700}
.search-suggest [data-suggest-all]{border-top:1px solid var(--line);color:var(--primary)}
.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:16px;white-space:nowrap}
.account-menu,.more-menu,.version-menu{position:relative}
.avatar{display:flex;justify-content:center;width:32px;height:32px;min-height:32px;border-radius:50%;background:var(--primary);color:white;font-size:16px;font-weight:500}
.menu-panel{position:absolute;right:0;top:calc(100% + 8px);z-index:70;min-width:220px;max-width:calc(100vw - 32px);border-radius:var(--radius-card);padding:8px 0;background:var(--surface);box-shadow:var(--menu-shadow);max-height:65vh;overflow:auto}
.menu-panel>a,.menu-panel form>button{display:flex;align-items:center;justify-content:flex-start;gap:12px;width:100%;min-height:40px;padding:8px 16px;color:var(--ink);text-decoration:none;font-weight:400;border-radius:0;background:transparent}
.menu-panel a:hover,.menu-panel form>button:hover{background:var(--hover)}
.menu-panel [aria-current]{background:var(--selected)}
.menu-identity{padding:8px 16px;margin:0 0 8px;border-bottom:1px solid var(--line)}
main{min-width:0}
.standard-page{max-width:720px;margin:32px auto;padding:24px;background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card);min-height:0}
.standard-page:has(>.account-sections){background:transparent;border:0;padding:0}
.login-page{max-width:400px;margin:64px auto;padding:32px;background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card);min-height:0}
.site-footer{display:flex;flex-wrap:wrap;gap:16px;justify-content:center;padding:24px 16px;font-size:12px}
.site-footer a{color:var(--subtle);text-decoration:none}
.site-footer a:hover{text-decoration:underline}
.card{background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card);padding:24px;box-shadow:none}
.card>:first-child{margin-top:0}
.card>:last-child{margin-bottom:0}
.card h2{font-weight:500}
.account-sections{display:grid;gap:16px}
.cards{list-style:none;padding:0;display:grid;gap:16px}
.cards>li{padding:20px;border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface);min-width:0}
.cards h2,.cards h3{margin:0 0 8px}
.actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:16px 0}
.warning,.success,.editor-error{display:flex;gap:12px;align-items:flex-start;border-radius:8px;padding:16px;background:var(--error-bg);color:var(--error);font-size:14px}
.warning .icon,.success .icon{margin-top:2px}
.success{background:var(--added-bg);color:var(--added-ink)}
.preserve{white-space:pre-wrap;overflow-wrap:anywhere}
.count{color:var(--subtle);font-size:12px;font-weight:400}
.tag{display:inline-block;border-radius:8px;padding:2px 8px;background:var(--surface-low);color:var(--muted);font-size:12px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
.home{max-width:1440px;display:grid;grid-template-columns:256px minmax(0,1fr);gap:32px;margin:auto;padding:24px 32px}
.home-tree{min-width:0}
.home-tree>h2{font-size:12px;color:var(--subtle);margin:8px 12px 16px}
.tree{display:block}
.tree-all,.tree summary,.tree li a{display:flex;align-items:center;gap:8px;min-height:32px;padding:4px 12px;border-radius:var(--radius-control);color:var(--ink);text-decoration:none;font-weight:400}
.tree-all{margin-bottom:8px}
.tree summary>.icon{width:18px;height:18px}
.tree summary>span{min-width:0}
.tree summary .count{margin-left:auto;white-space:nowrap}
.tree ul{list-style:none;margin:4px 0;padding:0 0 0 20px}
.tree li{position:relative;display:flex;align-items:center;gap:4px;border-radius:var(--radius-control)}
.tree li a{flex:1;min-width:0;overflow-wrap:anywhere}
.tree li>.count{position:absolute;right:12px;pointer-events:none}
.tree li a{padding-right:44px}
.tree a:hover,.tree summary:hover{background:var(--hover)}
.tree a[aria-current]{background:var(--tonal);color:var(--on-tonal)}
.tree-field>summary{font-weight:500}
.tree-kinds{padding-left:12px}
.tree-edit{border-top:1px solid var(--line);padding:12px 0;margin-top:16px}
.tree-edit>summary{font-size:12px;color:var(--muted)}
.tree-edit h3{margin-bottom:0}
.tree-note{font-size:12px;color:var(--subtle)}
.list-head{display:flex;align-items:center;gap:12px;min-height:48px;border-bottom:1px solid var(--line);padding:0 12px 8px}
.list-head h2{font-size:16px;margin:0}
.list-head a{margin-left:auto;white-space:nowrap;font-size:12px}
.template-list{list-style:none;margin:0;padding:0}
.template-row{display:grid;grid-template-columns:24px minmax(100px,1fr) minmax(60px,140px) 100px 144px 40px;gap:12px;align-items:center;min-height:48px;padding:8px 12px;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none}
.template-row:hover{background:var(--surface-low);text-decoration:none}
.template-row>.icon{color:var(--primary)}
.template-title{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.template-category,.template-owner,.template-date,.template-version{min-width:0;font-size:12px;color:var(--subtle)}
.template-owner,.template-date{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.empty-state{text-align:center;padding:64px 24px;color:var(--subtle)}
.empty-state>.icon{width:56px;height:56px;color:var(--subtle)}
.document-titlebar{display:flex;align-items:center;justify-content:space-between;gap:24px;background:var(--surface);border-bottom:1px solid var(--line);padding:16px 24px;margin-bottom:16px}
.document-heading{display:flex;align-items:center;gap:12px;min-width:0}
.document-heading>.icon{width:32px;height:32px;color:var(--primary)}
.document-heading h1,.document-heading h2{font-size:18px;font-weight:400;margin:0}
.document-heading p{font-size:12px;color:var(--subtle);margin:4px 0 0}
.title-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.document-actions{display:flex;align-items:center;flex-wrap:wrap;gap:4px;background:var(--toolbar);border-radius:var(--radius-control);min-height:40px;margin:0 24px;padding:0 8px}
.document-actions button,.document-actions .button{font-size:13px;min-height:32px;padding:4px 12px}
.document-actions .version-menu{margin-left:auto}
.version-menu summary{font-size:12px;font-weight:400;padding:4px 8px}
#copy-status{margin:8px 24px;color:var(--primary);font-size:12px;min-height:0}
#copy-status:empty{display:none}
.reading-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;padding:24px}
.reading-main{min-width:0}
.document-outline{display:none;position:sticky;top:88px;align-self:start;color:var(--subtle);font-size:13px;max-height:calc(100vh - 120px);overflow:auto}
.document-outline h2{font-size:13px;font-weight:500;margin:8px 0 16px}
.document-outline ol{list-style:none;padding:0}
.document-outline a{display:block;padding:8px 12px;color:var(--subtle);border-radius:4px;text-decoration:none}
.document-outline a:hover{background:var(--hover)}
.document-outline a[aria-current]{color:var(--primary);background:var(--selected)}
.paper,.editor-surface,.source-document{background:var(--surface);border:1px solid var(--paper-line);max-width:816px;margin:0 auto;padding:72px;color:#000;box-shadow:none;border-radius:0;min-width:0}
.markdown{font-size:15px;line-height:1.9;overflow-wrap:anywhere}
.markdown h1,.paper-title{font-size:20px;text-align:center;font-weight:500;margin:0 0 32px}
.markdown h2,.markdown h3{color:#000;font-weight:600;font-size:15px;padding:0;border:0;margin:28px 0 12px}
.markdown table{border-collapse:collapse;width:100%;table-layout:fixed;overflow-wrap:anywhere}
.markdown td,.markdown th{border:1px solid var(--paper-line);padding:6px 10px;height:36px;min-width:48px;vertical-align:top}
.markdown blockquote{border-left:2px solid var(--card-line);margin:16px 0;padding-left:20px;color:var(--muted)}
.markdown pre{font-size:13px}
/* Blanks to fill: a highlight plus a dashed underline, so the cue does not rely on colour alone. */
.document-details{display:grid;gap:16px;max-width:816px;margin:24px auto}
.document-details .card{padding:24px}
.history-page{max-width:816px;padding:24px;margin:auto}
.history{list-style:none;padding:0;margin:24px 0;display:grid;gap:12px}
.history-heading{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
.history-heading time{font-weight:500}
.history-heading>span:last-child{margin-left:auto;font-size:12px;color:var(--subtle)}
.current-tag{background:var(--selected);color:var(--on-selected)}
.history p{margin:12px 0}
.back-link{display:inline-flex;align-items:center;gap:8px;margin-bottom:16px;text-decoration:none}
.diff-page{max-width:1048px;padding:24px;margin:auto}
.diff-paper{max-width:none;margin:16px 0 0}
.diff{white-space:pre-wrap;background:transparent;border:0;padding:0;margin:0;font:13px/1.8 Consolas,"BIZ UDGothic","MS Gothic",monospace}
.diff>span{display:block;overflow-wrap:anywhere}
.added{background:var(--added-bg);color:var(--added-ink)}
.removed{background:var(--removed-bg);color:var(--removed-ink);text-decoration:line-through}
.document-page>.diff-paper~*,.document-page>h1,.document-page>p:not(#copy-status){margin-left:24px;margin-right:24px}
.edit-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start;padding:0 24px 24px;max-width:1440px;margin:auto}
.document-column{min-width:0}
.edit-sidebar{min-width:0;padding:20px}
.edit-sidebar label{margin:16px 0}
.edit-sidebar h2{margin-top:0}
.edit-sidebar fieldset{padding:0;border:0;margin-bottom:0}
.declarations{margin-top:24px}
/* Publish panel: the next version up top, quiet context, then the two things to fill in and the button. */
.publish-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.edit-sidebar .publish-head h2{margin:0;font-size:16px;line-height:1.5}
.version-pill{flex:0 0 auto;padding:2px 10px;border-radius:100px;background:var(--selected);color:var(--on-selected);font-size:12px;font-weight:700;line-height:1.6;white-space:nowrap}
.publish-meta{display:flex;flex-wrap:wrap;gap:4px 6px;margin:4px 0 0;font-size:12px;color:var(--muted)}
.publish-about{margin:4px 0 0;padding-bottom:8px;border-bottom:1px solid var(--line)}
.publish-about summary{display:inline-flex;min-height:28px;gap:8px;font-size:12px;font-weight:400;color:var(--primary)}
.publish-about>summary:after{margin:0 0 2px}
.edit-sidebar .publish-about h3{margin:8px 0 2px;font-size:12px;font-weight:500;color:var(--muted)}
.publish-about p{font-size:13px;line-height:1.7}
.edit-sidebar .declarations{margin-top:20px;padding:12px 8px 8px;border-radius:12px;background:var(--surface-low)}
.declarations legend{float:left;width:100%;margin:0 0 4px;padding:0 4px;font-size:12px;font-weight:700;color:var(--muted)}
.edit-sidebar .declarations .check{clear:both;margin:0;padding:6px 4px;border-radius:8px;font-size:13px;line-height:1.6;cursor:pointer}
.declarations .check:hover{background:var(--hover)}
.publish-submit{width:100%;margin-top:16px}
.source-document textarea{min-height:640px;border:0;padding:0;font-size:15px;outline:none;box-shadow:none}
.source-document:has(textarea[hidden]){display:none}
.document-title-input{margin:0;min-width:0;flex:1;max-width:816px}
.document-title-input input{border-color:transparent;font-size:18px;margin:0}
.document-title-input input:hover{border-color:var(--input-line)}
.document-titlebar>button{flex-shrink:0}
.editing-page .document-titlebar{gap:12px;flex-wrap:wrap}
.editing-page .document-titlebar>.document-heading{flex:1 1 180px;width:auto;min-width:0;overflow-wrap:anywhere}
.draft-controls{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;margin-left:auto;max-width:100%;min-width:0}
.draft-status{font-size:12px;color:var(--muted);overflow-wrap:anywhere;max-width:100%}
.draft-save{min-height:40px;padding:8px 12px;background:var(--surface-low);color:var(--primary)}
.draft-save:hover{background:var(--hover)}
.switch{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:40px;margin:0;cursor:pointer;flex-shrink:0}
.switch>input{position:absolute;width:1px;height:1px;opacity:0;margin:0}
.switch-track{display:inline-flex;align-items:center;width:40px;height:24px;border:1px solid var(--input-line);border-radius:24px;background:var(--surface-low);padding:3px;flex-shrink:0}
.switch-track::before{content:'';display:block;width:16px;height:16px;border-radius:50%;background:var(--muted);transition:transform 120ms}
.switch>input:checked+.switch-track{background:var(--primary);border-color:var(--primary)}
.switch>input:checked+.switch-track::before{background:var(--surface);transform:translateX(16px)}
.switch>input:focus-visible+.switch-track{outline:2px solid var(--primary);outline-offset:3px}
@media(max-width:600px){.editing-page .document-titlebar>.document-heading{flex-basis:calc(100% - 52px)}.draft-controls{flex:1 1 100%;gap:8px}.draft-status{flex:1 1 100%;text-align:right}.editing-page .document-titlebar>button{margin-left:auto}}
@media(prefers-reduced-motion:reduce){.switch-track::before{transition:none}}
.editor-settings{max-width:720px;margin:16px auto 32px;display:grid;gap:16px}
.editor-shell{position:relative;min-width:0}
.editor-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:0;min-height:40px;padding:4px 8px;border-radius:100px;background:var(--toolbar);position:sticky;top:72px;z-index:30;margin-bottom:16px}
.editor-tools{display:inline-flex;align-items:center;gap:0;padding:0 4px;position:relative}
.editor-tools+.editor-tools:before{content:"";position:absolute;left:0;height:20px;border-left:1px solid var(--paper-line)}
.editor-toolbar button{width:28px;height:32px;min-height:32px;padding:0;border-radius:4px;background:transparent;color:var(--muted)}
.editor-toolbar button .icon{width:18px;height:18px}
.editor-toolbar button:hover{background:var(--hover)}
.editor-toolbar button[aria-pressed=true]{background:var(--selected);color:var(--on-selected)}
.editor-mode{margin-left:auto}
/* One row like a word processor: groups that do not fit move into the "more" menu (editor/overflow.ts). */
.editor-toolbar.is-single-row{flex-wrap:nowrap}
.editor-toolbar.is-single-row>*{flex:0 0 auto}
.is-single-row .suggest-mode{margin-left:0}
.editor-more{margin-left:auto;padding:0 4px}
.editor-more[hidden],.editor-more-panel[hidden]{display:none}
.editor-more-panel{position:absolute;right:8px;top:calc(100% + 4px);z-index:44;display:flex;flex-wrap:wrap;align-items:center;gap:4px 0;max-width:min(420px,calc(100vw - 32px));padding:4px;border-radius:12px;background:var(--surface);box-shadow:var(--menu-shadow)}
.editor-more-panel .editor-mode{margin-left:0}
.style-control{position:relative;margin:0;width:120px}
.style-control select{height:32px;margin:0;padding:4px 20px 4px 8px;border:0;appearance:none;background:transparent;font-size:12px;cursor:pointer}
.style-control .icon{position:absolute;width:18px;height:18px;right:0;top:7px;pointer-events:none}
.editor-surface .ProseMirror{min-height:640px;outline:none;white-space:pre-wrap}
.editor-surface{cursor:text}
.editor-surface .ProseMirror>:first-child{margin-top:0}
.editor-surface .ProseMirror table{display:table;table-layout:fixed;width:100%}
.editor-surface td[data-align=center],.editor-surface th[data-align=center]{text-align:center}
.editor-surface td[data-align=right],.editor-surface th[data-align=right]{text-align:right}
.editor-surface .selectedCell:after{background:var(--selected);opacity:.65}
.editor-image-source{color:var(--subtle)}
.editor-popup{position:absolute;left:0;top:48px;z-index:40;width:320px;max-width:100%;padding:16px;background:var(--surface);border-radius:var(--radius-card);box-shadow:var(--menu-shadow);margin:0}
.editor-popup label{margin-top:0}
.editor-popup p{font-size:12px;color:var(--error)}
.popup-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.editor-popup button{font-size:12px;min-height:32px;padding:4px 12px}
.table-grid{display:flex;flex-direction:column;gap:4px}
.table-grid-row{display:flex;gap:4px}
button.table-cell{width:24px;height:24px;min-height:24px;padding:0;border:1px solid var(--card-line);background:var(--surface);border-radius:2px}
button.table-cell:hover,button.table-cell.is-selected{background:var(--selected);border-color:var(--primary)}
[data-editor-table-size]{display:block;text-align:center;margin-top:12px;color:var(--muted)}
.table-operations{display:grid;gap:0}
.table-operations button{justify-content:flex-start;background:transparent;color:var(--ink);border-radius:4px;width:100%;padding:8px;min-height:36px}
.table-operations button:hover{background:var(--hover)}
.form-error{color:var(--error);font-size:12px;margin:4px 0}
[aria-invalid=true]{border-color:var(--error)}
.key-value{display:flex;align-items:center;gap:8px}
.key-value pre{flex:1;min-width:0}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
@media(min-width:1200px){.reading-layout{grid-template-columns:min(var(--toc-w,216px),35vw) minmax(0,1fr);padding-right:calc(216px + 24px);gap:24px}.document-outline{display:block}}
/* The outline also shows beside the document in a narrow window such as a side pane (owner's instruction, 2026-11-14). */
@media(min-width:560px) and (max-width:1199px){.reading-layout{grid-template-columns:min(var(--toc-w,168px),35vw) minmax(0,1fr);gap:16px}.document-outline{display:block}.document-outline a{padding:6px 8px}}
@media(max-width:1300px){.site-header{gap:16px}.brand{font-size:18px}.template-row{grid-template-columns:24px minmax(100px,1fr) 100px 80px 120px 32px;gap:8px}}
@media(max-width:1100px){.edit-layout{grid-template-columns:minmax(0,1fr)}.edit-sidebar{width:100%;max-width:816px;margin:auto}.template-row{grid-template-columns:24px minmax(100px,1fr) 100px 80px 32px}.template-date{display:none}.header-create{padding-right:16px}.header-actions{gap:8px}.document-titlebar{flex-wrap:wrap}.title-actions{margin-left:auto}.home{gap:16px;padding:24px 16px}}
@media(max-width:850px){.home{grid-template-columns:200px minmax(0,1fr)}.template-row{grid-template-columns:24px minmax(0,1fr) 80px}.template-owner,.template-version{display:none}.site-header{gap:12px;padding:8px 16px}.header-create span{display:none}.header-create{width:40px;padding:0!important}.brand{font-size:18px}.paper,.editor-surface,.source-document{padding:48px 40px}.standard-page{margin:24px 16px}}
@media(max-width:600px){
 :root{--header-height:120px}
 .site-header{height:120px;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;padding:8px 16px}
 .brand{font-size:18px}
 .header-search{grid-row:2;grid-column:1/-1;width:100%;height:48px}
 .header-actions{gap:8px}
 .header-login{width:40px;padding:0!important}
 .header-login span{display:none}
 .home{grid-template-columns:minmax(0,1fr);padding:16px}
 .home-tree>h2{margin-top:0}
 .home-tree{order:2;border-top:1px solid var(--line);padding-top:16px}
 .tree-edit{margin-top:8px}
 .home-list{min-width:0}
 .list-head{padding-left:4px;gap:8px;flex-wrap:wrap}
 .template-row{padding-left:4px;padding-right:4px}
 .document-titlebar{padding:16px;gap:16px}
 .document-heading{width:100%}
 .document-heading h1,.document-heading h2{font-size:18px}
 .document-heading p{font-size:11px}
 /* Three buttons do not fit in one row on a phone, so the row wraps and no button breaks its label. */
 .title-actions{margin-left:0;gap:4px;flex-wrap:wrap;width:100%}
 .title-actions>form>button,.title-actions>a.button{padding:8px 10px;font-size:12px;gap:4px;white-space:nowrap}
 .title-actions .icon-button{width:36px;height:36px;min-height:36px;flex:none}
 .document-actions{margin:0 12px;border-radius:16px;padding:4px}
 .document-actions button,.document-actions .button{padding:4px 8px;font-size:11px}
 .document-actions .version-menu{margin-left:0}
 .reading-layout{padding:16px 12px}
 .paper,.editor-surface,.source-document{padding:40px 20px}
 .document-details .card,.card{padding:20px}
 .history-page{padding:16px}
 .diff-page{padding:16px}
 .edit-layout{padding:0 12px 16px;gap:16px}
 .editor-toolbar{top:128px;border-radius:16px;padding:4px}
 .editor-tools{padding:0 2px}
 .editor-settings{margin:0 12px 24px}
 .source-document textarea,.editor-surface .ProseMirror{min-height:480px}
 .login-page{margin:32px 16px;padding:24px;max-width:none}
 .standard-page{padding:20px}
 .template-category{max-width:80px}
 .site-footer{gap:12px;font-size:12px}
 .document-title-input{flex-basis:100%}
 .menu-panel{min-width:192px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

.editor-shell.is-markdown{display:contents}
.tree summary>span{display:flex;align-items:center;gap:8px;flex:1}

.tree summary>.icon:nth-child(2){display:none}
.tree details[open]>summary>.icon:first-child{display:none}
.tree details[open]>summary>.icon:nth-child(2){display:inline-block}
.editor-surface .ProseMirror{overflow-x:auto}
.document-heading>div{min-width:0}
.account-sections .template-row{grid-template-columns:24px minmax(0,1fr) minmax(0,auto) 144px 40px}
.account-sections .template-owner{display:none}
@media(max-width:600px){.account-sections .template-row{grid-template-columns:24px minmax(0,1fr) 40px}.account-sections .template-date,.account-sections .template-category{display:none}}

/* --- design review, batch 4 --- */
body{min-height:100vh;display:flex;flex-direction:column}
.site-footer{margin-top:auto}
.standard-page,.login-page{width:100%}
a{text-decoration:none;font-weight:500}
a:hover{text-decoration:underline}
.markdown a{text-decoration:underline;font-weight:inherit}
.site-footer a,.tree a,.menu-panel a,.template-row{font-weight:400}
.empty{color:var(--subtle);font-size:13px;margin:0 0 12px}
.hint{display:block;font-size:12px;color:var(--subtle);margin-top:4px}
.link-list{list-style:none;margin:0;padding:0}
.link-list li{display:flex;align-items:center;min-height:44px;border-bottom:1px solid var(--line)}
.link-list li:last-child{border-bottom:0}
.tree summary>.tree-name{display:block;flex:1;min-width:0;position:relative;padding-right:32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tree summary .count{position:absolute;right:0;top:50%;transform:translateY(-50%);margin:0}
.tree li>.count{right:12px}
.editor-surface .ProseMirror td p,.editor-surface .ProseMirror th p,.editor-surface .ProseMirror li p{margin:0}
.editor-surface .ProseMirror li{margin:0}
.edit-sidebar h3{font-size:14px;margin:16px 0 4px}
.edit-sidebar .preserve,.edit-sidebar .empty{margin:0 0 4px}
.table-operations button[data-editor-command=deleteRow]{margin-top:9px;position:relative;overflow:visible}
.table-operations button[data-editor-command=deleteRow]:before{content:"";position:absolute;left:0;right:0;top:-5px;border-top:1px solid var(--line)}
.title-entry{flex:1;max-width:860px}
.title-entry .document-title-input{max-width:none}
@media(min-width:851px){.reading-main .paper{min-height:720px}}
@media(max-width:850px){.standard-page{width:calc(100% - 32px);margin:24px auto}}
@media(max-width:600px){
 .login-page{width:calc(100% - 32px);margin:32px auto}
 .editor-tools+.editor-tools:before{display:none}
 .editor-mode{margin-left:0}
 .title-entry{max-width:none}
}

/* --- design review, batch 4, second pass --- */
.diff-page{max-width:864px}
.account-sections .template-date{justify-self:end}
.table-operations button:focus-visible{outline:0;background:var(--hover)}
@media(max-width:600px){
 .home-list .template-row{grid-template-columns:24px minmax(0,1fr);row-gap:2px;padding-top:10px;padding-bottom:10px}
 .home-list .template-title{white-space:normal}
 .home-list .template-category{grid-column:2;max-width:none}
 .home-list .template-row:last-child{border-bottom:0}
}
/* Rich text controls use generated format classes; only popups receive position styles. */
.editor-toolbar .editor-font-size::-webkit-calendar-picker-indicator{display:none!important}
.editor-toolbar .editor-font-size{width:40px;min-width:40px;height:28px;margin:0;padding:2px 0;text-align:center;font-size:12px;border:1px solid var(--card-line);border-radius:2px;background:var(--surface)}
.editor-toolbar .font-control{width:120px;min-width:120px}
.editor-color-button{position:relative}
.editor-color-indicator{fill:currentColor;color:var(--ink)}
.editor-color-button[data-editor-command="highlight"] .editor-color-indicator:not([class*="tc-"]){fill:transparent;stroke:var(--muted);stroke-width:.5px}
.editor-color-popup{width:250px;padding:16px}
.color-grid{display:flex;flex-direction:column;gap:2px}
.color-grid-row{display:flex;gap:2px}
.editor-popup button.color-cell{width:20px;height:20px;min-width:20px;min-height:20px;padding:0;border:1px solid rgba(7,26,51,.15);border-radius:0}
.editor-popup button.color-cell:hover,.editor-popup button.color-cell[aria-selected="true"]{outline:2px solid var(--primary);outline-offset:-2px}
.editor-popup button.color-none{width:100%;margin:0 0 12px;color:var(--ink);background:transparent;text-align:left;border-radius:4px}
.editor-popup button.color-none:hover,.editor-popup button.color-none[aria-selected="true"]{background:var(--selected)}
.editor-spacing-popup{width:180px;padding:8px}
.editor-popup .spacing-option{display:flex;align-items:center;gap:12px;width:100%;padding:8px 12px;text-align:left;color:var(--ink);background:transparent;border-radius:4px}
.editor-popup .spacing-option:hover{background:var(--hover)}
.spacing-option .icon{visibility:hidden}
.spacing-option[aria-checked="true"] .icon{visibility:visible}
@media(min-width:1101px){.editor-toolbar{width:calc(100% + 344px)}.edit-sidebar{margin-top:56px}}
/* design review, batch 5: colour and spacing buttons show their state without a pressed fill */
.editor-toolbar button.editor-color-button[aria-pressed=true],.editor-toolbar button[data-editor-command="lineSpacing"][aria-pressed=true]{background:transparent;color:var(--muted)}
.editor-toolbar button.editor-color-button[aria-pressed=true]:hover,.editor-toolbar button[data-editor-command="lineSpacing"][aria-pressed=true]:hover{background:var(--hover)}
.editor-popup .spacing-option{justify-content:flex-start;min-height:32px;padding:4px 16px 4px 12px}
.editor-popup .spacing-option:focus-visible,.editor-popup button.color-none:focus-visible{outline:0;background:var(--hover)}
.editor-popup button.color-none{justify-content:flex-start;min-height:32px;padding:4px 8px;margin:0 0 8px;border-radius:0;border-bottom:1px solid var(--card-line)}
.editor-popup button.color-none:hover,.editor-popup button.color-none[aria-selected="true"]{background:var(--hover)}
u [class*="tc-"]{text-decoration:underline}
@media(max-width:600px){.editor-tools{margin-right:4px}}

/* Contract numbering, batch 6. The display retains literal Markdown markers. */
@counter-style olt-kana{system:fixed;symbols:ア イ ウ エ オ カ キ ク ケ コ サ シ ス セ ソ タ チ ツ テ ト ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ マ ミ ム メ モ ヤ ユ ヨ ラ リ ル レ ロ ワ ヲ ン;suffix:" ";fallback:decimal}
.markdown ul.num-paren,.markdown ul.num-kana{list-style:none;padding-left:2em}
/* The number hangs to the left of the item, as in the editor, so every line of the item starts at the same place. */
.markdown ul.num-paren>li,.markdown ul.num-kana>li{position:relative}
.markdown ul.num-paren>li>p,.markdown ul.num-kana>li>p{margin-left:0}
.markdown .item-no{position:absolute;right:calc(100% + .25em);white-space:nowrap}
.ProseMirror ul.num-paren,.ProseMirror ul.num-kana{padding-left:2em;list-style:none;counter-reset:olt-paren olt-kana}
.ProseMirror ul.num-paren>li,.ProseMirror ul.num-kana>li{text-indent:0;position:relative}
.ProseMirror ul.num-paren>li{counter-increment:olt-paren}
.ProseMirror ul.num-kana>li{counter-increment:olt-kana}
.ProseMirror ul.num-paren>li:before,.ProseMirror ul.num-kana>li:before{position:absolute;right:calc(100% + .25em);white-space:nowrap}
.ProseMirror ul.num-paren>li:before{content:"(" counter(olt-paren) ")"}
.ProseMirror ul.num-kana>li:before{content:counter(olt-kana,olt-kana)}
.editor-toolbar button.editor-list-dropdown{width:16px;min-width:16px;height:32px;margin:0}
.editor-toolbar button.editor-list-dropdown .icon{width:16px}
.outline-subheading{padding-left:16px}
.reference-card{padding:16px;margin:0 0 20px}
.reference-card h2{font-size:14px;margin:0 0 12px;font-weight:600}
.reference-item+.reference-item{border-top:1px solid var(--line);margin-top:16px;padding-top:16px}
.reference-context.text-button{display:block;text-align:left;height:auto;min-height:0;font-size:13px;line-height:1.6;padding:0;border-radius:0;color:var(--ink);white-space:normal}
.reference-proposal{font-size:14px;font-weight:600;margin:8px 0}
.reference-actions{display:flex;gap:8px;align-items:center}
.reference-actions button{height:32px;min-height:32px;font-size:13px;padding:4px 16px}
.reference-warning{font-size:13px;color:var(--error)}
@media(max-width:600px){.reference-card{margin:0 0 16px}.edit-layout:has(.reference-card:not([hidden])) .edit-sidebar{display:contents}.edit-layout:has(.reference-card:not([hidden])) .reference-card{grid-row:1}.edit-layout:has(.reference-card:not([hidden])) .document-column{grid-row:2}}
/* The check list stays in view while editing a long contract: the sidebar follows the page on wide screens. */
.reference-card [data-editor-reference-list]{max-height:min(50vh,420px);overflow-y:auto}
@media(min-width:1101px){.edit-sidebar{position:sticky;top:128px;max-height:calc(100vh - 144px);overflow-y:auto}}
@media(max-width:600px){.reference-card [data-editor-reference-list]{max-height:232px}.edit-layout:has(.reference-card:not([hidden])) .reference-card{margin-bottom:0}}

/* Tracked comparisons, batch 7a. Existing document/editor rules stay intact. */
.tracked-diff-page,.proposal-changes{max-width:1208px;margin:auto;padding:24px}
.changes-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;align-items:start}
.changes-main,.change-sidebar{min-width:0}
.changes-main{grid-row:2}
.change-sidebar{grid-row:1;width:100%;max-width:816px;margin:0 auto}
.change-sidebar h2{font-size:16px;font-weight:500;margin:0 0 12px}
.change-sidebar ol{padding-left:24px;margin-bottom:0}
.change-sidebar li{margin:12px 0;overflow-wrap:anywhere}
.changes-main .paper{width:100%;max-width:816px;margin:0 auto}
.change-legend{display:flex;flex-wrap:wrap;gap:2px 16px;font-size:12px;color:var(--subtle);line-height:1.9;margin:0 0 12px;overflow-wrap:anywhere}
.change-legend>*{white-space:nowrap}
.tracked-changes ins,.change-legend ins{color:var(--primary);text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px;background:var(--selected)}
.tracked-changes del,.change-legend del{color:#B3261E;text-decoration:line-through;text-decoration-thickness:1.5px;background:#FCE8E6;padding:0 1px;margin-right:1px}
.change-sidebar a{font-weight:400}
.status-chip{display:inline-block;background:var(--selected);color:var(--on-selected);border-radius:8px;padding:2px 8px;font-size:12px;font-weight:500}
.proposal-body{margin:24px 0}
.proposal-body summary{cursor:pointer;font-size:16px;font-weight:500;padding:8px 0}
.proposal-body .paper{width:100%;max-width:816px;margin:12px 0 0}
.chg-row{position:relative;min-width:0;overflow-wrap:anywhere;scroll-margin-top:88px;margin:0 0 12px}
.chg-row:not(.chg-same)::before{content:"";position:absolute;top:0;bottom:0;left:-15px;width:3px;background:var(--subtle)}
.tracked-changes .chg-indent-0{padding-left:2em;text-indent:-2em}
.tracked-changes .chg-indent-1{padding-left:4em;text-indent:-2em}
.tracked-changes .chg-indent-2{padding-left:6em;text-indent:-2em}
.chg-quote{border-left:2px solid var(--card-line);padding-left:20px;color:var(--muted)}
.chg-code{font-family:monospace;white-space:pre-wrap;font-size:13px}
.chg-table-scroll{max-width:100%;overflow-x:auto}
.chg-table-label{font-size:12px;color:var(--subtle);margin:12px 0 4px}
.tracked-changes .chg-table-scroll table{min-width:240px}
.comparison-form{display:flex;flex-wrap:wrap;gap:16px;align-items:end;margin:20px 0 16px}
.comparison-form label{flex:1 1 240px;max-width:320px;min-width:0;margin:0;font-size:12px}
.comparison-form select{width:100%;min-width:0;height:40px;font-size:14px}
.change-actions{display:flex;flex-wrap:wrap;gap:16px;align-items:center;margin:16px 0}
.change-view-switch{display:inline-flex;border:1px solid var(--input-line);border-radius:var(--radius-control);overflow:hidden}
.change-view-switch a{display:flex;align-items:center;justify-content:center;min-height:40px;padding:0 24px;color:var(--muted);font-size:14px}
.change-view-switch a+a{border-left:1px solid var(--input-line)}
.change-view-switch a[aria-current="page"]{background:var(--selected);color:var(--on-selected)}
@media(min-width:1101px){.changes-layout{grid-template-columns:minmax(0,816px) 320px}.changes-main{grid-column:1;grid-row:1}.change-sidebar{grid-column:2;grid-row:1;position:sticky;top:88px;max-height:calc(100vh - 112px);overflow-y:auto}}
@media(max-width:600px){.tracked-diff-page,.proposal-changes{padding:16px}.comparison-form{gap:12px}.comparison-form label{max-width:none}.change-sidebar ol{max-height:200px;overflow-y:auto;scrollbar-width:thin}.change-actions{gap:8px}.change-view-switch a{padding:0 20px}}
.reference-context.text-button{font-weight:400}
.reference-proposal{font-weight:500}
.reference-card [data-editor-reference-list],.edit-sidebar{scrollbar-width:thin;scrollbar-color:var(--paper-line) transparent}
.reference-item{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
.reference-item+.reference-item{margin-top:12px;padding-top:12px}
.reference-context.text-button{flex:1 0 100%}
.reference-where{order:-1;flex:1 0 100%;margin:0;font-size:12px;color:var(--subtle)}
.reference-proposal{flex:1 1 auto;margin:4px 0}
.reference-actions{flex:0 0 auto;gap:4px}
.reference-actions button{padding:4px 10px}
.reference-card{padding:16px 12px}
/* Text scrolling under the sticky toolbar must not show through the gap around its rounded shape. */
.editor-toolbar{box-shadow:0 0 0 12px var(--canvas)}
.document-outline li.outline-subheading+li:not(.outline-subheading){margin-top:8px}
/* "Fix all" sits beside the card title and applies every renumbering proposal at once. */
.reference-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 12px}
.reference-head h2{margin:0}
.reference-head button{height:32px;min-height:32px;font-size:13px;padding:4px 10px;white-space:nowrap}
.reference-head{flex-wrap:wrap}
.reference-head button{margin-left:auto}
.reference-proposal{white-space:pre-line}

/* Editing comparisons and selective proposals, batch 7b. */
.editor-changes-paper{width:100%;min-height:640px;cursor:auto}
/* The notice is a tinted bar with a text button, so closing the comparison does not depend on finding the toolbar icon. */
.editor-changes-bar{max-width:816px;margin:0 auto}
.editor-changes-bar:has(.editor-changes-message:not([hidden])){display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;margin-bottom:12px;padding:6px 8px 6px 16px;border-radius:8px;background:var(--selected);color:var(--on-selected)}
.editor-changes-bar:has(.editor-changes-message[role=alert]){background:#FCE8E6;color:#8C1D18}
.editor-changes-message{flex:1 1 240px;min-width:0;margin:0;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.editor-changes-close.text-button{flex:0 0 auto;margin-left:auto;height:32px;min-height:32px;padding:0 12px;border-radius:var(--radius-control);font-size:13px;font-weight:500;color:var(--primary);white-space:nowrap}
.editor-changes-close.text-button:hover{background:rgba(14,123,163,.08)}
.editor-changes-legend{max-width:816px;margin:0 auto 8px}
.change-item{display:flex;align-items:center;justify-content:space-between;gap:8px}
.change-item a{min-width:0;word-break:keep-all;overflow-wrap:anywhere}
.change-revert{flex:0 0 auto;height:28px;min-height:28px;padding:0 10px;border:1px solid var(--card-line);border-radius:var(--radius-control);background:transparent;color:var(--muted);font-size:12px;font-weight:500;white-space:nowrap}
.change-revert:hover{background:var(--hover)}
.editor-changes-card ol{padding-left:24px;max-height:min(50vh,420px);overflow-y:auto;scrollbar-width:thin}
.editor-changes-card li{margin:12px 0;overflow-wrap:anywhere}
.editor-changes-card small,.change-sidebar small{display:block;font-size:12px;color:var(--subtle);margin-top:4px}
.change-sidebar input[type=checkbox]{display:inline-block;width:20px;height:20px;margin:0 6px 0 0;vertical-align:-5px;accent-color:var(--primary)}
/* The automatic renumbering row has no checkbox; indent it so its text lines up with the rows that do. */
.change-sidebar li.change-auto{padding-left:26px}
.change-sidebar form>button{max-width:100%;height:auto;min-height:40px;white-space:normal}
@media(max-width:600px){.editor-changes-paper{min-height:480px}.edit-layout:has(.editor-changes-card:not([hidden])) .edit-sidebar{display:contents}.edit-layout:has(.editor-changes-card:not([hidden])) .editor-changes-card{grid-row:1;margin:0}.edit-layout:has(.editor-changes-card:not([hidden])) .document-column{grid-row:2}.edit-layout:has(.editor-changes-card:not([hidden])) [data-editor-references]{grid-row:auto}.editor-changes-card ol{max-height:232px}.edit-layout:has(.editor-changes-card:not([hidden])) .editor-toolbar{display:none}.change-sidebar input[type=checkbox]{width:22px;height:22px;vertical-align:-6px}.change-sidebar form li{padding-block:4px}.change-sidebar li.change-auto{padding-left:28px}}

/* Keep contract typography independent of the surrounding application theme. */
.paper,.editor-surface,.source-document,.markdown{font-family:"Segoe UI","Yu Gothic UI","Meiryo UI",Meiryo,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif}
.markdown h1{color:inherit}
.markdown blockquote,.markdown .chg-quote{color:rgb(68,71,70)}
.markdown a,.markdown ins{color:rgb(11,87,208)}
.home-page{padding-bottom:96px}
.home-list{min-width:0;align-self:start;background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card);box-shadow:var(--shadow-card);padding:8px 20px 12px}
.tree details.tree-empty>summary{color:var(--subtle)}
.tree details.tree-empty .count{opacity:.6}
@media(min-width:851px){.home-list .template-row{min-height:60px}}
/* A flat footer under a thin cyan rule separates it from the patterned closing band above. */
.site-footer{display:block;background:var(--navy-deep);border-top:1px solid rgba(84,211,234,.45);padding:40px 32px}
.footer-inner{max-width:1056px;margin:auto;min-width:0}
.footer-main{display:flex;justify-content:space-between;align-items:flex-start;gap:32px}
.site-footer .brand{color:var(--on-navy);font-weight:700}
.footer-tagline{margin:12px 0 0;font-size:13px;color:var(--on-navy-muted)}
.footer-links{display:flex;flex-wrap:wrap;gap:16px;align-items:center;font-size:13px}
.site-footer .footer-links a{color:var(--on-navy)}
.footer-license{border-top:1px solid rgba(110,196,232,.22);padding-top:20px;margin:24px 0 0;font-size:13px;color:var(--on-navy-muted)}
.site-footer :focus-visible,.hero :focus-visible,#ai :focus-visible,.lp-cta :focus-visible,.fab:focus-visible{outline-color:var(--cyan)}
.fab{position:fixed;right:24px;bottom:24px;z-index:40;display:inline-flex;align-items:center;height:56px;padding:0 22px 0 18px;gap:10px;border-radius:16px;background:var(--primary);color:var(--surface);font-size:15px;font-weight:700;box-shadow:0 6px 20px rgba(7,26,51,.28);text-decoration:none;transition:background-color 120ms,box-shadow 120ms,transform 120ms}
.fab>.icon{width:24px;height:24px;color:var(--surface)}
/* On the landing page the button follows the viewport only until the closing band, which has its own buttons. */
.fab-dock{position:sticky;bottom:0;z-index:40;height:0;display:flex;justify-content:flex-end;align-items:flex-end;padding-right:24px;pointer-events:none}
.fab-dock .fab{position:static;margin-bottom:24px;pointer-events:auto}
/* The button floats over navy bands as well as white ones, so it uses the lighter primary colour. */
.fab:hover{background:var(--primary-hover);box-shadow:0 10px 28px rgba(7,26,51,.36);transform:translateY(-1px);text-decoration:none}
.hero,.lp-section,.lp-cta{font-family:Meiryo,"Hiragino Kaku Gothic ProN","Yu Gothic UI","Noto Sans JP",sans-serif}
.hero,#ai,.lp-cta{background-color:var(--navy-deep);background-image:radial-gradient(circle at 12% 0%,rgba(84,211,234,.18),transparent 46%),linear-gradient(rgba(110,196,232,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(110,196,232,.07) 1px,transparent 1px),linear-gradient(180deg,var(--navy-deep),var(--navy-mid) 55%,var(--navy-low));background-size:auto,38px 38px,38px 38px,auto}
.hero-inner{max-width:1440px;margin:auto;padding:28px 32px;display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:center;gap:32px}
.kicker{font-size:11px;font-weight:700;letter-spacing:.18em;line-height:1.2;color:var(--primary);margin:0 0 12px}
.hero .kicker{color:var(--cyan);margin-bottom:4px}
.hero h1{font-size:clamp(28px,2.4vw,34px);line-height:1.45;font-weight:700;color:var(--on-navy);text-wrap:balance;margin:0 0 4px}
.hero-description{font-size:15px;line-height:1.8;color:var(--on-navy-muted);max-width:46em;margin:0 0 8px}
.hero-nav{display:flex;flex-wrap:wrap;gap:8px 20px;font-size:13px}
.hero-nav a{color:var(--cyan-soft);text-decoration:underline;font-weight:400}
.hero-points{display:flex;flex-direction:column;align-items:flex-start;gap:8px;list-style:none;padding:0;margin:0}
.hero-points li{display:flex;align-items:center;gap:8px;max-width:100%;border:1px solid rgba(110,196,232,.5);background:rgba(84,211,234,.08);border-radius:100px;padding:6px 14px 6px 10px;font-size:13px;color:var(--on-navy)}
.hero-points .icon{width:18px;height:18px;color:var(--cyan)}
.lp-section{background:var(--surface)}
.lp-inner{max-width:1120px;margin:auto;padding:72px 32px;min-width:0}
.lp-section h2{font-size:26px;font-weight:700;line-height:1.5;color:var(--navy-ink);margin:0 0 16px}
.lp-intro{font-size:15px;line-height:1.9;color:var(--muted);max-width:44em;margin:0 0 32px}
.feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
#features{background:var(--canvas)}
.feature-card{background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card);padding:24px;box-shadow:var(--shadow-card);transition:border-color 120ms}
.feature-card:hover{border-color:var(--primary)}
.feature-icon{display:inline-flex;width:44px;height:44px;border-radius:12px;align-items:center;justify-content:center;background:var(--navy)}
.feature-icon>.icon{width:24px;height:24px;color:var(--cyan)}
.feature-card h3{font-size:17px;font-weight:700;color:var(--navy-ink);margin:16px 0 8px}
.feature-card p{font-size:14px;line-height:1.85;color:var(--muted);margin:0}
#how,#faq{background:var(--surface-low)}
.steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:32px;list-style:none;padding:0;margin:0}
.step-number{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--navy);color:var(--cyan);font-weight:700}
.steps li{position:relative}
/* A dashed rule runs from each step number to the next one. */
.steps li:not(:last-child):before{content:"";position:absolute;top:17px;left:52px;right:-16px;border-top:2px dashed var(--paper-line)}
.steps h3{font-size:16px;font-weight:700;margin:16px 0 8px}
.steps p{font-size:14px;line-height:1.85;color:var(--muted);margin:0}
#ai{background-image:radial-gradient(circle at 88% 0%,rgba(84,211,234,.18),transparent 46%),linear-gradient(rgba(110,196,232,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(110,196,232,.07) 1px,transparent 1px),linear-gradient(180deg,var(--navy-deep),var(--navy-mid) 55%,var(--navy-low))}
.ai-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:48px;align-items:center}
#ai .kicker{color:var(--cyan)}
#ai h2{color:var(--on-navy)}
#ai .lp-intro{color:var(--on-navy-muted);margin-bottom:0}
.ai-tools{display:grid;gap:12px;list-style:none;padding:0;margin:0}
.ai-tools li{display:flex;align-items:flex-start;gap:12px;border:1px solid rgba(110,196,232,.5);border-radius:var(--radius-control);padding:14px 16px;background:rgba(6,20,40,.5)}
.ai-tools .icon{color:var(--cyan);margin-top:2px}
.ai-tools strong{font-size:14px;color:var(--on-navy);font-weight:700}
.ai-tools p{font-size:13px;line-height:1.85;color:var(--on-navy-muted);margin:4px 0 0}
.pricing-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;max-width:880px;margin:auto}
.price-card{min-width:0;background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card);padding:28px;box-shadow:var(--shadow-card)}
.price-card h3{font-size:13px;font-weight:700;color:var(--primary);margin:0 0 12px}
.price{font-size:30px;font-weight:700;color:var(--navy-ink);margin:0 0 24px}
.price-card ul{display:grid;gap:8px;list-style:none;padding:0;margin:0;font-size:14px;line-height:1.9;color:var(--muted)}
.price-card li{display:flex;align-items:flex-start;gap:8px}
.price-card li .icon{width:18px;height:18px;color:var(--primary);margin-top:4px}
.price-note{font-size:13px;line-height:1.85;color:var(--subtle);border-top:1px solid var(--line);padding-top:20px;margin:24px 0 0}
#faq .lp-inner{max-width:800px}
.faq-list{margin-top:32px;display:grid;gap:12px}
.faq-item{min-width:0;background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card)}
.faq-item>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;font-size:16px;font-weight:700;color:var(--navy-ink);list-style:none;cursor:pointer}
.faq-item>summary::-webkit-details-marker{display:none}
/* The site-wide summary arrow would sit next to the icon; the FAQ uses the icon only. */
.faq-item>summary:after{display:none}
/* The closing band joins the footer; the page keeps its bottom room only when the band is absent. */
.home-page:has(.lp-cta){padding-bottom:0}
#pricing .lp-inner{max-width:944px}
.faq-item>summary>.icon{transition:transform 120ms}
.faq-item[open]>summary>.icon{transform:rotate(180deg)}
.faq-item>p{font-size:14.5px;line-height:1.9;color:var(--muted);padding:0 24px 24px;margin:0}
.lp-cta{text-align:center;padding:64px 32px}
.lp-cta-inner{max-width:1120px;margin:auto}
.lp-cta h2{font-size:30px;line-height:1.5;font-weight:700;color:var(--on-navy);text-wrap:balance;margin:0 0 12px}
.lp-cta p{color:var(--on-navy-muted);margin:0 0 28px}
.cta-actions .button{height:48px;padding:0 28px;font-size:15px}
.cta-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:16px}
.cta-primary{background:var(--cyan);color:var(--navy-deep);font-weight:700}
.cta-primary:hover{background:var(--cyan-soft)}
.cta-secondary{border:1px solid rgba(110,196,232,.6);color:var(--on-navy);background:transparent}
.cta-secondary:hover{background:rgba(84,211,234,.08)}
@media(max-width:1000px){.hero-inner{grid-template-columns:minmax(0,1fr);gap:16px}.hero-points{flex-direction:row;flex-wrap:wrap}.feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.ai-layout{grid-template-columns:minmax(0,1fr);gap:32px}}
@media(max-width:800px){.steps{grid-template-columns:minmax(0,1fr)}.steps li:not(:last-child):before{display:none}}
@media(max-width:760px){.pricing-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:640px){.feature-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){
 .hero-inner{padding:20px 16px 16px;gap:12px}
 .hero h1{font-size:22px}
 .hero-description{font-size:14px;line-height:1.7}
 /* The in-page links give their row to the three points, which wrap instead of being cut at the edge. */
 .hero-nav{display:none}
 .hero-points{gap:6px 8px}
 .hero-points li{padding:4px 12px 4px 8px;font-size:12px}
 .fab-dock{padding-right:16px}
 .fab-dock .fab{margin-bottom:16px}
 .lp-inner{padding:48px 16px}
 .lp-section h2{font-size:21px}
 .lp-cta{padding:48px 16px}
 .lp-cta h2{font-size:22px}
 .site-footer{padding:40px 32px}
 .footer-main{flex-direction:column;gap:24px}
 .footer-links{flex-direction:column;align-items:flex-start;gap:12px}
 .faq-item>summary{padding:20px 16px}
 .faq-item>p{padding:0 16px 20px}
 .fab{right:16px;bottom:16px;padding:0;width:56px;justify-content:center}
 .fab>span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
}

.kicker:has(>.icon){display:flex;align-items:center;gap:8px}
.kicker>.icon{width:18px;height:18px}

/* batch 10 */
:root{
 --diff-del-bg:#FFF0ED;--diff-del-strong:#F1C5BD;
 --diff-add-bg:#EAF6F0;--diff-add-strong:#B9E1CC;
}
.author-avatar{display:inline-flex;align-items:center;flex:0 0 28px;width:28px;height:28px;min-height:28px;font-size:13px;color:var(--surface)}
.history-author{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;color:var(--muted);font-size:13px;overflow-wrap:anywhere}
.history-author time{color:var(--muted)}
.history-browser{max-width:1120px}
.history-title{display:flex;justify-content:space-between;align-items:start;flex-wrap:wrap;gap:12px;margin-bottom:24px}
.history-title h1{margin:0}
.history-title .actions{margin:0}
.history-day{position:relative;margin-left:12px;padding:0 0 24px 24px;border-left:1px solid var(--card-line)}
.history-day h2{position:relative;margin:0 0 12px;font-size:15px}
.history-day h2:before{content:"";position:absolute;left:-30px;top:6px;width:11px;height:11px;border-radius:50%;border:2px solid var(--muted);background:var(--canvas)}
.history-batch{list-style:none;padding:0;margin:0;border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface);overflow:hidden}
.history-entry{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;min-width:0}
.history-entry+.history-entry{border-top:1px solid var(--line)}
.history-entry-main{flex:1;min-width:0}
.history-note{display:block;font-weight:600;color:var(--ink);overflow-wrap:anywhere;margin-bottom:8px}
.history-entry-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;min-width:0}
.version-badge{display:inline-flex;align-items:center;min-height:28px;padding:2px 8px;border:1px solid var(--card-line);border-radius:4px;font:12px/1.5 Consolas,monospace;color:var(--muted);white-space:nowrap}
.line-stats{display:inline-flex;gap:8px;font:13px/1.5 Consolas,monospace;white-space:nowrap}
.line-added{color:var(--added-ink)}
.line-removed{color:var(--removed-ink)}
.older-versions{display:inline-flex;min-height:40px;align-items:center;margin-left:36px}
.change-summary{display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin:20px 0}
.change-summary strong{font-size:14px;font-weight:500}
.diff-meter{display:inline-flex;gap:3px}
.diff-meter>span{width:9px;height:9px;border-radius:1px}
.meter-add{background:var(--added-ink)}
.meter-del{background:var(--removed-ink)}
.meter-empty{background:var(--card-line)}
.version-range{font:14px/1.8 Consolas,monospace;overflow-wrap:anywhere}
.comparison-arrow{padding-bottom:8px}
.change-view-switch{max-width:100%}
.change-view-switch a{white-space:nowrap;padding:0 16px}
.changes-main .paper.line-paper{padding:0;max-width:none;min-height:0;overflow:hidden}
.diff-table,.blame-table{width:100%;table-layout:fixed;border-collapse:collapse;color:var(--ink);background:var(--surface);font:12px/1.8 Consolas,"BIZ UDGothic","MS Gothic",monospace}
.diff-table th,.diff-table td,.blame-table th,.blame-table td{border:0;padding:4px 8px;vertical-align:top}
.diff-table thead th,.blame-table thead th{background:var(--surface-low);color:var(--muted);font-weight:400;text-align:left;border-bottom:1px solid var(--line);font-size:11px}
.diff-table .number-column{width:48px}
.diff-table .line-number,.blame-table .line-number{color:var(--muted);text-align:right;user-select:none}
.line-text{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
.diff-table .line-text{padding-left:24px;position:relative}
.line-sign{position:absolute;left:8px;white-space:pre}
.diff-table .before-text,.diff-table .before-number{border-right:1px solid var(--line)}
.diff-table .diff-del{background:var(--diff-del-bg)}
.diff-table .diff-add{background:var(--diff-add-bg)}
.diff-table del{background:var(--diff-del-strong);color:var(--ink);text-decoration:line-through}
.diff-table ins{background:var(--diff-add-strong);color:var(--ink);text-decoration:underline}
.diff-table .diff-context>td{padding:0;border-block:1px solid var(--line)}
.diff-context summary{padding:8px 16px;min-height:40px;color:var(--primary);background:var(--surface-low);cursor:pointer;overflow-wrap:anywhere}
.diff-table .diff-nested{border:0}
.blame-page{max-width:1208px}
.blame-table{border:1px solid var(--card-line)}
.blame-table th:first-child{width:208px}
.blame-table th:nth-child(2){width:48px}
.blame-table tbody+tbody{border-top:1px solid var(--line)}
.blame-origin{background:var(--surface-low);overflow-wrap:anywhere}
.blame-origin>span,.blame-origin>time{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.template-related{display:flex;align-items:center;flex-wrap:wrap;gap:12px 20px;margin:0 24px 16px;font-size:13px;color:var(--muted)}
.latest-change{display:flex;align-items:center;gap:12px 16px;flex-wrap:wrap;max-width:1208px;margin:16px auto 24px;padding:12px 20px;background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card)}
.latest-label{font-size:12px;color:var(--muted)}
.latest-change .history-author{flex:1}
.latest-note{color:var(--ink);font-weight:500;overflow-wrap:anywhere}
.latest-history{display:inline-flex;align-items:center;gap:8px;font-size:13px;white-space:nowrap;min-height:40px}
.proposal-heading{display:flex;align-items:start;flex-wrap:wrap;gap:16px;margin-bottom:16px}
.proposal-heading h1{margin:0;flex:1 1 280px;white-space:pre-wrap}
.status-chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:100px;font-size:13px;white-space:nowrap}
.proposal-open{background:var(--added-bg);color:var(--added-ink)}
.proposal-merged{background:var(--navy-ink);color:var(--surface)}
.proposal-declined,.proposal-withdrawn{background:var(--removed-bg);color:var(--removed-ink)}
.proposal-tabs{display:flex;gap:8px;margin:24px 0;border-bottom:1px solid var(--card-line)}
.proposal-tabs a{display:flex;align-items:center;min-height:44px;padding:8px 20px;color:var(--muted);border-bottom:2px solid transparent}
.proposal-tabs a[aria-current=page]{border-color:var(--primary);color:var(--ink);font-weight:600}
.proposal-conversation{max-width:864px;margin:0 auto}
.proposal-comment{background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius-card);margin:16px 0;overflow:hidden}
.proposal-comment>header{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:12px 16px;background:var(--surface-low);font-size:13px;color:var(--muted)}
.proposal-comment>header strong{font-weight:500;color:var(--ink);overflow-wrap:anywhere}
.proposal-comment>p{padding:16px;margin:0;overflow-wrap:anywhere}
.comment-actions{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
.comment-actions button{background:transparent;color:var(--muted);padding:4px 8px;min-height:40px;font-size:12px}
.comment-actions button:not(:disabled):hover{color:var(--surface)}
.proposal-event{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:16px 20px;margin:16px 0;color:var(--muted);font-size:13px;border-block:1px solid var(--line)}
.proposal-merge,.proposal-comment-form{margin:24px 0}
.proposal-merge h2,.proposal-comment-form h2{margin-top:0}
.proposal-merge .actions{margin-bottom:0}
@media(max-width:600px){
 .history-entry{align-items:start;flex-direction:column;gap:8px;padding:12px}
 .history-entry-actions{justify-content:flex-start;gap:8px;width:100%}
 .history-day{padding-left:16px;margin-left:4px}
 .history-day h2:before{left:-22px}
 .change-view-switch{display:flex;width:100%}
 .change-view-switch a{flex:1;padding:0 8px;font-size:12px;min-width:0}
 .comparison-arrow{display:none}
 .diff-table .number-column{width:36px}
 .diff-table.diff-split,.diff-split>tbody,.diff-split>tbody>.diff-line{display:block;width:100%}
 .diff-split>colgroup,.diff-split>thead{display:none}
 .diff-split>tbody>.diff-line{display:grid;grid-template-columns:36px minmax(0,1fr)}
 .diff-split .before-number{grid-area:1 / 1}
 .diff-split .before-text{grid-area:1 / 2}
 .diff-split .after-number{grid-area:2 / 1}
 .diff-split .after-text{grid-area:2 / 2}
 .diff-split .before-number,.diff-split .before-text{border-right:0}
 .diff-split>tbody>.diff-context,.diff-split>tbody>.diff-context>td{display:block;width:100%}
 .blame-table th:first-child{width:108px}
 .blame-table th:nth-child(2){width:32px}
 .blame-table th,.blame-table td{padding:4px}
 .blame-origin>span,.blame-origin>time{font-size:11px}
 .template-related{margin-inline:16px}
 .latest-change{margin-inline:16px;padding:12px;gap:8px}
 .latest-change .history-author{flex-basis:100%}
 .latest-history{margin-left:auto}
 .proposal-comment>header,.proposal-comment>p{padding:12px}
 .comment-actions{margin-left:0;width:100%}
 .proposal-tabs a{padding-inline:16px}
}

.name-check{border:1px solid var(--note-line);border-left-width:4px;border-radius:12px;padding:16px 20px;margin:16px 24px;background:var(--note-bg);color:var(--note-ink);overflow-wrap:anywhere;min-width:0}.name-check h2{margin:0 0 4px;font-size:16px;font-weight:600;color:var(--note-ink)}.name-check p{margin:4px 0;font-size:13px;line-height:1.7}.name-check ul{margin:8px 0;padding-left:20px}.name-check li{margin:8px 0;font-size:13px}.name-check li span,.name-check li strong{display:block}.name-check .check{font-weight:600}@media(max-width:559px){.name-check{margin:12px 16px;padding:12px 16px}}

.document-outline .outline-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px}
.document-outline .outline-heading h2{margin:8px 0}
.document-outline .toc-open{display:none}
.document-outline .outline-list button{display:block;width:100%;padding:8px 12px;text-align:left;color:var(--subtle);background:transparent;border:0;border-radius:4px;font:inherit;box-shadow:none;overflow-wrap:anywhere;min-width:0}
.document-outline .outline-list button:hover{background:var(--hover)}
.document-outline .outline-list button[aria-current]{color:var(--primary);background:var(--selected)}
.document-outline .outline-subheading{padding-left:16px}
.document-outline-compact{margin-bottom:16px;padding:12px;border:1px solid var(--paper-line);border-radius:8px}
.document-outline-compact ol{padding-left:24px}
.document-outline-compact a{overflow-wrap:anywhere}
.toc-closed .document-outline .outline-panel{display:none}
.toc-closed .document-outline .toc-open{display:inline-flex}
@media(min-width:560px){
 .document-outline-compact{display:none}
 .edit-layout.has-editor-toc{grid-template-columns:min(var(--toc-w,168px),35vw) minmax(0,1fr) 320px;max-width:1680px}
 .edit-layout.has-editor-toc>.document-outline{grid-column:1;grid-row:1;top:144px;margin-top:56px;max-height:calc(100vh - 160px)}
 .edit-layout.has-editor-toc>.document-column{grid-column:2;grid-row:1}
 .edit-layout.has-editor-toc>.edit-sidebar{grid-column:3;grid-row:1}
 .toc-closed .reading-layout{grid-template-columns:40px minmax(0,1fr)}
 .toc-closed .edit-layout.has-editor-toc{grid-template-columns:40px minmax(0,1fr) 320px}
}
@media(min-width:1200px){
 .edit-layout.has-editor-toc{grid-template-columns:min(var(--toc-w,216px),35vw) minmax(0,1fr) 320px}
 .toc-closed .reading-layout{padding-right:calc(40px + 24px)}
}
@media(min-width:560px) and (max-width:1100px){
 .edit-layout.has-editor-toc{grid-template-columns:min(var(--toc-w,168px),35vw) minmax(0,1fr)}
 .edit-layout.has-editor-toc>.edit-sidebar{grid-column:2;grid-row:auto}
 .toc-closed .edit-layout.has-editor-toc{grid-template-columns:40px minmax(0,1fr)}
}
@media(min-width:560px) and (max-width:600px){
 .edit-layout.has-editor-toc:has(.reference-card:not([hidden])) .edit-sidebar,.edit-layout.has-editor-toc:has(.editor-changes-card:not([hidden])) .edit-sidebar{display:block}
 .edit-layout.has-editor-toc:has(.reference-card:not([hidden])) .document-column,.edit-layout.has-editor-toc:has(.editor-changes-card:not([hidden])) .document-column{grid-row:1}
}
@media(max-width:559px){.edit-layout>[data-editor-toc]{display:none}}

.suggest-added,.suggest-excerpt-added{color:var(--added-ink);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
.suggest-removed,.suggest-excerpt-removed{color:var(--removed-ink);text-decoration:line-through;background:var(--removed-bg);white-space:pre-wrap;overflow-wrap:anywhere}
.suggest-added{background:var(--added-bg)}
.suggest-focus{outline:2px solid var(--primary);outline-offset:2px;background:var(--selected)}
.suggest-mode{position:relative;margin-left:auto;flex:0 0 auto;max-width:100%}
.editor-toolbar .suggest-mode-button{width:auto;gap:4px;padding:4px 8px;white-space:nowrap}
.suggest-mode-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:45;width:280px;max-width:calc(100vw - 32px);padding:8px 0;border-radius:8px;background:var(--surface);box-shadow:var(--menu-shadow)}
.editor-toolbar .suggest-mode-menu button{display:flex;justify-content:flex-start;width:100%;height:auto;min-height:40px;gap:12px;padding:8px 16px;text-align:left;color:var(--ink)}
.suggest-mode-menu button[aria-checked=true]{background:var(--selected)}
.suggest-mode-menu button[aria-disabled=true]{color:var(--subtle);cursor:default}
.suggest-mode-menu small{display:block;font-size:11px;font-weight:400;white-space:normal}
.suggest-panel{min-width:0;padding:16px;margin-bottom:20px}
.suggest-list{display:grid;gap:12px}
.suggest-card{min-width:0;border:1px solid var(--card-line);border-radius:8px;padding:12px;overflow-wrap:anywhere;scroll-margin-top:180px}
.suggest-card[tabindex]{cursor:pointer}
.suggest-author{display:flex;align-items:center;gap:8px;margin-bottom:8px;min-width:0}
.suggest-author>span:last-child{min-width:0;overflow-wrap:anywhere}
.suggest-author .avatar{flex:0 0 32px;align-items:center}
.suggest-card p{white-space:pre-wrap;margin:8px 0}
.suggest-card button{min-height:32px;padding:4px 12px;margin-top:8px}
@media(min-width:900px) and (max-width:1100px){
 .edit-layout.has-suggestions{grid-template-columns:minmax(0,1fr) 280px}
 .edit-layout.has-suggestions>.edit-sidebar{grid-column:2;grid-row:1;margin-top:56px}
 .edit-layout.has-suggestions>.document-column{grid-column:1;grid-row:1}
 .edit-layout.has-suggestions.has-editor-toc{grid-template-columns:min(var(--toc-w,120px),35vw) minmax(0,1fr) 280px}
 .edit-layout.has-suggestions.has-editor-toc>.document-column{grid-column:2}
 .edit-layout.has-suggestions.has-editor-toc>.edit-sidebar{grid-column:3;grid-row:1}
 .has-suggestions .editor-toolbar{width:calc(100% + 296px)}
}
@media(max-width:899px){
 .edit-layout.has-suggestions>.edit-sidebar{grid-row:auto;min-width:0}
 .has-suggestions .suggest-panel{width:100%;max-width:100%}
}
/* about-template: the facts about a template are kept visually apart from the white sheet (owner's instruction, 2026-11-14) */
:root{--note-bg:#FFF7E0;--note-line:#E8B93B;--note-ink:#5C4300}
.document-details{margin:48px auto 24px}
.about-template{min-width:0}
.about-head{display:flex;align-items:center;gap:12px;padding-bottom:16px;border-bottom:2px solid var(--navy)}
.about-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;border-radius:8px;background:var(--navy);color:var(--cyan)}
.about-mark .icon{width:20px;height:20px}
.about-head h2{margin:0;font-size:16px;font-weight:600;letter-spacing:.02em;color:var(--navy)}
.about-list{display:block;margin:0}
.about-row{display:grid;grid-template-columns:136px minmax(0,1fr);gap:8px 24px;padding:16px 0;border-bottom:1px solid var(--card-line)}
.about-row dt{display:flex;align-items:center;align-self:start;gap:8px;min-height:24px;font-size:12px;font-weight:600;letter-spacing:.04em;color:var(--muted)}
.about-row dd{margin:0;min-width:0;font-size:14px;color:var(--ink)}
.about-row dd p{margin:0}
.about-row dd>p{margin-top:8px}
.about-row dd>p:first-child{margin-top:0}
.about-lead dd{font-size:16px;line-height:1.7}
.about-none{color:var(--subtle);font-size:13px}
.about-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:100px;background:var(--navy);color:var(--on-navy);font-size:11px;letter-spacing:0}
.about-note{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-left:4px solid var(--note-line);border-radius:4px 8px 8px 4px;background:var(--note-bg);color:var(--note-ink)}
.about-note .icon{flex:0 0 20px;width:20px;height:20px;margin-top:1px}
.about-owner{display:inline-flex;align-items:center;gap:8px;font-weight:500}
.about-chips,.about-links{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:0}
.about-chips li{max-width:100%;padding:4px 12px;border:1px solid var(--cyan);border-radius:100px;background:var(--selected);color:var(--on-selected);font-size:13px;overflow-wrap:anywhere}
.about-links{flex-direction:column}
.about-links li{display:flex;align-items:center;gap:8px;min-width:0}
.about-links .icon{flex:0 0 18px;width:18px;height:18px;color:var(--subtle)}
.about-terms{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin-top:24px;padding:20px 24px;border-radius:var(--radius-card);background:var(--surface-low);color:var(--muted);font-size:13px}
.about-terms section{min-width:0}
.about-terms h3{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:12px;font-weight:600;letter-spacing:.04em;color:var(--navy)}
.about-terms p{margin:0 0 6px}
.about-terms p:last-child{margin-bottom:0}
.license-badge{padding:2px 8px;border-radius:4px;background:var(--navy);color:var(--on-navy);font-size:11px;letter-spacing:.02em}
.about-attribution{padding:8px 12px;border:1px solid var(--card-line);border-radius:6px;background:var(--surface);color:var(--ink);overflow-wrap:anywhere}
.guide-page{max-width:760px;margin:0 auto}
.guide-lead{font-size:16px;color:var(--muted)}
.guide-steps{display:grid;gap:16px;list-style:none;margin:24px 0;padding:0;counter-reset:guide-step}
.guide-steps>li{position:relative;min-width:0;padding:20px 24px 20px 72px;border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface);counter-increment:guide-step}
.guide-steps>li::before{content:counter(guide-step);position:absolute;left:24px;top:20px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--navy);color:var(--cyan);font-weight:600}
.guide-steps h2{margin:4px 0 8px;font-size:16px}
.guide-steps p{margin:0 0 8px}
.guide-steps p:last-child{margin-bottom:0}
.guide-steps pre{margin:8px 0 0}
@media(max-width:559px){.about-row{grid-template-columns:minmax(0,1fr);gap:6px}.about-terms{grid-template-columns:minmax(0,1fr);padding:16px}.guide-steps>li{padding:64px 16px 16px}.guide-steps>li::before{left:16px;top:16px}}

.document-details>details.card{background:transparent}
.about-note p{line-height:1.7}
/* feed: the list on the top page shows one low row per template with a dark mark; the summary opens on demand because ten rows share a page (owner's instructions, 2026-11-14) */
.home-list{background:transparent;border:0;box-shadow:none;padding:0}
.home-list .list-head{min-height:0;gap:12px;padding:0 0 16px;border-bottom:2px solid var(--navy)}
.home-list .list-head h2{font-size:18px;font-weight:600;letter-spacing:.02em;color:var(--navy)}
.home-list .list-head .count{padding:2px 10px;border-radius:100px;background:var(--surface-low);color:var(--muted)}
.section-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;border-radius:8px;background:var(--navy);color:var(--cyan)}
.section-mark .icon{width:20px;height:20px}
.feed{display:grid;gap:8px;list-style:none;margin:16px 0 0;padding:0}
.feed-item{position:relative;overflow:hidden;border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface);transition:border-color .15s,box-shadow .15s}
.feed-item:hover{border-color:var(--primary);box-shadow:var(--shadow-card)}
.feed-row{position:relative;display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:52px;padding:8px 88px 8px 12px}
.feed-mark{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--navy);color:var(--cyan)}
.feed-mark .icon{width:18px;height:18px}
.feed-title{min-width:0;margin:0;font-size:15px;font-weight:600;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.feed-title a{color:var(--navy);text-decoration:none}
.feed-title a:focus-visible{outline:none}
/* The link covers the row only, so the opened summary below it stays selectable. */
.feed-title a::after{content:"";position:absolute;inset:0}
.feed-title a:focus-visible::after{outline:2px solid var(--primary);outline-offset:-2px;border-radius:var(--radius-card)}
.feed-row:hover .feed-title a{color:var(--primary)}
.feed-sub{display:flex;align-items:center;gap:12px;min-width:0}
.feed-tags{display:flex;align-items:center;gap:6px;min-width:0}
.feed-kind{max-width:14em;padding:2px 10px;border-radius:100px;background:var(--selected);color:var(--on-selected);font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.feed-meta{display:flex;align-items:center;gap:6px;color:var(--subtle);font-size:12px;white-space:nowrap}
.feed-meta .author-avatar{flex-basis:22px;width:22px;height:22px;min-height:22px;font-size:11px}
.feed-owner{max-width:10em;overflow:hidden;text-overflow:ellipsis;color:var(--ink);font-weight:500}
.feed-version{padding:2px 10px;border:1px solid var(--card-line);border-radius:100px;background:var(--surface-low);color:var(--muted);font-size:12px;font-weight:600;white-space:nowrap}
/* The toggle is a sibling of the row (no control nested in a link) and is placed over the row's right end. */
.feed-fold>summary{position:absolute;top:10px;right:12px;z-index:1;display:inline-flex;align-items:center;gap:2px;height:32px;padding:0 6px 0 10px;border-radius:var(--radius-control);color:var(--muted);font-size:12px;font-weight:600;cursor:pointer;list-style:none;user-select:none}
.feed-fold>summary::after{content:none}
.feed-fold>summary:hover{background:var(--surface-low);color:var(--navy)}
.feed-fold>summary:focus-visible{outline:2px solid var(--primary);outline-offset:1px}
.feed-fold>summary .icon{width:18px;height:18px;transition:transform .15s}
.feed-fold[open]>summary{background:var(--selected);color:var(--on-selected)}
.feed-fold[open]>summary .icon{transform:rotate(180deg)}
.feed-detail{display:grid;gap:8px;padding:12px 16px 14px 56px;border-top:1px solid var(--card-line);background:var(--surface-low)}
.feed-summary{margin:0;color:var(--ink);font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.feed-none{color:var(--subtle)}
.feed-open{display:inline-flex;align-items:center;gap:2px;justify-self:start;font-size:13px;font-weight:600}
.feed-open .icon{width:16px;height:16px}
@media(max-width:1399px){.feed-meta .author-avatar,.feed-owner{display:none}}
@media(max-width:759px){.feed-row{grid-template-columns:32px minmax(0,1fr);row-gap:4px;padding:10px 52px 10px 12px}.feed-mark{grid-row:1/span 2;align-self:start}.feed-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;overflow-wrap:anywhere}.feed-sub{grid-column:2;flex-wrap:wrap;gap:6px 8px}.feed-tags{flex-wrap:wrap}.feed-kind{flex-shrink:0;max-width:100%}.feed-tags .tag{flex-shrink:0}.feed-fold>summary{padding:0 7px}.feed-fold>summary span{display:none}.feed-detail{padding:12px 16px 14px}}

/* batch 15 */
.sort-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:12px 0 16px;min-width:0}
.sort-tabs a{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:4px 12px;border-radius:100px;color:var(--muted);text-decoration:none}
.sort-tabs a:hover{background:var(--surface-low)}
.sort-tabs a[aria-current="page"]{background:var(--selected);color:var(--on-selected);font-weight:600}
.sort-tabs .for-you-settings{margin-left:auto;font-size:12px;color:var(--primary)}
.reason-chip{display:inline-block;min-width:0;max-width:12em;padding:2px 8px;border-radius:100px;background:var(--surface-low);color:var(--muted);font-size:11px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px;margin:24px 0;min-width:0}
.pager a,.pager [aria-current]{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:40px;padding:4px 8px;border-radius:100px;text-decoration:none}
.pager [aria-current]{background:var(--selected);color:var(--on-selected);font-weight:600}
.pager a:hover{background:var(--surface-low)}
.for-you-choice{display:flex;align-items:flex-start;gap:8px}
.for-you-choice input{flex:0 0 auto;width:20px;min-height:20px;height:20px;margin:1px 0 0}
@media(max-width:759px){.reason-chip{max-width:100%}.sort-tabs .for-you-settings{padding:4px 8px}.pager{gap:2px}.pager a,.pager [aria-current]{min-width:28px;padding:4px 6px}}

/* Draft text must wrap even when it contains an unbroken machine-generated string. */
.draft-page,.draft-page dd,.draft-page .paper,.draft-page .markdown,.draft-page .diff,.injection-check,.draft-list,.ai-actions{min-width:0;max-width:100%;overflow-wrap:anywhere}
.draft-page dd{margin-left:0;white-space:pre-wrap}
.standard-page:has(>.draft-page){width:min(880px,calc(100% - 32px));max-width:none;margin:clamp(16px,3vw,36px) auto;padding:0;background:transparent;border:0}
.draft-page>h1{margin:8px 0 12px;font-size:clamp(22px,3vw,28px);line-height:1.4}
.draft-visibility{display:flex;align-items:center;gap:6px;margin:0;color:var(--muted);font-size:13px}
.draft-visibility .icon{width:16px;height:16px}
.draft-section{min-width:0;margin-top:clamp(24px,4vw,36px);border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface)}
.draft-section-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;padding:16px clamp(16px,3vw,28px);background:var(--surface-low);border-bottom:1px solid var(--card-line);border-radius:var(--radius-card) var(--radius-card) 0 0}
.draft-section-header h2{display:flex;align-items:center;gap:10px;margin:0;font-size:clamp(18px,2vw,21px);font-weight:600;line-height:1.4;color:var(--ink)}
.draft-section-header h2 .icon{width:22px;height:22px;color:var(--primary)}
.draft-markup{display:none}
.draft-section:has(.draft-markup-switch:checked) .draft-clean-body{display:none}
.draft-section:has(.draft-markup-switch:checked) .draft-markup{display:block}
.draft-section .paper{margin:0;max-width:none;padding:clamp(20px,4vw,40px);border:0;border-radius:0 0 var(--radius-card) var(--radius-card);overflow:auto}
.draft-section .tracked-changes ins{color:var(--primary-hover)}
.draft-section .tracked-changes .chg-row:not(.chg-same)::before{background:var(--primary)}
.draft-section .tracked-changes .chg-cell-format{box-shadow:inset 0 -2px var(--primary)}
.draft-section .tracked-changes :is(ins,del) .math-display{display:inline-block;vertical-align:middle;max-width:100%}
.draft-actions{display:flex;flex-wrap:wrap;gap:16px;margin-top:24px}
.draft-actions>a{white-space:normal;height:auto;min-height:40px}
.draft-list,.ai-actions{padding-left:20px}
.draft-list li,.ai-actions li{display:flex;flex-wrap:wrap;gap:4px 12px;margin:12px 0;overflow-wrap:anywhere}
.draft-list li a,.ai-actions li span{min-width:0;overflow-wrap:anywhere}
.account-sections .card{min-width:0;overflow-wrap:anywhere}
.injection-check .preserve{white-space:pre-wrap}
@media(max-width:560px){.draft-section-header{padding:12px 16px}.draft-actions{display:block}.draft-actions>a{display:inline-flex;margin-bottom:16px}}

/* Profile links must sit above the feed's stretched title link. */
.feed-owner{position:relative;z-index:1}
.profile-page,.contact-page,.discussion-page{min-width:0;max-width:100%;overflow-wrap:anywhere}
.profile-heading{position:relative;display:flex;align-items:center;gap:16px;margin-bottom:24px}
.profile-heading>div{min-width:0}
.profile-heading h1,.profile-heading p{margin:0}
.profile-heading .avatar{flex-shrink:0}
.profile-name-row{display:flex;align-items:center;gap:8px;min-width:0}
.profile-name-row h1{min-width:0;overflow-wrap:anywhere}
.verified-mark{flex-shrink:0}
.verified-mark>summary{display:flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;list-style:none;cursor:pointer;color:var(--added-ink);border-radius:50%}
.verified-mark>summary::-webkit-details-marker{display:none}
.verified-mark>summary::after{display:none}
.verified-mark>summary:hover{background:var(--hover)}
.verified-mark>summary:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.verified-mark .icon{width:24px;height:24px}
.verified-mark-detail{position:absolute;top:100%;left:0;z-index:10;width:min(24rem,100%);padding:16px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow-card);font-size:14px;overflow-wrap:anywhere}
.profile-heading .verified-mark-detail p+p{margin-top:12px}
.profile-adoptions li{flex-wrap:wrap;gap:8px 16px;padding:10px 0;overflow-wrap:anywhere}
.profile-adoptions li>span:first-child{flex:1 1 100%;min-width:0}
.profile-report{margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
.profile-page .template-row{grid-template-columns:24px minmax(0,1fr) 80px}
.profile-page .template-owner,.profile-page .template-date,.profile-page .template-version{display:none}
.profile-page fieldset{min-width:0}
.profile-page .check{white-space:normal;overflow-wrap:anywhere}
.contact-notices{padding-left:24px}
.contact-notices li{margin-bottom:16px}
.contact-address{padding:16px;background:var(--surface-low);border-radius:8px;overflow-wrap:anywhere}
.discussion-list{list-style:none;padding:0;margin:24px 0}
.discussion-list li{padding:16px 0;border-bottom:1px solid var(--line)}
.discussion-list h2{font-size:18px;margin:0 0 8px}
.discussion-list p{font-size:13px;color:var(--subtle);margin:0}
.discussion-body{padding:16px;min-width:0;overflow-wrap:anywhere}
.discussion-body pre{white-space:pre-wrap;overflow-wrap:anywhere}
.discussion-body table{display:block;max-width:100%;overflow-x:auto}
.discussion-page .comment-actions{display:flex;flex-wrap:wrap;gap:8px;max-width:100%}
.discussion-page .comment-actions form{max-width:100%}
.discussion-page .comment-actions button{height:auto;min-height:36px;white-space:normal}
.discussion-reply{margin-top:24px}
@media(max-width:600px){.profile-heading{gap:12px}.discussion-body{padding:12px}.profile-page .template-row{grid-template-columns:24px minmax(0,1fr)}.profile-page .template-category{display:none}}
.template-list .template-row{position:relative}
.template-list .template-title::after{content:'';position:absolute;inset:0}
.template-list .template-owner{position:relative;z-index:1}

/* Proofreading and fill cues are decorations, never document formatting. */
:root{--fill-bg:#FFE866;--fill-line:#8A6A00}
.markdown mark.fill,.editor-surface .fill{background:var(--fill-bg);color:inherit;border-bottom:1px dashed var(--fill-line);border-radius:2px;padding:1px 2px}
:root{--proof-spell:var(--error);--proof-grammar:#1E7A46}
.proof-mark,.proof-kind{text-decoration-line:underline;text-decoration-style:wavy;text-decoration-thickness:1.5px;text-underline-offset:3px;text-decoration-skip-ink:none}
.proof-spell{text-decoration-color:var(--proof-spell)}
.proof-grammar{text-decoration-color:var(--proof-grammar)}
.proof-menu{position:fixed;z-index:80;min-width:180px;max-width:calc(100vw - 16px);padding:8px 0;background:var(--surface);border-radius:var(--radius-card);box-shadow:var(--menu-shadow)}
.proof-menu p{margin:0;padding:4px 16px 8px;font-size:12px;color:var(--muted)}
.proof-menu button{display:block;width:100%;min-height:36px;padding:6px 16px;border:0;border-radius:0;background:none;text-align:left;font:inherit;color:var(--ink);cursor:pointer}
.proof-menu button:hover,.proof-menu button:focus-visible{background:var(--surface-low);outline:0}
.suggest-added.proof-mark,.suggest-added .proof-mark,.proof-mark .suggest-added{border-bottom:2px solid var(--added-ink)}


/* Comments stay outside the sheet; the rail uses text order when alignment cannot be verified. */
.comment-document{position:relative;min-width:0}
.comments-rail{min-width:0;display:flex;flex-direction:column;gap:12px;align-self:start}
.comment-card,.comment-composer{min-width:0;max-width:100%;padding:16px;border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface);color:var(--ink);overflow-wrap:anywhere;transition:opacity 120ms,transform 120ms,box-shadow 120ms}
.comment-card header,.comment-composer header{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.comment-card header a,.comment-composer header a{font-weight:500;min-width:0;overflow-wrap:anywhere}
.comment-card header time{font-size:11px;color:var(--subtle)}
.comment-card .avatar,.comment-composer .avatar{flex:0 0 28px;width:28px;height:28px;min-height:28px;align-items:center;font-size:13px}
.comment-card p{margin:8px 0}
.comment-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7}
.comment-card blockquote,.comment-quote{margin:12px 0;padding:8px 12px;border:1px solid var(--line);border-radius:4px;background:var(--surface-low);color:var(--muted);font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}
.comment-card form,.comment-composer form{min-width:0;max-width:100%}
.comment-card button,.comment-composer button{min-height:32px;padding:6px 12px;font-size:12px;white-space:normal}
.comment-card .icon-button,.comment-composer .icon-button{width:32px;height:32px;padding:0}
.comment-card .comment-actions{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin-left:auto}
.comment-card .comment-actions form{display:inline-flex}
.comment-card .comment-actions .more-menu{margin-left:auto}
.comment-card .menu-panel{min-width:160px}
.comment-card .menu-panel>button{display:flex;justify-content:flex-start;width:100%;border-radius:0;background:transparent;color:var(--ink);padding:8px 16px}
.comment-card .menu-panel>button:hover{background:var(--hover)}
.comment-card .comment-entry+.comment-entry,[data-comment-id]+[data-comment-id]{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}
.comment-card details>summary{font-size:12px;color:var(--primary)}
.comment-card details.more-menu>summary{color:var(--subtle)}
.comment-card textarea,.comment-composer textarea{min-height:76px;max-height:260px;font-size:13px}
.comment-reply label,.comment-composer label{margin:12px 0 8px}
.comment-reply{padding-top:8px}
.comment-card .warning,.comment-composer .warning,.comment-notice{font-size:11px;line-height:1.6;margin:12px 0 0}
.comment-card .name-check,.comment-composer .name-check{padding:12px;max-width:100%;overflow-wrap:anywhere}
.comment-card .name-check h2,.comment-composer .name-check h2{font-size:14px}
.comment-card .name-check ul,.comment-composer .name-check ul{padding-left:20px}
.comment-card .check,.comment-composer .check{font-size:12px}
.comment-card .comment-edited,.comment-card small{color:var(--subtle);font-size:11px}
.comment-card.is-selected{transform:translateX(-6px);box-shadow:var(--shadow-card);border-color:var(--primary)}
.comment-card.is-muted{opacity:.55}
.comment-card.is-muted:focus-within,.comment-card.is-muted:hover{opacity:1}
.comments-ready .comments-rail .comment-reply{display:none}
.comments-ready .comments-rail .comment-card.is-selected .comment-reply{display:block}
.comment-mark{background:var(--selected);color:inherit;border-radius:2px;padding:0;cursor:pointer}
.comment-mark.is-selected,.comment-temporary{background:var(--tonal);color:inherit;outline:1px solid var(--primary)}
.comment-mark:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
[data-comment-add]{position:fixed;z-index:55;width:36px;height:36px;min-height:36px;padding:0!important;border-radius:50%;box-shadow:var(--shadow-card)}
[data-comments-history]{position:fixed;inset:var(--header-height) 0 0 auto;z-index:90;width:400px;max-width:100%;padding:20px;background:var(--surface-low);border-left:1px solid var(--line);box-shadow:var(--menu-shadow);overflow-y:auto;overscroll-behavior:contain}
[data-comments-history]>header,.comments-history-head{display:flex;align-items:center;gap:8px;justify-content:space-between}
[data-comments-history] h2{margin:0;font-size:18px}
[data-comments-history] [data-comment-history-close]{margin-left:auto}
.comment-filters{display:flex;flex-wrap:wrap;gap:4px;margin:16px 0}
[data-comment-filter]{background:transparent;color:var(--muted);padding:8px 12px;min-height:36px}
[data-comment-filter][aria-pressed="true"]{background:var(--selected);color:var(--on-selected)}
[data-comment-filter]:not([aria-pressed="true"]):hover{color:var(--surface)}
[data-comment-history-list]{display:flex;flex-direction:column;gap:12px;margin-top:16px}
[data-comments-history] .comment-card{transform:none;opacity:1}
.comment-orphan{font-size:12px;color:var(--subtle)}
.comment-feedback[role="alert"]{color:var(--error);background:var(--error-bg);padding:8px 12px;border-radius:4px}
[data-comment-status]{max-width:100%;overflow-wrap:anywhere;font-size:13px}
.comment-card [data-comment-close]{display:none}
.comments-sheet{display:none}
@media(min-width:1100px){
 .reading-layout.has-comments{grid-template-columns:min(var(--toc-w,156px),35vw) minmax(0,1fr);padding:24px;gap:20px}
 .toc-closed .reading-layout.has-comments{grid-template-columns:40px minmax(0,1fr);padding-right:24px}
 .has-comments .comment-document{display:grid;grid-template-columns:minmax(0,816px) 288px;align-items:start;gap:16px;justify-content:center}
 .has-comments .comment-document>.paper{width:100%;margin:0}

 .comments-ready [data-comment-close]{display:none}

}
@media(max-width:1099px){
 .comments-ready .comments-rail{display:none}
 .comments-rail{margin:20px 0}
 .comment-card.is-selected{transform:none}
 .comments-sheet{position:fixed;inset:auto 0 0;display:block;z-index:85;max-height:70vh;padding:16px;background:var(--surface-low);border:1px solid var(--line);border-radius:16px 16px 0 0;box-shadow:var(--menu-shadow);overflow-y:auto;overscroll-behavior:contain;max-width:100%}
 .comments-sheet .comment-card,.comments-sheet .comment-composer{width:100%;opacity:1;transform:none}
 .comments-sheet .comment-reply{display:block}
 [data-comments-history]{top:var(--header-height);width:min(400px,100%)}
}
@media(max-width:560px){[data-comments-history]{padding:16px}.comments-sheet{padding:12px}.comment-card,.comment-composer{padding:12px}}
@media(prefers-reduced-motion:reduce){.comment-card,.comment-composer{transition:none}}

/* The issue panel never changes comment selection or marks. */
[data-issue-panel]{min-width:0;max-width:100%;padding:16px;border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface);overflow-wrap:anywhere}
[data-issue-panel] h2{margin:0 0 12px;font-size:16px}
[data-issue-panel] button,[data-issue-panel] .button{white-space:normal;min-height:36px;padding:8px 12px;font-size:12px}
.issue-filters{display:flex;flex-wrap:wrap;gap:4px;margin:12px 0}
[data-issue-filter]{background:transparent;color:var(--muted)}
[data-issue-filter][aria-pressed="true"]{background:var(--selected);color:var(--on-selected)}
[data-issue-filter]:not([aria-pressed="true"]):hover{color:var(--surface)}
.issue-cards{display:flex;flex-direction:column;gap:8px}
[data-issue-card]{display:flex;flex-direction:column;gap:4px;padding:12px;border:1px solid var(--line);border-radius:var(--radius-control);text-decoration:none;overflow-wrap:anywhere}
[data-issue-card]:hover{background:var(--surface-low);text-decoration:none}
[data-issue-card]>span,.issue-meta,.issue-event time,.issue-notice{font-size:12px;color:var(--subtle)}
.issue-detail{min-width:0;max-width:100%}
.issue-detail>[data-issue-back]{margin-bottom:16px}
.issue-detail h2{font-size:18px}
.issue-status{display:inline-block;padding:4px 10px;margin:0;border-radius:var(--radius-control);background:var(--selected);color:var(--on-selected);font-size:12px}
/* Issue states. Open is green and Closed is purple; the word is always shown, so the colour is never the only cue. */
:root{--state-open:#146C3F;--state-open-bg:#E3F4EA;--state-closed:#5B3DB0;--state-closed-bg:#EEE8FB}
.issue-state{display:inline-flex;align-items:center;gap:6px;width:fit-content;margin:0;padding:3px 12px 3px 10px;border-radius:999px;font-size:12px;font-weight:500;line-height:1.5;white-space:nowrap}
.issue-state::before{content:"";flex:0 0 8px;width:8px;height:8px;border-radius:50%;background:currentColor}
.issue-state.is-open{background:var(--state-open-bg);color:var(--state-open)}
.issue-state.is-closed{background:var(--state-closed-bg);color:var(--state-closed)}
[data-issue-filter="open"][aria-pressed="true"]{background:var(--state-open-bg);color:var(--state-open)}
[data-issue-filter="closed"][aria-pressed="true"]{background:var(--state-closed-bg);color:var(--state-closed)}
.issue-meta{display:flex;gap:12px;flex-wrap:wrap;margin:12px 0}
.issue-body{min-width:0;line-height:1.8;overflow-wrap:anywhere}
.issue-body>*{max-width:100%}
.issue-body pre,.issue-body table{display:block;max-width:100%;overflow:auto}
.issue-body img{max-width:100%;height:auto}
.issue-body blockquote{margin:12px 0;padding:8px 12px;border-left:2px solid var(--line);color:var(--muted)}
.issue-detail .issue-quote{display:block;width:100%;text-align:left;justify-content:flex-start;margin:16px 0;padding:12px;background:var(--surface-low);border:1px solid var(--line);border-radius:var(--radius-control);color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere}
.issue-detail button.issue-quote:hover{background:var(--selected)}
.issue-timeline,.issue-reply,.issue-form{border-top:1px solid var(--line);margin-top:16px;padding-top:16px}
.issue-event{font-size:12px;line-height:1.7}
.issue-event time{display:block}
.issue-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:16px}
.issue-actions form{margin:0}
.issue-actions>a{font-size:12px}
.issue-form textarea{min-height:150px;max-height:400px}
.issue-form .name-check{max-width:100%;padding:12px;overflow-wrap:anywhere}
.issue-form .name-check ul{padding-left:20px}
.issue-form .name-check li>*{display:block}
.issue-feedback{color:var(--error);background:var(--error-bg);padding:8px 12px;border-radius:4px}
.issue-detail form{max-width:100%;min-width:0}
/* design review, batch 23: one filled button per view; the rest stay quiet so the reply reads as the main action */
.issue-meta{align-items:center;gap:8px}
.issue-meta a{color:var(--ink);font-weight:500;text-decoration:none}
.issue-timeline .issue-reply:first-child{border-top:0;margin-top:0;padding-top:0}
.issue-event{display:flex;flex-wrap:wrap;gap:2px 8px;align-items:baseline;margin:12px 0;padding:8px 12px;border-radius:8px;background:var(--surface-low);color:var(--muted)}
.issue-event time{display:inline}
[data-issue-panel] .issue-quiet button{min-height:28px;padding:4px 8px;background:transparent;color:var(--muted)}
[data-issue-panel] .issue-quiet button:hover{background:var(--hover)}
[data-issue-panel] .issue-secondary button{background:transparent;color:var(--primary);box-shadow:inset 0 0 0 1px var(--card-line)}
[data-issue-panel] .issue-secondary button:hover{background:var(--hover)}
[data-issue-panel] [data-issue-back]{padding-left:4px;padding-right:8px}
.issue-reply .issue-actions{margin-top:4px}
/* issue column, batch 24: issues get their own column right of the comments; narrower screens stack it above them */
@media(max-width:1647px){
 .issues-ready:has(.is-issue-open) .comments-sheet,.issues-ready:has(.is-issue-open) [data-comment-add],.issues-ready:has(.is-issue-open) [data-comments-history]{display:none}
 .issues-ready .comment-document.is-issue-open>.comments-rail{display:none}
}
@media(min-width:900px){
 .issues-ready .has-comments .comment-document{display:grid;grid-template-columns:minmax(0,816px) min(var(--issue-list-w,288px),50vw);align-items:start;gap:16px;justify-content:center}
 .issues-ready .has-comments .comment-document>.paper{width:100%;margin:0;min-width:0}
 .has-comments .comment-document>.paper{grid-column:1;grid-row:1 / span 2}
 .has-comments .comment-document>[data-issue-panel]{grid-column:2;grid-row:1}
 .has-comments .comment-document>.comments-rail{grid-column:2;grid-row:2}
 .has-comments .comment-document.is-issue-open{grid-template-columns:minmax(0,816px) min(var(--issue-open-w,min(520px,40vw)),60vw)}
 .comment-document.is-issue-open>[data-issue-panel]{position:sticky;top:calc(var(--header-height) + 16px);max-height:calc(100vh - var(--header-height) - 32px);overflow-y:auto;overscroll-behavior:contain}
}
@media(min-width:1400px){
 .reading-layout.has-comments .comment-document{grid-template-columns:minmax(0,816px) 288px min(var(--issue-list-w,clamp(240px,18vw,288px)),50vw)}
 .reading-layout.has-comments .comment-document>.paper{grid-row:1}
 .reading-layout.has-comments .comment-document>.comments-rail{grid-column:2;grid-row:1}
 .reading-layout.has-comments .comment-document>[data-issue-panel]{grid-column:3;grid-row:1;align-self:start;position:sticky;top:calc(var(--header-height) + 16px);max-height:calc(100vh - var(--header-height) - 32px);overflow-y:auto;overscroll-behavior:contain;padding:0 0 0 16px;border:0;border-radius:0;background:transparent}
 .reading-layout.has-comments .comment-document::after{content:"";grid-column:3;grid-row:1;align-self:stretch;justify-self:start;border-left:1px solid var(--paper-line);pointer-events:none}
 .reading-layout.has-comments [data-issue-panel]>[data-issue-list],.reading-layout.has-comments [data-issue-panel]>[data-issue-open]{position:static;max-height:none;overflow:visible}
 .reading-layout.has-comments .comment-document.is-issue-open{grid-template-columns:minmax(0,816px) min(var(--issue-open-w,min(520px,40vw)),60vw)}
 .reading-layout.has-comments .comment-document.is-issue-open>[data-issue-panel]{grid-column:2}
 .reading-layout.has-comments .comment-document.is-issue-open::after{grid-column:2}
}
@media(min-width:1648px){
 .reading-layout.has-comments .comment-document.is-issue-open{grid-template-columns:minmax(0,816px) 288px min(var(--issue-open-w,min(480px,26vw)),60vw)}
 .reading-layout.has-comments .comment-document.is-issue-open>[data-issue-panel]{grid-column:3}
 .reading-layout.has-comments .comment-document.is-issue-open::after{grid-column:3}
}
@media(max-width:899px){
 .comment-document>[data-issue-panel]{margin:20px 0}
}
/* A flat list with hairlines reads as a sidebar, so issues do not look like the comment cards beside them. */
.issue-cards{gap:0}
[data-issue-card]{padding:10px 8px;border:0;border-top:1px solid var(--line);border-radius:0}
.issue-cards>[data-issue-card]:last-of-type{border-bottom:1px solid var(--line)}
@media(max-width:899px){
 .issues-ready .comment-document.is-issue-open [data-issue-open]{position:fixed;inset:auto 0 0;z-index:86;width:100%;max-width:100vw;max-height:70vh;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:16px 16px 0 0;box-shadow:var(--menu-shadow);overflow-y:auto;overscroll-behavior:contain}
}

/* Keep menus and history controls usable within a narrow comment card. */
.comment-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;margin-bottom:8px}
.comment-card-actions form{display:inline-flex}
.comment-menu{position:relative;margin-left:auto}
.comment-menu>summary{justify-content:center;min-width:32px;min-height:32px;padding:4px;border-radius:50%;font-size:12px}
.comment-menu>summary:after{display:none}
.comment-menu[open]>.comment-menu-items{position:absolute;z-index:75;right:0;top:100%;width:220px;max-width:calc(100vw - 48px);padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:var(--menu-shadow)}
.comment-menu-items>form>button,.comment-menu-items>button{width:100%;justify-content:flex-start;background:transparent;color:var(--ink);border-radius:4px}
.comment-menu-items>form>button:hover,.comment-menu-items>button:hover{background:var(--hover)}
.comment-edit>summary{padding:6px 12px;font-weight:400}
.comment-history-trigger.icon-button{width:auto;min-width:56px;padding:0 12px;gap:6px;color:var(--primary)}
.comment-history-trigger [data-comment-count]{font-size:12px;font-variant-numeric:tabular-nums}
/* The entry menu stays at the top right even when the name and the time wrap in a narrow card. */
.comment-entry{position:relative}
.comment-entry>header{padding-right:36px}
.comment-entry .comment-menu{position:absolute;right:0;top:0;margin:0}
.comment-composer form button+button{margin-left:8px}
.is-painting .editor-surface,.is-painting .editor-surface *{cursor:copy}
.editor-ruler{position:relative;box-sizing:border-box;max-width:816px;width:100%;height:20px;margin:0 auto 4px;border:1px solid var(--paper-line);background:var(--hover);color:var(--subtle);user-select:none}
.editor-ruler[hidden]{display:none}
.editor-ruler-track{position:absolute;top:0;bottom:0;left:72px;right:72px;background-color:var(--surface);background-image:repeating-linear-gradient(to right,var(--paper-line) 0 1px,transparent 1px .25cm);background-size:100% 4px;background-repeat:no-repeat;background-position:left bottom;overflow:hidden}
.editor-ruler-ticks{display:flex;height:100%;width:max-content}
.editor-ruler-number{flex:0 0 1cm;font-size:9px;line-height:13px;text-align:left;border-left:1px solid var(--paper-line);padding-left:2px}
.editor-ruler .editor-ruler-handle{position:absolute;transform:translateX(-50%);min-width:0;min-height:0;width:12px;height:10px;padding:0;margin:0;border:1px solid var(--primary);border-radius:0;background:var(--primary);cursor:ew-resize;touch-action:none}
.editor-ruler .ruler-first{top:0;width:10px;height:5px}
.editor-ruler .ruler-left{top:7px;clip-path:polygon(50% 0,100% 100%,0 100%)}
.editor-ruler .ruler-right{top:4px;clip-path:polygon(0 0,100% 0,50% 100%)}
.editor-ruler .editor-ruler-handle:disabled{opacity:.35;cursor:default}
.editor-ruler .editor-ruler-handle:focus-visible{outline:2px solid var(--ink);outline-offset:2px;background:var(--ink)}
.editor-surface{position:relative}
.editor-ruler-guide{display:none;position:absolute;top:0;bottom:0;border-left:1px solid var(--primary);pointer-events:none;z-index:2}
.is-ruler-dragging .editor-ruler-guide{display:block}
.editor-shell.is-markdown .editor-ruler{display:none}
@media(max-width:899.98px){.editor-ruler,[data-editor-ruler-toggle]{display:none!important}.paper,.editor-surface{overflow-x:auto}}

/* Inheriting text color keeps profile names readable within existing metadata. */
a[href^="/u/"],.markdown a[href^="/u/"]{color:inherit;text-decoration:none}
a[href^="/u/"]:hover,.markdown a[href^="/u/"]:hover{text-decoration:underline}
.mention-suggestions{position:relative;z-index:90;list-style:none;margin:4px 0 0;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-control);box-shadow:var(--shadow-card);max-height:240px;overflow-y:auto;color:var(--ink);font-weight:400}
.mention-option{padding:8px 12px;border-radius:4px;cursor:pointer;overflow-wrap:anywhere}
.mention-option:hover,.mention-option[aria-selected="true"]{background:var(--selected);color:var(--on-selected)}
.notification-button{position:relative;flex-shrink:0}
.notification-count{position:absolute;top:0;right:0;padding:0 4px;min-width:18px;border-radius:12px;background:var(--tonal);color:var(--on-tonal);font-size:10px;font-weight:700;line-height:18px;text-align:center}
.notification-list{list-style:none;margin:20px 0;padding:0;border-top:1px solid var(--line)}
.notification{padding:16px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.notification.is-unread{background:var(--selected)}
.notification-open{color:inherit;text-decoration:none}
.notification-open:hover{text-decoration:underline}
.notification-template,.notification time{display:block;margin-top:4px;color:var(--muted);font-size:12px}
.notification-unread{display:inline-block;margin-top:8px;font-size:11px;font-weight:700;color:var(--on-selected)}
.notification-settings{margin-top:32px;padding-top:16px;border-top:1px solid var(--line)}

/* A single mixed list and proposal cards share the sidebar's existing title band. */
[data-issue-list]>header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin:0 0 12px}
[data-issue-list]>header h2{margin:0}
[data-issue-list]>header .button{background:var(--surface);color:var(--primary);box-shadow:inset 0 0 0 1px var(--card-line)}
[data-issue-list]>header .button:hover{background:var(--surface-low)}
[data-issue-cards]>p,[data-proposal-login]{margin:0;padding:8px 0;font-size:13px;color:var(--subtle)}
[data-proposal-card]{display:flex;flex-direction:column;gap:4px;min-width:0;padding:10px 8px;border-top:1px solid var(--line);text-decoration:none}
.issue-cards>.issue-card:last-of-type{border-bottom:1px solid var(--line)}
[data-proposal-card]:hover{background:var(--surface-low);text-decoration:none}
[data-proposal-card]>strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0}
[data-proposal-card]>span{font-size:12px;color:var(--subtle)}
.issue-kind,[data-issue-card]>.issue-proposal-count,[data-proposal-card]>.issue-kind{display:inline-flex;align-items:center;width:fit-content;margin:0;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:500;line-height:1.5;background:var(--selected);color:var(--on-selected)}
.issue-proposals{min-width:0;max-width:100%;margin-top:20px}
.issue-proposals>h3{margin:0 0 12px;font-size:15px}
.issue-proposal{min-width:0;max-width:100%;margin:12px 0;border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface);overflow:hidden;overflow-wrap:anywhere}
.issue-proposal>header{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--card-line);background:var(--surface-low);font-size:12px}
.issue-proposal>header time{color:var(--subtle)}
.issue-proposal-message{margin:12px;white-space:pre-wrap;overflow-wrap:anywhere}
.issue-proposal>.issue-actions{margin:12px}
.issue-proposal .issue-actions>a{overflow-wrap:anywhere}
.issue-proposal-diff{min-width:0;max-width:100%;max-height:min(60vh,520px);overflow-y:auto;padding:12px;border-top:1px solid var(--card-line)}
.issue-proposal-comparison{min-width:0;max-width:100%;overflow-wrap:anywhere}
.issue-proposal-comparison .tracked-changes{min-width:0;max-width:100%;overflow-wrap:anywhere}
.issue-proposal-comparison pre,.issue-proposal-comparison table{display:block;max-width:100%;overflow-x:auto;white-space:pre-wrap}
.issue-proposal-comparison img{max-width:100%;height:auto}
.issue-proposal-diff .change-summary{flex-wrap:wrap;gap:8px}
.issue-proposal-diff .change-legend{flex-wrap:wrap;white-space:normal}
@media(min-width:1400px){
 .reading-layout.has-comments [data-issue-panel]>[data-issue-list]{padding:0 16px 16px;border:1px solid var(--card-line);border-radius:var(--radius-card);background:var(--surface)}
 .reading-layout.has-comments [data-issue-panel]>[data-issue-list]>header{margin:0;gap:12px}
 .reading-layout.has-comments [data-issue-panel]>[data-issue-list]>header h2{flex:0 0 calc(100% + 32px);margin:0 -16px;padding:10px 16px;border-bottom:1px solid var(--card-line);border-radius:11px 11px 0 0;background:var(--surface-low)}
}
.hide-confirmation{min-width:0;max-width:100%;font-size:14px}
.hide-confirmation>summary{cursor:pointer;padding:6px 12px;font-weight:400}
.hide-confirmation>p{margin:8px 0;white-space:normal}
.hide-confirm-actions{display:flex;flex-wrap:wrap;gap:8px}
.comment-menu-items .hide-confirmation>summary:hover{background:var(--hover)}
.hidden-post{padding:20px 0;border-bottom:1px solid var(--line)}
.hidden-post-body{white-space:pre-wrap;overflow-wrap:anywhere}

/* MathML uses the browser's math fonts; no KaTeX styles or fonts are loaded. */
.math-inline{display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:2px 0;vertical-align:middle}
.math-display{display:block;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;text-align:center;margin:.6em 0;padding:.4em 0}
.math-display>span,.math-display math{max-width:none}
.math-error{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:12px;color:var(--muted);margin-left:.5em}
.math-inline>code,.math-display>code{white-space:pre-wrap;overflow-wrap:anywhere}
.editor-math{min-width:0;max-width:100%;cursor:pointer}
span.editor-math{display:inline-block;vertical-align:middle}
.editor-math:focus-visible,.editor-math.ProseMirror-selectednode{outline:2px solid var(--primary);outline-offset:2px}
.editor-math .math-display{margin:.1em 0}
.math-dialog-backdrop{position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:16px;background:var(--hover);overflow:auto}
.math-dialog{box-sizing:border-box;width:min(640px,100%);min-width:0;max-height:calc(100dvh - 32px);overflow:auto;padding:20px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);box-shadow:var(--menu-shadow)}
.math-dialog textarea{box-sizing:border-box;width:100%;max-width:100%;font-family:Consolas,"Courier New",monospace;resize:vertical}
.math-preview{min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;min-height:64px;margin:12px 0}
.math-symbols{display:grid;gap:10px;min-width:0}
.math-symbols fieldset{display:flex;flex-wrap:wrap;gap:4px;min-width:0;margin:0;padding:8px;border:1px solid var(--line);border-radius:var(--radius-control)}
.math-symbols legend{font-size:12px;color:var(--muted)}
.math-symbols button{min-width:32px;padding:6px 10px;background:var(--surface-low);color:var(--ink);border:1px solid var(--line)}
.math-symbols button:hover{background:var(--hover)}
.math-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:16px;position:sticky;bottom:0;background:var(--surface);padding-top:8px}
.math-actions button.secondary{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.math-actions button.secondary:hover{background:var(--hover)}
@media(max-width:560px){.math-dialog{padding:12px}.math-symbols button{padding:6px 8px}}

/* Proposal decisions: keep the fallback form usable before enhancement. */
.proposal-appearance,.proposal-bulk,.proposal-decisions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.proposal-appearance{margin:16px 0}
.proposal-appearance>span{font-weight:500;margin-right:4px}
.proposal-appearance button,.proposal-bulk button,.proposal-decisions button{min-height:44px;padding:8px 12px;border:1px solid var(--card-line);background:var(--surface);color:var(--ink)}
.proposal-appearance button:hover,.proposal-bulk button:hover,.proposal-decisions button:hover{background:var(--hover)}
.proposal-appearance button[aria-pressed=true],.proposal-decisions button[aria-pressed=true]{background:var(--selected);color:var(--on-selected);border-color:var(--primary);box-shadow:inset 0 0 0 1px var(--primary)}
.proposal-review-sidebar .proposal-review-list{list-style:none;padding:0;max-height:none;overflow:visible;margin:16px 0}
.proposal-review-sidebar li.proposal-review-card{margin:12px 0;padding:12px;border:1px solid var(--card-line);border-radius:var(--radius-control);background:var(--surface)}
.proposal-review-card>a{display:inline;overflow-wrap:anywhere}
.proposal-review-card .proposal-decisions{margin-top:12px}
.proposal-decisions button{flex:1;min-width:0}
.proposal-review-sidebar [data-proposal-submit]{width:100%;min-height:44px;padding:12px;overflow-wrap:anywhere}
[data-proposal-diff] .proposal-change-rejected{opacity:.38}
[data-proposal-preview-error]{overflow-wrap:anywhere}
@media(max-width:600px){.proposal-appearance>span{flex-basis:100%}.proposal-appearance button{flex:1;padding:8px;min-width:0;font-size:12px}.proposal-bulk button{flex:1;min-width:0;padding:8px}.proposal-review-sidebar{position:static}}
[data-proposal-diff] [id^="chg-"]:target{outline:2px solid var(--primary);outline-offset:4px}
/* Find and replace stays in the document flow; the toolbar keeps its existing overflow menu. */
.editor-find-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;align-items:center;box-sizing:border-box;width:100%;max-width:600px;min-width:0;margin:0 auto 8px;padding:12px 16px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.editor-find-bar[hidden]{display:none}
/* The bar stays below the sticky toolbar (72px top + 40px height + its 12px canvas ring) so 次へ stays reachable in a long document. */
@media(min-width:601px){.editor-find-bar{position:sticky;top:124px;z-index:29;box-shadow:0 8px 0 0 var(--canvas)}}
.editor-find-title{grid-column:1;grid-row:1;font-size:14px}
.editor-find-bar .editor-find-close{grid-column:2;grid-row:1;justify-self:end;min-height:32px;padding:4px 8px;border-color:transparent}
.editor-find-field{grid-column:1;display:grid;grid-template-columns:168px minmax(0,1fr);gap:8px;align-items:center;min-width:0;margin:0;font-size:13px}
.editor-find-field input{box-sizing:border-box;width:100%;min-width:0;margin:0}
.editor-find-bar button{flex:0 0 auto;min-height:40px;padding:8px 12px;background:var(--surface);color:var(--ink);border:1px solid var(--line);gap:4px}
.editor-find-bar button:hover{background:var(--hover)}
.editor-find-status{grid-column:2;grid-row:2;min-width:104px;font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.editor-find-case{grid-column:1/-1;min-width:0;margin:0;font-size:13px}
.editor-find-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px;min-width:0}
.editor-find-actions [data-editor-find-previous]{margin-left:auto}
@media(max-width:600px){.editor-find-field{grid-template-columns:minmax(0,1fr);gap:4px}.editor-find-status{grid-column:1/-1;grid-row:auto;min-width:0}.editor-find-status:empty{display:none}.editor-find-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.editor-find-actions [data-editor-find-previous]{margin-left:0}}
.editor-find-match{background:var(--tonal);color:var(--on-tonal)}
.editor-find-current{background:var(--selected);color:var(--on-selected);outline:2px solid var(--primary);outline-offset:1px}
.markdown mark.pending{background:var(--fill-bg);color:inherit;border-radius:2px;padding:1px 2px}

/* account deletion */
.account-deletion .check{min-width:0;overflow-wrap:anywhere;white-space:normal}

/* The reader drags the line between two columns to change their widths; app.js keeps the widths in this browser (owner's instruction, 2026-11-16). */
.col-handle{display:none;position:relative;z-index:3;width:12px;align-self:stretch;cursor:col-resize;touch-action:none}
.col-handle::after{content:"";position:absolute;top:0;bottom:0;left:5px;width:2px;border-radius:1px;background:transparent}
.col-handle:hover::after,.col-handle:focus-visible::after,.col-handle.is-dragging::after{background:var(--primary)}
.col-handle:focus-visible{outline:none}
.col-resizing,.col-resizing *{cursor:col-resize!important;user-select:none!important}
@media(min-width:560px){
 .reading-layout>.document-outline{grid-column:1;grid-row:1}
 .reading-layout>.reading-main{grid-column:2;grid-row:1}
 .reading-layout>.col-handle,.edit-layout.has-editor-toc>.col-handle{display:block;grid-column:1;grid-row:1;justify-self:end;margin-right:-14px}
 .toc-closed .col-handle[data-col-handle="toc"]{display:none}
}
@media(min-width:900px){
 .issues-ready .has-comments .comment-document>.col-handle{display:block;grid-column:2;grid-row:1 / span 2;justify-self:start;margin-left:-14px}
}
@media(min-width:1400px){
 .reading-layout.has-comments .comment-document>.col-handle{grid-column:3;grid-row:1;margin-left:-6px}
 .reading-layout.has-comments .comment-document.is-issue-open>.col-handle{grid-column:2}
}
@media(min-width:1648px){
 .reading-layout.has-comments .comment-document.is-issue-open>.col-handle{grid-column:3}
}
@media print{.col-handle{display:none!important}}

.community-adoption{min-width:0;overflow-wrap:anywhere}
.community-object{flex:1 1 100%;min-width:0}
.community-objections{padding-left:1.25rem}
.community-objections li+li{margin-top:1rem}
.community-objections time{display:block}

.editor-article-popup{max-height:min(360px,60vh);overflow-y:auto;overflow-x:hidden}
.editor-popup .editor-article-option{display:block;width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere;background:transparent;color:var(--ink);border-radius:4px}
.editor-popup .editor-article-option:hover,.editor-popup .editor-article-option:focus-visible{background:var(--hover)}
/* The notice stays under the sticky toolbar: the repaired citations are usually far from the top of a long document. */
.editor-reference-auto{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;width:fit-content;max-width:100%;margin:0 auto 8px;padding:8px 12px;font-size:12px;overflow-wrap:anywhere;position:sticky;top:136px;z-index:29;border:1px solid var(--card-line);border-radius:8px;background:var(--surface)}
@media(max-width:600px){.editor-reference-auto{top:184px}}
.editor-reference-auto[hidden]{display:none}
.editor-reference-auto .text-button{flex-shrink:0}

/* Account list actions stay at the right edge, including on small screens. */
.template-row.has-row-action{grid-template-columns:24px minmax(0,1fr) minmax(60px,140px) 100px 144px 40px 40px}
.template-row.has-row-action>form{grid-column:-2 / -1;grid-row:1;margin:0;justify-self:end}
.template-row.has-row-action>form>button{position:relative;z-index:1}
.draft-list{list-style:none;padding:0}
.draft-list li{display:grid;grid-template-columns:minmax(0,1fr) 40px;column-gap:12px;align-items:center}
.draft-list li>a,.draft-list li>span,.draft-list li>time{grid-column:1;min-width:0;overflow-wrap:anywhere}
.draft-list li>form{grid-column:2;grid-row:1 / 4;justify-self:end;margin:0}
.deleted-template-list{list-style:none;padding:0}
.deleted-template-list li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:center;margin:12px 0}
.deleted-template-list a,.deleted-template-list time{grid-column:1;min-width:0;overflow-wrap:anywhere}
.deleted-template-list form{grid-column:2;grid-row:1 / 3;margin:0;justify-self:end}
@media(max-width:1300px){.template-row.has-row-action{grid-template-columns:24px minmax(0,1fr) 100px 80px 120px 32px 40px;gap:8px}}
@media(max-width:1100px){.template-row.has-row-action{grid-template-columns:24px minmax(0,1fr) 100px 80px 32px 40px}}
@media(max-width:850px){.template-row.has-row-action{grid-template-columns:24px minmax(0,1fr) 80px 40px}}
@media(max-width:600px){.template-row.has-row-action{grid-template-columns:24px minmax(0,1fr) 40px}.template-row.has-row-action .template-category{display:none}}

/* Direct MathML editing uses the same colors as the surrounding editor. */
.math-visual-input{min-height:100px;max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius-control);padding:14px;margin:12px 0;font-size:26px;background:var(--surface);color:var(--ink)}
.math-source-toggle{display:block;margin:8px 0}
.math-visual-input .vieta-root{--vm-bg:var(--surface);--vm-text:var(--ink);--vm-border:var(--line)}
.math-visual-input .vieta-root .interactive-mathml{--mm-text:var(--ink);--mm-caret:var(--ink);--mm-selection:var(--hover);--mm-overlay-light:var(--hover);--mm-border-weak:var(--line);--mm-border-medium:var(--line);--mm-border-strong:var(--line);--mm-delimiter-active-border:var(--ink)}
.math-visual-input .interactive-mathml{display:inline-block;min-width:100%;min-height:64px}
.math-visual-input .lme{color:var(--ink)}
.math-dialog [hidden]{display:none}
