*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }


body {
  background: #b5b2a5;
  font-family: Verdana, Arial, sans-serif;
  font-size: 13px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
}


.app {
  width: 100%;
  max-width: 840px;
  min-width: 840px;
  background: #d4d0c8;
  border: 2px solid #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  padding: 2px;
}

.app::before {
  content: "Split Calculator v1.0";
  display: flex;
  align-items: center;
  background: linear-gradient(to right, #003c7f, #3a7dc4);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 6px;
  margin-bottom: 4px;
}


.app-inner {
  background: #fff;
  border: 2px inset #808080;
  padding: 10px 12px;
}


.app-banner {
  background: #003c7f;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  padding: 5px;
  margin-bottom: 10px;
}


.panel {
  border: 1px solid #808080;
  margin-bottom: 10px;
}

.panel-title {
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  padding: 2px 6px;
  font-weight: bold;
  font-size: 11px;
  color: #000;
}

.panel-body {
  padding: 8px 10px;
  background: #f0ede8;
}

.panel-body-row {
  padding: 8px 10px;
  background: #f0ede8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}


.drop-zone {
  border: 2px inset #808080;
  background: #fff;
  padding: 20px 10px;
  text-align: center;
  cursor: pointer;
  transition: background 0.1s;
}

.drop-zone:hover,
.drop-zone.dragover {
  background: #dce8f8;
}

.drop-zone-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 6px;
}

.drop-zone strong {
  display: block;
  font-size: 12px;
  color: #003c7f;
  margin-bottom: 4px;
}

.drop-zone p {
  font-size: 10px;
  color: #666;
}

.drop-zone-filename {
  font-size: 10px;
  color: #333;
  margin-top: 6px;
  font-style: italic;
}


.form-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.form-row label {
  font-size: 11px;
  color: #000;
  width: auto;
  flex-shrink: 0;
}


input[type="number"],
input[type="text"] {
  border: 2px inset #808080;
  background: #fff;
  padding: 2px 4px;
  font-size: 12px;
  font-family: Verdana, Arial, sans-serif;
  width: 100%;
}

button[type="submit"],
.btn {
  background: #d4d0c8;
  border: 2px solid #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  padding: 3px 14px;
  font-size: 11px;
  font-family: Verdana, Arial, sans-serif;
  cursor: pointer;
  color: #000;
  margin-left: auto;
}

button[type="submit"]:active,
.btn:active {
  border-color: #404040;
  border-right-color: #fff;
  border-bottom-color: #fff;
}


h2 {
  font-size: 13px;
  font-weight: bold;
  color: #003c7f;
  border-bottom: 2px solid #003c7f;
  margin: 14px 0 6px;
  padding-bottom: 2px;
}


.result-box,
.result {
  overflow-x: auto;
  margin-bottom: 0;
}

.result-table {
  border-collapse: collapse;
  width: 100%;
}

.result-table th {
  background: #003c7f;
  color: #fff;
  border: 1px solid #001f4d;
  padding: 5px 12px;
  text-align: center;
  font-size: 12px;
  white-space: nowrap;
  min-width: 80px;
}

.result-table td {
  border: 1px solid #808080;
  padding: 10px 16px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  background: #fff;
  color: #003c7f;
  white-space: nowrap;
  min-width: 80px;
}

.result-table tr:nth-child(even) td {
  background: #eef2fa;
}

.result-table tr.data-row td:nth-last-child(-n+2) {
  color: #8b0000;
  font-size: 20px;
}


/* ── Confidence rows ── */
.conf-header td {
  background: #003c7f;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 12px;
  text-align: center;
  border: 1px solid #001f4d;
}

.conf-data td {
  background: #fff;
  color: #003c7f;
  font-size: 20px;
  font-weight: bold;
  padding: 10px 16px;
  text-align: center;
  border: 1px solid #808080;
}

.conf-data td.conf-avg {
  color: #003c7f;
}


/* ── Confidence gauge ── */
.gauge-panel {
  border: 1px solid #808080;
  border-top: none;
  background: #f0ede8;
  padding: 10px 12px 14px;
  margin-bottom: 12px;
}

/* title row: "Confidence Gauge" on left, legend on right, all same line */
.gauge-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.gauge-title {
  font-size: 12px;
  font-weight: bold;
  color: #003c7f;
  text-align: center;
}

/* legend pinned to top-left, title stays centered */
.gauge-legend {
  position: absolute;
  left: 0;
  display: flex;
  gap: 12px;
  font-size: 10px;
  color: #444;
  align-items: center;
}

.gauge-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* box swatch for the legend */
.legend-box-black {
  width: 14px;
  height: 14px;
  background: #000;
  display: inline-block;
  flex-shrink: 0;
}

.legend-box-blue {
  width: 14px;
  height: 14px;
  background: #003c7f;
  display: inline-block;
  flex-shrink: 0;
}

/* gauge track closer to the title */
.gauge-wrap {
  position: relative;
  height: 20px;
  margin: 0 0 40px;
}

.gauge-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to right, #cc2200, #dd7700, #cccc00, #44aa00);
  border: 1px inset #808080;
}

/* markers on the bar — thin line style */
.gauge-marker-block {
  position: absolute;
  top: 0;
  width: 3px;
  height: 20px;
  background: #000;
  transform: translateX(-50%);
}

.gauge-avg-block {
  position: absolute;
  top: 0;
  width: 3px;
  height: 20px;
  background: #003c7f;
  transform: translateX(-50%);
}

.gauge-marker-label {
  position: absolute;
  font-size: 10px;
  font-weight: bold;
  color: #000;
  white-space: nowrap;
  transform: translateX(-50%);
}

.gauge-avg-label {
  position: absolute;
  font-size: 10px;
  font-weight: bold;
  color: #003c7f;
  white-space: nowrap;
  transform: translateX(-50%);
}

.gauge-scale {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #666;
  margin-bottom: 20px;
}

.bottom-note {
  font-size: 11px;
  color: #444;
  line-height: 1.6;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #d4d0c8;
}


.status-bar {
  background: #d4d0c8;
  border-top: 1px solid #808080;
  padding: 2px 6px;
  font-size: 10px;
  color: #000;
  margin-top: 2px;
}