:root {
  --accent: #1dcf9f;          /* requested theme */
  --accent-600: #18b98d;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #1d232a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ring: rgba(29, 207, 159, 0.35);
}

.uif-wrap[data-theme="dark"] {
  --bg: #0f1216;
  --card: #12171d;
  --text: #e5e7eb;
  --muted: #9aa3af;
  --border: #272c33;
  --ring: rgba(29, 207, 159, 0.45);
}

.uif-wrap {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

.uif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.uif-header h2 {
  font-size: 1.35rem;
  margin: 0;
}

.uif-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.uif-section-title {
  margin: 6px 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.uif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .uif-grid { grid-template-columns: 1fr; }
}

.uif-field label {
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.uif-input-prefix {
  position: relative;
  display: flex;
  align-items: center;
}
.uif-input-prefix > span {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}
.uif-input-prefix input {
  padding-left: 30px !important;
}

.uif-field input, .uif-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  outline: none;
  transition: box-shadow .2s, border-color .2s;
}
.uif-field input:focus, .uif-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.uif-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
}

.uif-inline {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.uif-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.uif-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .04s ease, box-shadow .2s, border-color .2s, background .2s;
}
.uif-btn:hover { transform: translateY(-1px); }
.uif-btn:active { transform: translateY(0); }

.uif-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1412;
  font-weight: 700;
}
.uif-btn.outline {
  border-color: var(--accent);
}
.uif-btn.ghost {
  background: transparent;
  border-color: var(--border);
}

.uif-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) {
  .uif-results-grid { grid-template-columns: 1fr; }
}

.uif-result {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px;
}
.uif-result.total {
  grid-column: 1 / -1;
  background: linear-gradient(0deg, rgba(29,207,159,0.1), rgba(29,207,159,0.1));
  border-color: var(--accent);
}
.uif-result .uif-label {
  color: var(--muted);
  font-size: 0.85rem;
}
.uif-result .uif-value {
  font-weight: 800;
  font-size: 1.1rem;
}

.tip-btn {
  border: 1px dashed var(--border);
  background: transparent;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
  color: var(--muted);
}
.tip-btn.sm { font-size: 0.8rem; padding: 1px 6px; }

.tip-bubble {
  position: fixed;
  max-width: 320px;
  z-index: 9999;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: none;
}

.uif-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,0.18) !important;
}

.uif-toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.18);
  z-index: 9999;
  display: none;
  max-width: 90vw;
  text-align: center;
  font-size: 0.9rem;
}