/* =========================================================
   استاد تعمیر — صفحه‌ی کار و میز تعمیر
   ========================================================= */

.job-screen { max-width: 1280px; margin: 0 auto; }
.job-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.back-btn { font-size: 20px; flex: 0 0 auto; }
.job-title-wrap { flex: 1; min-width: 0; }
.job-kicker { font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.job-kicker #job-difficulty { color: var(--gold); letter-spacing: 2px; }
.job-title-wrap h2 { font-size: 24px; font-weight: 900; margin: 1px 0; }
.job-title-wrap p { font-size: 12px; }
.job-top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ------------------------- مسیر تعمیر ------------------------- */
.repair-path {
  max-width: 100%; min-width: 0;
  background: linear-gradient(180deg, rgba(78, 54, 38, 0.94), rgba(54, 37, 26, 0.96));
  border: 1px solid #6b4a2f;
  border-radius: 16px;
  padding: 11px 14px;
  margin-bottom: 12px;
  box-shadow: 0 10px 26px rgba(30, 15, 4, 0.24), inset 0 1px 0 rgba(255, 220, 160, 0.08);
}
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp-title { font-size: 12.5px; font-weight: 700; color: #ffe9c7; }
.rp-count { font-size: 10.5px; color: var(--amber); background: rgba(255, 180, 74, 0.1); border: 1px solid rgba(255, 180, 74, 0.22); padding: 2px 8px; border-radius: 99px; }
.rp-list { list-style: none; padding: 0; margin: 9px 0 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; max-width: 100%; min-width: 0; scroll-snap-type: x proximity; scroll-padding-inline: 4px; }
.rp-list .rp-step { scroll-snap-align: center; }
.rp-step {
  flex: 1; min-width: 104px; display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.16); border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted); font-size: 10.5px; line-height: 1.45;
  transition: 0.2s;
}
.rp-dot {
  width: 19px; height: 19px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  background: rgba(255, 255, 255, 0.06); color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rp-step.done { color: var(--teal); border-color: rgba(90, 211, 191, 0.25); background: rgba(90, 211, 191, 0.07); }
.rp-step.done .rp-dot { background: var(--teal); color: #10322b; border-color: var(--teal); }
.rp-step.current { color: var(--amber); border-color: rgba(255, 193, 99, 0.55); background: rgba(255, 180, 74, 0.11); box-shadow: 0 0 0 2px rgba(255, 180, 74, 0.08); }
.rp-step.current .rp-dot { background: var(--amber); color: #3a2308; border-color: var(--amber); animation: rpPulse 1.8s ease-in-out infinite; }
@keyframes rpPulse { 50% { box-shadow: 0 0 0 5px rgba(255, 180, 74, 0.16); } }
.rp-tip {
  margin-top: 8px; font-size: 11.5px; line-height: 1.8; color: #f2ddc0;
  background: rgba(255, 180, 74, 0.07); border-right: 2px solid var(--amber);
  padding: 6px 9px; border-radius: 7px;
}
.rp-tip b { color: var(--amber); }

/* ------------------------- اندازه‌گیری سریع ------------------------- */
.quick-bar {
  background: linear-gradient(180deg, rgba(46, 72, 64, 0.62), rgba(33, 51, 44, 0.66));
  border: 1px solid rgba(90, 211, 191, 0.26);
  border-radius: 14px;
  padding: 9px 12px 10px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(160, 255, 235, 0.06);
}
.quick-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.quick-bar-title { font-size: 12px; font-weight: 700; color: var(--teal); }
.quick-bar .link-btn { font-size: 11px; }
.quick-tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin: 0; }
.quick-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: rgba(90, 211, 191, 0.08); border: 1px solid rgba(90, 211, 191, 0.24);
  color: var(--cream); border-radius: 9px; padding: 8px 9px; font-size: 11px;
  transition: 0.15s; text-align: right;
}
.quick-btn:hover { background: rgba(90, 211, 191, 0.16); border-color: rgba(90, 211, 191, 0.45); transform: translateY(-1px); }
.quick-btn:disabled { opacity: 0.5; transform: none; cursor: wait; }
.quick-btn b { color: var(--teal); font-family: monospace; font-size: 10px; direction: ltr; }
.meter-verdict { margin-top: 6px; font-size: 10.5px; color: #79a394; transition: 0.2s; }
.meter-verdict.good { color: var(--green); }
.meter-verdict.bad { color: var(--red); }
.meter-verdict.warn { color: var(--amber); }
.btn.ready { animation: readyPulse 1.8s ease-in-out infinite; }
@keyframes readyPulse {
  0%, 100% { box-shadow: 0 4px 0 var(--gold-deep), 0 10px 22px rgba(255, 154, 46, 0.18); }
  50% { box-shadow: 0 4px 0 var(--gold-deep), 0 0 0 6px rgba(255, 180, 74, 0.16), 0 14px 30px rgba(255, 154, 46, 0.35); }
}

.job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.bench-col { min-width: 0; }
.bench-frame {
  background: linear-gradient(180deg, #4a3424, #2f2016);
  border: 1px solid #6b4a2f;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(30, 15, 4, 0.45), inset 0 1px 0 rgba(255, 220, 160, 0.1);
  overflow: hidden;
}
.bench-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid #5c4029;
  color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 7px 11px; border-radius: 10px; transition: 0.15s;
}
.tool-btn:hover { color: var(--cream); background: rgba(255, 180, 74, 0.08); border-color: rgba(255, 180, 74, 0.3); }
.tool-btn.active { color: var(--amber); background: rgba(255, 180, 74, 0.12); border-color: rgba(255, 180, 74, 0.45); box-shadow: inset 0 0 0 1px rgba(255, 180, 74, 0.15); }
.tool-btn.on { color: var(--teal); border-color: rgba(73, 197, 177, 0.4); background: rgba(73, 197, 177, 0.1); }
.tool-btn span { font-weight: 500; }
.toolbar-spacer { flex: 1; }
.meter-modes { display: flex; gap: 3px; background: rgba(0, 0, 0, 0.3); padding: 3px; border-radius: 9px; }
.mode-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 700;
  padding: 5px 10px; border-radius: 6px; transition: 0.15s; font-family: monospace;
}
.mode-btn.active { background: rgba(73, 197, 177, 0.16); color: var(--teal); }

.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 300px;
  background: radial-gradient(ellipse at 50% 40%, #3a2a1e, #241811 75%);
  overflow: hidden;
  touch-action: none;
}
#bench { width: 100%; height: 100%; display: block; cursor: crosshair; }
.canvas-hint {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 10, 7, 0.85); border: 1px solid #4b3525;
  padding: 6px 14px; border-radius: 99px; font-size: 11px; color: #cbb79d;
  pointer-events: none; white-space: nowrap; max-width: 92%;
  overflow: hidden; text-overflow: ellipsis;
}
.power-badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 10.5px; padding: 4px 10px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.5); border: 1px solid #4b3525; color: var(--muted);
  pointer-events: none;
}
.power-badge.on { color: var(--green); border-color: rgba(123, 216, 143, 0.45); background: rgba(123, 216, 143, 0.1); box-shadow: 0 0 14px rgba(123, 216, 143, 0.15); }

/* بزرگ‌نمایی برد */
.bench-zoom {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  display: flex; align-items: center; gap: 3px;
  background: rgba(12, 8, 5, 0.62); border: 1px solid #4b3525;
  border-radius: 11px; padding: 3px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.zoom-btn {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.06);
  color: var(--cream); font-size: 15px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; transition: 0.15s;
  touch-action: manipulation;
}
.zoom-btn:hover { background: rgba(90, 211, 191, 0.16); border-color: rgba(90, 211, 191, 0.45); color: var(--teal); }
.zoom-btn:disabled { opacity: 0.32; cursor: default; }
.zoom-level { min-width: 36px; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--teal); direction: ltr; }

.bench-footer {
  display: flex; align-items: stretch; gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}
.meter {
  flex: 1; min-width: 240px;
  background: linear-gradient(180deg, #1a2a22, #101a15);
  border: 1px solid #2f5a48;
  border-radius: 13px;
  padding: 10px 14px;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(73, 197, 177, 0.06);
}
.meter-screen { display: flex; align-items: baseline; gap: 8px; }
.meter-mode { font-size: 10px; color: #5fae94; font-family: monospace; letter-spacing: 1px; }
.meter-value {
  flex: 1; text-align: center;
  font-size: 30px; font-weight: 700; color: #7dffcf;
  text-shadow: 0 0 14px rgba(125, 255, 207, 0.45);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  line-height: 1.2;
  transition: 0.1s;
}
.meter-value.blank { color: #3c6a58; text-shadow: none; letter-spacing: 4px; }
.meter-value.pulse { animation: meterPulse 0.35s ease; }
@keyframes meterPulse { 50% { opacity: 0.4; transform: scale(0.98); } }
.meter-unit { font-size: 13px; color: #5fae94; font-family: monospace; }
.meter-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; font-size: 10px; color: #6d8f81; }
.meter-meta .link-btn { color: #6d8f81; }
.meter-meta .link-btn:hover { color: #9be8cd; }
.job-actions { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.job-actions .btn { padding: 10px 18px; }
.job-actions .btn-sm { padding: 7px 12px; font-size: 11px; }

/* ------------------------- ستون کناری ------------------------- */
.job-side { padding: 0; display: flex; flex-direction: column; max-height: calc(100vh - 150px); min-height: 420px; overflow: hidden; }
.side-tabs { display: flex; border-bottom: 1px solid var(--line); flex: 0 0 auto; overflow-x: auto; }
.side-tab {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; font-weight: 700; padding: 12px 6px;
  border-bottom: 2px solid transparent; transition: 0.15s; white-space: nowrap;
}
.side-tab:hover { color: var(--cream); }
.side-tab.active { color: var(--amber); border-bottom-color: var(--amber); background: rgba(255, 180, 74, 0.04); }
.side-panels { flex: 1; min-height: 0; display: flex; }
.side-panel { display: none; width: 100%; min-height: 0; }
.side-panel.active { display: flex; }
.panel-scroll { flex: 1; overflow-y: auto; padding: 16px; max-height: calc(100vh - 260px); }
.side-h { font-size: 13px; margin: 16px 0 8px; color: #e9d6ba; }
.side-h:first-child { margin-top: 0; }
.symptom-box { background: rgba(255, 180, 74, 0.06); border: 1px solid rgba(255, 180, 74, 0.18); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.symptom-label { font-size: 10px; color: var(--amber); font-weight: 700; display: block; margin-bottom: 4px; }
.symptom-box p { font-size: 12.5px; line-height: 1.95; color: #ecd9bd; }
.story-box { font-size: 12px; line-height: 1.95; color: var(--muted); padding: 0 2px 4px; }
.tool-list { display: flex; flex-direction: column; gap: 6px; }
.tool-row { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 9px; padding: 8px 10px; font-size: 12px; }
.tool-row small { color: var(--muted); font-size: 10px; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.status-cell { background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 9px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.status-cell span { color: var(--muted); }
.status-cell b { color: var(--cream); font-size: 11.5px; }
.status-cell b.on { color: var(--green); }
.status-cell b.off { color: var(--muted); }
.status-cell b.warn { color: var(--red); }

/* ------------------------- قطعات ------------------------- */
.parts-list { display: flex; flex-direction: column; gap: 7px; }
.part-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid #5c4029;
  border-radius: 11px; padding: 9px 11px; cursor: pointer; transition: 0.15s;
  text-align: right; color: var(--cream);
}
.part-card:hover { border-color: rgba(255, 180, 74, 0.45); background: rgba(255, 180, 74, 0.06); transform: translateX(-2px); }
.part-ico { font-size: 18px; flex: 0 0 auto; }
.part-body { flex: 1; min-width: 0; }
.part-body b { display: block; font-size: 12px; }
.part-body small { font-size: 10px; color: var(--muted); }
.part-watt { font-size: 9.5px; color: var(--teal); background: rgba(73, 197, 177, 0.08); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.part-empty { text-align: center; padding: 24px 10px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.part-empty .pe-ico { font-size: 32px; display: block; margin-bottom: 8px; opacity: 0.7; }
.part-selected { border-color: var(--amber); background: rgba(255, 180, 74, 0.1); box-shadow: 0 0 0 1px rgba(255, 180, 74, 0.35); }

.spec-list { display: flex; flex-direction: column; gap: 5px; }
.spec-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; padding: 6px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.025); }
.spec-row span { color: var(--muted); }
.spec-row b { color: #e9d6ba; font-family: monospace; font-size: 11px; direction: ltr; }
.test-list { display: flex; flex-direction: column; gap: 6px; }
.test-row { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; padding: 7px 9px; border-radius: 8px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.05); }
.test-row .tr-node { color: var(--teal); font-weight: 700; }
.test-row .tr-exp { color: var(--amber); font-family: monospace; direction: ltr; }
.test-row .tr-exp.hidden-exp { color: var(--muted); font-family: var(--font); direction: rtl; }
.manual-text { font-size: 12.5px; line-height: 2; color: #dfcdb5; background: rgba(0, 0, 0, 0.18); border-radius: 10px; padding: 10px 12px; }

/* ------------------------- راهنما ------------------------- */
.hint-list { display: flex; flex-direction: column; gap: 8px; }
.hint-card {
  border: 1px solid #5c4029; border-radius: 12px; padding: 11px 12px;
  background: rgba(255, 255, 255, 0.025);
}
.hint-card.bought { border-color: rgba(73, 197, 177, 0.3); background: rgba(73, 197, 177, 0.05); }
.hint-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hint-tier { font-size: 11.5px; font-weight: 700; color: #e9d6ba; }
.hint-cost { font-size: 10.5px; color: var(--amber); }
.hint-card button { margin-top: 8px; width: 100%; }
.hint-text { margin-top: 8px; font-size: 11.5px; line-height: 1.9; color: #d9c8ae; }
.hint-log { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.hint-log-item { font-size: 11px; line-height: 1.9; color: #cbb79d; background: rgba(255, 180, 74, 0.05); border-right: 2px solid rgba(255, 180, 74, 0.35); padding: 7px 9px; border-radius: 6px; }

/* ------------------------- گزارش ------------------------- */
.measure-log { display: flex; flex-direction: column; gap: 5px; }
.log-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; padding: 7px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.025); border-right: 2px solid rgba(73, 197, 177, 0.3); }
.log-row .lr-points { color: var(--muted); }
.log-row .lr-val { color: var(--teal); font-family: monospace; direction: ltr; }
.log-row.bad .lr-val { color: var(--red); }

/* ------------------------- تنظیم ------------------------- */
.side-foot { border-top: 1px solid var(--line); padding: 12px 16px; background: rgba(0, 0, 0, 0.18); flex: 0 0 auto; }
.tune-label { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.tune-label b { color: var(--amber); }
input[type='range'] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--teal-deep), var(--teal));
  outline: none; margin-bottom: 10px;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--cream); border: 3px solid var(--teal); cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
input[type='range']::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--cream); border: 3px solid var(--teal); cursor: pointer; }

/* ------------------------- موبایل ------------------------- */
@media (max-width: 1000px) {
  .repair-path { padding: 10px 12px; margin-bottom: 10px; }
  .rp-list { overflow-x: auto; scrollbar-width: none; }
  .rp-list::-webkit-scrollbar { display: none; }
  .rp-step { min-width: 96px; flex: 0 0 auto; }
  .quick-tests { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}

/* ------------------------- حالت بسته ------------------------- */
.case-closed-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(20, 13, 9, 0.55), rgba(10, 7, 5, 0.9));
  backdrop-filter: blur(1px); z-index: 5;
}
.case-open-cta {
  text-align: center; background: rgba(20, 13, 9, 0.9);
  border: 1px solid #5a4029; border-radius: 18px; padding: 20px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}
.case-open-cta .co-ico { font-size: 38px; display: block; margin-bottom: 6px; }
.case-open-cta h4 { font-size: 16px; margin-bottom: 4px; }
.case-open-cta p { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }

/* ------------------------- آموزش کوتاه ------------------------- */
.tut-steps { display: flex; flex-direction: column; gap: 9px; }
.tut-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255, 180, 74, 0.06); border: 1px solid rgba(255, 180, 74, 0.18);
  border-radius: 12px; padding: 10px 12px;
}
.tut-step > span {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: var(--amber); color: #3a2308; display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.tut-step b { font-size: 13px; }
.tut-step p { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.8; }

/* ------------------------- ریسپانسیو ------------------------- */
@media (max-width: 1280px) {
  .repair-path { max-width: 100%; }
}
@media (max-width: 1180px) {
  .job-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .job-side { max-height: none; }
  .panel-scroll { max-height: 420px; }
}
@media (max-width: 1000px) {
  .job-layout { grid-template-columns: 1fr; }
  .job-side { max-height: none; min-height: 0; }
  .side-panels { min-height: 300px; }
  .panel-scroll { max-height: 340px; }
  .canvas-wrap { aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .job-top { gap: 8px; }
  .job-title-wrap h2 { font-size: 18px; }
  .job-title-wrap p { display: none; }
  .job-top-actions .stat-chip { display: none; }
  .job-top-actions .btn { padding: 8px 10px; font-size: 11px; }
  .bench-toolbar { gap: 4px; padding: 8px; }
  .tool-btn { padding: 6px 8px; font-size: 11px; }
  .tool-btn span { display: none; }
  .meter-modes { margin-inline-start: auto; }
  .canvas-wrap { aspect-ratio: 4 / 3; min-height: 240px; }
  .canvas-hint { font-size: 9.5px; padding: 4px 9px; }
  .bench-zoom { top: 7px; right: 7px; padding: 2px; }
  .zoom-btn { width: 34px; height: 34px; font-size: 16px; }
  .zoom-level { min-width: 30px; font-size: 10px; }
  .bench-footer { padding: 8px; gap: 8px; }
  .meter { min-width: 100%; padding: 8px 10px; }
  .meter-value { font-size: 25px; }
  .job-actions { flex-direction: row; width: 100%; }
  .job-actions .btn { flex: 1; font-size: 12px; padding: 9px 8px; }
  .job-actions .btn-sm { flex: 0 0 auto; }
  .side-tab { font-size: 10.5px; padding: 10px 4px; }
  .panel-scroll { max-height: 300px; padding: 12px; }
  .quick-bar { padding: 8px 10px 9px; margin-bottom: 10px; }
  .quick-bar-title { font-size: 11px; }
  .quick-btn { padding: 7px 8px; font-size: 10.5px; }
}
