:root{color-scheme:light;--ink:#172923;--muted:#5d6b64;--line:#dce2d8;--paper:#f6f5ef;--white:#fdfdf8;--green:#184439;--lime:#e4fa9e;--serif:Georgia,"Times New Roman",serif;--sans:system-ui,-apple-system,"Segoe UI",sans-serif;--mono:ui-monospace,"DejaVu Sans Mono",monospace}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:14px}
button,input,summary{font:inherit}
button,summary{cursor:pointer}
button:disabled,summary[aria-disabled=true]{cursor:default;opacity:.55}
a{color:inherit;text-decoration:none}
button:focus-visible,input:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #387b64;outline-offset:3px}
.symbols{position:absolute;width:0;height:0;overflow:hidden}
.auth-screen{min-height:100dvh;display:grid;grid-template-rows:auto 1fr auto;place-items:center;padding:28px;background:radial-gradient(ellipse at 50% 0%,#e5eee4 0%,var(--paper) 55%)}
.auth-brand{align-self:start;justify-self:start}
.auth-card{width:min(100%,430px);padding:35px;background:var(--white);border:1px solid var(--line);border-radius:18px;box-shadow:0 20px 60px #183c3310}
.auth-card .eyebrow{color:#658575}
.auth-card h1{margin:10px 0;font-size:43px;line-height:1.03}
.auth-card h1 span{color:#5b8d71}
.auth-card>p{color:var(--muted);line-height:1.55;margin:0 0 20px}
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;padding:4px;background:#edf0e8;border-radius:9px;margin:21px 0}
.auth-tabs button{border:0;border-radius:7px;background:transparent;padding:9px;color:var(--muted);font-weight:620}
.auth-tabs button.selected{background:var(--white);color:var(--ink);box-shadow:0 1px 4px #17292312}
#auth-form{display:grid;gap:14px}
#auth-form label{display:grid;gap:6px;color:#40534a;font-size:12px;font-weight:650}
#auth-form input{width:100%;height:42px;padding:0 11px;border:1px solid #d4ddd2;border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:14px;font-weight:400}
#auth-submit{width:100%;margin-top:3px;min-height:43px}
.auth-error{margin:0!important;padding:10px 11px;border-radius:8px;background:#faece5;color:#803e2b!important;font-size:12px}
.auth-error.auth-success{background:#e8f4e6;color:#315d42!important}
.text-button{display:block;margin:12px auto 0;border:0;background:transparent;color:var(--green);font:inherit;font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.text-button:hover{color:#214e42}
.auth-card .auth-footnote{margin:19px 0 0;font-size:11px;line-height:1.55}
.auth-local{margin-top:21px;padding-top:18px;border-top:1px solid var(--line)}
.auth-local button{width:100%;min-height:42px}
.auth-local p{margin:9px 0 0;color:var(--muted);font-size:11px;line-height:1.55;text-align:center}
.auth-caption{align-self:end;justify-self:end;color:var(--muted);font-size:11px}
button svg,summary svg,.search svg,.brand svg,.template svg,.draft-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
.topbar{background:var(--white);border-bottom:1px solid var(--line)}
.top-inner{max-width:1200px;margin:auto;min-height:70px;padding:0 34px;display:flex;align-items:center;gap:16px}
.brand{display:inline-flex;align-items:center;gap:10px;font-size:20px;font-weight:730;letter-spacing:-.07em}
.brand-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--green);color:var(--lime)}
.brand svg{width:21px;height:21px}
.top-divider{width:1px;height:22px;background:var(--line);margin-left:1px}
.top-section,.save-status{color:var(--muted);font-size:13px}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:12px}
.local-pill,.count{display:inline-flex;align-items:center;gap:7px;background:#eef2e9;border:1px solid #dfe6d9;border-radius:99px;padding:5px 9px;color:#405b4f;font-size:12px}
.local-pill{flex:none;white-space:nowrap}
.account-button{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid var(--line);border-radius:99px;background:var(--white);padding:6px 10px;color:var(--ink);font:inherit;font-size:12px;cursor:pointer}
.tutorial-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tutorial-card{min-height:130px;text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:17px;border:1px solid var(--line);border-radius:12px;background:var(--white);color:var(--ink);transition:transform .16s,border-color .16s,box-shadow .16s}
.tutorial-card:hover{transform:translateY(-2px);border-color:#91ad9b;box-shadow:0 8px 24px #173a3210}
.tutorial-card strong{font-family:var(--serif);font-size:19px;font-weight:600;letter-spacing:-.02em}
.tutorial-card>span:last-child{font-size:12px;line-height:1.5;color:var(--muted)}
.tutorial-number{font:10px var(--mono);letter-spacing:.1em;color:#658575}
.local-pill>span:first-child,.small-dot,.save-status>span:first-child{width:7px;height:7px;border-radius:50%;background:#5a8a70;display:inline-block;flex:none}
.icon-button{border:1px solid var(--line);background:transparent;border-radius:9px;color:var(--ink);width:35px;height:35px;display:grid;place-items:center}
.icon-button:hover,.button.outline:hover{background:#e9eee4}
.main{max-width:1200px;margin:auto;padding:30px 34px 0}
.hero{position:relative;overflow:hidden;min-height:300px;background:linear-gradient(114deg,#173a32 25%,#224f44 90%);border-radius:18px;color:#f7f9ee;isolation:isolate}
.hero-content{position:relative;z-index:1;padding:35px 43px 37px;max-width:610px}
.eyebrow{font-family:var(--mono);letter-spacing:.15em;font-size:10px;font-weight:650;color:#64776c}
.hero-label{color:#b1d7bd;display:flex;align-items:center;gap:8px}
.hero-label>span{width:15px;height:1px;background:#b1d7bd}
h1,h2{font-family:var(--serif);font-weight:400;letter-spacing:-.052em;margin:0}
.hero h1{font-size:clamp(53px,7vw,83px);line-height:.91;margin:14px 0 13px}
.hero h1 span{color:var(--lime)}
.hero p{font-size:14px;color:#e0e9dc;margin:0 0 22px;line-height:1.5}
.hero .local-mode-note{max-width:540px;margin:0 0 17px;padding:10px 12px;border:1px solid #a5cbb74d;border-radius:8px;background:#ffffff0b;color:#e0e9dc;font-size:12px;line-height:1.5}
.hero-art{position:absolute;top:0;right:0;height:100%;width:min(52%,560px);opacity:.95}
.hero-actions{display:flex;flex-wrap:wrap;gap:8px}
.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:8px 12px;min-height:37px;border-radius:8px;border:1px solid transparent;white-space:nowrap;font-size:13px;font-weight:620}
.button svg{width:16px;height:16px}
.button.bright{background:var(--lime);color:#223626}
.button.bright:hover{background:#f0ffbf}
.button.ghost{background:#ffffff09;border-color:#a5cbb773;color:#f6f9ee}
.button.ghost:hover{background:#ffffff1c}
.button.outline{background:var(--white);border-color:var(--line);color:var(--ink)}
.button.dark{background:var(--green);color:#fff;border-color:var(--green)}
.button.dark:hover{background:#286050}
.section{margin-top:30px}
.section-head{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:12px}
.section h2,.manuscripts h2{font-size:35px;line-height:1.07;margin-top:5px}
.templates{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.template{display:flex;align-items:center;gap:11px;text-align:left;background:var(--white);border:1px solid var(--line);border-radius:12px;padding:13px;color:inherit;min-width:0;min-height:76px;transition:border-color .16s,transform .16s}
.template:hover{border-color:#80a78e;transform:translateY(-2px)}
.template-icon,.draft-icon{width:41px;height:41px;flex:none;border-radius:9px;display:grid;place-items:center}
.template-icon.sage,.draft-icon{background:#e4efdf;color:#365f47}
.template-icon.lilac{background:#ebe5f5;color:#635078}
.template-icon.apricot{background:#f6e8d9;color:#895c37}
.template-text{display:grid;gap:4px;line-height:1.25}
.template strong{font-size:13px}
.template-text span,.draft-meta,.empty p{color:var(--muted);font-size:12px}
.template .template-arrow{margin-left:auto;width:16px;color:#61776a}
.count{font-family:var(--sans);font-size:11px;padding:3px 7px;letter-spacing:0;vertical-align:middle}
.search{display:flex;align-items:center;gap:7px;background:var(--white);border:1px solid var(--line);border-radius:8px;padding:0 9px;color:#556a5e;max-width:100%}
.search svg{width:15px}
.search input{min-width:0;width:164px;border:0;background:none;padding:8px 0;color:var(--ink);font-size:12px}
.drafts{display:grid;gap:7px}
.empty{border:1px dashed #c9d4c8;border-radius:11px;padding:17px 15px;display:flex;gap:12px;align-items:center}
.empty p{margin:4px 0 0}
.draft{border:1px solid var(--line);border-radius:10px;display:flex;align-items:center;gap:10px;background:var(--white);padding-right:10px}
.draft-open{border:0;background:none;flex:1;min-width:0;display:flex;align-items:center;gap:10px;text-align:left;color:inherit;padding:9px}
.draft-open:hover strong{text-decoration:underline}
.draft-name{display:grid;gap:3px;min-width:0}
.draft-name strong,.title-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.draft-meta.shared{color:#315f48;font-weight:650}
.footer{border-top:1px solid var(--line);padding:13px 0;margin-top:25px;display:flex;justify-content:space-between;color:var(--muted);font-size:11px;gap:10px}
/* The editor is the workspace, so it uses the full viewport. */
.studio{--studio-green:#183c33;--studio-line:#315c4f;width:100%;height:100dvh;margin:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:#eef1e9;overflow:hidden}
.editor-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 18px;background:var(--studio-green);color:#f5f8ed;border-bottom:1px solid var(--studio-line);z-index:2}
.editor-left,.editor-actions{display:flex;align-items:center;gap:8px;min-width:0}
.editor-name{min-width:0}
.editor-name .eyebrow{color:#b1d7bd}
.editor-back{flex:none;margin-right:4px}
.studio-mark{display:grid;place-items:center;flex:none;width:35px;height:35px;border-radius:10px;background:#ffffff12;color:var(--lime)}
.studio-mark svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.title-button{max-width:min(42vw,410px);border:0;background:transparent;display:flex;align-items:center;gap:6px;padding:2px 0;color:inherit;font:600 22px var(--serif);letter-spacing:-.025em;text-align:left}
.title-button:hover:not(:disabled) span{text-decoration:underline;text-underline-offset:3px}
.title-button svg{width:13px;color:#b1d7bd}
.title-button:disabled{opacity:1}
.title-button:disabled svg{visibility:hidden}
.editor-header .button.outline{border-color:#72978966;color:#f5f8ed;background:transparent}
.editor-header .button.outline:hover:not(:disabled){background:#315c4f}
.editor-header .button.dark{background:var(--lime);border-color:var(--lime);color:var(--studio-green)}
.editor-header .button.dark:hover:not(:disabled){background:#f1ffc1}
.editor-header .exports[open] summary{background:#315c4f}
.editor-header .export-menu{color:var(--ink)}
.save-status{display:grid;grid-template-columns:7px auto;align-items:center;column-gap:5px;margin-right:4px;flex:none;white-space:nowrap;color:#d1e1d5}
.save-status-width,.save-status-label{grid-area:1/2}
.save-status-width{visibility:hidden}
.save-status-label{contain:inline-size;overflow:hidden;text-overflow:ellipsis}
.save-status>span:first-child{background:#8ec9a1}
.save-status[data-state=error]>span:first-child{background:#f3ab90}
.save-status[data-state=busy]>span:first-child{background:#eac984}
.editor-host iframe{width:100%;height:100%;display:block;border:0;background:#eef1e9}
.editor-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;padding:8px 15px;background:var(--white);border-top:1px solid var(--line);font-size:11px;color:var(--muted)}
.exports{position:relative}
.exports summary{list-style:none}
.exports summary::-webkit-details-marker{display:none}
.export-menu{position:absolute;right:0;top:calc(100% + 6px);min-width:165px;padding:4px;background:var(--white);border:1px solid var(--line);border-radius:9px;box-shadow:0 8px 25px #10271a26}
.export-menu button{width:100%;display:flex;justify-content:space-between;gap:14px;border:0;background:none;color:inherit;padding:8px;border-radius:5px}
.export-menu button:hover{background:#edf1e8}
.export-menu button span{color:var(--muted);font-size:12px}
dialog{width:min(440px,calc(100% - 24px));border:1px solid var(--line);border-radius:14px;background:var(--white);padding:22px;color:var(--ink)}
.command-dialog{width:min(660px,calc(100% - 24px));padding:10px;border-radius:16px;box-shadow:0 24px 70px #142c2450}
.command-search-head{display:flex;align-items:center;gap:11px;padding:10px 12px;border-bottom:1px solid var(--line);color:#62766b}
.command-search-head svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;flex:none}
.command-search-head input{flex:1;min-width:0;border:0;background:transparent;padding:5px 0;font-size:16px;outline:0!important}
.command-search-head kbd{border:1px solid var(--line);border-radius:5px;padding:2px 6px;color:var(--muted);font:11px var(--mono)}
.command-results{max-height:min(58vh,520px);overflow:auto;padding:6px 0}
.command-result{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 12px;text-align:left;border:0;border-radius:9px;background:transparent;color:var(--ink);padding:10px 12px}
.command-result:hover,.command-result[aria-selected=true]{background:#edf2e8}
.command-result-title{font-size:14px;font-weight:620}
.command-result-path{font:10px var(--mono);color:#718278;white-space:nowrap}
.command-result-description{grid-column:1/-1;font-size:12px;color:var(--muted)}
.command-result-empty{padding:22px 13px;color:var(--muted);font-size:13px}
.command-search-note{margin:0;padding:8px 12px 5px;border-top:1px solid var(--line);font-size:11px!important}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
dialog::backdrop{background:#132d26a0}
dialog h2{font-size:31px;margin-top:5px}
dialog p{line-height:1.55;color:var(--muted)}
dialog label{display:grid;gap:5px;font-size:13px}
dialog input{border:1px solid #a8baab;border-radius:7px;padding:8px;color:var(--ink)}
.dialog-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:16px}
.account-section{display:grid;gap:9px;margin-top:17px;padding-top:14px;border-top:1px solid var(--line)}
.account-section h3{margin:0;font-size:15px}
.account-section p{margin:0;font-size:12px}
.account-section>.button{justify-self:start}
.account-links{display:grid;gap:7px;max-height:200px;overflow:auto}
.account-links-empty{font-size:12px;margin:0}
.account-link-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px;border:1px solid var(--line);border-radius:8px;background:#f7f8f2}
.account-link-row>span{display:grid;gap:3px;min-width:0}
.account-link-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.account-link-row small{color:var(--muted);font-size:10px}
.account-link-row .button{min-height:30px;padding:5px 9px;font-size:11px}
.recovery-code-list{white-space:pre-wrap;overflow-wrap:anywhere;background:#f4f5ed;border:1px solid var(--line);border-radius:8px;padding:12px;font:12px/1.7 var(--mono);color:var(--ink)}
.recovery-ack{display:flex!important;grid-template-columns:auto 1fr;align-items:center;gap:8px!important;margin-top:12px;font-size:12px!important}
.recovery-ack input{margin:0}
.notice{position:fixed;z-index:4;right:14px;bottom:15px;background:var(--green);color:white;padding:10px 13px;border-radius:9px;max-width:min(380px,calc(100vw - 28px));box-shadow:0 5px 20px #102b2140;overflow-wrap:anywhere}
@media(max-width:810px){.top-inner,.main{padding-left:20px;padding-right:20px}.hero-content{padding-left:27px}.template{align-items:flex-start}.template .template-arrow{display:none}.template-text{gap:5px}.hero-art{opacity:.6}}
@media(max-width:590px){.top-inner,.main{padding-left:12px;padding-right:12px}.top-inner{min-height:53px;gap:8px}.top-divider,.top-section{display:none}.main{padding-top:13px}.hero{min-height:0}.hero-content{padding:22px 16px}.hero h1{font-size:53px}.hero-art{width:75%;right:-10%;opacity:.35}.hero p{max-width:270px}.section{margin-top:22px}.section h2{font-size:28px}.templates{grid-template-columns:1fr;gap:5px}.template{min-height:0;padding:8px;align-items:center}.template .template-arrow{display:block}.template-icon{width:34px;height:34px}.search input{width:104px}.search{gap:4px;padding:0 5px}.editor-header{padding:6px 8px;gap:5px}.editor-actions{gap:4px;flex-wrap:wrap}.editor-actions .button{padding:6px 8px;min-height:31px}.save-status{font-size:11px}.title-button{max-width:70vw}.footer{font-size:10px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important}}
@media(max-width:720px){.tutorial-cards{grid-template-columns:1fr}.tutorial-card{min-height:0}}


.writing-desk,.paper-frame{position:relative;min-height:0;min-width:0;height:100%}
.editor-host{position:absolute;inset:0}
.editor-host[data-ready=false]{opacity:0;pointer-events:none}
.editor-cover{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;text-align:center;padding:20px;background:radial-gradient(ellipse at 50% 42%,#f9fcf0,var(--white) 65%)}
.cover-mark{display:grid;place-items:center;background:var(--green);color:var(--lime);width:50px;height:50px;border-radius:14px;margin-bottom:18px}
.cover-mark svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.editor-cover h2{font-size:clamp(23px,4vw,36px)}
.editor-cover p{color:var(--muted);margin:9px 0 0}
#editor-context{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 11px var(--mono);color:var(--green)}
#share-dialog{width:min(490px,calc(100% - 24px))}
.share-panel{display:grid;gap:8px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#f1f5eb}
.share-panel label{font-weight:650}
.share-panel p{margin:0;font-size:12px}
.share-panel>button{justify-self:start}
.copy-row{display:flex;gap:7px}
.copy-row input{flex:1;min-width:0;background:var(--white)}
.share-live{display:grid;gap:4px;margin-top:14px;padding-top:13px;border-top:1px solid var(--line)}
.share-live span{font-size:13px;color:var(--muted)}
@media(max-width:760px){.editor-header,.editor-footer{padding-inline:10px}.editor-header{gap:7px}.editor-actions{flex-wrap:wrap}.editor-back span{display:none}}
@media(max-width:550px){.editor-left{flex-wrap:wrap}.editor-footer{font-size:10px}.editor-footer #editor-hint{display:none}.title-button{font-size:19px;max-width:62vw}.editor-actions .button{font-size:12px}.editor-back{margin:0}.studio-mark{display:none}}

.share-panel + .share-panel{margin-top:10px;background:var(--white)}

/* Manuscript actions live above the page, outside the native canvas. */
.desk-context,.desk-views{display:flex;align-items:center;gap:8px;min-width:0}
.desk-views{flex:none}
.draft-state{white-space:nowrap}
#shortcut-label{white-space:nowrap}
#shortcut-label kbd{border:1px solid var(--line);border-radius:4px;padding:1px 4px;background:#f1f4eb;color:var(--green);font:600 10px var(--mono)}
#mode-label{font:600 10px var(--mono);letter-spacing:.06em;white-space:nowrap}
#editor-hint{flex:1;min-width:0;text-align:center;overflow-wrap:anywhere}
#resume-manuscript{padding:4px 9px;min-height:27px;letter-spacing:normal;font-size:11px}
.desk-label-prefix{white-space:nowrap;color:#64776c;font:650 10px var(--mono);letter-spacing:.1em}
#editor-context{background:#e6eee2;border-radius:5px;padding:3px 6px;letter-spacing:normal}
@media(max-width:480px){
  .desk-label-prefix,#mode-label,#shortcut-label{display:none}
}

#shortcut-hint:empty{visibility:hidden}
#shortcut-hint{margin:0;pointer-events:none}
