/* Tiewrap vibrating screen calculator (Dec 2026).
   Same night-navy band and orange signal colour as the QR code page (/qrcode/), under the site's white header.
   Everything is scoped to .tws so Bootstrap and the site styles are not touched. */
.tws-page {
  --q-night: #0f1730;
  --q-field: #17223f;
  --q-line: #2b3963;
  --q-signal: #ff8a1f;
  --q-signal-hi: #ffa24f;
  --q-text: #eef2ff;
  --q-muted: #9ba6c9;
  --q-display: 'Chakra Petch', 'Hind', sans-serif;
  /* names used by the calculator script and its drawing */
  --bg: #0f1730; --panel: #17223f; --ink: #eef2ff; --mut: #9ba6c9; --line: #2b3963;
  --or: #ff8a1f; --orsoft: rgba(255, 138, 31, .13); --ok: #5fd39a; --warn: #ffc08a; --bad: #ff8a80;
  --q-title: #fff; --q-on-signal: #0f1730; --q-cta: #141f3d; --q-dot: rgba(238, 242, 255, .08); --q-btn-line: #4a5a8c;
  background: var(--q-night);
}
/* light mode (switch at the top of the page) */
.tws-page.tws-light {
  --q-night: #f3f5f9; --q-field: #ffffff; --q-line: #d6dce8; --q-signal: #e06a00; --q-signal-hi: #f07c12;
  --q-text: #0f1730; --q-muted: #56617f; --q-title: #0f1730; --q-on-signal: #ffffff; --q-cta: #e7ebf3;
  --q-dot: rgba(15, 23, 48, .07); --q-btn-line: #b9c2d6;
  --bg: #f3f5f9; --panel: #ffffff; --ink: #0f1730; --mut: #56617f; --line: #d6dce8;
  --or: #e06a00; --orsoft: rgba(224, 106, 0, .1); --ok: #1f7a4a; --warn: #a25b00; --bad: #b3261e;
}
html[dir="rtl"] .tws-page { --q-display: 'Reem Kufi', 'IBM Plex Sans Arabic', sans-serif; }

/* ---------- band ---------- */
.tws { position: relative; color: var(--q-text); overflow: hidden; font-size: 16px; line-height: 1.55; }
html[dir="rtl"] .tws { font-family: 'IBM Plex Sans Arabic', 'Hind', sans-serif; }
.tws * { box-sizing: border-box; min-width: 0; }
.tws::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--q-dot) 1.1px, transparent 1.4px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 30%, transparent 70%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 30%, transparent 70%);
}
.tws-wrap { position: relative; padding-top: 64px; padding-bottom: 80px; }
.tws-wrap::before, .tws-wrap::after { display: none; }
.tws [hidden] { display: none !important; }
.tws p, .tws span, .tws label, .tws li, .tws td, .tws th { color: inherit; }
.tws .num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }

/* ---------- type ---------- */
.tws-intro { margin-bottom: 36px; max-width: 46em; }
.tws-tag { display: inline-block; background: rgba(255, 138, 31, .14); color: var(--q-signal) !important; border: 1px solid rgba(255, 138, 31, .4); font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 4px; margin-bottom: 16px; }
.tws-page .tws .tws-title {
  font-family: var(--q-display) !important; font-weight: 600; color: #fff;
  font-size: clamp(32px, 4vw, 52px); line-height: 1.08; letter-spacing: -.01em; margin: 0 0 16px;
}
.tws-page .tws .tws-title { color: var(--q-title); }
html[dir="rtl"] .tws-page .tws .tws-title { line-height: 1.3; letter-spacing: 0; word-spacing: .2em; }
.tws-lead { font-size: 18px; line-height: 1.6; color: var(--q-muted) !important; margin: 0; }
.tws-page .tws h2 {
  font-family: var(--q-display) !important; font-weight: 600; font-size: 19px; color: var(--q-text);
  margin: 0 0 10px; line-height: 1.3;
}
html[dir="rtl"] .tws-page .tws h2 { word-spacing: .15em; }

/* ---------- results and drawing ---------- */
.tws .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: stretch; margin-bottom: 28px; }
.tws .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.tws .kpi { background: var(--q-field); border: 1px solid var(--q-signal); border-radius: 6px; padding: 12px 14px; }
.tws .kpi b { display: block; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; font-weight: 600; color: var(--q-title); }
.tws .kpi b.txt { font-size: clamp(18px, 2.1vw, 23px); }
.tws .kpi span { font-size: 13px; color: var(--q-muted) !important; }
.tws .kpi i { font-style: normal; font-size: 13px; color: var(--q-muted); }
.tws .ok { color: var(--ok) !important; } .tws .warn { color: var(--warn) !important; } .tws .bad { color: var(--bad) !important; }
.tws .verdict { grid-column: 1 / -1; background: var(--orsoft); border: 1px solid rgba(255, 138, 31, .35); border-radius: 6px; padding: 12px 14px; font-size: 15px; }
.tws .fig { position: relative; min-height: 340px; background: rgba(255, 255, 255, .03); border: 1px solid var(--q-line); border-radius: 6px; }
.tws .fig > svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- inputs ---------- */
.tws .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.tws fieldset { background: var(--q-field); border: 1px solid var(--q-line); border-radius: 6px; padding: 12px 14px 6px; margin: 0; min-width: 0; }
.tws legend {
  font-family: var(--q-display); font-weight: 600; font-size: 17px; color: var(--q-text);
  width: auto; float: none; border: 0; margin: 0; padding: 0 6px; line-height: 1.4;
}
.tws label { display: grid; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: 10px; padding: 6px 0; margin: 0; max-width: none; font-weight: 400; font-size: 15px; border-bottom: 1px dashed var(--q-line); }
.tws label:last-child { border-bottom: 0; }
.tws label small { display: block; color: var(--q-muted); font-size: 13px; }
.tws input, .tws select {
  font-family: inherit; font-size: 16px; width: 100%; height: 44px; padding: 6px 10px; margin: 0;
  border: 1px solid var(--q-line); border-radius: 6px; background: var(--q-night); color: var(--q-text);
  direction: ltr; text-align: center; box-shadow: none;
}
.tws select { text-align: start; direction: inherit; }
.tws select option { background: var(--q-field); color: var(--q-text); }
.tws input:focus, .tws select:focus { outline: none; border-color: var(--q-signal); box-shadow: 0 0 0 3px rgba(255, 138, 31, .25); }
.tws input:disabled { opacity: .3; background: transparent; }

/* ---------- buttons ---------- */
.tws .bar, .tws .stot { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-top: 14px; }
.tws button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; margin: 0;
  border-radius: 6px; border: 1px solid var(--q-btn-line); background: transparent; color: var(--q-text);
  font-family: var(--q-display); font-weight: 600; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s;
}
html[dir="rtl"] .tws button { word-spacing: .08em; }
.tws button:hover { border-color: var(--q-text); }
.tws button.pri { background: var(--q-signal); border-color: var(--q-signal); color: var(--q-on-signal); }
.tws button.pri:hover { background: var(--q-signal-hi); }
.tws button:focus-visible { outline: 2px solid var(--q-text); outline-offset: 3px; }
.tws #msg { font-size: 14px; color: var(--q-muted); }

/* ---------- steel weight ---------- */
.tws .steel { background: var(--q-field); border: 1px solid var(--q-line); border-radius: 6px; padding: 14px; margin-top: 28px; }
.tws .steel p { margin: 0 0 10px; color: var(--q-muted) !important; font-size: 14px; }
.tws .scroll { overflow-x: auto; }
.tws table { width: 100%; border-collapse: collapse; font-size: 15px; background: transparent; margin: 0; }
.tws .steel table { min-width: 900px; }
.tws .steel th { font-size: 13px; color: var(--q-muted); font-weight: 500; text-align: start; padding: 6px 4px; border-bottom: 1px solid var(--q-line); }
.tws .steel td { padding: 4px; vertical-align: middle; border-bottom: 1px solid var(--q-line); }
.tws .steel td input, .tws .steel td select { height: 40px; padding: 4px 6px; }
.tws .steel td select { min-width: 190px; }
.tws .steel .sel { display: flex; align-items: center; gap: 8px; }
.tws .steel .shp { width: 46px; height: 46px; flex: none; background: var(--q-night); border-radius: 6px; padding: 3px; }
.tws .steel .x { min-height: 40px; width: 40px; padding: 0; font-size: 18px; font-family: inherit; }
.tws .stot b { font-size: clamp(22px, 3vw, 30px); color: var(--q-title); }

/* ---------- detail tables ---------- */
.tws .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 14px; margin-top: 28px; }
.tws .card { background: var(--q-field); border: 1px solid var(--q-line); border-radius: 6px; padding: 14px; }
.tws .card td { padding: 7px 4px; border-bottom: 1px solid var(--q-line); vertical-align: top; }
.tws .card td:last-child { text-align: end; }
.tws .card tr:last-child td { border-bottom: 0; }
.tws .notes { color: var(--q-muted); font-size: 14px; max-width: 80ch; margin: 28px 0 0; padding-inline-start: 20px; }
.tws .notes li { margin-bottom: 6px; color: var(--q-muted) !important; }

/* ---------- call to action (same as the QR page) ---------- */
.tws-cta { background: var(--q-cta); border-top: 1px solid var(--q-line); }
.tws-cta-in { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; padding-top: 40px; padding-bottom: 40px; }
.tws-cta-in::before, .tws-cta-in::after { display: none; }
.tws-cta p { margin: 0; max-width: 40em; font-size: 19px; line-height: 1.5; color: var(--q-text) !important; }
.tws-cta a {
  flex: none; display: inline-flex; align-items: center; height: 50px; padding: 0 22px; border-radius: 6px;
  background: var(--q-signal); color: var(--q-on-signal) !important; font-family: var(--q-display); font-weight: 600; font-size: 16px; text-decoration: none;
}
.tws-cta a:hover, .tws-cta a:focus { background: var(--q-signal-hi); text-decoration: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 991px) {
  .tws .hero { grid-template-columns: minmax(0, 1fr); }
  .tws-wrap { padding-top: 44px; padding-bottom: 60px; }
}
@media (max-width: 600px) {
  .tws .kpis { grid-template-columns: minmax(0, 1fr); }
  .tws label { grid-template-columns: minmax(0, 1fr) 100px; }
  .tws-lead { font-size: 17px; }
  .tws-cta-in { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .tws button { transition: none; } }

/* ---------- questions (also sent to Google as FAQPage data) ---------- */
.tws-faq { margin-top: 40px; max-width: 860px; }
.tws-faq details { border-top: 1px solid var(--q-line); padding: 14px 0; }
.tws-faq details:last-child { border-bottom: 1px solid var(--q-line); }
.tws-faq summary { cursor: pointer; font-weight: 600; font-size: 17px; color: var(--q-text); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.tws-faq summary::-webkit-details-marker { display: none; }
.tws-faq summary::after { content: "+"; color: var(--q-signal); font-size: 22px; line-height: 1; flex: none; }
.tws-faq details[open] summary::after { content: "−"; }
.tws-faq summary:focus-visible { outline: 2px solid var(--q-text); outline-offset: 3px; }
.tws-faq details p { margin: 10px 0 0; color: var(--q-muted) !important; font-size: 16px; line-height: 1.65; max-width: 70ch; }

/* ---------- light / dark switch ---------- */
.tws-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.tws-top .tws-tag { margin: 0; }
.tws .tws-theme { gap: 8px; font-family: inherit; font-weight: 500; }
.tws .tws-theme .fa { color: var(--q-signal); font-size: 16px; }
.tws-light .tws input:disabled { opacity: .45; background: #eef1f6; }

/* ---------- motor rotation ---------- */
.tws .tws-rot svg { display: block; width: 100%; max-width: 440px; height: auto; margin: 4px auto 10px; }
.tws .rotl { margin: 0; padding-inline-start: 20px; font-size: 14px; color: var(--q-muted); }
.tws .rotl li { margin-bottom: 5px; color: var(--q-muted) !important; }
.tws .rotl li b { color: var(--q-text); font-weight: 600; }

.tws .fhint { margin: 6px 0 8px; font-size: 13px; line-height: 1.5; color: var(--q-muted) !important; }
