/* All presentation rules are scoped to this calculator. */
.tcgw {
  --tcgw-gold: #e7c569;
  --tcgw-charcoal: #323232;
  --tcgw-gray: #b5babc;
  --tcgw-background: #fff;
  --tcgw-text: #323232;
  --tcgw-muted: #63696c;
  --tcgw-border: rgba(181, 186, 188, .66);
  --tcgw-input: #fff;
  --tcgw-output: rgba(231, 197, 105, .13);
  --tcgw-focus: #323232;
  --tcgw-font: "TCGW IranYekan X", "IRANYekanXV", "IRANYekanX", Tahoma, Arial, sans-serif;
  box-sizing: border-box;
  width: 100%;
  max-width: 760px;
  min-width: 0;
  margin: 28px auto;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--tcgw-border);
  border-radius: 24px;
  background: var(--tcgw-background);
  color: var(--tcgw-text);
  box-shadow: 0 10px 32px rgba(50, 50, 50, .055);
  font-family: var(--tcgw-font);
  font-size: 16px;
  line-height: 1.9;
  text-align: right;
  isolation: isolate;
  color-scheme: light;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.tcgw[data-theme="dark"] {
  --tcgw-background: #323232;
  --tcgw-text: #f6f6f3;
  --tcgw-muted: #b5babc;
  --tcgw-border: rgba(181, 186, 188, .3);
  --tcgw-input: #292929;
  --tcgw-output: rgba(231, 197, 105, .075);
  --tcgw-focus: #e7c569;
  color-scheme: dark;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .1);
}
.tcgw *, .tcgw *::before, .tcgw *::after { box-sizing: border-box; }
.tcgw [hidden] { display: none !important; }
.tcgw .tcgw-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0; padding: 0; border: 0; }
.tcgw .tcgw-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tcgw .tcgw-logo { display: flex; align-items: center; justify-content: center; flex: 0 0 62px; width: 62px; height: 62px; border: 1px solid rgba(181, 186, 188, .22); border-radius: 15px; background: #fff; overflow: hidden; }
.tcgw .tcgw-logo img { display: block; width: 54px; height: 48px; max-width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; object-fit: contain; box-shadow: none; }
.tcgw .tcgw-title { margin: 0; padding: 0; border: 0; font-family: var(--tcgw-font); font-size: clamp(19px, 3.5vw, 27px); font-weight: 750; line-height: 1.6; color: var(--tcgw-text); letter-spacing: normal; text-transform: none; overflow-wrap: normal; }
.tcgw .tcgw-intro { margin: 20px 0 25px; padding: 0; color: var(--tcgw-muted); font-family: var(--tcgw-font); font-size: 14px; font-weight: 400; line-height: 2; }
.tcgw .tcgw-button { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 44px; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid var(--tcgw-border); border-radius: 12px; background: transparent; color: var(--tcgw-text); box-shadow: none; font-family: var(--tcgw-font); font-size: 16px; font-weight: 400; line-height: 1; text-decoration: none; text-transform: none; cursor: pointer; touch-action: manipulation; transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.tcgw .tcgw-button:hover { border-color: var(--tcgw-gold); background: var(--tcgw-output); color: var(--tcgw-text); box-shadow: none; }
.tcgw .tcgw-button:focus-visible { outline: 2px solid var(--tcgw-focus); outline-offset: 3px; }
.tcgw .tcgw-icon { display: block; width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }
.tcgw .tcgw-icon-sun { display: none; }
.tcgw[data-theme="dark"] .tcgw-icon-sun { display: block; color: var(--tcgw-gold); }
.tcgw[data-theme="dark"] .tcgw-icon-moon { display: none; }
.tcgw .tcgw-fields { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); grid-template-areas: "output-label . input-label" "output swap input"; gap: 10px 16px; direction: ltr; width: 100%; margin: 0; padding: 0; }
.tcgw .tcgw-label { display: block; min-width: 0; margin: 0; padding: 0; color: var(--tcgw-text); font-family: var(--tcgw-font); font-size: 14px; font-weight: 650; line-height: 1.8; direction: rtl; text-align: right; cursor: default; }
.tcgw .tcgw-label-input { grid-area: input-label; }
.tcgw .tcgw-label-output { grid-area: output-label; }
.tcgw .tcgw-control { min-width: 0; width: 100%; min-height: 100px; margin: 0; padding: 14px; border: 1px solid var(--tcgw-border); border-radius: 15px; color: var(--tcgw-text); background: var(--tcgw-input); }
.tcgw .tcgw-control-input { grid-area: input; display: flex; align-items: center; justify-content: center; transition: border-color .18s ease, box-shadow .18s ease; }
.tcgw .tcgw-control-input:focus-within { border-color: var(--tcgw-focus); box-shadow: 0 0 0 2px var(--tcgw-output); }
.tcgw .tcgw-input { appearance: none; -webkit-appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 54px; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--tcgw-text); box-shadow: none; outline: none; font-family: var(--tcgw-font); font-size: 38px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.5; letter-spacing: normal; text-align: center; direction: ltr; text-indent: 0; }
.tcgw .tcgw-input:focus { border: 0; background: transparent; color: var(--tcgw-text); outline: none; box-shadow: none; }
.tcgw .tcgw-input::placeholder { color: var(--tcgw-muted); font-family: var(--tcgw-font); font-size: 16px; opacity: .65; }
.tcgw .tcgw-control-output { grid-area: output; display: flex; align-items: center; justify-content: center; border-color: rgba(231, 197, 105, .8); background: var(--tcgw-output); text-align: center; }
.tcgw .tcgw-output-value { display: block; max-width: 100%; color: var(--tcgw-text); font-family: var(--tcgw-font); font-size: 38px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.65; letter-spacing: normal; overflow-wrap: anywhere; word-break: normal; user-select: all; cursor: text; }
.tcgw[data-theme="dark"] .tcgw-output-value { color: var(--tcgw-gold); }
.tcgw .tcgw-swap { grid-area: swap; align-self: center; justify-self: center; border-radius: 50%; border-color: var(--tcgw-gold); background: var(--tcgw-gold); color: #323232; }
.tcgw .tcgw-swap:hover { background: #323232; border-color: #323232; color: #e7c569; }
.tcgw[data-theme="dark"] .tcgw-swap:hover { background: #e7c569; border-color: #fff; color: #323232; }
.tcgw .tcgw-error { margin: 12px 0 0; padding: 9px 12px; border-right: 3px solid var(--tcgw-gold); background: var(--tcgw-output); color: var(--tcgw-text); font-family: var(--tcgw-font); font-size: 12px; line-height: 1.9; }
.tcgw .tcgw-formulas { display: grid; gap: 8px; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid var(--tcgw-border); }
.tcgw .tcgw-formula { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 5px; margin: 0; padding: 0; color: var(--tcgw-muted); font-family: var(--tcgw-font); font-size: 13px; font-weight: 400; line-height: 1.9; direction: rtl; }
.tcgw .tcgw-formula bdi { font-weight: 650; color: var(--tcgw-text); white-space: nowrap; }
.tcgw .tcgw-noscript { margin: 16px 0 0; color: var(--tcgw-text); font-family: var(--tcgw-font); font-size: 13px; line-height: 1.9; }
.tcgw .tcgw-screen-reader { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
@media (max-width: 480px) {
  .tcgw { padding: 18px 15px; border-radius: 20px; }
  .tcgw .tcgw-header { gap: 10px; }
  .tcgw .tcgw-brand { gap: 10px; }
  .tcgw .tcgw-logo { flex-basis: 46px; width: 46px; height: 46px; border-radius: 11px; }
  .tcgw .tcgw-logo img { width: 40px; height: 36px; }
  .tcgw .tcgw-title { font-size: 19px; }
  .tcgw .tcgw-theme { min-width: 40px; width: 40px; min-height: 40px; height: 40px; }
  .tcgw .tcgw-intro { margin: 18px 0 20px; font-size: 12px; }
  .tcgw .tcgw-fields { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); gap: 8px; }
  .tcgw .tcgw-label { font-size: 12px; }
  .tcgw .tcgw-control { min-height: 84px; padding: 10px 7px; border-radius: 12px; }
  .tcgw .tcgw-input { min-height: 54px; font-size: 28px; }
  .tcgw .tcgw-output-value { font-size: 28px; }
  .tcgw .tcgw-swap { min-width: 40px; width: 40px; min-height: 40px; height: 40px; }
  .tcgw .tcgw-formulas { margin-top: 20px; padding-top: 16px; gap: 7px; }
  .tcgw .tcgw-formula { font-size: 11px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .tcgw, .tcgw .tcgw-button, .tcgw .tcgw-control-input { transition: none; }
}
