/* ROBERIN baseball OBP calculator Phase 1 redesign - v2 */
body.postid-1524 {
  --obp-page: #f9f1e7;
  --obp-paper: #fff7e8;
  --obp-panel: #f8efe2;
  --obp-input: #fff8ed;
  --obp-green: #e2edd8;
  --obp-ink: #34281f;
  --obp-muted: #574838;
  --obp-line: #6b5745;
  --obp-accent: #ddbf6f;
  --obp-focus: #4f7d94;
  --obp-red: #9d4b38;
  --obp-shadow: 4px 4px 0 rgba(82, 65, 50, 0.24);
  --obp-shadow-soft: 2px 2px 0 rgba(82, 65, 50, 0.16);
  background:
    linear-gradient(rgba(107, 87, 69, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 87, 69, 0.024) 1px, transparent 1px),
    var(--obp-page);
  background-size: 18px 18px;
}

.baseball-on-base-percentage-calculator-container,
.baseball-on-base-percentage-calculator-container *,
.baseball-on-base-percentage-calculator-container *::before,
.baseball-on-base-percentage-calculator-container *::after {
  box-sizing: border-box;
}

.baseball-on-base-percentage-calculator-container {
  width: min(950px, calc(100vw - 32px));
  max-width: 950px;
  margin: 12px auto 22px;
  padding: 0;
  color: var(--obp-ink);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.5;
}

.baseball-on-base-percentage-calculator-container input {
  font: inherit;
}

.baseball-on-base-percentage-calculator-container button {
  -webkit-tap-highlight-color: transparent;
}

.obp-tool__panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 14px;
  background: var(--obp-paper);
  border: 2px solid var(--obp-line);
  border-radius: 0;
  box-shadow: var(--obp-shadow);
}

.obp-tool__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(107, 87, 69, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 87, 69, 0.045) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.obp-tool__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--obp-line);
}

.obp-tool__eyebrow,
.obp-tool__subtitle,
.obp-card__head p,
.obp-message,
.obp-result-note {
  margin: 0;
}

.obp-tool__eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 5px;
  padding: 3px 8px;
  color: var(--obp-ink);
  background: var(--obp-green);
  border: 1px solid var(--obp-line);
  box-shadow: var(--obp-shadow-soft);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.obp-tool__title {
  margin: 0 0 5px;
  color: var(--obp-ink);
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 950;
  line-height: 1.12;
  letter-spacing: -0.05em;
  word-break: keep-all;
}

.obp-tool__subtitle {
  max-width: 640px;
  color: var(--obp-muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
  word-break: keep-all;
}

.obp-tool__formula-chip {
  display: grid;
  gap: 4px;
  min-width: 230px;
  padding: 9px 10px;
  color: var(--obp-ink);
  background: var(--obp-input);
  border: 2px solid var(--obp-line);
  box-shadow: var(--obp-shadow-soft);
}

.obp-tool__formula-chip span {
  color: var(--obp-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.obp-tool__formula-chip strong {
  color: var(--obp-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.obp-tool__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 12px;
  align-items: start;
}

.obp-card {
  min-width: 0;
  padding: 12px;
  color: var(--obp-ink);
  background: var(--obp-panel);
  border: 2px solid var(--obp-line);
  box-shadow: var(--obp-shadow-soft);
}

.obp-card__head {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.obp-card__head--result {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.obp-card__head h3 {
  margin: 0;
  color: var(--obp-ink);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.obp-card__head p,
.obp-result-note {
  color: var(--obp-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  word-break: keep-all;
}

.obp-input-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
}

.obp-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.obp-field__label {
  color: var(--obp-muted);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.2;
  word-break: keep-all;
}

.obp-field__label em {
  font-style: normal;
  color: var(--obp-ink);
}

.obp-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 8px;
  color: var(--obp-ink);
  -webkit-text-fill-color: var(--obp-ink);
  background: var(--obp-input);
  border: 2px solid var(--obp-line);
  border-radius: 0;
  box-shadow: inset 1px 1px 0 rgba(82, 65, 50, 0.12);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.obp-field input::placeholder {
  color: rgba(87, 72, 56, 0.62);
  -webkit-text-fill-color: rgba(87, 72, 56, 0.62);
}

.obp-field input:focus {
  outline: 3px solid rgba(79, 125, 148, 0.28);
  outline-offset: 1px;
  border-color: var(--obp-focus);
}

.obp-field input::-webkit-outer-spin-button,
.obp-field input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.obp-field input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.obp-message {
  min-height: 20px;
  margin-top: 9px;
  padding: 7px 9px;
  color: var(--obp-muted);
  background: rgba(255, 248, 237, 0.7);
  border: 1px dashed rgba(107, 87, 69, 0.55);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.baseball-on-base-percentage-calculator-container.is-invalid .obp-message {
  color: #6f2d20;
  background: #f4d8cd;
  border-color: #9d4b38;
}

.obp-actions {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(0, 0.78fr));
  gap: 7px;
  margin-top: 9px;
}

.obp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  padding: 8px 9px;
  color: var(--obp-ink);
  background: var(--obp-input);
  border: 2px solid var(--obp-line);
  border-radius: 0;
  box-shadow: var(--obp-shadow-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-align: center;
  white-space: normal;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.obp-button--primary {
  background: var(--obp-accent);
  font-weight: 950;
}

.baseball-on-base-percentage-calculator-container .obp-button {
  font-size: 13px;
  font-weight: 900;
}

.baseball-on-base-percentage-calculator-container .obp-button--primary {
  font-weight: 950;
}

.obp-button:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(82, 65, 50, 0.18);
}

.obp-button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.obp-button:focus-visible {
  outline: 3px solid rgba(79, 125, 148, 0.38);
  outline-offset: 2px;
}

.obp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 4px 8px;
  color: var(--obp-ink);
  background: var(--obp-input);
  border: 2px solid var(--obp-line);
  box-shadow: var(--obp-shadow-soft);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.15;
}

.obp-badge.low { background: #f1d2c5; }
.obp-badge.average { background: #f7df9d; }
.obp-badge.good { background: #e2edd8; }
.obp-badge.excellent { background: var(--obp-accent); }

.obp-result-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  background: var(--obp-input);
  border: 2px solid var(--obp-line);
  box-shadow: inset 1px 1px 0 rgba(82, 65, 50, 0.1);
}

.obp-result-label,
.obp-result-percent {
  color: var(--obp-muted);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
}

.obp-result-value {
  display: block;
  min-width: 0;
  color: var(--obp-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(31px, 5vw, 45px);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: -0.06em;
  text-align: center;
}

.obp-result-percent {
  padding: 4px 7px;
  background: var(--obp-green);
  border: 1px solid var(--obp-line);
  text-align: center;
}

.obp-breakdown {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.4fr;
  gap: 7px;
  margin-bottom: 9px;
}

.obp-breakdown div {
  min-width: 0;
  padding: 8px;
  background: rgba(255, 248, 237, 0.72);
  border: 1px solid rgba(107, 87, 69, 0.72);
}

.obp-breakdown span,
.obp-breakdown strong {
  display: block;
  min-width: 0;
}

.obp-breakdown span {
  margin-bottom: 3px;
  color: var(--obp-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
}

.obp-breakdown strong {
  color: var(--obp-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.obp-result-note {
  min-height: 38px;
  margin-bottom: 9px;
  padding: 8px 9px;
  background: rgba(226, 237, 216, 0.7);
  border: 1px solid rgba(107, 87, 69, 0.58);
}

.obp-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.obp-guide span {
  min-width: 0;
  padding: 6px 5px;
  color: var(--obp-ink);
  border: 1px solid var(--obp-line);
  box-shadow: 1px 1px 0 rgba(82, 65, 50, 0.14);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.obp-guide .low { background: #f1d2c5; }
.obp-guide .average { background: #f7df9d; }
.obp-guide .good { background: #e2edd8; }
.obp-guide .excellent { background: var(--obp-accent); }

body.postid-1524 .cs-custom-content-post-before,
body.postid-1524 .entry-content > .baseball-on-base-percentage-calculator-container + ins.adsbygoogle {
  width: min(950px, calc(100vw - 32px));
  max-width: 950px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: clip;
  text-align: center;
}

body.postid-1524 .cs-custom-content-post-before ins.adsbygoogle,
body.postid-1524 .entry-content > .baseball-on-base-percentage-calculator-container + ins.adsbygoogle {
  display: block !important;
  width: min(728px, 100%) !important;
  max-width: 100% !important;
  min-height: 90px;
  margin: 12px auto 18px !important;
}

@media (max-width: 860px) {
  .obp-tool__header,
  .obp-tool__grid {
    grid-template-columns: 1fr;
  }

  .obp-tool__formula-chip {
    min-width: 0;
  }

  .obp-input-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .baseball-on-base-percentage-calculator-container {
    width: min(100% - 14px, 950px);
    margin-top: 8px;
    margin-bottom: 18px;
  }

  .obp-tool__panel,
  .obp-card {
    padding: 10px;
  }

  .obp-input-grid,
  .obp-breakdown,
  .obp-guide {
    grid-template-columns: 1fr;
  }

  .obp-actions {
    grid-template-columns: 1fr 1fr;
  }

  .obp-result-main {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .obp-card__head--result {
    align-items: center;
  }

  body.postid-1524 .cs-custom-content-post-before,
  body.postid-1524 .entry-content > .baseball-on-base-percentage-calculator-container + ins.adsbygoogle {
    width: min(100% - 14px, 950px) !important;
  }
}

@media (max-width: 380px) {
  .obp-actions {
    grid-template-columns: 1fr;
  }

  .obp-button {
    min-height: 40px;
  }
}

body.postid-1524[data-scheme="dark"],
body.postid-1524[data-scheme="inverse"] {
  background: #201811;
}

body[data-scheme="dark"] .baseball-on-base-percentage-calculator-container,
body[data-scheme="inverse"] .baseball-on-base-percentage-calculator-container {
  --obp-page: #201811;
  --obp-paper: #2b2119;
  --obp-panel: #33271d;
  --obp-input: #241c15;
  --obp-green: #344a32;
  --obp-ink: #f2e4cf;
  --obp-muted: #f0dfc5;
  --obp-line: #a98b6b;
  --obp-accent: #d2aa55;
  --obp-focus: #d2aa55;
  --obp-red: #e5a28b;
  --obp-shadow: 4px 4px 0 rgba(0, 0, 0, 0.38);
  --obp-shadow-soft: 2px 2px 0 rgba(0, 0, 0, 0.28);
}

body[data-scheme="dark"] .obp-tool__panel,
body[data-scheme="inverse"] .obp-tool__panel,
body[data-scheme="dark"] .obp-card,
body[data-scheme="inverse"] .obp-card,
body[data-scheme="dark"] .obp-tool__formula-chip,
body[data-scheme="inverse"] .obp-tool__formula-chip,
body[data-scheme="dark"] .obp-field input,
body[data-scheme="inverse"] .obp-field input,
body[data-scheme="dark"] .obp-result-main,
body[data-scheme="inverse"] .obp-result-main,
body[data-scheme="dark"] .obp-breakdown div,
body[data-scheme="inverse"] .obp-breakdown div,
body[data-scheme="dark"] .obp-message,
body[data-scheme="inverse"] .obp-message {
  color: var(--obp-ink);
  -webkit-text-fill-color: var(--obp-ink);
  border-color: var(--obp-line);
}

body[data-scheme="dark"] .obp-field input::placeholder,
body[data-scheme="inverse"] .obp-field input::placeholder {
  color: rgba(240, 223, 197, 0.62);
  -webkit-text-fill-color: rgba(240, 223, 197, 0.62);
}

body[data-scheme="dark"] .obp-message,
body[data-scheme="inverse"] .obp-message,
body[data-scheme="dark"] .obp-breakdown div,
body[data-scheme="inverse"] .obp-breakdown div {
  background: rgba(36, 28, 21, 0.78);
}

body[data-scheme="dark"] .baseball-on-base-percentage-calculator-container.is-invalid .obp-message,
body[data-scheme="inverse"] .baseball-on-base-percentage-calculator-container.is-invalid .obp-message {
  color: #f2e4cf;
  -webkit-text-fill-color: #f2e4cf;
  background: #593024;
  border-color: #d2aa55;
}

body[data-scheme="dark"] .obp-badge,
body[data-scheme="inverse"] .obp-badge,
body[data-scheme="dark"] .obp-guide span,
body[data-scheme="inverse"] .obp-guide span,
body[data-scheme="dark"] .obp-button--primary,
body[data-scheme="inverse"] .obp-button--primary {
  color: #241c15;
  -webkit-text-fill-color: #241c15;
}

body[data-scheme="dark"] .obp-tool__eyebrow,
body[data-scheme="inverse"] .obp-tool__eyebrow {
  color: #f2e4cf;
  -webkit-text-fill-color: #f2e4cf;
  background: #344a32;
  border-color: #a98b6b;
}

body[data-scheme="dark"] .obp-result-note,
body[data-scheme="inverse"] .obp-result-note {
  color: #f2e4cf;
  -webkit-text-fill-color: #f2e4cf;
  background: rgba(36, 28, 21, 0.86);
  border-color: rgba(169, 139, 107, 0.88);
}

body[data-scheme="dark"] .obp-result-percent,
body[data-scheme="inverse"] .obp-result-percent {
  color: #241c15;
  -webkit-text-fill-color: #241c15;
  background: #d2aa55;
  border-color: #a98b6b;
  font-weight: 950;
}

body[data-scheme="dark"] .obp-button:not(.obp-button--primary),
body[data-scheme="inverse"] .obp-button:not(.obp-button--primary),
body[data-scheme="dark"] .obp-badge:not(.low):not(.average):not(.good):not(.excellent),
body[data-scheme="inverse"] .obp-badge:not(.low):not(.average):not(.good):not(.excellent) {
  color: var(--obp-ink);
  -webkit-text-fill-color: var(--obp-ink);
  background: var(--obp-input);
}

body[data-scheme="dark"] .obp-button:not(.obp-button--primary),
body[data-scheme="inverse"] .obp-button:not(.obp-button--primary) {
  color: #f2e4cf;
  -webkit-text-fill-color: #f2e4cf;
  background: #241c15;
  border-color: #a98b6b;
}

body[data-scheme="dark"] .obp-button--primary,
body[data-scheme="inverse"] .obp-button--primary {
  color: #241c15;
  -webkit-text-fill-color: #241c15;
  background: #d2aa55;
  border-color: #a98b6b;
}

@media (prefers-color-scheme: dark) {
  body[data-scheme="auto"] .baseball-on-base-percentage-calculator-container {
    --obp-page: #201811;
    --obp-paper: #2b2119;
    --obp-panel: #33271d;
    --obp-input: #241c15;
    --obp-green: #344a32;
    --obp-ink: #f2e4cf;
    --obp-muted: #f0dfc5;
    --obp-line: #a98b6b;
    --obp-accent: #d2aa55;
    --obp-focus: #d2aa55;
    --obp-shadow: 4px 4px 0 rgba(0, 0, 0, 0.38);
    --obp-shadow-soft: 2px 2px 0 rgba(0, 0, 0, 0.28);
  }

  body[data-scheme="auto"] .obp-badge,
  body[data-scheme="auto"] .obp-guide span,
  body[data-scheme="auto"] .obp-button--primary {
    color: #241c15;
    -webkit-text-fill-color: #241c15;
  }

  body[data-scheme="auto"] .obp-tool__eyebrow {
    color: #f2e4cf;
    -webkit-text-fill-color: #f2e4cf;
    background: #344a32;
    border-color: #a98b6b;
  }

  body[data-scheme="auto"] .obp-result-note {
    color: #f2e4cf;
    -webkit-text-fill-color: #f2e4cf;
    background: rgba(36, 28, 21, 0.86);
    border-color: rgba(169, 139, 107, 0.88);
  }

  body[data-scheme="auto"] .obp-result-percent {
    color: #241c15;
    -webkit-text-fill-color: #241c15;
    background: #d2aa55;
    border-color: #a98b6b;
    font-weight: 950;
  }

  body[data-scheme="auto"] .obp-button:not(.obp-button--primary) {
    color: #f2e4cf;
    -webkit-text-fill-color: #f2e4cf;
    background: #241c15;
    border-color: #a98b6b;
  }

  body[data-scheme="auto"] .obp-button--primary {
    color: #241c15;
    -webkit-text-fill-color: #241c15;
    background: #d2aa55;
    border-color: #a98b6b;
  }
}
