

/* ============================================================
   TANK VOLUME CALCULATOR — Enhanced Styles
   ============================================================ */

.tv-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.tv-shape-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tv-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
  font-family: var(--system-fonts);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2364748B'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.tv-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

[data-theme="dark"] .tv-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2394A3B8'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}


.tv-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--subtext);
}

.tv-hint {
  font-size: .68rem;
  color: var(--subtext);
  opacity: .7;
}


.tv-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tv-input-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 600px) {
  .tv-input-grid { grid-template-columns: 1fr; }
  .tv-input-grid-3 { grid-template-columns: 1fr; }
}


.tv-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tv-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  transition: border-color .2s ease, box-shadow .2s ease;
  text-align: center;
}

.tv-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.tv-input::placeholder { color: var(--border); font-weight: 400; }


/* Result */
.tv-result {
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  text-align: center;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  transform-origin: top center;
}

.tv-result.hidden { display: none; }

.tv-result.tv-result--visible { animation: pctSlideDown .35s cubic-bezier(.4,0,.2,1); }


.tv-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tv-result-badge {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(37,99,235,.1);
  color: var(--primary);
  border: 1px solid rgba(37,99,235,.15);
}

.tv-result-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--subtext);
  flex: 1;
  text-align: left;
}


.tv-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 480px) {
  .tv-result-grid { grid-template-columns: 1fr; }
}


.tv-result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s ease;
}

.tv-result-item:hover { border-color: var(--primary); }

.tv-result-item-label {
  font-size: .65rem;
  font-weight: 700;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tv-result-item-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}


.tv-copy-btn {
  font-size: .62rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--subtext);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .2s ease;
  font-family: var(--system-fonts);
  white-space: nowrap;
}

.tv-copy-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.tv-copy-btn--copied { background: var(--success) !important; color: #fff !important; border-color: var(--success) !important; }


/* Bar chart */
.tv-bar-chart {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  animation: pctSlideDown .35s cubic-bezier(.4,0,.2,1);
}

.tv-bar-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
  text-align: center;
}

.tv-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tv-bar-row:last-child { margin-bottom: 0; }

.tv-bar-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--subtext);
  min-width: 48px;
  text-align: right;
}

.tv-bar-track {
  flex: 1;
  height: 16px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.tv-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  min-width: 0;
}

.tv-bar-fill--gal { background: linear-gradient(90deg, #2563eb, #3b82f6); }

.tv-bar-fill--lit { background: linear-gradient(90deg, #22c55e, #4ade80); }

.tv-bar-fill--cuft { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.tv-bar-fill--cum { background: linear-gradient(90deg, #ec4899, #f472b6); }

.tv-bar-value {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  min-width: 44px;
  text-align: right;
}


/* Error */
.tv-result-error {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--error);
  text-align: left;
}

.tv-result-error--visible { display: flex; align-items: flex-start; gap: 8px; }

.tv-result-error::before {
  content: '!';
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; min-width: 20px;
  background: var(--error); color: #fff; border-radius: 50%;
  font-size: .75rem; font-weight: 800;
}


[data-theme="dark"] .tv-result { background: var(--card); }

[data-theme="dark"] .tv-result-item { background: var(--bg); }

[data-theme="dark"] .tv-bar-chart { background: var(--bg); }

[data-theme="dark"] .tv-input { background: var(--bg); }


@media (max-width: 480px) {
  .tv-result { padding: 14px 12px; }
  .tv-result-item-val { font-size: 1.1rem; }
  .tv-result-item { padding: 10px 8px; }
  .tv-bar-chart { padding: 10px; }
  .tv-bar-label { font-size: .65rem; min-width: 36px; }
  .tv-bar-value { font-size: .68rem; min-width: 36px; }
  .tv-bar-track { height: 14px; }
}
