/* ============================================================
   SYMPHO — workspace chrome (rail, topbar, popovers, palette)
   ============================================================ */

.shell { display: grid; height: 100vh; }
.shell[data-rail="on"]  { grid-template-columns: var(--rail-w) 1fr; }
.shell[data-rail="off"] { grid-template-columns: 1fr; }

.shell-main { display: grid; grid-template-rows: var(--top-h) 1fr; min-width: 0; min-height: 0; }

.shell-body { display: grid; min-height: 0; min-width: 0; }
.shell-body[data-side="on"]  { grid-template-columns: var(--side-w) 1fr; }
.shell-body[data-side="off"] { grid-template-columns: 1fr; }

/* ---------------- app rail ---------------- */
.rail {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; gap: 4px;
}
.rail-logo {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 6px;
  display: grid; place-items: center; cursor: pointer; flex: none;
  background: linear-gradient(150deg, color-mix(in oklch, var(--sympho) 96%, white), color-mix(in oklch, var(--sympho) 70%, black));
  color: oklch(0.16 0.02 264);
  box-shadow: 0 4px 14px -4px var(--sympho);
  transition: transform 0.18s var(--ease);
}
.rail-logo:hover { transform: scale(1.06) rotate(-4deg); }
.rail-group { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.rail-sep { width: 26px; height: 1px; background: var(--line); margin: 7px 0; }

.rail-item {
  position: relative; width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-3); border-radius: 12px;
  transition: color 0.15s, background 0.15s;
}
.rail-item:hover { color: var(--text); background: var(--surface-2); }
.rail-item[data-on="true"] { color: var(--text); background: var(--surface-2); }
.rail-ind {
  position: absolute; left: -10px; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 22px; border-radius: 3px; background: var(--ind);
  transition: transform 0.2s var(--ease);
}
.rail-item[data-on="true"] .rail-ind { transform: translateY(-50%) scaleY(1); }
.rail-tip {
  position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%) translateX(-4px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
  padding: 6px 10px; border-radius: 8px; font-size: 12.5px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.14s, transform 0.14s;
  z-index: 60; box-shadow: var(--shadow); font-weight: 500;
}
.rail-item:hover .rail-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------------- top bar ---------------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 40;
}
.ws-btn {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 10px 0 7px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  color: var(--text); cursor: pointer; transition: background 0.14s, border-color 0.14s;
}
.ws-btn:hover { background: var(--surface-2); border-color: var(--line); }
.ws-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: oklch(0.16 0.02 264);
  background: linear-gradient(150deg, color-mix(in oklch, var(--sympho) 96%, white), color-mix(in oklch, var(--sympho) 72%, black));
}

.cmd-btn {
  display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px;
  width: 340px; max-width: 36vw;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px;
  color: var(--text-4); cursor: text; font-family: var(--ui); font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.cmd-btn:hover { border-color: var(--line-strong); }
.cmd-btn span { flex: 1; text-align: left; }
kbd {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 2px 6px; line-height: 1;
}

.ic-btn {
  position: relative; width: 38px; height: 38px; flex: none;
  display: grid; place-items: center; border-radius: 9px;
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  cursor: pointer; transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.ic-btn:hover, .ic-btn[data-on="true"] { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.ic-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--zamna); border: 2px solid var(--bg-2); }

/* ---------------- popover ---------------- */
.pop {
  position: absolute; z-index: 80;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 8px; box-shadow: var(--shadow-lg);
  animation: popIn 0.16s var(--ease) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
.pop-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 9px; cursor: pointer; color: var(--text-2);
  transition: background 0.12s, color 0.12s;
}
.pop-row:hover { background: var(--surface-2); color: var(--text); }
.pop-row[data-on="true"] { background: var(--accent-dim); }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* app launcher grid */
.grid-pop { right: 0; top: calc(100% + 8px); width: 312px; }
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.app-cell {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 6px; border-radius: 12px; cursor: pointer;
  background: transparent; border: none; color: var(--text);
  transition: background 0.14s;
}
.app-cell:hover:not(:disabled) { background: var(--surface-2); }
.app-cell:disabled { opacity: 0.45; cursor: default; }

/* ---------------- command palette ---------------- */
.cmd-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: oklch(0.1 0.01 264 / 0.55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 13vh;
  animation: popIn 0.15s var(--ease) both;
}
.cmd-panel {
  width: 600px; max-width: 92vw; max-height: 64vh;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column;
}
.cmd-input { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmd-input input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--ui); font-size: 15px; }
.cmd-input input::placeholder { color: var(--text-4); }
.cmd-list { padding: 4px 6px 8px; }
.cmd-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; background: transparent; border: none; cursor: pointer;
  color: var(--text); transition: background 0.1s;
}
.cmd-row:hover:not(:disabled) { background: var(--surface-2); }
.cmd-row:disabled { opacity: 0.4; cursor: default; }

/* ---------------- contextual sidebar ---------------- */
.side {
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.side-head { padding: 18px 16px 14px; display: flex; align-items: center; gap: 11px; }
.side-nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px;
  border-radius: 9px; cursor: pointer; color: var(--text-3); border: none; background: transparent;
  font-family: var(--ui); font-size: 13.5px; font-weight: 500; text-align: left; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.13s, color 0.13s;
}
.side-link > svg { flex: none; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link[data-on="true"] { background: var(--accent-dim); color: var(--text); }
.side-link[data-on="true"] svg { color: var(--accent); }
.side-link svg { color: var(--text-4); flex: none; }
.side-foot { padding: 12px; border-top: 1px solid var(--line); }

/* ---------------- content canvas ---------------- */
.canvas { overflow-y: auto; overflow-x: hidden; min-height: 0; }
.canvas-in { max-width: 1180px; margin: 0 auto; padding: 28px 32px 64px; }
.wide .canvas-in { max-width: 1400px; }

/* generic grid helpers */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* page header band */
.pagehead {
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px;
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
