:root { --ink:#202631; --muted:#647082; --line:#dce1e9; --paper:#fff; --ground:#f7f8fa; --blue:#465ae8; --cyan:#c9eff8; --gray:#e6e8ec; --red:#ffc5c5; --shadow:0 8px 24px rgba(34,45,72,.11); font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif; }
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; min-width:320px; color:var(--ink); background:var(--ground); font-size:14px; }
button, input, select, textarea { font:inherit; color:inherit; }
button { border:1px solid var(--line); background:#fff; border-radius:8px; padding:8px 10px; cursor:pointer; }
button:hover { border-color:#9aa7c4; background:#fafbff; } button:focus-visible, .note-card:focus-visible { outline:3px solid rgba(70,90,232,.35); outline-offset:2px; }
.primary { background:var(--blue); border-color:var(--blue); color:#fff; font-weight:700; } .primary:hover { background:#3548d4; border-color:#3548d4; }
.topbar { height:62px; display:flex; align-items:center; gap:24px; padding:0 18px; background:#fff; border-bottom:1px solid var(--line); position:relative; z-index:5; }
.brand { display:flex; align-items:center; gap:9px; white-space:nowrap; } .brand-mark { display:grid; place-items:center; width:28px; height:28px; color:#fff; background:var(--blue); font-weight:800; border-radius:7px; } .brand strong,.brand span { display:block; } .brand span { color:var(--muted); font-size:11px; margin-top:1px; }
.legend { display:flex; align-items:center; gap:12px; color:#536072; font-size:12px; flex:1; } .legend span { white-space:nowrap; } .swatch { display:inline-block; width:11px; height:11px; margin-right:4px; border:1px solid rgba(30,38,49,.12); border-radius:3px; vertical-align:-1px; }.cyan{background:var(--cyan)}.gray{background:var(--gray)}.red{background:var(--red)}
.top-actions { display:flex; align-items:center; gap:10px; }.sync-status { color:var(--muted); font-size:12px; white-space:nowrap; }.sync-status.error { color:#b42525; }.sync-status.ok { color:#35714b; }
.shell { display:grid; grid-template-columns:220px minmax(0,1fr) 310px; height:calc(100vh - 62px); }
.field-panel,.detail-panel { background:#fff; border-right:1px solid var(--line); overflow:auto; }.detail-panel { border-right:0; border-left:1px solid var(--line); }.panel-heading { display:flex; align-items:center; justify-content:space-between; height:54px; padding:0 14px; border-bottom:1px solid var(--line); }.panel-heading h2 { font-size:13px; letter-spacing:.04em; margin:0; }.count { color:var(--muted); font-size:12px; }.field-list { padding:8px; }.field-button { width:100%; display:flex; align-items:center; justify-content:space-between; text-align:left; margin-bottom:4px; padding:10px; border-color:transparent; }.field-button.selected { color:var(--blue); background:#eef0ff; border-color:#d9ddff; }.field-button small{color:var(--muted);}.panel-note{margin:12px 14px; padding:10px; background:#f5f7fb; border-radius:8px; color:var(--muted); font-size:12px; line-height:1.55;}
.board-section { min-width:0; display:grid; grid-template-rows:49px minmax(0,1fr); }.board-toolbar { height:49px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 12px; border-bottom:1px solid var(--line); background:#fff; }.update-notice{min-height:18px; color:var(--muted);font-size:12px}.view-actions { display:flex; align-items:center; gap:5px; white-space:nowrap; }.view-actions button { padding:5px 8px; border-radius:6px; font-size:12px; }.view-actions output { min-width:42px; text-align:center; color:var(--muted); font-size:12px; }
.board-viewport { min-width:0; overflow:hidden; position:relative; touch-action:none; background-color:#f7f8fa; background-image:radial-gradient(#dbe0e8 1px, transparent 1px); background-size:20px 20px; cursor:grab; }.board-viewport.panning { cursor:grabbing; }.world { position:absolute; transform-origin:0 0; min-width:1px; min-height:1px; }.edge-layer,.lane-layer,.node-layer { position:absolute; inset:0; overflow:visible; }.edge-layer { pointer-events:none; }.edge-path { fill:none; stroke:#94a0b4; stroke-width:1.5; vector-effect:non-scaling-stroke; }.edge-path.cross-field { stroke-dasharray:4 4; }.lane { position:absolute; border:1px solid #e0e5ed; border-radius:12px; background:rgba(255,255,255,.5); }.lane-label { position:absolute; left:14px; top:11px; color:#68758a; font-size:12px; font-weight:700; letter-spacing:.03em; }.note-card { position:absolute; width:272px; height:216px; display:flex; flex-direction:column; text-align:left; padding:12px; border:1px solid rgba(32,38,49,.12); border-radius:10px; box-shadow:0 2px 5px rgba(38,49,70,.08); overflow:hidden; cursor:pointer; transition:box-shadow .15s, border-color .15s; }.note-card:hover { box-shadow:var(--shadow); }.note-card.selected { border:2px solid var(--blue); box-shadow:0 0 0 3px rgba(70,90,232,.12), var(--shadow); }.note-card.cyan{background:var(--cyan)}.note-card.gray{background:var(--gray)}.note-card.red{background:var(--red)}.note-meta { display:flex; justify-content:space-between; gap:8px; color:#526075; font-size:11px; }.note-kind { font-weight:700; }.note-card h3 { margin:10px 0 7px; font-size:15px; line-height:1.35; }.note-card p { margin:0; font-size:12px; line-height:1.55; display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }.note-footer { margin-top:auto; display:flex; justify-content:space-between; gap:6px; color:#536072; font-size:11px; }.status-chip { padding:2px 5px; background:rgba(255,255,255,.52); border-radius:4px; white-space:nowrap; }
.empty-state { position:absolute; left:50%; top:46%; transform:translate(-50%,-50%); display:grid; justify-items:center; gap:10px; min-width:260px; padding:26px; background:#fff; border:1px solid var(--line); box-shadow:var(--shadow); border-radius:12px; color:var(--muted); text-align:center; }.empty-state strong { color:var(--ink); font-size:15px; }
.detail-content { padding:14px; }.placeholder { color:var(--muted); line-height:1.65; }.detail-title { margin:0 0 6px; font-size:17px; line-height:1.45; }.detail-meta { color:var(--muted); font-size:12px; line-height:1.6; }.detail-body { white-space:pre-wrap; line-height:1.7; margin:18px 0; }.detail-section { border-top:1px solid var(--line); padding:14px 0 0; margin-top:14px; }.detail-section h3 { margin:0 0 8px; font-size:12px; }.detail-section p { margin:0; color:#3c4859; white-space:pre-wrap; line-height:1.6; }.detail-section ul { padding-left:18px; margin:0; }.detail-section li { margin:0 0 7px; line-height:1.45; word-break:break-word; }.detail-section a { color:#2e48be; }.detail-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:18px; }.connected-item { display:flex; justify-content:space-between; gap:4px; align-items:center; padding:7px 0; border-top:1px solid #edf0f4; }.connected-item button{font-size:11px;padding:3px 5px;}.icon-button { border:0; padding:2px 6px; background:transparent; font-size:20px; line-height:1; color:var(--muted); }
.note-dialog { width:min(720px, calc(100vw - 24px)); max-height:calc(100vh - 24px); border:1px solid var(--line); border-radius:12px; box-shadow:0 22px 70px rgba(20,30,54,.25); padding:0; }.note-dialog::backdrop{background:rgba(30,38,49,.35)}.note-dialog form{padding:18px;overflow:auto;max-height:calc(100vh - 24px)}.dialog-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.dialog-header h2{margin:0;font-size:18px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px 12px}.note-dialog label{display:grid;gap:5px;margin:11px 0;font-size:12px;font-weight:700}.note-dialog input,.note-dialog select,.note-dialog textarea{width:100%;border:1px solid #c8d0dc;border-radius:7px;padding:8px;background:#fff}.note-dialog textarea{min-height:100px;resize:vertical;line-height:1.5}.note-dialog textarea.short-area{min-height:58px}.field-hint{font-weight:400;color:var(--muted)}.form-message{min-height:18px;color:#b42525;margin:8px 0;font-size:12px}.conflict-preview{margin:8px 0;padding:9px;border:1px solid #e6be67;border-radius:7px;background:#fff9e9;white-space:pre-wrap;font-size:12px;line-height:1.5}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.edit-hidden{display:none!important}
.compact-dialog { width:min(460px, calc(100vw - 24px)); }
@media (max-width:1050px){.shell{grid-template-columns:185px minmax(0,1fr)}.detail-panel{position:absolute;right:0;top:62px;bottom:0;width:310px;z-index:4;box-shadow:-8px 0 24px rgba(36,45,64,.12);display:none}.detail-panel.open{display:block}.legend{display:none}}@media(max-width:720px){.topbar{gap:8px;padding:0 10px}.top-actions .sync-status{display:none}.shell{grid-template-columns:132px minmax(0,1fr)}.field-panel{font-size:12px}.panel-note{display:none}.field-button{padding:8px}.field-button small{display:none}.view-actions button:nth-of-type(3){display:none}.board-toolbar{padding:0 6px}.update-notice{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.form-grid{grid-template-columns:1fr}.note-dialog form{padding:14px}}
@media(max-width:720px){.shell{grid-template-columns:minmax(0,1fr);grid-template-rows:45px minmax(0,1fr)}.field-panel{grid-row:1;display:flex;align-items:center;overflow:hidden;border-right:0;border-bottom:1px solid var(--line)}.field-panel .panel-heading{height:44px;flex:0 0 auto;border-bottom:0;padding:0 10px}.field-panel .panel-heading h2{font-size:12px}.field-list{display:flex;gap:4px;overflow-x:auto;padding:4px;min-width:0}.field-button{width:auto;flex:0 0 auto;margin:0;padding:6px 8px;white-space:nowrap}.board-section{grid-row:2}.detail-panel{top:107px}}
.note-card h3{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.note-footer{min-width:0}.note-footer > span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-chip{flex:0 0 auto}
.brand .brand-mark { display:grid; color:#fff; font-size:15px; margin-top:0; }
@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}
.gate-screen{position:fixed;inset:0;display:grid;place-items:center;background:var(--ground);padding:24px;z-index:10}.gate-card{max-width:420px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:28px;text-align:center}.gate-card h1{margin:0 0 10px;font-size:18px}.gate-card p{margin:0 0 16px;color:var(--muted);line-height:1.6}.gate-card code{background:var(--ground);padding:1px 5px;border-radius:4px}
.share-notice{color:var(--muted);font-size:11px;white-space:nowrap}
@media (max-width:720px) {
  .topbar { height:120px; flex-wrap:wrap; align-content:center; gap:6px; }
  .brand { max-width:100%; min-width:0; }
  .brand > div { min-width:0; }
  .brand strong { overflow:hidden; text-overflow:ellipsis; }
  .top-actions { width:100%; min-width:0; flex-wrap:wrap; gap:6px; }
  .share-notice { width:100%; white-space:normal; }
  .top-actions button { white-space:nowrap; }
  .shell { height:calc(100vh - 120px); }
  .detail-panel { top:165px; }
}
