/* RapidTables-parity premium calculator UIs — sequence + spacing */

/* Hide generic Ready box when tool has its own results */
.workspace[class*="-ui"] > #calc-result { display: none !important; }

.tool-box[class*="-ui"] {
  padding: 18px 20px 22px;
}

.rt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 16px;
  border-bottom: 2px solid #cfcfcf;
}
.rt-tabs a, .rt-tabs button {
  border: 1px solid #cfcfcf;
  border-bottom: none;
  background: #eee;
  color: #222;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  margin-right: 3px;
  border-radius: 4px 4px 0 0;
  text-decoration: none;
  cursor: pointer;
}
.rt-tabs .on, .rt-tabs a.on {
  background: #ff6b1a;
  color: #fff;
  border-color: #ff6b1a;
}

.rt-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.rt-toggle button {
  border: 1px solid #bbb;
  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 36px;
}
.rt-toggle button.on {
  background: #ff6b1a;
  color: #fff;
  border-color: #ff6b1a;
}
.rt-toggle button.on-dark {
  background: #555;
  color: #fff;
  border-color: #444;
}

/* Label LEFT · controls RIGHT — consistent vertical sequence */
.rt-field {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
  margin: 0 0 14px;
  min-height: 40px;
}
.rt-field > label {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: #222;
  line-height: 1.35;
}
.rt-field .ctl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rt-field input[type="text"],
.rt-field input[type="number"],
.rt-field select,
.rt-out {
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  min-height: 36px;
  box-sizing: border-box;
}
.rt-field input[type="text"],
.rt-field input[type="number"] {
  width: 120px;
  max-width: 100%;
}
.rt-field select { min-width: 120px; }
.rt-out {
  background: #fff;
  min-width: 160px;
  flex: 1;
  font-weight: 700;
  color: #111;
}

/* Affix units fused to inputs (RapidTables style) */
.affix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  background: #e8e8e8;
  border: 1px solid #bbb;
  padding: 0 12px;
  min-height: 36px;
  box-sizing: border-box;
  border-radius: 3px;
  white-space: nowrap;
}
.ctl > input + .affix {
  margin-left: -9px;
  border-left: 0;
  border-radius: 0 3px 3px 0;
}
.ctl > input:has(+ .affix) {
  border-radius: 3px 0 0 3px;
}
.ctl > .affix + input {
  margin-left: -1px;
  border-radius: 0 3px 3px 0;
}
.ctl > .affix:has(+ input) {
  border-radius: 3px 0 0 3px;
  border-right: 0;
}

@media (max-width: 640px) {
  .rt-field {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 16px;
    align-items: start;
  }
}

.rt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 16px;
  padding-top: 4px;
}
.rt-actions .btn {
  min-height: 38px;
  padding: 8px 18px;
  font-size: 14px;
}

.rt-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #d5d5c8;
}
.rt-panel h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.rt-steps, .rt-history {
  width: 100%;
  min-height: 80px;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #fff;
  padding: 10px 12px;
  font-size: 13px;
  font-family: Consolas, monospace;
  white-space: pre-wrap;
  resize: vertical;
  margin: 8px 0 0;
  box-sizing: border-box;
}
.rt-toolbar {
  display: flex;
  gap: 6px;
  background: #e8e8e8;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 4px;
  margin: 6px 0;
}
.rt-toolbar button {
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.sci-pro { max-width: 540px; }
.sci-hist {
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 4px;
  min-height: 88px;
  max-height: 140px;
  overflow: auto;
  padding: 8px;
  font-family: Consolas, monospace;
  font-size: 13px;
  margin-bottom: 6px;
}
.sci-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-bottom: 6px;
}
.sci-entry input {
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 18px;
  font-weight: 700;
  font-family: Consolas, monospace;
  text-align: right;
}
.sci-entry .sci-enter {
  background: #ff6b1a;
  color: #fff;
  border: 1px solid #ff6b1a;
  border-radius: 4px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}
.sci-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.sci-grid button {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.sci-grid button:hover { background: #f3f3f3; }
.sci-grid .k-ac { background: #e57373; color: #fff; border-color: #c62828; }
.sci-grid .k-eq { background: #ff6b1a; color: #fff; border-color: #ff6b1a; grid-row: span 2; }
.sci-grid .k-fn { background: #f7f4ea; }
.sci-grid .k-op { background: #eee; }
.sci-grid .on { outline: 2px solid #ff6b1a; }

/* Percentage — RapidTables sentence rows, clear sequence + space */
.pct-pro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pct-free {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d5d5c8;
  border-radius: 4px;
}
.pct-free input {
  flex: 1;
  min-width: 180px;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 14px;
  min-height: 36px;
}
.pct-free .out,
.pct-line .out {
  min-width: 100px;
  border: 1px solid #ccc;
  background: #fafafa;
  border-radius: 3px;
  padding: 8px 10px;
  font-weight: 700;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}
.pct-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d5d5c8;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: #222;
}
.pct-line input {
  width: 88px;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 8px 8px;
  font-size: 14px;
  min-height: 36px;
  box-sizing: border-box;
}
.pct-line .btn,
.pct-free .btn {
  white-space: nowrap;
  min-height: 36px;
}
.pct-block {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d5d5c8;
  border-radius: 4px;
}
.pct-block > .pct-h {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #222;
}
.pct-conv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d5d5c8;
  border-radius: 4px;
  font-size: 14px;
}
.pct-conv input {
  width: 80px;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 8px;
  min-height: 36px;
  box-sizing: border-box;
}

.frac-pro .frac-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 14px 0 18px;
  padding: 8px 0;
}
.frac-stack {
  display: inline-grid;
  justify-items: center;
  gap: 4px;
}
.frac-stack input {
  width: 72px;
  text-align: center;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 8px;
  min-height: 36px;
}
.frac-line { width: 72px; height: 2px; background: #333; }
.frac-op {
  width: 44px;
  height: 44px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 20px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}
.mixed-whole {
  width: 52px;
  text-align: center;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 8px;
  min-height: 36px;
  margin-right: 4px;
}

.rt-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
  margin: 8px 0 12px;
}
.rt-table th, .rt-table td {
  border: 1px solid #ccc;
  padding: 8px;
  vertical-align: middle;
}
.rt-table th { background: #eee; }
.rt-table input, .rt-table select {
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 13px;
  min-height: 34px;
  box-sizing: border-box;
}

.formula-box {
  background: #fffef5;
  border: 1px solid #e0d9a8;
  padding: 14px 16px;
  margin: 12px 0 18px;
  font-size: 14px;
  line-height: 1.65;
}
.ex-box {
  background: #f7f7f0;
  border: 1px solid #ddd;
  padding: 14px 16px;
  margin: 10px 0 18px;
  font-size: 14px;
  line-height: 1.65;
}

.currency-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.currency-bar button {
  min-width: 40px;
  min-height: 36px;
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 3px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}
.currency-bar button.on {
  background: #ff6b1a;
  color: #fff;
  border-color: #ff6b1a;
}

.cat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  margin: 12px 0 18px;
}
.cat-table th, .cat-table td {
  border: 1px solid #ccc;
  padding: 8px 10px;
  text-align: left;
}
.cat-table th { background: #eee; }

/* Average data field full width */
.rt-field.rt-stack {
  grid-template-columns: 1fr;
  align-items: start;
}
.rt-field.rt-stack textarea {
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 14px;
  min-height: 90px;
  box-sizing: border-box;
  background: #fff;
}
