:root {
  font-family: Tahoma, Arial, sans-serif;
  color: #f6f7f3;
  background: #070907;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-small {
  width: 18px;
  height: 18px;
}

.icon-medium {
  width: 25px;
  height: 25px;
}

.icon-large {
  width: 27px;
  height: 27px;
}

@layer base {
  html,
  body,
  .app-shell {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    margin: 0;
    min-width: 320px;
    background: #070907;
  }

  h1,
  h2,
  p {
    margin: 0;
  }

  button,
  a {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  button {
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
  }
}
.welcome-layer {
--accent: #b7ff5a;	
	
	
}
.app-shell {
  --accent: #b7ff5a;
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #050605;
}

.camera-stage {
  position: absolute;
  
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #1b201b 0, #0c0f0c 46%, #050605 100%);
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #050605;
}

.camera-stage video.mirror {
  transform: scaleX(-1);
}

.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(2, 4, 2, 0.58),
    transparent 19%,
    transparent 67%,
    rgba(2, 3, 2, 0.7)
  );
}

.top-bar {
  position: absolute;
  z-index: 4;
  top: max(18px, env(safe-area-inset-top));
  left: clamp(18px, 4vw, 42px);
  right: clamp(18px, 4vw, 42px);
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
}

.mini-brand {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  transform: rotate(45deg);
}

.live-status {
  direction: rtl;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.64);
  background: rgba(7, 9, 7, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 11px;
  backdrop-filter: blur(12px);
}

.live-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b9089;
}

.live-status b {
  font-weight: 400;
}

.live-status.online span {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.camera-message {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  background: #090c09;
}

.camera-message p {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.13);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-message h2 {
  margin-top: 20px;
  font-size: 21px;
  font-weight: 700;
}

.error-message p {
  max-width: 360px;
  line-height: 1.9;
}

.error-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--accent);
  background: rgba(183, 255, 90, 0.08);
  border: 1px solid rgba(183, 255, 90, 0.25);
  border-radius: 18px;
}

.error-message button {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 11px 18px;
  color: #0c1009;
  background: var(--accent);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}

.capture-flash {
  position: absolute;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: #fff;
  transition: opacity 0.16s ease;
}

.capture-flash.visible {
  opacity: 0.88;
}

.ar-placeholder {
  position: absolute;
  z-index: 2;
  top: 43%;
  left: 50%;
  width: clamp(82px, 16vw, 160px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 24px 20px rgba(0, 0, 0, 0.35));
}

.ar-placeholder span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--model-color);
  box-shadow:
    inset -18px -20px 34px rgba(0, 0, 0, 0.35),
    inset 12px 12px 24px rgba(255, 255, 255, 0.22);
  animation: float 4s ease-in-out infinite;
}

.ar-placeholder.manual {
  transform: translate(calc(-50% + var(--manual-x)), calc(-50% + var(--manual-y)))
    rotate(var(--manual-rotation)) scale(var(--manual-scale));
}

.ar-placeholder.manual span {
  animation: none;
}

.ar-orb span {
  border-radius: 50%;
}
.ar-cube span {
  border-radius: 15%;
  transform: rotate(45deg) scale(0.72);
}
.ar-ring span {
  border-radius: 50%;
  background: transparent;
  border: clamp(12px, 2vw, 23px) solid var(--model-color);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.25),
    0 0 22px color-mix(in srgb, var(--model-color) 40%, transparent);
}

.tool-dock {
 --accent: #b7ff5a;	
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(88px + env(safe-area-inset-bottom));
  transition: height 0.38s cubic-bezier(0.22, 0.8, 0.3, 1);
  pointer-events: none;
}

.tool-dock.expanded {
  height: min(340px, 45dvh);
}

.tool-dock.settings-open {
  height: min(620px, 78dvh);
}

.tool-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(88px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
  pointer-events: auto;
  background: rgba(12, 15, 12, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(22px) saturate(125%);
}

.tool-nav-scroll {
  height: 88px;
  display: flex;
  align-items: stretch;
  gap: 3px;
  padding: 9px max(14px, calc((100vw - 640px) / 2));
  overflow-x: auto;
  direction: rtl;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.tool-nav-scroll::-webkit-scrollbar {
  display: none;
}

.tool-nav button {
  position: relative;
  flex: 1 0 104px;
  max-width: 136px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.56);
  border-radius: 15px;
  font-size: 11px;
  white-space: nowrap;
  transition:
    color 0.2s,
    background 0.2s;
}

.tool-nav button.active {
  color: #10140d;
  background: var(--accent);
}

.nav-icon {
  height: 26px;
  display: grid;
  place-items: center;
}

.tool-panel {
  position: absolute;
  inset: 0 0 calc(88px + env(safe-area-inset-bottom));
  overflow: hidden;
  pointer-events: auto;
  background:linear-gradient( 180deg, rgba(2, 4, 2, 0.58), transparent 19%, transparent 67%, rgba(2, 3, 2, 0.7) );
  border-radius: 26px 26px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
 
  animation: panel-in 0.36s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.tool-panel::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 34px;
  height: 3px;
  border-radius: 3px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.18);
}

.panel-content {
  width: min(760px, 100%);
  height: 100%;
  margin: auto;
  padding: 26px clamp(18px, 4vw, 34px) 18px;
}

.settings-panel {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(183, 255, 90, 0.35) transparent;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 700;
}

.panel-kicker {
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.close-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

.model-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: none;
}

.model-list::-webkit-scrollbar {
  display: none;
}

.model-card {
  position: relative;
  flex: 0 0 108px;
  height: 103px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  font-size: 11px;
}

.model-card.selected {
  color: white;
  border-color: rgba(183, 255, 90, 0.6);
  background: rgba(183, 255, 90, 0.07);
}

.model-card i {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.model-preview {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  color: var(--accent);
  font-size: 32px;
  line-height: 1;
}

.color-list {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
  min-height: 92px;
  overflow-x: auto;
  padding: 0 5px;
  scrollbar-width: none;
}

.color-list button {
  position: relative;
  flex: 0 0 78px;
  height: 72px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.color-list button.selected {
  border-color: var(--swatch);
}

.color-list button span {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: var(--swatch);
  border-radius: 50%;
}

.color-name {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-list button.selected .color-name {
  color: #fff;
}

.color-list button i {
  position: absolute;
  top: 25px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #0d100c;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.capture-button,
.setting-row,
.website-link {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  color: #f7f8f5;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  text-align: right;
  font-family: inherit;
}

.capture-button > span:first-child,
.setting-icon {
  flex: 0 0 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #11150e;
  background: var(--accent);
  border-radius: 13px;
}

.capture-button div,
.setting-row > span:nth-child(2),
.website-link > span:nth-child(2) {
  flex: 1;
}
.capture-button b,
.setting-row b,
.website-link b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.capture-button small,
.setting-row small,
.website-link small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.43);
  font-size: 10px;
}
.capture-button > svg,
.setting-row > svg,
.website-link > svg {
  color: rgba(255, 255, 255, 0.32);
  transform: rotate(180deg);
}
.capture-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mode-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
}

.mode-selector-label {
  min-width: 0;
  color: var(--accent);
}

.mode-selector-label > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.mode-selector-label small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented-control {
  flex: 0 0 auto;
  display: flex;
  gap: 3px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 11px;
}

.segmented-control button {
  min-width: 67px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.segmented-control button.active {
  color: #11150e;
  background: var(--accent);
}

.manual-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin-bottom: 18px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  transition:
    opacity 0.25s ease,
    filter 0.25s ease;
}

.manual-controls.disabled {
  opacity: 0.35;
  filter: grayscale(1);
}

.range-control {
  display: block;
  padding: 4px 0 8px;
}

.range-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.range-meta b {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 500;
}

.range-meta output {
  min-width: 40px;
  color: var(--accent);
  font-size: 10px;
  text-align: left;
}

.range-control input {
  width: 100%;
  height: 18px;
  appearance: none;
  direction: ltr;
  background: transparent;
  cursor: pointer;
}

.range-control input::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(
    to right,
    var(--accent) 0,
    var(--accent) var(--range-fill),
    rgba(255, 255, 255, 0.12) var(--range-fill),
    rgba(255, 255, 255, 0.12) 100%
  );
  border-radius: 4px;
}

.range-control input::-moz-range-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.range-control input::-moz-range-progress {
  height: 3px;
  background: var(--accent);
  border-radius: 4px;
}

.range-control input::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  margin-top: -6px;
  appearance: none;
  background: #11150e;
  border: 3px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(183, 255, 90, 0.1);
}

.range-control input::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #11150e;
  border: 3px solid var(--accent);
  border-radius: 50%;
}

.range-control input:disabled {
  cursor: not-allowed;
}

.settings-panel .setting-row {
  margin-bottom: 4px;
}

.welcome-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) 22px max(25px, env(safe-area-inset-bottom));
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, #25311c 0, #11160e 25%, #080a08 62%);
  background-size:
    34px 34px,
    34px 34px,
    auto;
}

.welcome-layer.closing {
  opacity: 0;
  transform: scale(1.015);
  transition:
    opacity 0.26s ease,
    transform 0.26s ease;
}

.welcome-glow {
  position: absolute;
  top: -28vw;
  left: 50%;
  width: min(850px, 110vw);
  aspect-ratio: 1;
  border: 1px solid rgba(183, 255, 90, 0.1);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow:
    inset 0 0 100px rgba(183, 255, 90, 0.025),
    0 0 0 70px rgba(183, 255, 90, 0.018),
    0 0 0 140px rgba(183, 255, 90, 0.012);
}

.welcome-card {
  position: relative;
  width: min(440px, 100%);
  text-align: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-bottom: clamp(28px, 7vh, 62px);
  background: var(--accent);
  border-radius: 15px;
  transform: rotate(45deg);
  box-shadow: 0 12px 35px rgba(183, 255, 90, 0.16);
}

.brand-mark span {
  width: 4px;
  background: #10140d;
  border-radius: 5px;
  transform: rotate(-45deg);
}

.brand-mark span:nth-child(1) {
  height: 13px;
}
.brand-mark span:nth-child(2) {
  height: 23px;
}
.brand-mark span:nth-child(3) {
  height: 17px;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.welcome-card h1 {
  font-size: clamp(34px, 8vw, 52px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.welcome-card h1 em {
  color: rgba(255, 255, 255, 0.38);
  font-style: normal;
  font-weight: 500;
}

.welcome-copy {
  max-width: 380px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 300;
  line-height: 2;
}

.loading-block {
  margin-top: clamp(28px, 6vh, 52px);
}

.loading-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.loading-label b {
  direction: ltr;
  color: var(--accent);
  font-size: 12px;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 4px;
}

.progress-track span {
  display: block;
  height: 100%;
  margin-right: 0;
  background: var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(183, 255, 90, 0.5);
  transition: width 0.25s ease;
}

.loading-block small {
  display: block;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 9px;
}

.primary-button {
  width: 100%;
  height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  padding: 0 9px 0 20px;
  color: #10140d;
  background: var(--accent);
  border-radius: 15px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 14px 35px rgba(183, 255, 90, 0.11);
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

.primary-button:hover {
  filter: brightness(1.06);
}
.primary-button:active {
  transform: scale(0.985);
}

.button-icon {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: var(--accent);
  background: #11150e;
  border-radius: 11px;
  transform: rotate(180deg);
}

.welcome-footer {
  position: absolute;
  bottom: max(15px, env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, 0.23);
  font-size: 9px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-12px) rotate(2deg);
  }
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 768px) {
  .tool-dock {
    right: 24px;
    bottom: 24px;
    left: 24px;
    height: 92px;
  }

  .tool-dock.expanded {
    height: min(350px, 46dvh);
  }

  .tool-dock.settings-open {
    height: min(610px, 76dvh);
  }

  .tool-nav {
    bottom: 0;
    height: 92px;
    padding-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
  }

  .tool-nav-scroll {
    height: 90px;
    justify-content: center;
    padding: 9px 18px;
  }

  .tool-panel {
    inset: 0 0 102px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
  }

  .tool-nav button {
    flex-basis: 118px;
  }
}

@media (max-height: 690px) {
  .brand-mark {
    margin-bottom: 20px;
  }
  .welcome-card h1 {
    font-size: clamp(30px, 7vh, 42px);
  }
  .welcome-copy {
    margin-top: 9px;
    line-height: 1.7;
  }
  .loading-block {
    margin-top: 20px;
  }
  .primary-button {
    margin-top: 20px;
  }
}

@media (max-width: 520px) {
  .mode-selector {
    align-items: stretch;
    flex-direction: row;
    gap: 10px;
  }

  .segmented-control button {
    flex: 1;
  }

  .manual-controls {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* نمایشگرهای بزرگ و موبایل افقی: ابزارها در لبه راست قرار می‌گیرند. */
@media (min-width: 1024px), (orientation: landscape) and (max-height: 700px) {
  .tool-dock {
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    left: auto;
    width: 92px;
    height: auto;
    transition: width 0.38s cubic-bezier(0.22, 0.8, 0.3, 1);
  }

  .tool-dock.expanded {
    width: min(450px, 54vw);
    height: auto;
  }

  .tool-dock.settings-open {
    width: min(520px, 62vw);
    height: auto;
  }

  .tool-nav {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 92px;
    height: auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
  }

  .tool-nav-scroll {
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 12px 8px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .tool-nav button {
    width: 100%;
    max-width: none;
    min-height: 66px;
    flex: 0 0 66px;
  }

  .tool-panel {
    inset: 0 102px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
  }

  .tool-panel::before {
    top: 50%;
    right: 8px;
    left: auto;
    width: 3px;
    height: 34px;
    transform: translateY(-50%);
  }

  .panel-content {
    padding-top: 22px;
  }

  .settings-panel {
    padding-bottom: 22px;
  }
}

@media (orientation: landscape) {
  .tool-dock.expanded .model-panel,
  .tool-dock.expanded .color-panel {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .tool-dock.expanded .model-list,
  .tool-dock.expanded .color-list {
    min-height: 0;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(183, 255, 90, 0.35) transparent;
  }

  .tool-dock.expanded .model-card {
    width: 100%;
    height: 72px;
    min-height: 72px;
    max-width: none;
    flex: 0 0 72px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 9px 14px;
  }

  .tool-dock.expanded .model-preview {
    width: 45px;
    flex: 0 0 45px;
  }

  .tool-dock.expanded .color-list {
    gap: 10px;
    padding: 2px 5px 8px;
  }

  .tool-dock.expanded .color-list button {
    width: 100%;
    min-height: 55px;
    flex: 0 0 55px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 7px 12px;
    border-radius: 14px;
  }

  .tool-dock.expanded .color-list button span {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
  }

  .tool-dock.expanded .color-list button i {
    top: 50%;
    right: 25px;
    left: auto;
    transform: translate(50%, -50%);
  }
}

/*
 * هنگام کشیدن اسلایدر فقط همان کنترل روی تصویر می‌ماند.
 * عنصر input جابه‌جا یا بازسازی نمی‌شود تا تعامل لمسی قطع نشود.
 */
.tool-dock.slider-focus {
  top: auto;
  right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  height: 104px;
  pointer-events: none;
  transition: none;
}

.tool-dock.slider-focus .tool-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(120%);
}

.tool-dock.slider-focus .tool-panel {
  position: fixed;
  inset: auto 0 0;
  height: 118px;
  overflow: visible;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(5, 7, 5, 0.82), transparent);
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  animation: none;
}

.tool-dock.slider-focus .tool-panel::before,
.tool-dock.slider-focus .panel-heading,
.tool-dock.slider-focus .mode-selector,
.tool-dock.slider-focus .setting-row {
  display: none;
}

.tool-dock.slider-focus .settings-panel {
  width: 100%;
  max-width: none;
  padding: 20px clamp(22px, 8vw, 120px) max(22px, env(safe-area-inset-bottom));
  overflow: visible;
  pointer-events: none;
}

.tool-dock.slider-focus .manual-controls {
  display: block;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 13px 17px;
  pointer-events: auto;
  opacity: 1;
  background: rgba(13, 16, 13, 0.88);
  border-color: rgba(183, 255, 90, 0.3);
  border-radius: 18px;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  filter: none;
}

.tool-dock.slider-focus .range-control {
  display: none;
}

.tool-dock.slider-focus .range-control.focused {
  display: block;
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
