:root{font-family:'Segoe UI','Malgun Gothic',sans-serif;color:#172033;background:#f3f6fb}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{border:1px solid #ccd5e3;background:white;color:#172033;border-radius:7px;padding:8px 14px;cursor:pointer}button:hover{background:#eff6ff;border-color:#2563eb}button:disabled{opacity:.45;cursor:default}input,select{border:1px solid #ccd5e3;border-radius:7px;padding:9px;background:white;min-width:0}label{display:flex;flex-direction:column;gap:7px;margin:16px 0}header{height:64px;display:flex;align-items:center;gap:12px;padding:12px 24px;background:white;border-bottom:1px solid #dce3ed}.brand{display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none;font-weight:700;font-size:22px}.brand img{width:32px;height:32px}.brand span{font-weight:400;font-size:15px;color:#64748b}#connection{margin-left:auto;color:#64748b;font-size:14px}#home{max-width:1120px;margin:40px auto;display:grid;grid-template-columns:1fr 1fr;gap:24px;padding:0 24px}.welcome{grid-column:1/-1}h1{font-size:30px}p{color:#64748b;line-height:1.7}.card{background:white;border:1px solid #dce3ed;border-radius:14px;padding:26px}.row{display:flex;gap:8px;flex-wrap:wrap}.row input{flex:1}#error{padding:12px 24px;background:#fff1f2;color:#9f1239}#workspace{height:calc(100vh - 64px);display:flex;flex-direction:column}.document-heading{display:flex;gap:12px;align-items:center;padding:8px 20px;background:white;border-bottom:1px solid #dce3ed}.document-heading h1{font-size:18px;margin:8px 0}.document-heading span{margin-right:auto;color:#64748b;font-size:13px}#md{display:grid;grid-template-columns:1fr 1fr;flex:1;min-height:0}#editor{border:0;border-right:1px solid #dce3ed;resize:none;outline:none;background:#fbfcfe;padding:28px;font:15px/1.7 Consolas,monospace}#preview{background:white;padding:28px;overflow:auto;line-height:1.7;overflow-wrap:anywhere}#preview img,#preview svg{max-width:100%}pre{white-space:pre-wrap;background:#f3f6fb;padding:16px;border-radius:8px}table{border-collapse:collapse}td,th{border:1px solid #dce3ed;padding:8px}#board{width:100%;flex:1;border:0;min-height:0}dialog{border:1px solid #ccd5e3;border-radius:14px;padding:28px;width:680px;max-width:94vw;max-height:90vh}dialog::backdrop{background:#17203366}dialog form{display:flex;justify-content:space-between}li{padding:8px 0}li button{margin-left:14px}[hidden]{display:none!important}@media(max-width:800px){#home{grid-template-columns:1fr}#md{grid-template-columns:1fr}#preview{display:none}header{padding:8px}.brand span{display:none}}
:is(#home):has(#import:not([hidden])){grid-template-columns:1fr;max-width:1000px;margin-top:20px}#import{display:grid;grid-template-columns:1fr 1fr;gap:4px 22px}#import>h2,#import>h3,#import>p,#import>button,#my-documents{grid-column:1/-1;margin:6px 0}#import>label{margin:10px 0}#import>button{justify-self:start}#my-documents{padding-left:18px}@media(max-width:800px){#import{display:block}}
body{min-width:0;overflow-wrap:anywhere}header{height:auto;min-height:64px;flex-wrap:wrap}header>*{max-width:100%;min-width:0}.brand{flex-wrap:wrap}.document-heading{flex-wrap:wrap}.document-heading h1{min-width:0;overflow-wrap:anywhere}.document-heading button{white-space:normal}.row>*{max-width:100%}dialog{padding:20px}dialog form{gap:10px;flex-wrap:wrap}dialog section{min-width:0}#workspace{height:calc(100dvh - var(--header-height,64px));min-height:300px}#home,.card{min-width:0}#preview pre{overflow-wrap:anywhere}input[type=file]{width:100%;max-width:100%}#preview table{table-layout:fixed;max-width:100%}#preview td,#preview th{overflow-wrap:anywhere}@media(max-width:800px){#md{grid-template-columns:1fr;grid-template-rows:minmax(240px,45dvh) minmax(240px,55dvh)}#preview{display:block;min-height:240px;max-height:65dvh}#workspace{height:auto;min-height:calc(100dvh - var(--header-height,64px))}#board{flex:none;height:calc(100dvh - 80px);min-height:620px}#home{padding:0 12px;margin:20px auto}.card{padding:18px}header button{padding:8px 10px}#editor{min-width:0}#connection{max-width:100%}.document-heading h1{flex-basis:100%}}
dialog{width:680px;max-width:calc(100% - 24px);max-height:calc(100% - 24px)}

#links li{display:flex;gap:8px;flex-wrap:wrap;align-items:center;overflow-wrap:anywhere}#links li select{max-width:100%}#links li button{margin:0}#desktop-panel{max-width:900px;margin:24px auto}#sharing-enabled{align-self:flex-start}

#import{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}#import>.row{grid-column:1/-1}#import>*{min-width:0}#import .row>label{flex:1 1 220px;min-width:0}#import select{max-width:100%;width:100%}

#auth{order:3}#auth summary{cursor:pointer;font-weight:600}#notice{padding:12px 24px;background:#e8f7ee;color:#166534}.password-field{position:relative;display:block;min-width:0}.password-field input{width:100%;padding-right:48px}#password-toggle{position:absolute;right:3px;top:50%;transform:translateY(-50%);width:38px;height:36px;padding:7px;border:0;background:transparent}#password-toggle svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}.eye-slash{display:none}.revealed .eye-slash{display:block}

/* Web workspace: document tools live inside the active document. */
body{background:#f7f9fc}header{gap:8px;padding:8px 14px;min-height:58px}.brand{font-size:20px}.account-link{font-size:13px;color:#64748b}#workspace{height:calc(100dvh - var(--header-height,58px));min-height:380px}#document-tabs{display:flex;flex-wrap:wrap;gap:3px;padding:6px 12px;background:#edf2f8;border-bottom:1px solid #dce3ed}#document-tabs>span{display:flex;min-width:0;max-width:100%}#document-tabs button{border-radius:6px 0 0 6px;max-width:100%;white-space:normal;overflow-wrap:anywhere}#document-tabs button+button{border-radius:0 6px 6px 0;padding-inline:9px}button.selected{background:#e0edff;color:#1d4ed8;border-color:#93b4ef}#workspace-layout{display:flex;flex:1;min-height:0;min-width:0}#workspace-sidebar{width:240px;flex-shrink:0;background:#f8fafc;border-right:1px solid #dce3ed;padding:12px;overflow:auto}#workspace-sidebar h3{font-size:12px;text-transform:uppercase;color:#64748b;margin:22px 0 8px}#workspace-sidebar input{width:100%;margin:10px 0}.document-item{display:flex;min-width:0}.document-item>button:first-child{flex:1;min-width:0;overflow-wrap:anywhere;text-align:left}.document-item>button{border-color:transparent;background:transparent;padding:8px}.document-item .selected{background:#e0edff!important}#outline,#backlinks,#local-folder{display:flex;flex-direction:column;gap:3px}#outline button,#backlinks button,#local-folder button{text-align:left;border:0;background:transparent;overflow-wrap:anywhere}#local-folder details{padding-left:10px}#local-folder summary{padding:8px;cursor:pointer}.sidebar-hidden #workspace-sidebar{display:none}#document-content{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0}.document-heading{padding:7px 12px;gap:7px}.document-heading #document-title{font-size:17px;font-weight:600;min-width:80px;flex:1;border:1px solid transparent;background:transparent;padding:6px}.document-heading #document-title:focus{border-color:#2563eb;background:white}#md-tools{display:flex;gap:4px;flex-wrap:wrap;background:white;border-bottom:1px solid #dce3ed;padding:7px 12px}#md-tools button{font-size:13px;padding:6px 10px;border-color:transparent}#md-tools button[aria-pressed=true]{background:#e0edff;color:#1d4ed8}#properties{background:white;padding:8px 18px;border-bottom:1px solid #e2e8f0}#properties summary{cursor:pointer;font-size:13px;color:#64748b}#property-list{max-height:230px;overflow:auto;margin-top:8px}.property-row{display:grid;grid-template-columns:85px minmax(90px,.3fr) minmax(100px,1fr) 32px;gap:6px;align-items:start;padding:5px 0}.property-row input,.property-row select{width:100%;padding:6px;font-size:13px}.property-row input[type=checkbox]{width:20px}.property-row>button{padding:6px}.property-value{display:flex;align-items:center;flex-wrap:wrap;gap:5px;min-width:0}.property-value>input{flex:1;min-width:75px}.property-value textarea{width:100%}.tag{display:inline-flex;align-items:center;max-width:100%;background:#f1f5f9;border:1px solid #d7e0eb;border-radius:16px;padding:1px 4px}.tag button{background:transparent!important;border:0;font-size:13px;padding:3px 5px;overflow-wrap:anywhere}.tag.selected{background:#dbeafe;color:#1e40af;border-color:#93c5fd}.tag.selected button:hover{background:#bfdbfe!important}.rating-stars{font-size:23px;letter-spacing:2px;background:linear-gradient(90deg,#f59e0b var(--rating),#cbd5e1 var(--rating));background-clip:text;color:transparent}#properties-divider{height:5px;min-height:5px;background:#e2e8f0;cursor:row-resize}#properties:not([open])+#properties-divider{display:none}#find-panel{display:flex;gap:5px;align-items:center;flex-wrap:wrap;padding:8px;background:#f1f5f9}#find-panel label{flex-direction:row;align-items:center;margin:0;font-size:12px}#find-panel input{max-width:180px}#md{display:grid;grid-template-columns:minmax(0,var(--split,50%)) 5px minmax(0,1fr);grid-template-rows:minmax(0,1fr);min-height:0}#md-divider{background:#e2e8f0;cursor:col-resize}#editor{width:100%;min-height:0;min-width:0;padding:22px;border:0;line-height:1.8;tab-size:4}#preview{min-width:0;min-height:0;max-height:none;padding:22px;font-size:15px}#preview pre{overflow:auto;white-space:pre}#preview table{table-layout:auto}#preview .katex-display{overflow:auto;max-width:100%}#md[data-view=editor]{grid-template-columns:minmax(0,1fr)}#md[data-view=editor] #preview,#md[data-view=editor] #md-divider{display:none}#md[data-view=preview]{grid-template-columns:minmax(0,1fr)}#md[data-view=preview] #editor,#md[data-view=preview] #md-divider{display:none}#board{height:auto;flex:1;min-height:0}#document-status{display:flex;gap:12px;padding:4px 12px;font-size:12px;color:#64748b;background:#f8fafc}#save-status{margin-left:auto}#diagram-dialog{width:1200px;height:85dvh;padding:0;overflow:hidden}#diagram-frame{border:0;width:100%;height:100%}.focus-mode{height:100dvh!important;background:white}.focus-mode #workspace-sidebar,.focus-mode #document-tabs,.focus-mode #document-status{display:none}.focus-mode:not(.show-tools) .document-heading,.focus-mode:not(.show-tools) #md-tools,.focus-mode:not(.show-tools) #properties,.focus-mode:not(.show-tools) #properties-divider,.focus-mode:not(.show-tools) #find-panel{display:none}
@media(max-width:900px){#workspace-sidebar{width:190px}#md-tools button{padding:6px 8px}.brand span{display:none}header .account-link{margin-left:auto}}
@media(max-width:700px){#workspace{height:auto;min-height:calc(100dvh - var(--header-height,64px))}#workspace-layout{flex-direction:column}#workspace-sidebar{width:100%;max-height:240px;border-bottom:1px solid #dce3ed}#document-content{min-height:650px}#md{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(260px,45dvh) minmax(260px,45dvh)}#md-divider{display:none}#md[data-view=editor],#md[data-view=preview]{grid-template-rows:minmax(500px,70dvh)}#editor,#preview{padding:16px;max-height:none}#board{min-height:850px;height:100dvh;flex:none}.property-row{grid-template-columns:65px minmax(80px,1fr) 32px}.property-value{grid-row:2;grid-column:1/4}.property-row>button{grid-column:3;grid-row:1}.document-heading>select{max-width:100%}#document-tabs{max-height:150px;overflow:auto}.focus-mode #document-content{min-height:0;flex:1}.focus-mode #workspace-layout{height:100%}.focus-mode #board{height:100%;min-height:0}.focus-mode #md{height:100%;grid-template-rows:minmax(0,1fr)}.focus-mode #md[data-view=split]{grid-template-rows:1fr 1fr}#find-panel input{max-width:100%;min-width:0;flex:1 1 100px}}
@media print{body>header,#notice,#error,#home,#workspace-sidebar,#document-tabs,.document-heading,#md-tools,#properties,#properties-divider,#find-panel,#editor,#md-divider,#document-status{display:none!important}#workspace,#workspace-layout,#document-content,#md,#preview{display:block!important;height:auto!important;overflow:visible!important;max-height:none!important}#preview{padding:0}#preview pre{white-space:pre-wrap}}

.native-host #new-md,.native-host #new-board,.native-host #menu-open,.native-host #open-file,.native-host .account-link{display:none}

#diagram-dialog>form{justify-content:flex-end;padding:5px 10px;margin:0;background:#f8fafc}#diagram-dialog #diagram-frame{height:calc(100% - 50px)}

/* Native sharing stays in one window; optional settings expand inline. */
.native-host .welcome,.native-host #my-documents,.native-host #my-documents-title,.native-host #download{display:none!important}
.native-host #home{display:block;max-width:680px;margin:0 auto;padding:16px}.native-host .card{max-width:680px;margin:16px auto;min-width:0}.native-host #home .card{margin:0}
.native-host header{flex-wrap:wrap}.native-host .brand{pointer-events:none}.native-offer #import h2{margin-top:0}.native-offer #import>.row{display:block}.native-offer #initial-role{width:100%}
#share-advanced,#desktop-options{border:1px solid #dce3ed;border-radius:10px;padding:12px;margin:16px 0}#share-advanced summary,#desktop-options summary{cursor:pointer;font-weight:600}#share-advanced #auth{margin-top:12px;padding:10px}#share-advanced #auth[hidden]{display:none}
.native-host #create,.native-host #desktop-copy{background:#2563eb;color:white;border-color:#2563eb}.native-host #create{width:100%;padding:12px}
.inline-settings{position:static;width:auto;max-width:100%;max-height:none;padding:0;border:0;box-shadow:none}.inline-settings li{overflow-wrap:anywhere}.inline-settings .row{flex-wrap:wrap}.inline-settings input,.inline-settings select{max-width:100%;min-width:0}
#desktop-panel{padding:20px}#desktop-link{width:100%;min-width:0}#desktop-copy-status{font-size:13px;color:#166534;margin-left:8px}#desktop-options:not([open])>*:not(summary){display:none}
@media(max-width:480px){.native-host #home,#desktop-panel{padding:12px}.native-host header .brand{font-size:17px}.inline-settings .row>*{flex:1 1 100%;width:100%}}

.native-host #settings-open{display:none!important}

.sharing-heading{display:flex;align-items:center;gap:12px}.sharing-heading h2{margin:0;flex:1}.sharing-heading #sharing-enabled{display:inline-flex;align-items:center;gap:10px;font-size:18px;font-weight:700;padding:11px 18px;border-radius:28px;color:#166534;background:#e8f7ee;border:1px solid #86c6a2}.sharing-heading #sharing-enabled::before{content:"";width:34px;height:20px;border-radius:12px;background:radial-gradient(circle at 24px 10px,#fff 7px,transparent 8px),#16824d;flex-shrink:0}.sharing-heading #sharing-enabled[aria-checked=false]{background:#f1f5f9;color:#475569;border-color:#cbd5e1}.sharing-heading #sharing-enabled[aria-checked=false]::before{background:radial-gradient(circle at 10px 10px,#fff 7px,transparent 8px),#94a3b8}.sharing-hint{font-size:14px;margin:18px 0}.sharing-heading .close{flex-shrink:0}@media(max-width:480px){.sharing-heading{gap:8px}.sharing-heading h2{font-size:19px;flex-basis:100%}.sharing-heading #sharing-enabled{font-size:17px;margin-left:auto}}

#settings #member-name{flex:1 1 180px;min-width:140px}#settings{overflow:auto}#desktop-open{margin-left:8px}

/* Keep desktop link policies and actions on one row. */
dialog#settings{width:980px}#links{padding-left:0;list-style:none}#links li>.link-summary{flex:1 1 220px;min-width:0}#links li>button{flex-shrink:0;white-space:nowrap;margin-left:0}@media(min-width:900px){dialog#settings #links li{flex-wrap:nowrap}dialog#settings #links li>select{flex-shrink:0}}

#sidebar-tabs{display:flex;gap:4px;margin-bottom:12px;border-bottom:1px solid #dce3ed;padding-bottom:8px}#sidebar-tabs button{flex:1;min-width:0;padding:7px 4px}#sidebar-tabs [aria-selected=true]{background:#e8f0ff;color:#1d4ed8;border-color:#93b4ee}#workspace-sidebar [role=tabpanel]{min-width:0}#outline:empty::before{content:"MD 문서의 목차가 여기에 표시됩니다."}#backlinks:empty::before{content:"이 문서를 참조하는 문서가 없습니다."}

#sidebar-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}#document-search-results{display:flex;flex-direction:column;gap:6px}#document-search-results button{text-align:left;overflow-wrap:anywhere}#sidebar-search input{width:100%}

.embedded-document body{background:white}.embedded-document body>header,.embedded-document #home,.embedded-document #notice,.embedded-document #document-tabs,.embedded-document #workspace-sidebar,.embedded-document .document-heading,.embedded-document #md-tools,.embedded-document #properties,.embedded-document #properties-divider,.embedded-document #find-panel,.embedded-document #document-status,.embedded-document #editor,.embedded-document #md-divider{display:none!important}.embedded-document #workspace,.embedded-document #workspace-layout,.embedded-document #document-content{height:100dvh!important;min-height:0!important;margin:0}.embedded-document #md:not([hidden]){display:block!important;height:100%;min-height:0;overflow:auto}.embedded-document #preview{display:block!important;min-height:0;max-height:none;height:100%;padding:16px}.embedded-document #board:not([hidden]){display:block;width:100%;height:100dvh;min-height:0;flex:1}.embedded-document #error{margin:0}
