/* דמות מתמונה — לפי UI-STYLE-GUIDE.md. הכל תחום תחת .pvf-root כדי לא להשפיע על תבנית האתר. */
.pvf-root {
  --bg: #0d1117; --panel: #12161e; --card: #161b24; --line: rgba(255,255,255,.14);
  --text: #e8ecf2; --muted: #98a2b3; --accent: #dca24a; --accent-soft: #d3a05a;
  --accent2: #2f86ff; --ok: #33bd6b; --input: #10151d;
  font-family: "Rubik", "Segoe UI", system-ui, sans-serif; color: var(--text); line-height: 1.4;
  text-align: right;
}
.pvf-root *, .pvf-root *::before, .pvf-root *::after { box-sizing: border-box; }
.pvf-root [hidden] { display: none !important; }
.pvf-root button, .pvf-root input, .pvf-root select { font-family: inherit; letter-spacing: normal; text-transform: none; }
.pvf-root h1, .pvf-root h2, .pvf-root h3, .pvf-root p { margin: 0; padding: 0; border: 0; }
/* תבניות (Elementor וכו') מגדירות גופן גלובלי ישירות על h1/h2, לעיתים עם !important — וירושה תמיד מפסידה לכלל ישיר.
   לכן מצהירים על הגופן מחדש על כל אלמנט ברכיב. */
.pvf-root, .pvf-root * { font-family: "Rubik", "Segoe UI", system-ui, sans-serif !important; }
.pvf-root h1, .pvf-root h2, .pvf-root h3 { line-height: 1.3 !important; text-transform: none !important; letter-spacing: normal; }

/* פריסה */
.pvf-app { display: flex; flex-direction: column; height: 900px;
           background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pvf-topbar { flex-shrink: 0; background: var(--panel); border-bottom: 1px solid var(--line);
              padding: 12px 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pvf-topbar h1 { font-size: 1.3rem !important; font-weight: 800 !important; color: var(--accent) !important; letter-spacing: .3px; }
.pvf-sub { font-size: .85rem; color: var(--muted); }
.pvf-owner-bar { margin-inline-start: 18px; display: flex; gap: 14px; font-size: .8rem; color: var(--muted); border: 1px dashed var(--line);
                 border-radius: 9px; padding: 5px 10px; background: var(--card); }
.pvf-owner-bar b { color: var(--text); font-weight: 600; }
.pvf-owner-bar.low { border-color: var(--accent); } .pvf-owner-bar.low #pvf-obBalance { color: var(--accent); }
.pvf-muted { color: var(--muted); }
.pvf-main { display: flex; flex: 1; min-height: 0; }
.pvf-viewport { position: relative; flex: 1; min-width: 0; }
.pvf-panel { width: 340px; flex-shrink: 0; background: var(--panel); border-left: 1px solid var(--line);
             overflow-y: auto; padding: 12px 14px; }
#pvf-canvas { display: block; width: 100%; height: 100%; }

/* כרטיס */
.pvf-card { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px 12px; margin-bottom: 6px; }
.pvf-card h2 { font-size: .95rem !important; color: var(--accent) !important; margin: 0 0 8px; font-weight: 700 !important; letter-spacing: .2px; }
.pvf-card.locked { opacity: .5; pointer-events: none; }
/* אקורדיון (כרטיסים 2–3): רק אחד פתוח; כרטיס נעול — סגור ולא ניתן לפתיחה */
.pvf-acc .pvf-acc-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; margin: 0 !important; user-select: none; }
.pvf-acc .pvf-acc-head:hover { filter: brightness(1.12); }
.pvf-acc .pvf-acc-head:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.pvf-acc .pvf-chev { color: var(--muted); transition: transform .15s; flex-shrink: 0; }
.pvf-acc.open .pvf-chev { transform: rotate(180deg); color: var(--accent); }
.pvf-acc .pvf-acc-body { display: none; margin-top: 8px; }
.pvf-acc.open .pvf-acc-body { display: block; }
.pvf-acc.locked .pvf-acc-head { cursor: not-allowed; }
.pvf-card.locked h2 { color: var(--muted) !important; }
.pvf-info { font-size: .82rem; color: var(--muted); line-height: 1.45; margin: 6px 0 4px; }
.pvf-lbl { display: block; font-size: .78rem; color: var(--muted); margin: 8px 0 4px; }

/* כפתורים */
.pvf-root button.pvf-primary {
  display: block; width: 100%; margin-top: 10px; text-align: center; background: var(--accent-soft); color: #201603;
  border: none; border-radius: 9px; padding: 11px; font-weight: 700; font-size: .92rem; cursor: pointer; line-height: 1.3;
}
.pvf-root button.pvf-primary:hover { filter: brightness(1.06); }
.pvf-root button.pvf-primary:disabled { opacity: .45; cursor: not-allowed; }
.pvf-root button.pvf-primary.alt { background: var(--ok); color: #fff; }
.pvf-root button.pvf-ghost { display: block; width: 100%; margin-top: 6px; background: transparent; border: 1px solid var(--line);
  color: var(--muted); border-radius: 8px; padding: 7px 10px; font-size: .82rem; cursor: pointer; line-height: 1.3; }
.pvf-root button.pvf-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent2); }
.pvf-root button.pvf-ghost:disabled { opacity: .45; cursor: not-allowed; }
.pvf-latest { font-size: .8rem; color: var(--muted); margin: 8px 0 0; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 7px; }
.pvf-root .pvf-latest a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* טאבים */
.pvf-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.pvf-root .pvf-tab { flex: 1; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 9px;
            padding: 9px 6px; font-weight: 600; font-size: .88rem; cursor: pointer; }
.pvf-root .pvf-tab:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.pvf-root .pvf-tab.active { color: #201603; background: var(--accent-soft); border-color: var(--accent-soft); }

/* אזור גרירה + פח */
.pvf-drop-wrap { position: relative; }
.pvf-drop { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 150px;
            border: 1.5px dashed var(--line); border-radius: 11px; background: var(--input); color: var(--muted);
            font-size: .85rem; cursor: pointer; text-align: center; padding: 10px; overflow: hidden; margin: 0; }
.pvf-drop.small { min-height: 64px; }
.pvf-drop:hover, .pvf-drop.over { border-color: var(--accent); color: var(--text); }
.pvf-drop img { max-width: 100%; max-height: 220px; object-fit: contain; }
.pvf-root .pvf-clear-btn { position: absolute; top: 8px; left: 8px; z-index: 2; width: 34px; height: 34px; display: grid;
             place-items: center; padding: 0; cursor: pointer; background: #d9534f; color: #fff; border: none;
             border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.pvf-root .pvf-clear-btn:hover { background: #e8615c; }
.pvf-drop.small + .pvf-clear-btn { top: 50%; transform: translateY(-50%); }

/* שדות */
.pvf-root .pvf-select {
  width: 100%; background: var(--input); border: 1px solid var(--line); color: var(--text); border-radius: 9px;
  padding: 10px 12px; font-size: .9rem; cursor: pointer; appearance: none; height: auto; margin: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%238a93a6' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: left 12px center;
}
.pvf-root .pvf-select.sm { padding: 6px 8px; border-radius: 7px; font-size: .85rem; background-position: left 8px center; }
.pvf-root .pvf-select:hover:not(:disabled), .pvf-root .pvf-select:focus { border-color: var(--accent); outline: none; }
.pvf-root .pvf-select:disabled { opacity: .45; cursor: not-allowed; }
.pvf-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pvf-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.pvf-field label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 3px; }
.pvf-root .pvf-field input[type=number] {
  width: 100%; background: var(--input); border: 1px solid var(--line); color: var(--text); border-radius: 7px;
  padding: 6px; font-size: .85rem; height: auto; margin: 0; box-shadow: none;
}
.pvf-root .pvf-field input:focus { border-color: var(--accent); outline: none; }
.pvf-root .pvf-field input:disabled { opacity: .4; cursor: not-allowed; }
.pvf-field.span2 { grid-column: span 2; }
.pvf-field.chamfer { display: flex; align-items: center; gap: 10px; }
.pvf-root .pvf-field.chamfer input[type=number] { width: 80px; flex-shrink: 0; }
.pvf-field label.check { display: flex; align-items: center; gap: 6px; flex: 1; margin: 0; font-size: .78rem; color: var(--text); cursor: pointer; }
.pvf-field label.check:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.pvf-root input[type=checkbox] { accent-color: var(--accent2); width: 15px; height: 15px; margin: 0; }
.pvf-root .pvf-field input.bad { border-color: #ff5c72; }
.pvf-field-err { margin: 6px 0 0; font-size: .78rem; color: #ff8a9a; }
.pvf-faces-note { margin: 8px 0 0; padding: 6px 8px; background: var(--input); border: 1px solid var(--line); border-radius: 7px; }
.pvf-faces-note b { color: var(--text); font-weight: 600; }
.pvf-faces-note .down { color: var(--accent); }

/* אריחים */
.pvf-dim { background: var(--input); border: 1px solid var(--line); border-radius: 9px; padding: 6px; text-align: center; }
.pvf-dim.span2 { grid-column: span 2; }
.pvf-dim-label { display: block; font-size: .7rem; color: var(--muted); margin-bottom: 3px; }
.pvf-dim-val { display: block; font-size: .9rem; font-weight: 600; color: var(--text); }
.pvf-dim-val.good { color: var(--ok); } .pvf-dim-val.warn { color: var(--accent); }
.pvf-sub-h { font-size: .78rem; color: var(--muted); margin: 10px 0 5px; }

/* תצוגה */
.pvf-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 1rem; pointer-events: none; }
.pvf-spinner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
               gap: 14px; background: rgba(16,19,26,.6); color: var(--text); z-index: 5; }
.pvf-spin { width: 44px; height: 44px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
            animation: pvf-spin 1s linear infinite; }
@keyframes pvf-spin { to { transform: rotate(360deg); } }
.pvf-eta { font-size: .95rem; color: var(--text); background: rgba(22,27,36,.9); border: 1px solid var(--line);
           border-radius: 9px; padding: 6px 14px; font-variant-numeric: tabular-nums; }
.pvf-eta b { color: var(--accent); font-weight: 700; }
.pvf-spin-note { color: var(--accent); font-size: .88rem; font-weight: 600; border: 1px solid rgba(220,162,74,.5);
                 border-radius: 9px; padding: 6px 12px; background: rgba(44,33,9,.85); }
.pvf-banner { position: absolute; bottom: 0; left: 0; right: 0; z-index: 4; background: linear-gradient(180deg, #3a2c0c, #2c2109);
              color: var(--accent); border-top: 1px solid rgba(220,162,74,.5); text-align: center; font-size: .9rem;
              font-weight: 600; padding: 9px 16px; pointer-events: none; }
.pvf-overlay-tools { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 3; }
.pvf-root .pvf-overlay-tools button { background: rgba(30,36,48,.8); color: var(--text); border: 1px solid var(--line);
             border-radius: 8px; padding: 6px 10px; font-size: .82rem; cursor: pointer; line-height: 1.3; }
.pvf-root .pvf-overlay-tools button:hover:not(:disabled) { border-color: var(--accent2); }
.pvf-root .pvf-overlay-tools button.active { border-color: var(--accent); color: var(--accent); }
.pvf-root .pvf-overlay-tools button:disabled { opacity: .4; cursor: not-allowed; }
.pvf-overlay-tools { align-items: center; }
/* כפתור "הדרכה" (VIEW-TOOLS-BUTTONS.md) — ענבר, בולט כקריאה לפעולה. !important מול עיצוב קישורים של התבנית */
.pvf-root a.pvf-guide-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft) !important; color: #201603 !important; font-weight: 700;
  border: 1px solid var(--accent-soft); border-radius: 8px; padding: 6px 18px; font-size: .82rem;
  line-height: 1.3; text-decoration: none !important; white-space: nowrap; cursor: pointer; box-shadow: none;
}
.pvf-root a.pvf-guide-btn:hover { filter: brightness(1.06); }
.pvf-root a.pvf-guide-btn[hidden] { display: none !important; }

/* חלונות הודעה — סטנדרט בית */
.pvf-msgbox { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center;
              padding: 20px; background: rgba(8,11,20,.66); }
.pvf-msgbox-card { width: min(430px,100%); text-align: center; direction: rtl; background: #1e2438; border: 1px solid #2b3350;
                   border-top: 4px solid #ff5c72; border-radius: 16px; padding: 26px 24px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
                   animation: pvf-pop .16s ease-out; }
.pvf-msgbox-title { margin: 0 0 8px !important; font-size: 18px; font-weight: 700; color: #e7eaf3; }
.pvf-msgbox-msg { margin: 0 0 20px !important; font-size: 14px; line-height: 1.65; color: #9aa3bd; }
.pvf-root .pvf-msgbox-btn { min-width: 130px; padding: 10px 18px; border-radius: 10px; border: none; font-weight: 700;
                 font-size: 14px; color: #fff; cursor: pointer; background: linear-gradient(90deg, #5b8cff, #7c5cff); }
.pvf-msgbox-actions { display: flex; gap: 10px; justify-content: center; }
.pvf-root .pvf-msgbox-btn.danger { background: #d9534f; }
.pvf-root .pvf-msgbox-btn.ghost { background: transparent; border: 1px solid #2b3350; color: #9aa3bd; }
@keyframes pvf-pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pvf-msgbox-card { animation: none; } }

/* מובייל — חסום */
.pvf-mobile-block { display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.pvf-mobile-card { max-width: 420px; text-align: center; background: var(--card); border: 1px solid var(--line);
                   border-top: 4px solid var(--accent); border-radius: 16px; padding: 28px 22px; }
.pvf-mobile-card h2 { margin: 6px 0 10px; color: var(--accent); font-size: 1.25rem; }
.pvf-mobile-card p { color: var(--muted); line-height: 1.6; font-size: .95rem; }
.pvf-mobile-icon { font-size: 2.4rem; }
