* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.modal-loading {
  pointer-events: none;
  opacity: 0.7;
}
.modal-loading .modal-loading-overlay {
  display: flex;
}
.modal-loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  border-radius: inherit;
}
.modal-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #333;
  border-top-color: #e5a128;
  border-radius: 50%;
  animation: modal-spin 0.8s linear infinite;
}
@keyframes modal-spin {
  to { transform: rotate(360deg); }
}
.btn-saving {
  pointer-events: none;
  opacity: 0.8;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
}

#app {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Status label (used in dev-section) */
.status {
  font-size: 12px;
  color: #555;
}

.status.connected {
  color: #4ade80;
}

.status.offline {
  color: #f87171;
}

.status.searching {
  color: #737373;
}

/* Main header — matches Pico app: solid black bar, centered title, blue temp */
.main-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  height: 50px;
  background: #141414;
  position: relative;
  flex-shrink: 0;
}

.main-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #ffa500;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.main-header.offline h1 {
  color: #f87171;
}

.main-header.searching h1 {
  color: #737373;
}

.btn-batchflow {
  margin-left: auto;
  padding: 5px 12px;
  border: none;
  border-radius: 4px;
  background: #3399ff;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-batchflow:hover { background: #5cb0ff; }

.temp {
  font-size: 24px;
  font-weight: 700;
  color: #3399ff;
  margin-right: auto;
}

/* Screens */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen {
  flex: 1;
}

.screen.hidden {
  display: none;
}

/* Tap grid — fixed column count, centered, max 180px per card, squishes on narrow screens */
.tap-grid {
  display: grid;
  grid-template-columns: repeat(var(--active-taps, 5), minmax(0, 180px));
  justify-content: center;
  gap: 10px;
  padding: 10px;
  flex: 1;
  align-content: start;
}

.tap-card {
  cursor: pointer;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 340px;
  background: linear-gradient(180deg, #1f1f1f 0%, #141414 100%);
}

.tap-card.pouring {
  border-color: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
}

.tap-card.offline {
  border-color: #222;
  opacity: 0.6;
}

/* Tap label — bold orange like Pico app */
.tap-card .tap-label {
  font-size: 18px;
  font-weight: 700;
  color: #ffa500;
  text-align: center;
}

.tap-card .beverage-name {
  font-size: 15px;
  font-weight: 600;
  color: #e8e8e8;
  text-align: center;
  min-height: 20px;
}

.tap-card .stats {
  font-size: 12px;
  color: #888;
  text-align: center;
  min-height: 18px;
}

/* Vertical keg gauge — silhouette with rounded ends, fill from bottom */
.tap-card .level-gauge {
  flex: 1;
  min-height: 95px;
  background: #0d0d0d;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 2px solid #888;
  align-self: center;
  width: 50%;
  max-width: 80px;
}

.tap-card .level-gauge .level-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #E5A128; /* fallback; overridden by SRM-based inline style */
  transition: height 0.3s ease;
  z-index: 0;
}

/* Double horizontal lines at 33% and 66% — always on top, solid light gray */
.tap-card .level-gauge::before,
.tap-card .level-gauge::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  height: 2px;
  background: #888;
  box-shadow: 0 2px 0 #888;
  pointer-events: none;
  z-index: 1;
}

.tap-card .level-gauge::before {
  bottom: 33.33%;
}

.tap-card .level-gauge::after {
  bottom: 66.66%;
}

.tap-card .keg-label {
  font-size: 13px;
  font-weight: 600;
  color: #737373;
  text-align: center;
  min-height: 18px;
}

.tap-card .remaining {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.tap-card .status {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.tap-card .status.idle {
  color: #737373;
}

.tap-card .status.pouring {
  color: #22c55e;
}

.tap-card .status.offline {
  color: #f87171;
}

.tap-card .pour-buttons {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.tap-card button.pour-btn {
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 600;
  background: #252525;
  color: #93c5fd;
  border: 1px solid #404040;
  border-radius: 4px;
  cursor: pointer;
}

.tap-card button.pour-btn:hover:not(:disabled) {
  background: #333;
  color: #bfdbfe;
}

.tap-card button.pour-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tap-card.offline button.pour-btn {
  opacity: 0.4;
  pointer-events: none;
}

/* Top navigation bar */
.top-nav {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 6px;
  background: #1a1a1a;
  border-bottom: 1px solid #262626;
  flex-shrink: 0;
}

.top-nav .nav-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #252525;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
}

.top-nav .nav-btn:hover:not(:disabled):not(.active) {
  background: #333;
}

.top-nav .nav-btn.active {
  background: #cc8400;
  color: #1a1a1a;
  border-color: #cc8400;
}

.top-nav .nav-btn.active:hover {
  color: #fff;
}

.top-nav .nav-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.top-nav .help-btn {
  width: 40px;
  padding: 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: #26264d;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
}

.top-nav .help-btn:hover {
  background: #333366;
}

/* Sub-action bar — context-sensitive buttons beneath tab rows */
.sub-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 16px;
  background: #1e1e1e;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.sub-action-bar.hidden {
  display: none;
}

.sub-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  background: #252525;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
}

.sub-btn:hover:not(:disabled) {
  background: #333;
}

.sub-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sub-btn-green {
  background: #166534;
  color: #fff;
  border: none;
}

.sub-btn-green:hover:not(:disabled) {
  background: #15803d;
}

.sub-btn-reload {
  background: #f59e0b;
  color: #1a1a1a;
  border: none;
}

.sub-btn-reload:hover:not(:disabled) {
  background: #fbbf24;
}

.sub-btn-red {
  background: #991b1b;
  color: #fff;
  border: none;
}

.sub-btn-red:hover:not(:disabled) {
  background: #b91c1c;
}

/* Screen headers (Kegs, Beverages) */
.screen-header {
  padding: 16px;
  background: #141414;
  border-bottom: 1px solid #222;
}

.screen-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #ffa500;
}

.screen-content {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.list-header {
  display: grid;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #888;
  border-bottom: 1px solid #333;
}

.list-header-kegs {
  grid-template-columns: 1fr 1fr 80px 120px;
}

.list-header-bevs {
  grid-template-columns: 1fr 60px 60px 50px 120px;
}

.list-body {
  margin-top: 8px;
}

.list-row {
  display: grid;
  gap: 12px;
  padding: 12px;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
}

.list-row:hover {
  background: #222;
  border-color: #444;
}

.list-row-keg {
  grid-template-columns: 1fr 1fr 80px 120px;
}

.list-row-bev {
  grid-template-columns: 1fr 60px 60px 50px 120px;
}

.list-row .row-name {
  font-weight: 600;
  color: #e0e0e0;
}

.list-row .row-meta {
  font-size: 14px;
  color: #888;
}

.list-row .row-actions {
  display: flex;
  gap: 8px;
}

.list-row .btn-edit,
.list-row .btn-delete {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.list-row .btn-edit {
  background: #333;
  color: #93c5fd;
}

.list-row .btn-edit:hover {
  background: #444;
}

.list-row .btn-delete {
  background: #4a1515;
  color: #f87171;
}

.list-row .btn-delete:hover {
  background: #6b2020;
}


.keg-name-input {
  margin: 0 0 16px 0;
  padding: 10px 12px;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 14px;
}

.keg-calc-readonly {
  margin: 0 0 16px 0;
  padding: 10px 12px;
  background: #252525;
  border: 1px solid #444;
  border-radius: 4px;
  color: #22c55e;
  font-size: 16px;
  font-weight: 600;
}

.calc-hint {
  font-size: 12px;
  font-weight: 400;
  color: #666;
}

/* Keg modal: two-column rows for compact layout */
.keg-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.keg-field {
  flex: 1;
  min-width: 0;
}

#form-keg .keg-field input,
#form-keg .keg-field .keg-calc-readonly {
  margin-bottom: 0;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  position: relative;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.modal-content h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #ffa500;
}

.modal-content label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin-bottom: 4px;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 14px;
  background: #252525;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
}

.modal-content select {
  cursor: pointer;
}

/* Beverage modal: Color (SRM) row with swatch */
.bev-srm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.bev-srm-row input {
  flex: 1;
  margin-bottom: 0;
}

.bev-srm-swatch {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #E5A128;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-actions .btn-cancel,
.modal-actions .btn-save,
.modal-actions .btn-delete {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}

.modal-actions .btn-cancel {
  background: #333;
  color: #ccc;
  border: 1px solid #444;
}

.modal-actions .btn-cancel:hover {
  background: #444;
}

.modal-actions .btn-save {
  background: #166534;
  color: #fff;
  border: none;
}

.modal-actions .btn-save:hover {
  background: #15803d;
}

.modal-actions .btn-delete {
  background: #991b1b;
  color: #fff;
  border: none;
}

.modal-actions .btn-delete:hover {
  background: #b91c1c;
}

.modal-confirm p {
  margin: 0 0 20px 0;
  color: #e0e0e0;
}

.list-error {
  color: #f87171;
  padding: 16px;
}

/* Tap selector modal */
.modal-tap-select .tap-select-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.tap-select-loading {
  padding: 24px;
  text-align: center;
  color: #888;
}

.tap-select-row {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
  background: #252525;
  border: none;
  border-bottom: 1px solid #333;
  cursor: pointer;
  text-align: left;
}

.tap-select-row:hover {
  background: #333;
}

.tap-select-row.tap-select-system {
  background: #2a2a2a;
  color: #93c5fd;
}

.tap-select-cancel {
  width: 100%;
}

/* Calibrate / Mark Empty modals */
.calibrate-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 24px;
  margin-bottom: 20px;
  font-size: 14px;
}

.calibrate-grid span:first-child {
  color: #888;
}

.calibrate-grid .cal-new-label {
  color: #22c55e;
  font-weight: 700;
}

.cal-new-value {
  font-size: 20px;
  font-weight: 700;
  color: #22c55e;
}

.cal-confirm-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(34, 197, 94, 0.2);
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  cursor: pointer;
}

.cal-confirm-label input {
  width: auto;
  margin: 0;
}

.keg-name-highlight {
  font-size: 18px;
  font-weight: 600;
  color: #ffa500;
  margin: 8px 0 20px 0;
}

/* SYSTEM tab — Active Taps, Units, DEMO */
.system-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.system-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-row label {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  min-width: 80px;
}

.system-row select,
.system-row input[type="text"] {
  padding: 6px 10px;
  font-size: 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e0e0e0;
  cursor: pointer;
}


.wifi-mode-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.wifi-mode-section > label {
  display: block;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 10px;
}

.wifi-mode-buttons {
  display: flex;
  gap: 8px;
}

.btn-wifi-reset {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  background: #4a1515;
  color: #f87171;
  border: 1px solid #6b2020;
  border-radius: 4px;
  cursor: pointer;
  flex: 1;
}

.btn-wifi-reset:hover:not(:disabled) {
  background: #6b2020;
}

.btn-wifi-reset:disabled {
  background: #333;
  color: #888;
  border-color: #444;
  cursor: default;
}

.main-header.standalone h1 {
  border: 2px solid #ffa500;
  border-radius: 6px;
  padding: 2px 14px;
}

/* Dev-only section (hidden in production) */
.dev-section {
  margin-top: 20px;
  padding: 12px;
  border: 1px solid #991b1b;
  border-radius: 6px;
}

.dev-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.btn-connect-dev {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  background: #991b1b;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-connect-dev:hover {
  background: #b91c1c;
}

.dev-section input[type="text"] {
  padding: 6px 10px;
  font-size: 14px;
  background: #1a1a1a;
  border: 1px solid #991b1b;
  border-radius: 4px;
  color: #e0e0e0;
  width: 140px;
}

.dev-section .status {
  display: block;
  margin-top: 8px;
}

/* Settings screen */
.settings-header {
  padding: 16px;
  background: #141414;
  border-bottom: 1px solid #222;
}

.settings-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #ffa500;
}

.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  background: #1a1a1a;
  flex-wrap: wrap;
}

.settings-tab-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #888;
  background: #252525;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
}

.settings-tab-btn:hover {
  color: #ccc;
  background: #333;
}

.settings-tab-btn.active {
  color: #ffa500;
  background: #1a1a1a;
  border-color: #ffa500;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.settings-pane {
  display: none;
}

.settings-pane.active {
  display: block;
}

.alerts-section {
  margin-bottom: 24px;
}

.alerts-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #ffa500;
}

.alerts-section label {
  display: block;
  margin: 12px 0 4px 0;
  font-size: 13px;
  color: #888;
}

.alerts-section input[type="text"],
.alerts-section input[type="email"],
.alerts-section input[type="password"],
.alerts-section select {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  font-size: 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e0e0e0;
}

.alerts-section input[type="range"] {
  width: 100%;
  max-width: 300px;
  margin: 4px 0;
}

.btn-secondary {
  margin-top: 16px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  background: #2a4a6a;
  color: #e0e0e0;
  border: 1px solid #3a5a7a;
  border-radius: 4px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #3a5a8a;
}

.updates-version {
  font-size: 18px;
  font-weight: 600;
  color: #ffa500;
  margin-bottom: 8px;
}

.updates-note {
  color: #888;
  font-size: 14px;
  margin-bottom: 16px;
}

.ap-mode-notice {
  background: #3a2800;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  color: #ffc107;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.updates-log {
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  color: #a0a0a0;
  min-height: 120px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.ota-progress-bar {
  margin-top: 10px;
  height: 6px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 3px;
  overflow: hidden;
}

.ota-progress-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.about-section {
  margin-bottom: 24px;
}

.about-support-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.about-support-row > div {
  flex: 1;
  min-width: 0;
}

.about-support-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  flex-shrink: 0;
}

.about-section h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #ffa500;
}

.about-section p {
  margin: 0;
  font-size: 14px;
  color: #ccc;
  line-height: 1.5;
}

.about-section a {
  color: #93c5fd;
  text-decoration: none;
}

.about-section a:hover {
  text-decoration: underline;
}

.cal-instructions {
  margin-bottom: 16px;
  color: #888;
}

.cal-tap-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cal-tap-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  background: #252525;
  color: #888;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
}

.cal-tap-btn:hover {
  background: #333;
  color: #ccc;
}

.cal-tap-btn.active {
  background: #2a4a6a;
  color: #93c5fd;
  border-color: #3a5a7a;
}

.cal-tap-btn.pouring {
  background: #1a4a1a;
  color: #22c55e;
  border-color: #2a6a2a;
}

.cal-tap-btn.wrong-pour {
  background: #4a1a1a;
  color: #f87171;
  border-color: #6a2a2a;
}

.cal-tap-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cal-sim-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.cal-sim-buttons.hidden {
  display: none;
}

.cal-pour-btn {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #333;
  color: #93c5fd;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
}

.cal-pour-btn:hover {
  background: #444;
}

.cal-main label {
  display: block;
  margin: 12px 0 4px 0;
  font-size: 13px;
  color: #888;
}

.cal-volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.cal-volume-row input[type="range"] {
  flex: 1;
  min-width: 0;
}

.btn-cal-adjust {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  background: #252525;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
}

.btn-cal-adjust:hover {
  background: #333;
}

.cal-data-row {
  display: flex;
  gap: 12px;
  margin: 12px 0 16px 0;
  flex-wrap: wrap;
}

.cal-data-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 100px;
}

.cal-data-block label {
  font-size: 13px;
  color: #888;
  margin: 0;
}

.cal-pulses {
  font-size: 24px;
  font-weight: 700;
  color: #ffa500;
}

.cal-data-block #cal-k-input {
  width: 100%;
  max-width: 120px;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 600;
  background: #252525;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
}

.cal-data-block #cal-k-input:not(:disabled)::-webkit-outer-spin-button,
.cal-data-block #cal-k-input:not(:disabled)::-webkit-inner-spin-button {
  opacity: 1;
}

.cal-data-block #cal-k-input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cal-current-k {
  font-size: 18px;
  font-weight: 600;
  color: #ffa500;
}

.cal-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 16px;
}

.cal-checkbox-label input {
  width: auto;
  margin: 0;
}

/* Leak detection */
.tap-card .status.leak { color: #f59e0b; font-weight: 700; }
.tap-card.leak { border-color: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.35); }

/* Drip test button */
.pour-btn.drip-btn {
  background: #292524;
  border-color: #57534e;
  color: #a8a29e;
}
.pour-btn.drip-btn.dripping {
  background: #78350f;
  border-color: #f59e0b;
  color: #fbbf24;
  animation: drip-pulse 1.2s ease-in-out infinite;
}
@keyframes drip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* Demo badge & notice */
.demo-badge {
  background: #ffc107;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  vertical-align: middle;
  flex-shrink: 0;
  position: absolute;
  z-index: 1;
}
.demo-badge-left {
  left: 33%;
  transform: translateX(-50%);
}
.demo-badge-right {
  right: 33%;
  transform: translateX(50%);
}
.demo-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Learn More button in header */
.btn-learn-more {
  background: #ffc107;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-decoration: none;
  position: absolute;
  z-index: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-learn-more:hover {
  background: #ffd54f;
}

/* Purchase button in header */
.btn-purchase {
  background: #22c55e;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-decoration: none;
  position: absolute;
  z-index: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-purchase:hover {
  background: #4ade80;
}

/* Demo splash modal */
.modal-splash {
  max-width: 480px;
}
.modal-splash h3 {
  text-align: center;
}
.splash-list {
  margin: 12px 0 16px 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: #ccc;
}
.splash-cta {
  text-align: center;
  font-size: 13px;
  color: #aaa;
  margin-top: 8px;
}
.splash-cta a {
  color: #22c55e;
  text-decoration: none;
  font-weight: 600;
}
.splash-cta a:hover {
  text-decoration: underline;
}
.modal-splash .modal-actions {
  justify-content: center;
}


/* ---- Pour Log ---- */

.log-graph-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.log-toggle-btn {
  background: #2a2a2a;
  color: #aaa;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.log-toggle-btn.active {
  background: #3a3a3a;
  color: #ffc107;
  border-color: #ffc107;
}

.log-graph {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
  min-height: 120px;
}
.log-graph-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-size: 13px;
}
.log-graph-label {
  width: 80px;
  text-align: right;
  padding-right: 8px;
  color: #aaa;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-graph-track {
  flex: 1;
  height: 18px;
  background: #222;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.log-graph-fill {
  height: 100%;
  border-radius: 3px;
  min-width: 2px;
}
.log-graph-val {
  width: 60px;
  text-align: right;
  padding-left: 6px;
  color: #ccc;
  font-size: 12px;
  flex-shrink: 0;
}
.log-graph-empty {
  color: #666;
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.log-table-wrap {
  overflow-x: auto;
}
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.log-table th {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 2px solid #444;
  color: #aaa;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}
.log-table th.sortable {
  cursor: pointer;
}
.log-table th.sortable:hover {
  color: #fff;
}
.log-table th.sort-active {
  color: #ffc107;
}
.log-table th.sort-active::after {
  content: ' \25B2';
  font-size: 10px;
}
.log-table th.sort-active.sort-desc::after {
  content: ' \25BC';
}
.log-table td {
  padding: 6px;
  border-bottom: 1px solid #2a2a2a;
  color: #ddd;
}
.log-table tr:hover td {
  background: #252525;
}
.log-table .log-no-data {
  text-align: center;
  color: #666;
  padding: 24px 6px;
}

