/* ================= Tree Mind Map — dizayn tizimi ================= */
:root {
  --bg: #05070d;
  --ui: rgba(12, 16, 28, .74);
  --ui-solid: #0c1020;
  --ui-2: rgba(255, 255, 255, .06);
  --ui-3: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .12);
  --text: #eef2ff;
  --muted: #98a3c0;
  --accent: #ffc65c;
  --accent2: #ff8a3d;
  --card-bg: rgba(20, 20, 30, .55);
  --card-text: #fff;
  --gold: linear-gradient(135deg, #fff3c4, #ffc65c 45%, #e8902f);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  color-scheme: dark;
}
.shot-card { width: min(980px, 100%); }
.shot-card img { display: block; width: calc(100% - 28px); margin: 14px; border-radius: 12px; border: 1px solid var(--line); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--ui-3); border: 1px solid var(--line); border-bottom-width: 2px; }

/* ---------- fon ---------- */
#bg, #fade { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#bg { transition: filter .3s; }
#fade { z-index: 1; pointer-events: none; opacity: 0; }
#dim { position: fixed; inset: 0; background: #000; pointer-events: none; z-index: 1; opacity: .08; transition: opacity .3s; }

/* ---------- maydon ---------- */
#stage { position: fixed; inset: 0; z-index: 2; cursor: grab; touch-action: none; overflow: hidden; }
#stage.panning { cursor: grabbing; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; --sw: 2; --r: 16; --fs: 15; --pad: 10; --iz: 1; }
#links { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
#links path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#links path.flow { stroke-dasharray: 1.5 12; opacity: .75; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -27; } }

/* ---------- kartalar (node) ---------- */
.node {
  --c: #7cf;
  position: absolute; transform: translate(-50%, -50%);
  width: max-content; min-width: 64px; max-width: 260px;
  padding: calc(var(--pad) * 1px) calc(var(--pad) * 1.7px);
  border-radius: calc(var(--r) * 1px);
  font-size: calc(var(--fs) * 1px); font-weight: 650; line-height: 1.3; text-align: center;
  color: var(--card-text); background: var(--card-bg);
  border: calc(var(--sw) * 1px) solid var(--c);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  white-space: pre-wrap; overflow-wrap: anywhere;
  user-select: none; -webkit-user-select: none; cursor: pointer;
  outline: 2px solid transparent; outline-offset: 5px;
  transition: scale .18s ease, box-shadow .25s, outline-color .2s, background .25s, color .25s;
}
.node:hover { scale: 1.035; }
.node.dragging { scale: 1.06; cursor: grabbing; z-index: 6; transition: none; }
.node.sel { outline-color: rgba(255, 255, 255, .9); z-index: 5; }
.node.drop { outline: 2px dashed var(--accent); outline-offset: 9px; }
.node.root { font-family: var(--display); font-size: calc(var(--fs) * 1.3px); font-weight: 700; letter-spacing: .01em; padding: calc(var(--pad) * 1.5px) calc(var(--pad) * 2.4px); min-width: 120px; }
.node.root::after { content: ''; position: absolute; inset: calc(var(--sw) * -1px - 7px); border-radius: inherit; border: 2px solid var(--c); opacity: 0; animation: pulse 2.8s ease-out infinite; pointer-events: none; }
@keyframes pulse { 0% { opacity: .65; transform: scale(.97); } 100% { opacity: 0; transform: scale(1.14); } }
.n-body { display: flex; align-items: center; justify-content: center; gap: .45em; }
.n-emoji { font-size: 1.15em; line-height: 1; }
.n-text { outline: none; min-width: 1ch; }
.node.editing { cursor: text; scale: 1.04; }
.node.editing .n-text { user-select: text; -webkit-user-select: text; cursor: text; caret-color: currentColor; }

/* dizaynlar */
.node[data-design=glass] { background: var(--card-bg); -webkit-backdrop-filter: blur(8px) saturate(150%); backdrop-filter: blur(8px) saturate(150%); box-shadow: 0 10px 30px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.22); }
.node[data-design=solid] { background: color-mix(in srgb, var(--c) 86%, #000); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); border-color: color-mix(in srgb, var(--c) 50%, #fff); box-shadow: 0 10px 26px color-mix(in srgb, var(--c) 30%, rgba(0,0,0,.3)); }
.node[data-design=neon] { background: rgba(5,6,18,.8); color: #fff; text-shadow: 0 0 10px var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 70%, transparent), inset 0 0 14px color-mix(in srgb, var(--c) 40%, transparent); }
.node[data-design=gradient] { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 82%, #fff), color-mix(in srgb, var(--c) 62%, #000)); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); border-color: color-mix(in srgb, var(--c) 45%, #fff); box-shadow: 0 12px 26px color-mix(in srgb, var(--c) 35%, transparent); }
.node[data-design=paper] { background: #fffdf7; color: #1e2230; box-shadow: 0 5px 0 -1px color-mix(in srgb, var(--c) 70%, #000), 0 16px 28px rgba(0,0,0,.28); }
.node[data-design=leaf] { border-radius: calc(var(--r) * 2px + 12px) 6px; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 40%, rgba(8,28,14,.7)), rgba(8,24,14,.8)); color: #f2fff0; box-shadow: 0 10px 26px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.2); }
.node[data-design=bubble] { border-radius: 999px; background: radial-gradient(circle at 28% 22%, rgba(255,255,255,.6), rgba(255,255,255,.1) 32%, color-mix(in srgb, var(--c) 32%, transparent) 100%); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: inset 0 0 18px rgba(255,255,255,.22), 0 10px 26px rgba(0,0,0,.25); }
.node[data-design=cosmic] { background: radial-gradient(1px 1px at 18% 30%, #fff, transparent), radial-gradient(1px 1px at 72% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 85% 22%, #fff, transparent), radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--c) 48%, transparent), rgba(8,6,28,.92) 70%); color: #fff; box-shadow: 0 0 24px color-mix(in srgb, var(--c) 42%, transparent), inset 0 0 0 1px rgba(255,255,255,.08); }

/* stroke chiziq uslublari (dizayndan keyin — ustun) */
.node[data-stroke=dashed] { border-style: dashed; }
.node[data-stroke=dotted] { border-style: dotted; }
.node[data-stroke=double] { border-style: double; border-width: max(4px, calc(var(--sw) * 1px)); }
.node[data-stroke=glow] { box-shadow: 0 0 calc(var(--sw) * 3px + 6px) var(--c), 0 0 calc(var(--sw) * 8px + 16px) color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 12px color-mix(in srgb, var(--c) 30%, transparent); }
.node[data-stroke=animated] { border-color: transparent; }
.node[data-stroke=animated]::before {
  content: ''; position: absolute; inset: calc(var(--sw) * -1px); border-radius: inherit; padding: calc(var(--sw) * 1px);
  background: conic-gradient(from var(--ang), var(--c), #fff, var(--c) 35%, transparent 55%, var(--c));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 3s linear infinite; pointer-events: none;
}
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
#world.no-glow .node { box-shadow: none; text-shadow: none; }

/* karta tugmalari */
.n-tools {
  position: absolute; left: 50%; bottom: 100%; margin-bottom: 10px;
  display: flex; gap: 2px; padding: 4px;
  background: rgba(10, 13, 24, .94); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
  transform: translateX(-50%) scale(calc(var(--iz) * .88)); transform-origin: 50% 100%;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  white-space: nowrap; text-shadow: none; font: 600 12px var(--font); color: #dfe6ff; cursor: default;
}
.node.sel:not(.editing):not(.dragging) .n-tools { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(var(--iz)); }
.n-tools button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #dfe6ff; transition: background .15s, color .15s; }
.n-tools button:hover { background: rgba(255,255,255,.1); color: #fff; }
.n-tools button[data-act=palette] { color: var(--c); }
.n-tools button[data-act=plus] { color: #8ff0a4; }
.n-tools button[data-act=trash]:hover { background: rgba(255,80,100,.2); color: #ff8a9a; }

/* ---------- umumiy UI elementlari ---------- */
.ib { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; color: #dce3f7; position: relative; transition: background .15s, color .15s, transform .15s; flex: none; }
.ib:hover { background: var(--ui-3); color: #fff; }
.ib:active { transform: scale(.94); }
.ib.on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.ib.accent { color: var(--accent); }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 9px; border-radius: 8px; background: #0b0f1c; border: 1px solid var(--line); color: #fff; font-size: 12px; font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,.4); pointer-events: none; z-index: 30;
}
.dock [data-tip]:hover::after { bottom: calc(100% + 10px); }
.topbar [data-tip]:hover::after { top: calc(100% + 8px); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; border-radius: 11px; background: var(--ui-2); border: 1px solid var(--line); font-size: 13px; font-weight: 700; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { background: var(--ui-3); border-color: rgba(255,255,255,.2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--gold); color: #2a1800; border: 0; box-shadow: 0 10px 30px rgba(255,170,60,.3); }
.btn.danger { color: #ff9aa8; }
.btn.danger:hover { background: rgba(255,80,100,.16); border-color: rgba(255,80,100,.4); }
.btn.wide { width: 100%; margin-top: 12px; }

/* ---------- yuqori panel ---------- */
.topbar { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 10; display: flex; align-items: center; gap: 12px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 14px 6px 6px; border-radius: 16px; background: var(--ui); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.brand .logo { width: 40px; height: 40px; display: block; filter: drop-shadow(0 4px 12px rgba(94,230,214,.35)); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .01em; background: linear-gradient(90deg, #b6ffb0, #5ee6d6 45%, #ffc65c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-txt small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.theme-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 16px; background: var(--ui); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); transition: border-color .2s, transform .2s; }
.theme-chip:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); transform: translateY(-1px); }
.theme-chip canvas { width: 56px; height: 36px; border-radius: 10px; display: block; background: #000; }
.tc-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.tc-txt small { color: var(--muted); font-size: 11px; font-weight: 600; }
.tc-txt b { font-size: 13.5px; }
.crown { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; padding: 3px 7px; border-radius: 6px; background: var(--gold); color: #3a2200; }
.top-actions { margin-left: auto; display: flex; gap: 2px; padding: 4px; border-radius: 16px; background: var(--ui); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); }

/* ---------- pastki boshqaruv ---------- */
.dock { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 10; display: flex; align-items: center; gap: 3px; padding: 6px; border-radius: 20px; background: var(--ui); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow); max-width: calc(100vw - 24px); }
.menu-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 13px; border-radius: 14px; font-weight: 800; font-size: 14px; color: #241500; background: var(--gold); box-shadow: 0 8px 22px rgba(255,170,60,.35), inset 0 1px 0 rgba(255,255,255,.6); transition: transform .15s, box-shadow .2s; flex: none; }
.menu-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(255,170,60,.45), inset 0 1px 0 rgba(255,255,255,.6); }
.sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; flex: none; }
.seg { display: flex; gap: 2px; padding: 2px; border-radius: 13px; background: rgba(255,255,255,.04); }
.zoom { min-width: 48px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- parametrlar paneli ---------- */
.panel { position: fixed; top: 80px; right: 16px; bottom: 90px; width: 340px; z-index: 12; display: flex; flex-direction: column; border-radius: 20px; background: rgba(11, 14, 26, .9); border: 1px solid var(--line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow); transform: translateX(calc(100% + 30px)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.panel.open { transform: none; }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.p-head h3 { margin: 0; font-family: var(--display); font-size: 16px; font-weight: 700; }
.p-head small { color: var(--muted); font-size: 12px; }
.p-body { overflow-y: auto; padding: 6px 18px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.p-sec { padding: 14px 0 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.p-sec:last-child { border-bottom: 0; }
.p-sec h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); font-weight: 800; }
.muted { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.5; }
.lbl { font-size: 12px; font-weight: 700; color: #c4cce2; margin: 14px 0 8px; }
#nText { width: 100%; resize: vertical; min-height: 54px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); outline: none; font-size: 14px; font-weight: 600; }
#nText:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.sw { width: 26px; height: 26px; border-radius: 50%; background: var(--sc); border: 2px solid rgba(255,255,255,.18); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); transition: transform .12s; }
.sw:hover { transform: scale(1.12); }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--sc), inset 0 0 0 2px rgba(0,0,0,.25); }
.sw-custom { position: relative; width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(#ff5f6d, #ffd23f, #7ee081, #4fc3ff, #a66bff, #ff5f6d); border: 2px solid rgba(255,255,255,.25); overflow: hidden; cursor: pointer; }
.sw-custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: #c4cce2; }
.cbox { display: flex; align-items: center; gap: 6px; }
input[type=color] { -webkit-appearance: none; appearance: none; width: 38px; height: 30px; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: rgba(255,255,255,.05); cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.mini { font-size: 11px; font-weight: 700; padding: 6px 9px; border-radius: 8px; background: var(--ui-2); border: 1px solid var(--line); color: var(--muted); }
.mini:hover { color: #fff; background: var(--ui-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 10px; border-radius: 9px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: #c9d1e6; transition: all .15s; }
.chip:hover { background: var(--ui-3); color: #fff; }
.chip.on { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 70%, transparent); color: #fff; }
.emojis { display: flex; flex-wrap: wrap; gap: 4px; }
.emojis button { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; background: rgba(255,255,255,.04); border: 1px solid transparent; display: grid; place-items: center; }
.emojis button:hover { background: var(--ui-3); }
.emojis button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.emojis button:first-child { font-size: 11px; color: var(--muted); font-weight: 700; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 16px; }
.btns .btn { padding: 8px 10px; font-size: 12.5px; }
.btns .btn:last-child { grid-column: span 2; }
.rng { display: block; margin-top: 14px; }
.rng span { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: #c4cce2; margin-bottom: 8px; }
.rng em { font-style: normal; color: var(--accent); font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #0b0e1a; box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(0,0,0,.5); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid #0b0e1a; cursor: pointer; }
.tgl { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; font-weight: 600; color: #d3d9ea; cursor: pointer; }
.tgl input { position: absolute; opacity: 0; pointer-events: none; }
.tgl i { width: 36px; height: 21px; border-radius: 20px; background: rgba(255,255,255,.12); position: relative; flex: none; transition: background .2s; }
.tgl i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .2s; }
.tgl input:checked + i { background: var(--accent); }
.tgl input:checked + i::after { transform: translateX(15px); }
.tgl input:focus-visible + i { outline: 2px solid #fff; outline-offset: 2px; }
.row-inline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- rang popover ---------- */
.pop { position: fixed; z-index: 40; width: 228px; padding: 12px; border-radius: 16px; background: rgba(11,14,26,.96); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: popIn .16s ease; }
.pop .lbl { margin: 0 0 8px; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.97); } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 16px); z-index: 60; padding: 10px 16px; border-radius: 12px; background: rgba(11,14,26,.94); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- kartalar menyusi ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(3, 5, 12, .72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.g-wrap { width: min(1240px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; border-radius: 24px; background: rgba(9, 12, 22, .94); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: rise .3s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(14px) scale(.985); opacity: 0; } }
.g-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; flex-wrap: wrap; }
.g-title { display: flex; align-items: center; gap: 14px; }
.g-title img { width: 48px; height: 48px; }
.g-title h2 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 700; }
.g-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.g-tools { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; min-width: 240px; }
#gSearch { flex: 1; max-width: 320px; height: 40px; padding: 0 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); outline: none; font-size: 13.5px; }
#gSearch:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.g-tabs { display: flex; gap: 6px; padding: 0 22px 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tab { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 11px; font-size: 13px; font-weight: 700; color: #c4cce2; background: rgba(255,255,255,.04); border: 1px solid transparent; transition: all .15s; }
.tab i { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 8px; background: rgba(255,255,255,.08); color: var(--muted); }
.tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab.on { color: #fff; background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.tab.on i { background: var(--accent); color: #221400; }
.g-grid { flex: 1; overflow-y: auto; padding: 18px 22px 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-auto-rows: max-content; gap: 16px; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.g-card { position: relative; border-radius: 18px; background: #0c1020; border: 1px solid rgba(255,255,255,.08); overflow: hidden; cursor: pointer; transition: transform .25s, box-shadow .25s; isolation: isolate; }
.g-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.6px; background: conic-gradient(from var(--ang), #ffe9a8, #ffb347, #ff7eb6, #7ad7ff, #8ff0a4, #ffe9a8); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; animation: spin 4s linear infinite; z-index: 3; pointer-events: none; }
.g-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,.5); }
.g-card:hover::before, .g-card.active::before { opacity: 1; }
.g-media { position: relative; }
.g-card canvas { display: block; width: 100%; aspect-ratio: 5 / 3; background: #05070d; }
.g-badge { position: absolute; top: 10px; left: 10px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; padding: 4px 8px; border-radius: 7px; background: var(--gold); color: #3a2200; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.g-on { position: absolute; top: 10px; right: 10px; font-size: 10.5px; font-weight: 800; padding: 4px 8px; border-radius: 7px; background: rgba(10,14,26,.85); color: #8ff0a4; border: 1px solid rgba(143,240,164,.4); display: none; }
.g-card.active .g-on { display: block; }
.g-act { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 8px; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.g-card:hover .g-act, .g-card:focus-within .g-act { opacity: 1; transform: none; }
.g-act button { flex: 1; padding: 8px 8px; border-radius: 10px; font-size: 12px; font-weight: 800; background: rgba(8,10,20,.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.2); }
.g-act button:hover { background: rgba(20,24,40,.95); }
.g-act button.pri { background: var(--gold); color: #2a1800; border: 0; }
.g-info { padding: 11px 14px 14px; }
.g-info b { display: block; font-family: var(--display); font-size: 14px; font-weight: 700; }
.g-info small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.45; }
.g-cat { display: inline-block; margin-top: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.g-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }
@media (hover: none) { .g-act { opacity: 1; transform: none; } }

/* ---------- xush kelibsiz ---------- */
.welcome { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 40%, rgba(10,20,30,.55), rgba(2,4,10,.85)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .4s ease; }
.w-card { width: min(560px, 100%); text-align: center; padding: 34px 30px 30px; border-radius: 28px; background: rgba(10,14,26,.82); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: rise .5s cubic-bezier(.2,.8,.2,1); }
.w-logo { width: 104px; height: 104px; filter: drop-shadow(0 12px 30px rgba(94,230,214,.35)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.w-card h1 { margin: 14px 0 8px; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 6vw, 38px); letter-spacing: -.01em; background: linear-gradient(90deg, #b6ffb0, #5ee6d6 40%, #ffc65c 75%, #ff7eb6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.w-card p { margin: 0 auto; max-width: 460px; color: #c4cce2; line-height: 1.6; font-size: 14.5px; }
.w-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 18px 0 22px; }
.w-pills span { font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 20px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.w-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.w-btns .btn { padding: 12px 22px; font-size: 14px; }

/* ---------- yordam ---------- */
.h-card { width: min(520px, 100%); max-height: 100%; overflow: auto; border-radius: 22px; background: rgba(10,14,26,.96); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .3s ease; }
.keys { list-style: none; margin: 0; padding: 10px 18px 20px; }
.keys li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13.5px; color: #d3d9ea; }
.keys li span { color: var(--muted); font-size: 12.5px; font-weight: 700; }

/* ---------- moslashuvchan (mobil) ---------- */
@media (max-width: 900px) {
  .theme-chip .crown { display: none; }
}
@media (max-width: 700px) {
  .topbar { top: 10px; left: 10px; right: 10px; gap: 8px; }
  .brand-txt small, .tc-txt small { display: none; }
  .brand { padding: 5px; }
  .brand-txt { display: none; }
  .top-actions .ib { width: 34px; height: 34px; }
  .top-actions [data-cmd=new], .top-actions [data-cmd=full] { display: none; }
  .hide-sm { display: none !important; }
  .dock { bottom: 10px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .dock .ib { width: 38px; height: 38px; }
  .menu-btn span { display: none; }
  .menu-btn { padding: 0 11px; }
  .panel { top: auto; left: 10px; right: 10px; bottom: 74px; width: auto; height: 62vh; transform: translateY(calc(100% + 90px)); }
  .modal { padding: 10px; }
  .g-wrap { height: 100%; border-radius: 18px; }
  .g-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 14px; }
  .g-info small { display: none; }
  .keys li { grid-template-columns: 110px 1fr; }
  [data-tip]:hover::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .node.root::after, #links path.flow, .g-card::before, .node[data-stroke=animated]::before, .w-logo { animation: none; }
}
