:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;color:#263d35;background:#f7f8f4;font-synthesis:none}
*{box-sizing:border-box}
body{margin:0}
button,a,input{-webkit-tap-highlight-color:transparent}
button{font:inherit;font-size:13px;border:1px solid #dce3d9;border-radius:8px;background:#fff;color:#365247;padding:9px 13px;cursor:pointer;white-space:nowrap}
button:hover{background:#edf2e9;border-color:#aec3ad}
button:disabled{opacity:.4;cursor:default}
button.primary{background:#315d46;color:#fff;border-color:#315d46}
button:focus-visible,a:focus-visible{outline:3px solid #96b77f;outline-offset:3px}
[hidden]{display:none!important}
body{min-height:100dvh;display:flex;flex-direction:column}
header{height:42px;flex-shrink:0;padding:0 12px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #dfe5db;background:#fcfdf9}
.brand{font-size:17px;color:#315d46;text-decoration:none;font-weight:650;letter-spacing:-1px;white-space:nowrap}
.divider{display:inline-block;width:1px;height:16px;background:#dce3d9;flex-shrink:0}
#title{font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0;max-width:160px;flex:0 1 auto}
header:has(.tools:not([hidden])) #title{max-width:100px}
nav{display:flex;gap:3px;margin-left:auto;padding-left:10px;border-left:1px solid #dce3d9;flex-shrink:0}
nav button{font-size:11px;padding:3px 7px}
.tools[hidden]+nav{border-left:0}
#welcome{max-width:790px;margin:0 auto;padding:100px 28px 40px}
.eyebrow{font-size:11px;letter-spacing:3px;color:#85967e}
.eyebrow span{letter-spacing:0;margin-left:10px}
h1{font-size:54px;letter-spacing:-2px;font-weight:550;margin:20px 0}
#welcome>p{color:#7b887a;font-size:16px}
.welcome-actions{display:flex;gap:12px;margin:34px 0 65px}
.welcome-actions button{padding:14px 22px}
h2{font-size:14px;font-weight:500;display:flex;justify-content:space-between;gap:12px}
h2 small{font-size:11px;color:#8b9488;font-weight:400}
.recent{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 0;border-bottom:1px solid #e1e6dc}
.recent button{border:0;background:none;padding:0;font-size:15px;text-align:left;white-space:normal;overflow-wrap:anywhere}
.recent small{font-size:11px;color:#899381}
.recent-copy{display:flex;flex-direction:column;gap:6px}
.recent .disk{font-size:12px;flex-shrink:0}
#welcome .privacy{font-size:12px;line-height:1.8;margin-top:36px}
#workspace{flex:1;min-height:0;display:flex;flex-direction:column}
.tools{flex:1 1 auto;min-width:0;display:flex;justify-content:safe center;align-items:center;gap:4px;overflow-x:auto;scrollbar-width:none}
.tools::-webkit-scrollbar{display:none}
.tool-group{display:flex;align-items:center;gap:0;padding:1px;border-radius:6px;background:#f1f4ec;flex-shrink:0}
.tools button{font-size:11px;line-height:16px;padding:2px 6px;background:transparent;border-color:transparent;border-radius:4px}
.tools button:hover{background:#e5ecdf}
.tools button:disabled{opacity:.62}
.tools button.danger:hover{background:#f7e4df;color:#9a3d2b}
.tool-icon{display:inline-block;min-width:0.9em;text-align:center}
#canvas{position:relative;overflow:hidden;flex:1;min-height:200px;background-image:radial-gradient(#bccbbb 1px,transparent 1px);background-size:22px 22px;outline:none;touch-action:none}
#viewport{position:absolute;transform-origin:0 0;will-change:transform}
#edges{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}
#edges path{stroke:none;opacity:.8}
#nodes{position:absolute;left:0;top:0}
.node{position:absolute;min-width:72px;max-width:320px;padding:15px 20px;background:#fff;border:1px solid #d5dfcf;border-radius:12px;box-shadow:0 3px 6px #30462b05;font-size:15px;line-height:22px;cursor:pointer;overflow-wrap:anywhere;white-space:pre-wrap;user-select:none;-webkit-touch-callout:none;touch-action:none}
.node.root{background:#e9efdf;font-weight:600;border-color:#a9bd96;min-width:120px}
.node.selected{outline:2px solid #608b51;outline-offset:3px}
.node.editing{padding:10px 12px;min-width:160px}
.edit-field{display:grid;min-width:136px}
.edit-field::after,.edit-field textarea{grid-area:1/1;margin:0;padding:4px 0;border:0;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal}
.edit-field::after{content:attr(data-value) " ";visibility:hidden}
.edit-field textarea{display:block;width:100%;min-width:0;height:100%;resize:none;overflow:hidden;outline:none;background:transparent;color:inherit;user-select:text}
.node .count{display:inline-flex;align-items:center;justify-content:center;font-size:10px;line-height:16px;color:#708363;margin-left:8px;border:1px solid #cdd9c4;border-radius:12px;padding:0 6px;background:transparent}
.node.drop-child{background:#e2efd9;outline:3px dashed #608b51}
.node.drop-before:before,.node.drop-after:after{content:"";position:absolute;left:-12px;right:-40px;height:4px;border-radius:2px;background:#467333}
.node.drop-before:before{top:-9px}
.node.drop-after:after{bottom:-9px}
.node.is-dragging{opacity:.4}
#drag-ghost{position:fixed;z-index:6;transform:translate(-50%,-50%);pointer-events:none;max-width:240px;padding:8px 14px;border-radius:12px;border:1px dashed #608b51;background:#f4f8ef;color:#303b35;font-size:14px;line-height:20px;box-shadow:0 10px 28px #30462b2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#drop-hint{position:absolute;left:20px;bottom:20px;padding:10px 16px;background:#315d46;color:white;border-radius:8px;font-size:12px;pointer-events:none}
footer{display:flex;justify-content:space-between;align-items:center;gap:12px;height:26px;flex-shrink:0;padding:0 12px;border-top:1px solid #e0e6db;color:#8b9784;font-size:10px}
.footer-info{display:flex;gap:14px;min-width:0;white-space:nowrap;overflow:hidden}
#status{color:#5f725f}
.footer-info .hint{overflow:hidden;text-overflow:ellipsis}
footer>div{display:flex;gap:4px;align-items:center}
footer button{border:0;background:transparent;font-size:11px;line-height:16px;padding:2px 6px}
#notice{position:fixed;bottom:48px;left:50%;transform:translateX(-50%);z-index:5;max-width:min(680px,90vw);background:#fffaf0;color:#775721;border:1px solid #e5d1a8;box-shadow:0 8px 30px #263d3514;border-radius:10px;padding:14px 20px;font-size:13px;line-height:1.6;pointer-events:none}
@media(max-width:1080px){.tool-label{display:none}
.tools button{padding:2px 5px;font-size:12px}
nav{padding-left:8px}
header:has(.tools:not([hidden])) #title{max-width:64px}
}
@media(max-width:800px){header{height:auto;min-height:42px;padding:6px 10px;padding-top:max(6px,env(safe-area-inset-top));flex-wrap:wrap;gap:6px}
nav{width:100%;min-width:0;max-width:100%;overflow-x:auto;margin-left:0;padding-left:0;border-left:0}
nav button{flex:1 0 auto;padding:4px 8px}
#title{max-width:140px}
.tools{order:1;flex:1 1 100%;justify-content:flex-start}
.tool-label{display:none}
.tools button{font-size:12px;padding:2px 6px}
footer{height:auto;min-height:44px;padding:4px 8px;padding-bottom:max(4px,env(safe-area-inset-bottom))}
.footer-info .hint{display:none}
#welcome{padding:48px 20px 32px}
h1{font-size:42px}
h2{flex-direction:column}
.recent{gap:12px;align-items:stretch}
.node{font-size:14px}
}

.writing-hint{position:absolute;left:2px;top:calc(100% + 2px);width:max-content;max-width:340px;padding:0;font-size:10px;line-height:1.4;font-weight:400;color:#b7c0b4;background:transparent;white-space:normal;pointer-events:none;z-index:2}
.writing-hint.over-recommended{color:#c4b59a}
.node.editing{z-index:3}
dialog{width:min(440px,calc(100vw - 32px));border:1px solid #dce3d9;border-radius:16px;padding:28px;color:#263d35;background:#fcfdf9;box-shadow:0 20px 80px #263d3526}
dialog::backdrop{background:#1d312a55}
dialog h2{font-size:22px;margin:0 0 14px}
dialog p{font-size:13px;line-height:1.7;color:#74816d}
.dialog-close{position:absolute;right:14px;top:14px;border:0;background:transparent;font-size:22px;padding:0 6px}
.export-options{display:grid;gap:10px;margin-top:22px}
.export-options button{display:flex;flex-direction:column;gap:7px;text-align:left;padding:16px;white-space:normal}
.export-options strong{font-size:14px;font-weight:600}
.export-options span{font-size:12px;color:#7b8973}
#export-progress{margin-bottom:0;color:#946025}

.node{width:max-content}

.node,.node.root{background:var(--branch-fill,#fff);border-color:var(--branch-border,#a9bd96);color:#303b35}
.node.selected{outline-color:var(--branch-ink,#608b51)}
.node-label{vertical-align:middle}
.node-markers{display:flex;align-items:center;gap:8px;margin-top:8px;line-height:22px}
.node-marker{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;font-family:"Segoe UI Symbol",sans-serif;font-size:18px;color:var(--branch-ink,#52785d)}
button.node-marker{padding:0;border:1px solid var(--branch-border);border-radius:5px;background:#ffffffa8;cursor:pointer}
button.node-marker:hover{background:#fff}
.marker-important{color:#946b2f}
.marker-question{border:1.5px solid currentColor;border-radius:50%;font-size:14px;font-weight:700;min-width:20px;width:20px;height:20px}
.node.completed .node-label{text-decoration:line-through;text-decoration-thickness:1px;text-decoration-color:var(--branch-ink);color:#6c766b}
.node.editing{color:#303b35}
.tools button[aria-pressed="true"]{background:#e4ecde;border-color:#b5c5a9;color:#315d46}


/* Paper and ink: text stays level and readable; only the outlines are sketched. */
:root{background:#faf8f2;color:#343c35;font-family:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Noto Sans CJK SC","Segoe UI",sans-serif;text-rendering:optimizeLegibility}

header{background:#fffdf7;border-bottom-color:#dedbd1}
.brand{font-family:"Segoe Print","Bradley Hand",cursive;color:#444b40}

button{border-radius:5px 8px 6px 4px;border-color:#d6d3c8;background:#fffdf8;color:#454d40}

.tool-group{background:#f4f1e8}
.tools button:hover{background:#e9e6da}
nav{border-left-color:#dedbd1}

#canvas{background-color:#faf8f2;background-image:radial-gradient(#d9d5c9 .7px,transparent .7px);background-size:24px 24px}

.node,.node.root{background:transparent;border:0;border-radius:8px 11px 7px 10px;box-shadow:none;color:#303b35;font-size:14px;line-height:22px;padding:11px 16px;isolation:isolate}

.node.root{min-width:120px;font-size:18px;line-height:26px;font-weight:650;padding:13px 18px}

.node[data-depth="1"]{min-width:96px;font-size:16px;line-height:24px;font-weight:600;padding:12px 17px}

.node[data-depth="2"]{font-size:15px;line-height:23px;font-weight:500}

.node-outline{position:absolute;inset:0;width:100%;height:100%;z-index:-1;overflow:visible;pointer-events:none}

.node-outline path{fill:var(--branch-fill);stroke:var(--branch-ink);stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}

.node-outline path+path{fill:none;opacity:.25}

.node.selected{outline-style:dashed;outline-width:1.5px;outline-offset:4px}

.node.editing{background:var(--branch-fill);border:1px solid var(--branch-ink);padding:10px 12px}

.node-main{display:flex;align-items:flex-start;gap:8px;min-width:0}
.node-label{display:block;min-width:0;text-wrap:balance}
/* One text line tall, so markers sit on the first line of a wrapped node. */
.node-markers{display:inline-flex;align-items:center;flex:0 0 auto;height:22px;height:1lh;line-height:inherit;gap:5px;margin:0}
.node-marker{width:22px;height:22px;min-width:22px}

button.node-marker{border:0;background:transparent;border-radius:3px}
button.node-marker:hover{background:#ffffffc0;outline:1px dashed currentColor}

.marker-question{border:0}
.marker-icon{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}

.writing-hint{background:transparent}
/* In flow so the layout reserves its space and neighbours never sit under it. */
.node.editing .writing-hint{position:static;display:block;width:auto;max-width:none;margin:2px 0 0}

@media(max-width:800px){.node{font-size:14px;line-height:21px}.node.root{font-size:17px;line-height:24px}.node[data-depth="1"]{font-size:15.5px;line-height:23px}.node[data-depth="2"]{font-size:14.5px;line-height:22px}
.edit-field textarea,.edit-field::after{font-size:16px}
}

.hint-touch{display:none}
#file-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html,body{overscroll-behavior:none}
body:has(#workspace:not([hidden])){height:100dvh;overflow:hidden}
button,a{touch-action:manipulation}

@media (hover:none){
button:hover{background:#fffdf8;border-color:#d6d3c8}
button.primary:hover{background:#315d46;color:#fff;border-color:#315d46}
.tools button:hover{background:transparent;border-color:transparent;color:inherit}
.tools button.danger:hover{background:transparent;color:#365247}
.tools button[aria-pressed="true"]:hover{background:#e4ecde;border-color:#b5c5a9;color:#315d46}
button.node-marker:hover{background:transparent;outline:none}
.recent button:hover{background:none;border-color:transparent}
}

@media (max-width:800px){
.tools{flex-wrap:wrap;overflow:visible;row-gap:4px}
}
@media (pointer:coarse),(max-width:800px){
.tools button,nav button,footer button{min-height:40px}
.tools button{padding:8px 12px}
nav button{padding:8px 12px}
footer button{padding:8px 10px}
button.node-marker{width:36px;height:36px;min-width:36px}
.node .count{min-height:32px;padding:4px 10px;font-size:12px}
#canvas button{touch-action:none}
.welcome-actions{flex-wrap:wrap}
.welcome-actions button,.recent button{min-height:44px}
}
@media (pointer:coarse){
.hint-keys{display:none}
.hint-touch{display:inline}
}

footer{border-top-color:#dedbd1;color:#777d70}
dialog{background:#fffdf7;border-radius:9px 14px 10px 8px}

.site-home{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;white-space:nowrap;text-decoration:none;font-size:13px;color:#70786d}.site-home:hover{color:#315d46}.site-home:focus-visible{outline:3px solid #9eb7ab;outline-offset:3px}
