/* NAWAT Qaysar 3D — Glossy Piano-Black & Imperial Gold 3D Workspace */

:root {
  color-scheme: dark;
  --in-oklab: ;
  --in-oklch: ;
  --bg: #000000;
  --bg-radial-top: #1c1c22;
  --bg-radial-mid: #060608;
  --panel: rgba(9, 9, 12, 0.88);
  --panel2: rgba(18, 18, 22, 0.94);
  --panel-elev: rgba(28, 28, 34, 0.96);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --gold-line: rgba(223, 169, 48, 0.56);
  --gold-glow: rgba(223, 169, 48, 0.28);
  --text: #f3f4f8;
  --text-strong: #ffffff;
  --mut: #a3a8b8;
  --acc: #dfa930;
  --acc-bright: #ffe699;
  --acc-deep: #9e6e0a;
  --acc2: #38bdf8;
  --acc2-soft: #bae6fd;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --scrollbar-thumb: rgba(223, 169, 48, 0.58);
  --scrollbar-track: rgba(6, 6, 8, 0.9);
  --font: "Cairo", "Segoe UI", "Tahoma", "Noto Sans Arabic", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --left-w: 226px;
  --right-w: 44vw;
  --right-top-h: 54%;
  accent-color: var(--acc);
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
    --in-oklch: in oklch;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(
      135deg var(--in-oklab),
      rgba(255, 255, 255, 0.068) 0%,
      rgba(255, 255, 255, 0.015) 24%,
      transparent 46%,
      rgba(255, 255, 255, 0.032) 78%,
      transparent 100%
    ),
    radial-gradient(ellipse 85% 58% at 50% -10%, var(--bg-radial-top) 0%, var(--bg-radial-mid) 46%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.65;
  text-align: start;
  -webkit-font-smoothing: antialiased;
  perspective: 1500px;
}

::selection {
  background: rgba(223, 169, 48, 0.35);
  color: #ffffff;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--acc-bright);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* Custom accessible scrollbars on scrollable surfaces */
.project-list,
.chat-messages,
.table-wrapper,
.work-split-bottom,
.cloud-models-grid,
.dlg-body,
.tree-scroll {
  scrollbar-width: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

@supports not (scrollbar-color: auto) {
  .project-list::-webkit-scrollbar,
  .chat-messages::-webkit-scrollbar,
  .table-wrapper::-webkit-scrollbar,
  .work-split-bottom::-webkit-scrollbar,
  .cloud-models-grid::-webkit-scrollbar,
  .dlg-body::-webkit-scrollbar,
  .tree-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  .project-list::-webkit-scrollbar-thumb,
  .chat-messages::-webkit-scrollbar-thumb,
  .table-wrapper::-webkit-scrollbar-thumb,
  .work-split-bottom::-webkit-scrollbar-thumb,
  .cloud-models-grid::-webkit-scrollbar-thumb,
  .dlg-body::-webkit-scrollbar-thumb,
  .tree-scroll::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 99px;
  }
  .project-list::-webkit-scrollbar-track,
  .chat-messages::-webkit-scrollbar-track,
  .table-wrapper::-webkit-scrollbar-track,
  .work-split-bottom::-webkit-scrollbar-track,
  .cloud-models-grid::-webkit-scrollbar-track,
  .dlg-body::-webkit-scrollbar-track,
  .tree-scroll::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}

/* ===== GLOSSY PIANO-BLACK 3D STAGE BACKGROUND ===== */
.stage-3d-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  perspective: 1200px;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 230, 153, 0.08), transparent 40%),
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.07), transparent 44%);
}

.stage-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(75px);
  opacity: 0.42;
  mix-blend-mode: screen;
}

.stage-orb-gold {
  width: 34vw;
  height: 34vw;
  max-width: 500px;
  max-height: 500px;
  top: -12%;
  inset-inline-start: 14%;
  background: radial-gradient(circle, rgba(255, 230, 153, 0.24), rgba(223, 169, 48, 0.05) 65%, transparent);
  animation: orbDriftA 18s ease-in-out infinite alternate;
}

.stage-orb-cyan {
  width: 34vw;
  height: 34vw;
  max-width: 480px;
  max-height: 480px;
  bottom: 4%;
  inset-inline-end: 8%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), rgba(180, 188, 205, 0.04) 68%, transparent);
  animation: orbDriftB 21s ease-in-out infinite alternate;
}

.stage-horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34%;
  height: 2px;
  background: linear-gradient(
    90deg var(--in-oklab),
    transparent 6%,
    rgba(255, 255, 255, 0.28) 28%,
    rgba(255, 230, 153, 0.6) 50%,
    rgba(255, 255, 255, 0.28) 72%,
    transparent 94%
  );
  box-shadow: 0 0 34px 3px rgba(255, 255, 255, 0.14);
  opacity: 0.62;
}

.floor-3d {
  position: absolute;
  bottom: -26%;
  left: -18%;
  right: -18%;
  height: 76%;
  background-image:
    linear-gradient(rgba(223, 169, 48, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 52px 52px;
  transform: rotateX(69deg) translateZ(-85px);
  mask-image: radial-gradient(ellipse at 50% 34%, black 22%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 34%, black 22%, transparent 74%);
  animation: floorFloat 14s ease-in-out infinite alternate;
}

@keyframes floorFloat {
  0% {
    opacity: 0.45;
    transform: rotateX(69deg) translateZ(-85px) translateY(0);
  }
  100% {
    opacity: 0.8;
    transform: rotateX(69deg) translateZ(-70px) translateY(16px);
  }
}

@keyframes orbDriftA {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(32px, 24px, 0) scale(1.08); }
}

@keyframes orbDriftB {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-28px, -22px, 0) scale(1.06); }
}

.bg-3d-typography {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotateX(9deg) rotateY(-1.5deg) translateZ(-55px);
  user-select: none;
}

.bg-3d-word-ar {
  font-size: clamp(3.8rem, 8.8vw, 8.2rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: rgba(255, 230, 153, 0.05);
  text-shadow:
    0 3px 0 rgba(223, 169, 48, 0.14),
    0 14px 32px rgba(0, 0, 0, 0.95),
    0 0 70px rgba(223, 169, 48, 0.12);
  line-height: 1.05;
}

.bg-3d-word-en {
  font-size: clamp(1rem, 2.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: 0.55em;
  color: rgba(255, 255, 255, 0.065);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.14),
    0 8px 22px rgba(0, 0, 0, 0.95);
  margin-top: 8px;
}

/* ===== 3-COLUMN MOUSE-RESIZABLE SHELL ===== */
#appShell {
  position: relative;
  z-index: 10;
  display: grid;
  direction: ltr;
  grid-template-columns: var(--left-w) 12px minmax(300px, 1fr) 12px var(--right-w);
  height: 100vh;
  padding: 10px;
  transform-style: preserve-3d;
}

#appShell.tables-hidden {
  grid-template-columns: var(--left-w) 12px minmax(300px, 1fr);
}

#appShell.tables-hidden #resizerRight,
#appShell.tables-hidden #pagesSidebar {
  display: none;
}

.pane {
  direction: rtl;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: calc(100vh - 20px);
  overflow: hidden;
  background: linear-gradient(
    168deg var(--in-oklab),
    rgba(30, 30, 36, 0.72) 0%,
    rgba(10, 10, 13, 0.9) 38%,
    rgba(2, 2, 4, 0.97) 100%
  );
  backdrop-filter: blur(22px) saturate(110%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.85),
    0 4px 16px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(223, 169, 48, 0.14);
}

#projectsSidebar {
  padding: 13px 11px;
  gap: 10px;
  border-color: rgba(223, 169, 48, 0.36);
  transform: rotateY(1deg) translateZ(6px);
}

#mainChat {
  background: linear-gradient(
    180deg var(--in-oklab),
    rgba(18, 18, 22, 0.86) 0%,
    rgba(6, 6, 8, 0.94) 55%,
    rgba(1, 1, 2, 0.98) 100%
  );
  border-color: rgba(223, 169, 48, 0.48);
  transform: translateZ(14px);
}

#pagesSidebar {
  border-color: rgba(223, 169, 48, 0.52);
  transform: rotateY(-0.9deg) translateZ(12px);
}

/* Mouse Splitters */
.v-resizer {
  position: relative;
  z-index: 30;
  transform: translateZ(26px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}

.v-resizer .grip {
  width: 5px;
  height: 82px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), var(--acc-bright), rgba(255, 255, 255, 0.28));
  opacity: 0.75;
  transition: opacity 0.16s, transform 0.16s, box-shadow 0.16s;
}

.v-resizer:hover .grip,
.v-resizer.dragging .grip,
.v-resizer:focus-visible .grip {
  opacity: 1;
  transform: scaleX(1.4);
  box-shadow: 0 0 16px rgba(223, 169, 48, 0.85);
}

.h-resizer {
  position: relative;
  z-index: 30;
  height: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: row-resize;
  user-select: none;
  touch-action: none;
}

.h-resizer .hgrip {
  width: 118px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--acc-bright), transparent);
  opacity: 0.78;
  transition: opacity 0.16s, width 0.16s, box-shadow 0.16s;
}

.h-resizer:hover .hgrip,
.h-resizer.dragging .hgrip {
  opacity: 1;
  width: 170px;
  box-shadow: 0 0 14px rgba(223, 169, 48, 0.8);
}

/* ===== LEFT SIDEBAR: BRAND, PROJECTS & SIMPLE SETTINGS ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  filter: drop-shadow(0 4px 12px rgba(223, 169, 48, 0.36));
}

.brand .b1 {
  font-weight: 900;
  font-size: 0.96rem;
  color: var(--text-strong);
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.brand .b2 {
  color: var(--acc-bright);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  font-weight: 800;
}

/* ===== TACTILE 3D BUTTONS & GLOSSY BLACK PILLS ===== */
.btn-gold-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: 2.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: 11px;
  border: 1px solid #fae39c;
  background: linear-gradient(180deg var(--in-oklab), #f7d774 0%, #d49b24 58%, #9e6c08 100%);
  color: #0c101a;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  box-shadow:
    0 2px 0 #6b4904,
    0 8px 20px rgba(223, 169, 48, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: transform 0.14s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn-gold-3d:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow:
    0 3px 0 #6b4904,
    0 12px 26px rgba(223, 169, 48, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.btn-gold-3d:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 #6b4904,
    0 4px 10px rgba(223, 169, 48, 0.25),
    inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-block-size: 2rem;
  padding: 0.35rem 0.72rem;
  border-radius: 10px;
  background: linear-gradient(180deg var(--in-oklab), rgba(40, 40, 48, 0.92) 0%, rgba(16, 16, 20, 0.96) 52%, rgba(8, 8, 10, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.13s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-soft:hover {
  transform: translateY(-1px);
  border-color: var(--gold-line);
  background: linear-gradient(180deg var(--in-oklab), rgba(52, 52, 62, 0.96) 0%, rgba(22, 22, 28, 0.98) 100%);
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.9),
    0 6px 16px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-soft:active {
  transform: translateY(1px);
}

.btn-soft.active {
  border-color: var(--acc-bright);
  background: linear-gradient(180deg var(--in-oklab), rgba(223, 169, 48, 0.28), rgba(40, 28, 8, 0.92));
  color: var(--acc-bright);
  box-shadow: 0 0 14px rgba(223, 169, 48, 0.25), inset 0 1px 0 rgba(255, 230, 153, 0.25);
}

.btn-pill-gold {
  border-color: var(--gold-line);
  color: var(--acc-bright);
  background: linear-gradient(180deg var(--in-oklab), rgba(44, 37, 20, 0.92), rgba(14, 12, 8, 0.98));
}

.btn-pill-gold:hover {
  border-color: var(--acc-bright);
  box-shadow: 0 4px 16px rgba(223, 169, 48, 0.3);
}

.btn-pill-cloud {
  border-color: rgba(125, 211, 252, 0.52);
  color: #bae6fd;
  background: linear-gradient(180deg var(--in-oklab), rgba(30, 34, 42, 0.95), rgba(8, 10, 14, 0.98));
}

.btn-pill-cloud:hover {
  border-color: #7dd3fc;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.24);
}

.ctrl-input {
  width: 100%;
  min-block-size: 2.35rem;
  background: rgba(4, 4, 6, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.45rem 0.72rem;
  color: var(--text-strong);
  font-size: 0.8rem;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.75);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ctrl-input::placeholder {
  color: rgba(170, 176, 192, 0.72);
}

.ctrl-input:focus {
  border-color: var(--acc-bright);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.75), 0 0 0 2px rgba(223, 169, 48, 0.22);
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mut);
  display: flex;
  justify-content: space-between;
  padding: 0 3px;
  font-variant-numeric: tabular-nums;
}

.project-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-inline-end: 2px;
}

.proj-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-block-size: 2.3rem;
  padding: 0.45rem 0.62rem;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(22, 22, 27, 0.8), rgba(10, 10, 13, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--mut);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: start;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.proj-item:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(180deg, rgba(32, 32, 40, 0.9), rgba(14, 14, 18, 0.96));
  color: var(--text-strong);
}

.proj-item.active {
  background: linear-gradient(90deg var(--in-oklab), rgba(223, 169, 48, 0.22), rgba(22, 22, 27, 0.96));
  color: var(--acc-bright);
  border-color: var(--gold-line);
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 230, 153, 0.22);
}

.proj-name-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.proj-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.proj-del {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--mut);
  font-size: 0.72rem;
  padding: 2px 4px;
}

.proj-item:hover .proj-del,
.proj-item:focus-within .proj-del {
  opacity: 0.9;
}

.proj-del:hover {
  color: var(--bad);
}

.proj-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}

.proj-dot.unstable {
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
}

/* Simple 3-Pillar Settings Card */
.simple-settings-box {
  background: linear-gradient(180deg var(--in-oklab), rgba(20, 20, 25, 0.94), rgba(6, 6, 8, 0.98));
  border: 1px solid var(--gold-line);
  border-radius: 13px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.ss-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--acc-bright);
  padding-bottom: 2px;
}

.ss-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 16, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.72rem;
}

.ss-val {
  color: var(--acc-bright);
  font-weight: 700;
  font-size: 0.7rem;
}

.side-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

#openScopeBtn {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.langs {
  display: flex;
  gap: 3px;
}

.lang-btn {
  border: 1px solid var(--line);
  background: rgba(14, 14, 18, 0.92);
  color: var(--mut);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.lang-btn.active {
  border-color: var(--acc-bright);
  background: rgba(223, 169, 48, 0.22);
  color: var(--acc-bright);
}

/* ===== CENTER: CONVERSATION TOPBAR, SPEED & VOICE ===== */
.chat-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg var(--in-oklab), rgba(26, 26, 32, 0.95), rgba(8, 8, 10, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 20px rgba(0, 0, 0, 0.45);
}

.chat-topbar .btn-soft {
  min-block-size: 1.82rem;
  padding: 0.22rem 0.56rem;
  font-size: 0.72rem;
}

.speed-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(4, 4, 6, 0.96);
  border: 1px solid var(--gold-line);
  border-radius: 11px;
  padding: 4px 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 16px rgba(223, 169, 48, 0.14);
}

.speed-steps {
  display: flex;
  align-items: center;
  gap: 3px;
}

.speed-btn {
  min-inline-size: 24px;
  min-block-size: 24px;
  padding: 0 5px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(32, 32, 38, 0.95), rgba(14, 14, 18, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--mut);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
}

.speed-btn.passed {
  background: rgba(223, 169, 48, 0.24);
  border-color: var(--acc);
  color: var(--acc-bright);
}

.speed-btn.active {
  background: linear-gradient(180deg, #fff0b8, #dfa930);
  border-color: #ffffff;
  color: #0c101a;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(223, 169, 48, 0.7);
}

.crew-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--acc-bright);
  padding-inline-start: 7px;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status-pill {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 99px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status-pill.offline {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* ===== CHAT FEED, WATERMARK & READABLE TYPOGRAPHY ===== */
.chat-feed-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.chat-watermark-ar {
  font-size: clamp(2.8rem, 5.2vw, 5.5rem);
  font-weight: 900;
  color: rgba(255, 230, 153, 0.05);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.05em;
}

.chat-watermark-en {
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.065);
  letter-spacing: 0.45em;
}

.chat-messages {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  width: 100%;
  max-width: 72ch;
  margin: 0 auto;
}

.msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--mut);
  padding: 2px 8px 4px;
}

.msg-body {
  padding: 13px 16px;
  border-radius: 15px;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: anywhere;
  text-wrap: pretty;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.msg.user .msg-body {
  background: linear-gradient(160deg var(--in-oklab), rgba(32, 34, 42, 0.94), rgba(12, 13, 17, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-inline-start: 4px solid var(--acc2);
}

.msg.assistant .msg-body {
  background: linear-gradient(160deg var(--in-oklab), rgba(22, 22, 26, 0.95), rgba(7, 7, 9, 0.98));
  border: 1px solid var(--gold-line);
  border-inline-start: 4px solid var(--acc);
}

/* Formatted Markdown Nodes Inside Messages */
.md-h3 {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--acc-bright);
  margin: 0.45rem 0 0.25rem;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(223, 169, 48, 0.24);
  text-wrap: balance;
}

.md-h3:first-child {
  margin-top: 0;
}

.md-p {
  margin: 0.32rem 0;
}

.md-p:first-child {
  margin-top: 0;
}

.md-p:last-child {
  margin-bottom: 0;
}

.md-hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin: 0.75rem 0;
}

.md-list {
  margin: 0.35rem 0;
  padding-inline-start: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.md-inline-code {
  font-family: var(--mono);
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fde68a;
  padding: 0.08rem 0.35rem;
  border-radius: 5px;
  direction: ltr;
  unicode-bidi: isolate;
}

.md-code {
  margin: 0.55rem 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #020203;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #f3f4f6;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
}

.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.att-card {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(12, 12, 15, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 0.75rem;
  color: var(--acc2-soft);
  cursor: pointer;
}

.att-card:hover {
  border-color: var(--acc-bright);
  color: var(--acc-bright);
}

.att-thumb {
  max-width: 180px;
  max-height: 110px;
  border-radius: 9px;
  border: 1px solid var(--gold-line);
  margin-top: 6px;
  display: block;
}

/* Pending Attachment & Active Cloud Bar */
.upload-tray {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 6, 8, 0.94);
}

.tray-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 20, 25, 0.96);
  border: 1px solid var(--gold-line);
  border-radius: 9px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 700;
}

.tray-remove {
  background: transparent;
  border: none;
  color: var(--mut);
  font-size: 0.72rem;
}

.tray-remove:hover {
  color: var(--bad);
}

.drop-active {
  outline: 2px dashed var(--acc-bright);
  outline-offset: -6px;
}

/* ===== COMPOSER BAR ===== */
.composer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg var(--in-oklab), rgba(20, 20, 25, 0.95), rgba(5, 5, 7, 0.99));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.c-icon-btn {
  min-block-size: 2.25rem;
  padding: 0 11px;
  border-radius: 10px;
  background: linear-gradient(180deg var(--in-oklab), rgba(38, 38, 46, 0.95), rgba(14, 14, 18, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.12s, border-color 0.15s;
}

.c-icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--gold-line);
}

.c-icon-btn.mic.recording {
  border-color: var(--bad);
  background: rgba(248, 113, 113, 0.22);
  color: #fecaca;
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.5);
}

.c-icon-btn.spk.active {
  border-color: rgba(52, 211, 153, 0.62);
  color: #a7f3d0;
  background: rgba(16, 48, 36, 0.88);
}

.chat-textarea {
  flex: 1 1 100%;
  width: 100%;
  min-block-size: 2.65rem;
  max-block-size: 7.5rem;
  field-sizing: content;
  resize: vertical;
  background: rgba(3, 3, 5, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 0.5rem 0.78rem;
  color: var(--text-strong);
  font-size: 0.85rem;
  line-height: 1.5;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.chat-textarea:focus {
  border-color: var(--acc-bright);
}

.composer-send-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  flex-shrink: 0;
}

.qaysar-select {
  min-block-size: 2.25rem;
  max-width: 185px;
  padding: 0 10px;
  border-radius: 10px;
  background: linear-gradient(180deg var(--in-oklab), rgba(44, 36, 18, 0.94), rgba(14, 12, 8, 0.98));
  border: 1.5px solid var(--acc);
  color: var(--acc-bright);
  font-weight: 800;
  font-size: 0.78rem;
  outline: none;
  box-shadow: 0 0 14px rgba(223, 169, 48, 0.22), inset 0 1px 0 rgba(255, 230, 153, 0.2);
}

.qaysar-select option,
.qaysar-select optgroup {
  background: #09090c;
  color: #f8fafc;
}

.btn-send {
  min-block-size: 2.25rem;
  padding: 0 16px;
  border-radius: 10px;
  white-space: nowrap;
}

.btn-stop {
  min-block-size: 2.25rem;
  padding: 0 15px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f87171, #dc2626);
  border: 1px solid #fecaca;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

/* ===== RIGHT PANEL: ACCESSIBLE TABS + MOUSE-RESIZABLE TABLE & PREVIEW ===== */
.tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(24, 24, 30, 0.92), rgba(8, 8, 10, 0.96));
}

[role="tablist"] {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  flex: 1;
  scrollbar-width: none;
}

[role="tablist"]::-webkit-scrollbar {
  display: none;
}

[role="tab"] {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 2.15rem;
  padding: 6px 12px;
  border-radius: 10px 10px 0 0;
  background: rgba(18, 18, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: none;
  color: var(--mut);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.14s, color 0.14s;
}

[role="tab"]:hover {
  color: var(--text-strong);
  background: rgba(30, 30, 36, 0.94);
}

[role="tab"][aria-selected="true"] {
  background: linear-gradient(180deg, rgba(34, 34, 42, 0.96), rgba(14, 14, 18, 0.98));
  color: var(--acc-bright);
  border-color: var(--gold-line);
}

[role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 3px solid var(--acc-bright);
}

.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.65rem;
  color: var(--mut);
}

.tab-close:hover {
  background: rgba(248, 113, 113, 0.35);
  color: #ffffff;
}

.tab-panels-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

[role="tabpanel"] {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

[role="tabpanel"][hidden] {
  display: none !important;
}

.tabpanel-inner {
  flex: 1;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

.work-split-top {
  height: var(--right-top-h);
  min-height: 145px;
  max-height: 82%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.92), rgba(5, 5, 7, 0.97));
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.work-split-bottom {
  flex: 1;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.92), rgba(5, 5, 7, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 12px;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(28, 28, 34, 0.92), rgba(14, 14, 18, 0.95));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#workTableCaption {
  text-wrap: balance;
}

.table-wrapper {
  flex: 1;
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.data-table th {
  position: relative;
  text-align: start;
  padding: 9px 10px;
  background: #141418;
  color: var(--acc-bright);
  border-bottom: 1px solid rgba(223, 169, 48, 0.44);
  font-weight: 800;
  white-space: nowrap;
  user-select: none;
  text-wrap: balance;
}

.col-resizer {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 6px;
  cursor: col-resize;
}

.col-resizer:hover {
  background: rgba(223, 169, 48, 0.6);
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.data-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

.data-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: rgba(12, 12, 16, 0.98);
  font-weight: 700;
  color: var(--acc-bright);
}

@container (width < 460px) {
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    margin-block-end: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
  }

  .data-table tbody th {
    position: sticky;
    inset-block-start: 0;
    background: #1a1a20;
    padding: 6px 10px;
  }

  .data-table td::before {
    font-weight: 700;
    color: var(--mut);
  }
  .data-table td:nth-of-type(1)::before { content: "الدور: "; }
  .data-table td:nth-of-type(2)::before { content: "المهمة: "; }
  .data-table td:nth-of-type(3)::before { content: "السرعة: "; }
  .data-table td:nth-of-type(4)::before { content: "الثبات: "; }
  .data-table td:nth-of-type(5)::before { content: "الحالة: "; }
}

/* Sub-panels inside Right Tabs */
.card-box {
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.94), rgba(6, 6, 8, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tree-scroll {
  max-height: 210px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.78rem;
  text-align: start;
  width: 100%;
}

.tree-row:hover {
  background: var(--panel2);
}

.code-viewer {
  flex: 1;
  min-height: 160px;
  width: 100%;
  background: #020203;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #f1f5f9;
  resize: vertical;
  direction: ltr;
}

.plugin-card {
  background: linear-gradient(180deg, rgba(22, 22, 28, 0.92), rgba(10, 10, 14, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-media {
  max-width: 100%;
  max-height: 240px;
  border-radius: 10px;
  border: 1px solid var(--gold-line);
}

/* ===== NATIVE TOP-LAYER MODAL DIALOGS WITH @starting-style ===== */
dialog {
  margin: auto;
  padding: 0;
  border: 1px solid var(--gold-line);
  border-radius: 18px;
  background: linear-gradient(170deg var(--in-oklab), #1a1a20 0%, #070709 55%, #000000 100%);
  color: var(--text);
  width: min(580px, 94vw);
  max-height: 88vh;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  dialog {
    transform: translateY(10px) scale(0.96);
  }
}

dialog[open] {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] {
    transform: translateY(0) scale(1);
  }
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(7px);
  transition-property: background-color, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog[open]::backdrop {
  background-color: rgba(0, 0, 0, 0.8);
}

@starting-style {
  dialog[open]::backdrop {
    background-color: rgba(0, 0, 0, 0);
  }
}

.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.dlg-head h1 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--acc-bright);
  text-wrap: balance;
}

.dlg-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dlg-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--mut);
}

.dlg-field strong {
  color: var(--text-strong);
}

.dlg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

/* ===== CLOUD MODELS & USAGE SYNC DIALOG ===== */
.cloud-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cloud-filter-btn.active {
  border-color: var(--acc-bright);
  background: rgba(223, 169, 48, 0.25);
  color: var(--acc-bright);
}

.cloud-models-grid {
  max-height: 245px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
  padding: 6px;
  background: rgba(3, 3, 5, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
}

.cloud-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: linear-gradient(180deg, rgba(24, 24, 29, 0.92), rgba(12, 12, 16, 0.96));
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.13s, background 0.13s;
}

.cloud-model-row:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.cloud-model-row.selected {
  border-color: var(--acc-bright);
  background: linear-gradient(180deg, rgba(56, 42, 14, 0.72), rgba(22, 18, 8, 0.94));
}

.cloud-badge-loaded {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(52, 211, 153, 0.16);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.45);
  white-space: nowrap;
}

.usage-sync-box {
  background: linear-gradient(180deg, rgba(18, 18, 22, 0.94), rgba(6, 6, 8, 0.98));
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== RESPONSIVE & ACCESSIBILITY MEDIA QUERIES ===== */
@media (max-width: 960px) {
  #appShell {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }
  .v-resizer {
    display: none;
  }
  .pane {
    height: auto;
    min-height: 460px;
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floor-3d,
  .stage-orb-gold,
  .stage-orb-cyan {
    animation: none;
  }
  dialog,
  dialog::backdrop {
    transition-duration: 0.08s;
  }
}

@media (forced-colors: active) {
  .pane,
  .msg-body,
  .btn-soft,
  .btn-gold-3d,
  .simple-settings-box,
  .work-split-top,
  .work-split-bottom,
  dialog {
    border: 1px solid CanvasText;
    box-shadow: none;
    background: Canvas;
    color: CanvasText;
  }
  .btn-gold-3d {
    background: ButtonFace;
    color: ButtonText;
    border: 2px solid ButtonText;
  }
  [role="tab"][aria-selected="true"] {
    outline: 2px solid Highlight;
  }
  .switch-fallback,
  .switch-fallback::after {
    border: 1px solid ButtonText;
    background: ButtonFace;
  }
}

/* ===== SETTINGS PAGE & FEATURE ACTIVATION SWITCHES ===== */
.stage-3d-disabled .stage-3d-bg {
  display: none;
}

.settings-page {
  position: relative;
  z-index: 20;
  height: 100vh;
  padding: 12px;
  direction: rtl;
  display: flex;
}

.sp-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: var(--gold-line);
}

.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg var(--in-oklab), rgba(26, 26, 32, 0.96), rgba(8, 8, 10, 0.98));
}

.sp-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.sp-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 6, 8, 0.92);
}

.sp-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-block-size: 2.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(22, 22, 27, 0.85), rgba(10, 10, 13, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--mut);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: start;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}

.sp-nav-btn:hover {
  border-color: rgba(255, 255, 255, 0.34);
  color: var(--text-strong);
}

.sp-nav-btn.active {
  background: linear-gradient(90deg var(--in-oklab), rgba(223, 169, 48, 0.25), rgba(26, 26, 32, 0.98));
  border-color: var(--gold-line);
  color: var(--acc-bright);
  box-shadow: inset 0 1px 0 rgba(255, 230, 153, 0.2);
}

.sp-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px;
  scrollbar-width: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.sp-panel[hidden] {
  display: none !important;
}

.sp-card {
  max-width: 820px;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.94), rgba(6, 6, 8, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 15px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.sp-card-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--acc-bright);
  text-wrap: balance;
}

.sp-card-desc {
  font-size: 0.8rem;
  color: var(--mut);
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(22, 22, 27, 0.9), rgba(10, 10, 13, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.switch-row:hover {
  border-color: var(--gold-line);
}

.switch-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-info strong {
  font-size: 0.86rem;
  color: var(--text-strong);
}

.switch-info span {
  font-size: 0.74rem;
  color: var(--mut);
}

.switch-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.switch-state-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 99px;
  min-inline-size: 3.6rem;
  text-align: center;
}

.switch-state-pill.on {
  background: rgba(52, 211, 153, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

.switch-state-pill.off {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--mut);
}

/* Native HTML <input type="checkbox" switch> + Chrome/Edge/Firefox Fallback */
input[type="checkbox"][switch] {
  accent-color: var(--acc);
  margin: 0;
  cursor: pointer;
}

input[type="checkbox"][switch]:focus-visible {
  outline: 3px solid var(--acc-bright);
  outline-offset: 4px;
}

input[type="checkbox"].switch-fallback {
  appearance: none;
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 99px;
  background: rgba(34, 34, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65);
  transition: background 0.18s ease, border-color 0.18s ease;
}

input[type="checkbox"].switch-fallback::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d1d5db;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
  transition: transform 0.18s ease, background 0.18s ease;
}

input[type="checkbox"].switch-fallback:checked {
  background: linear-gradient(180deg, rgba(223, 169, 48, 0.85), rgba(158, 110, 10, 0.95));
  border-color: var(--acc-bright);
}

input[type="checkbox"].switch-fallback:checked::after {
  transform: translateX(20px);
  background: #ffffff;
}

@media (max-width: 780px) {
  .sp-layout {
    grid-template-columns: 1fr;
  }
  .sp-nav {
    flex-direction: row;
    overflow-x: auto;
    border-inline-end: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ===== INTEGRATED SSH TERMINAL & QUICK CHIPS ===== */
.ssh-inline-box {
  background: rgba(5, 5, 8, 0.94);
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ssh-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ssh-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 7px;
  background: rgba(24, 24, 30, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--acc2-soft);
  direction: ltr;
}

.ssh-chip:hover {
  border-color: var(--acc-bright);
  color: var(--acc-bright);
}

.ssh-terminal {
  background: #020203;
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.35);
  line-height: 1.5;
}


