/* (c) ChrysoKit . chrysokit.com . build 20260510a . tip-calculator.css */

.tip-grid {
  --t-primary:      var(--ck-primary,      var(--primary,      #D4A373));
  --t-primary-soft: rgba(212, 163, 115, 0.12);
  --t-primary-glow: rgba(212, 163, 115, 0.32);
  --t-accent:       var(--ck-accent,       var(--accent,       #8FA98E));
  --t-tip-color:    #C9885E;
  --t-bg:           var(--ck-bg,           var(--bg,           #FAF6E8));
  --t-card:         var(--ck-card,         var(--card,         #ffffff));
  --t-text:         var(--ck-text,         var(--text,         #1A1714));
  --t-text-soft:    var(--ck-text-soft,    var(--text-soft,    #6b6157));
  --t-text-mute:    var(--ck-text-mute,    var(--text-mute,    #b4a99c));
  --t-border:       var(--ck-border,       var(--border,       rgba(0,0,0,0.08)));

  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) { .tip-grid { grid-template-columns: 1fr; } }

[data-theme="dark"] .tip-grid {
  --t-primary-soft: rgba(212, 163, 115, 0.18);
  --t-bg:        rgba(255, 255, 255, 0.04);
  --t-card:      rgba(0, 0, 0, 0.22);
  --t-text:      #FEFAE0;
  --t-text-soft: #c8bdb1;
  --t-text-mute: rgba(255, 255, 255, 0.42);
  --t-border:    rgba(255, 255, 255, 0.08);
}

.tip-inputs { display: flex; flex-direction: column; gap: 22px; }

.tip-section {
  padding: 18px;
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  border-radius: 14px;
}

.tip-section-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--t-text-soft);
  margin-bottom: 14px;
}
.tip-section-head i { width: 16px; height: 16px; }

.tip-row {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px;
}
@media (max-width: 560px) { .tip-row { grid-template-columns: 1fr; } }

.tip-currency {
  display: flex; align-items: stretch;
  border: 1px solid var(--t-border);
  border-radius: 10px;
  background: var(--t-card);
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.tip-currency:focus-within {
  border-color: var(--t-primary);
  box-shadow: 0 0 0 3px var(--t-primary-glow);
}
.tip-currency select {
  border: 0; background: transparent;
  padding: 0 10px;
  font: inherit; font-weight: 700;
  color: var(--t-primary);
  border-right: 1px solid var(--t-border);
  cursor: pointer;
  min-width: 64px;
}
.tip-currency input {
  flex: 1 1 auto; min-width: 0;
  border: 0; background: transparent;
  padding: 12px 14px;
  font: inherit; font-size: 1.05rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
  color: var(--t-text);
  width: 100%;
}

.tip-stepper {
  display: flex; align-items: stretch;
  border: 1px solid var(--t-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--t-card);
}
.tip-stepper button {
  width: 42px; border: 0; background: transparent;
  cursor: pointer;
  color: var(--t-text-soft);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.tip-stepper button:hover { background: var(--t-primary-soft); color: var(--t-primary); }
.tip-stepper button:active { transform: scale(0.94); }
.tip-stepper button i { width: 16px; height: 16px; }
.tip-stepper input {
  flex: 1 1 auto; min-width: 0;
  border: 0; background: transparent;
  padding: 12px 8px;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  text-align: center; font-variant-numeric: tabular-nums;
  outline: none; color: var(--t-text);
  -moz-appearance: textfield;
  width: 100%;
}
.tip-stepper input::-webkit-outer-spin-button,
.tip-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tip-quality {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
@media (max-width: 720px) { .tip-quality { grid-template-columns: repeat(3, 1fr); } }

.tq {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px;
  font: inherit;
  background: var(--t-card);
  border: 1px solid var(--t-border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--t-text);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, background 0.18s;
}
.tq:hover { transform: translateY(-2px); border-color: var(--t-primary); }
.tq.is-active {
  background: var(--t-primary);
  border-color: var(--t-primary);
  color: #fff;
  box-shadow: 0 6px 18px var(--t-primary-glow);
  transform: translateY(-2px);
}
.tq.is-active .pct, .tq.is-active .lbl { color: #fff; }
.tq .emoji { font-size: 1.3rem; line-height: 1; }
.tq .lbl { font-size: 0.78rem; font-weight: 600; color: var(--t-text-soft); }
.tq .pct { font-size: 0.92rem; font-weight: 800; color: var(--t-text); font-variant-numeric: tabular-nums; }

.tip-slider-wrap {
  padding: 14px;
  background: var(--t-card);
  border: 1px solid var(--t-border);
  border-radius: 12px;
}
.tip-slider-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tip-slider-head label { font-weight: 600; font-size: 0.92rem; color: var(--t-text-soft); }
.tip-pct-readout {
  font-weight: 800; font-size: 1.1rem;
  color: var(--t-primary);
  font-variant-numeric: tabular-nums;
  padding: 2px 10px;
  background: var(--t-primary-soft);
  border-radius: 6px;
}

input[type="range"]#tipPct {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: linear-gradient(to right, var(--t-primary) 0%, var(--t-primary) var(--pct, 37.5%), var(--t-border) var(--pct, 37.5%), var(--t-border) 100%);
  border-radius: 999px;
  outline: none;
}
input[type="range"]#tipPct::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  background: #fff;
  border: 3px solid var(--t-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s;
}
input[type="range"]#tipPct::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]#tipPct::-moz-range-thumb {
  width: 22px; height: 22px;
  background: #fff;
  border: 3px solid var(--t-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.tip-ticks {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--t-text-mute);
  font-variant-numeric: tabular-nums;
}

.tip-toggles { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }

.tip-toggle {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.tip-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.tk-track {
  position: relative;
  flex: 0 0 auto;
  width: 40px; height: 22px;
  background: var(--t-border);
  border-radius: 999px;
  transition: background 0.2s;
}
.tk-track::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.tip-toggle input:checked + .tk-track { background: var(--t-primary); }
.tip-toggle input:checked + .tk-track::after { left: 20px; }

.tip-toggle .lbl { font-weight: 600; font-size: 0.95rem; color: var(--t-text); }

.tip-tax-field { margin: 6px 0; }

.tip-suffix { position: relative; display: flex; align-items: stretch; }
.tip-suffix input { flex: 1 1 auto; padding-right: 38px; min-width: 0; }
.tip-suffix span {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: var(--t-text-soft); pointer-events: none;
}

.tip-summary { position: sticky; top: 88px; }

.tip-summary-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px 0;
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--t-text-soft);
}
.tip-summary-title i { width: 16px; height: 16px; }

.tip-pp {
  text-align: center;
  padding: 22px;
  background: linear-gradient(135deg, rgba(212, 163, 115, 0.10), rgba(143, 169, 142, 0.06));
  border-radius: 14px;
  margin-bottom: 18px;
}
[data-theme="dark"] .tip-pp { background: linear-gradient(135deg, rgba(212, 163, 115, 0.16), rgba(143, 169, 142, 0.10)); }
.tip-pp-amount {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  color: var(--t-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  word-break: break-word;
}
.tip-pp-sub { color: var(--t-text-soft); font-size: 0.92rem; margin-top: 4px; }

.tip-vis {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.tip-vis svg { width: 200px; height: 200px; }

.tip-legend {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  justify-content: center;
}
.tip-legend li {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem;
  color: var(--t-text-soft);
}
.tip-legend .swatch { width: 12px; height: 12px; border-radius: 3px; }
.tip-legend .v {
  font-weight: 700;
  color: var(--t-text);
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}

.tip-stats {
  display: grid; gap: 8px; margin: 0;
  padding: 16px;
  background: var(--t-bg);
  border-radius: 12px;
}
.tip-stats > div {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0;
}
.tip-stats > div + div {
  border-top: 1px dashed var(--t-border);
  padding-top: 8px; margin-top: 4px;
}
.tip-stats dt { font-size: 0.92rem; color: var(--t-text-soft); margin: 0; }
.tip-stats dd {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0;
  color: var(--t-text);
}
.tip-stats #tipStatTipPct { font-weight: 600; color: var(--t-text-mute); margin-left: 4px; }
.tip-stats .total dt, .tip-stats .total dd {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--t-text);
}
.tip-stats .total {
  padding-top: 10px;
  border-top: 1px solid var(--t-border) !important;
  margin-top: 6px;
}
.tip-stats .rounded dd { color: var(--t-primary); }

.tip-actions { justify-content: flex-end; flex-wrap: wrap; }

.btn-quiet {
  background: transparent;
  color: var(--t-text-soft);
  border: 1px solid transparent;
}
.btn-quiet:hover { background: rgba(0, 0, 0, 0.05); color: var(--t-text); }
[data-theme="dark"] .btn-quiet:hover { background: rgba(255, 255, 255, 0.08); }

.tip-ref { list-style: none; padding: 0; display: grid; gap: 8px; }
.tip-ref li {
  padding: 10px 14px;
  background: var(--t-bg);
  border-left: 3px solid var(--t-primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  color: var(--t-text);
}
