:root {
  color-scheme: light;
  --bg: #f5f1ea;
  --bg-2: #ebe4d8;
  --panel: #fffdf8;
  --panel-2: #f7f1e8;
  --ink: #24201b;
  --text: #2d2923;
  --muted: #766e63;
  --line: rgba(73, 58, 39, .16);
  --line-strong: rgba(73, 58, 39, .28);
  --blue: #2f75b6;
  --blue-soft: #dceefc;
  --teal: #2d7d74;
  --olive: #66833e;
  --yellow: #be7f1a;
  --green: #2f8d5a;
  --red: #b7444b;
  --shadow: 0 20px 55px rgba(91, 70, 42, .12);
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(135deg, var(--bg), #fbf8f2 52%, var(--bg-2)); color: var(--text); font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; flex: 0 0 auto; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 68px; border-right: 1px solid var(--line); background: rgba(255, 253, 248, .94); backdrop-filter: blur(18px); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; box-shadow: 10px 0 30px rgba(82, 63, 39, .08); transition: width .16s ease, box-shadow .16s ease; }
.sidebar-open .sidebar, .sidebar-pinned .sidebar { width: 256px; box-shadow: 16px 0 44px rgba(82, 63, 39, .14); }
.sidebar-head { height: 58px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.brand { min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: -.04em; font-size: 1.18rem; text-decoration: none; white-space: nowrap; color: var(--ink); }
.collapse-btn, .pin-btn { width: 40px; min-width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
.pin-btn { opacity: 0; pointer-events: none; }
.sidebar-open .pin-btn, .sidebar-pinned .pin-btn { opacity: 1; pointer-events: auto; }
.sidebar-pinned .pin-btn { background: #e4f0fa; color: var(--blue); border-color: rgba(47, 117, 182, .35); }
.side-nav { padding: 10px; display: grid; align-content: start; gap: 6px; overflow: auto; }
.side-nav a, button, .button { border: 1px solid var(--line); background: rgba(255,255,255,.72); color: var(--text); border-radius: 12px; min-height: 40px; padding: 9px 12px; text-decoration: none; cursor: pointer; font: inherit; box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; }
.side-nav a, .sidebar-foot button { display: flex; align-items: center; gap: 10px; width: 100%; }
.side-nav a:hover, .side-nav a.active, button:hover, .button:hover { border-color: rgba(47, 117, 182, .35); background: #fff; color: var(--blue); }
.side-nav a svg { color: #38546d; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.user-chip { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.66); min-height: 46px; }
.user-chip span { color: var(--muted); font-size: .82rem; }
.app-shell:not(.sidebar-open):not(.sidebar-pinned) .nav-label { display: none; }
.app-shell:not(.sidebar-open):not(.sidebar-pinned) .brand, .app-shell:not(.sidebar-open):not(.sidebar-pinned) .user-chip { display: none; }
.app-shell:not(.sidebar-open):not(.sidebar-pinned) .sidebar-head { grid-template-columns: 1fr; padding: 9px; }
.app-shell:not(.sidebar-open):not(.sidebar-pinned) .pin-btn { display: none; }
.app-shell:not(.sidebar-open):not(.sidebar-pinned) .side-nav, .app-shell:not(.sidebar-open):not(.sidebar-pinned) .sidebar-foot { padding: 8px; }
.app-shell:not(.sidebar-open):not(.sidebar-pinned) .side-nav a, .app-shell:not(.sidebar-open):not(.sidebar-pinned) .sidebar-foot button { justify-content: center; padding: 0; width: 52px; height: 46px; }
.content { min-width: 0; margin-left: 68px; padding: 18px 22px; transition: margin-left .16s ease; }
.sidebar-pinned .content { margin-left: 256px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.04em; color: var(--ink); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: rgba(255,253,248,.82); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: 0 12px 34px rgba(91, 70, 42, .08); }
.card h2, .card h3 { margin: 0 0 12px; font-size: 1.05rem; letter-spacing: -.02em; color: var(--ink); }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item { border: 1px solid var(--line); background: rgba(255,255,255,.72); border-radius: 14px; padding: 12px; }
.title { font-weight: 750; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: .78rem; background: #ece4d7; color: var(--muted); white-space: nowrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { border: 1px solid var(--line); background: rgba(255,255,255,.68); border-radius: 999px; padding: 8px 13px; text-decoration: none; color: var(--muted); }
.tab.active, .tab:hover { border-color: rgba(47, 117, 182, .35); background: #fff; color: var(--blue); }
.status-planned { background: #ece4d7; color: #675b4b; }
.status-ready { background: #dceefc; color: var(--blue); }
.status-doing { background: #fff0c9; color: var(--yellow); }
.status-review { background: #ffe2c8; color: #a6531d; }
.status-done { background: #dff2e7; color: var(--green); }
.status-cancelled { background: #e9e3dd; color: #7b7770; }
.danger { color: var(--red); }
form { margin: 0; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); background: rgba(255,255,255,.82); color: var(--ink); border-radius: 12px; min-height: 40px; padding: 9px 11px; font: inherit; }
input:focus, select:focus, textarea:focus, button:focus, .button:focus, a:focus { outline: 3px solid rgba(47,117,182,.2); outline-offset: 2px; }
textarea { min-height: 108px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
button.primary, .button.primary { background: var(--blue); color: white; border-color: transparent; font-weight: 760; box-shadow: 0 10px 24px rgba(47,117,182,.18); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login .card { width: min(420px, 100%); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 650; }
code { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; font-size: .9em; }
.table-wrap { overflow: auto; }
.modal-dialog { width: min(560px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--text); padding: 20px; box-shadow: var(--shadow); }
.modal-dialog::backdrop { background: rgba(39, 31, 22, .32); backdrop-filter: blur(3px); }
.modal-dialog h2 { margin: 0; color: var(--ink); }
.timeline { display: grid; gap: 7px; }
.timeline .bar { display: grid; grid-template-columns: 7rem 1fr 12rem; gap: 10px; align-items: center; }
.track { height: 10px; border-radius: 999px; background: #e2d8c9; overflow: hidden; }
.fill { height: 100%; border-radius: inherit; background: var(--blue); width: 62%; }
.fill.done { background: var(--green); width: 100%; }
.fill.doing { background: #d69b2d; width: 72%; }
.fill.review { background: #e88540; width: 86%; }

.org-workbench { height: calc(100vh - 36px); min-height: 620px; display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.org-shell { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.org-shell.inspector-open { grid-template-columns: minmax(0, 1fr) 360px; }
.org-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,248,.82); box-shadow: 0 10px 30px rgba(91,70,42,.08); }
.org-viewport { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: #faf7ef; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.org-world { position: absolute; left: 0; top: 0; width: 2800px; height: 1800px; transform-origin: 0 0; background: linear-gradient(rgba(79, 94, 111, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 94, 111, .08) 1px, transparent 1px); background-size: 32px 32px; }
.org-arrows { position: absolute; inset: 0; width: 2800px; height: 1800px; pointer-events: none; overflow: visible; }
.org-node { position: absolute; width: 260px; min-height: 132px; border: 2px solid rgba(47,117,182,.38); border-radius: 16px; background: var(--blue-soft); color: #17304a; box-shadow: 0 18px 40px rgba(75, 86, 97, .16); padding: 12px; cursor: grab; user-select: none; }
.org-node.root { cursor: default; border-color: rgba(47,117,182,.28); }
.org-node:active { cursor: grabbing; }
.org-node.selected { outline: 4px solid rgba(47,117,182,.24); border-color: var(--blue); }
.org-node h3 { margin: 0 0 8px; color: #1e6796; font-size: 1rem; }
.org-node-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.org-node-member { display: grid; gap: 2px; background: rgba(255,255,255,.68); border: 1px solid rgba(44,55,65,.1); border-radius: 10px; padding: 8px; margin-top: 6px; }
.org-node-member strong { color: #202b37; }
.org-node-member span { color: #776432; font-size: .78rem; }
.org-inspector { display: none; min-height: 0; overflow: auto; background: rgba(255,253,248,.9); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.org-shell.inspector-open .org-inspector { display: block; }
.org-inspector-empty { min-height: 260px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.inspector-section { display: grid; gap: 12px; }
.org-mini-list { display: grid; gap: 8px; }
.org-mini-member { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 12px; background: rgba(247,241,232,.86); border: 1px solid var(--line); }
.hidden { display: none !important; }
@media (max-width: 1000px) {
  .content, .sidebar-pinned .content { margin-left: 58px; padding: 14px; }
  .sidebar { width: 58px; }
  .sidebar-open .sidebar, .sidebar-pinned .sidebar { width: min(256px, calc(100vw - 20px)); }
  .app-shell:not(.sidebar-open):not(.sidebar-pinned) .side-nav a, .app-shell:not(.sidebar-open):not(.sidebar-pinned) .sidebar-foot button { width: 42px; }
  .grid, .grid-3, .form-grid, .org-shell { grid-template-columns: 1fr; }
  .org-shell.inspector-open { grid-template-columns: 1fr; }
  .org-workbench { height: auto; }
  .org-viewport { min-height: 520px; }
  .timeline .bar { grid-template-columns: 1fr; }
}
