:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --text-secondary: #78716c;
  --border: #e7e5e4;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --accent-dark: #92400e;
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html {
  scroll-behavior: smooth;
}
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
header {
  padding: 32px 0 24px;
  text-align: center;
}
.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.logo span {
  color: var(--accent);
}
header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
  font-weight: 300;
}

/* Price Banner */
.price-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.price-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.price-banner-header h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}
.price-date {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
}
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.price-item {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: 8px;
}
.price-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.price-value {
  font-size: 22px;
  font-weight: 700;
}
.price-value small {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}
.price-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.price-change {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}
.price-change.up {
  background: var(--red-light);
  color: var(--red);
}
.price-change.down {
  background: var(--green-light);
  color: var(--green);
}
.price-change.same {
  background: var(--bg);
  color: var(--text-secondary);
}

/* Ad slots */
.ad-slot {
  margin: 16px 0;
  min-height: 50px;
  text-align: center;
  overflow: hidden;
}
.ad-placeholder {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 18px 12px;
  color: var(--text-secondary);
  font-size: 12px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(0, 0, 0, 0.015) 8px,
    rgba(0, 0, 0, 0.015) 16px
  );
}
.ad-placeholder .ad-label {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  color: var(--border);
}

/* Self-promo cards (replaces ads when adsense disabled) */
.promo-slot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.promo-card {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  height: 100px;
  background-size: cover;
  background-position: center;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.promo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.promo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.25) 100%
  );
}
.promo-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 16px;
}
.promo-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 6px;
}
.promo-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.promo-desc {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* BUDI banner */
.budi-banner {
  background: var(--accent-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--accent-dark);
  line-height: 1.5;
}
.budi-banner strong {
  font-weight: 600;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Form */
.field {
  margin-bottom: 18px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field select,
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2378716C' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.field .hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Sections */
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.toggle-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  transition: background 0.2s;
}
.toggle-extra:hover {
  background: var(--border);
}
.toggle-extra .toggle-icon {
  transition: transform 0.2s;
  font-size: 10px;
}
.toggle-extra.open .toggle-icon {
  transform: rotate(90deg);
}
.extra-fields {
  display: none;
  margin-bottom: 4px;
}
.extra-fields.show {
  display: block;
}

/* Results */
.results {
  display: none;
}
.results.show {
  display: block;
}
.result-hero {
  text-align: center;
  padding: 28px 20px;
  background: var(--text);
  color: white;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.result-hero .label {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 4px;
}
.result-hero .amount {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
}
.result-hero .amount small {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.6;
}
.result-hero .sub {
  font-size: 13px;
  opacity: 0.5;
  margin-top: 8px;
}

.result-breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child {
  border-bottom: none;
}
.result-row .rlabel {
  font-size: 14px;
  color: var(--text-secondary);
}
.result-row .rvalue {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}
.result-row .rsub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Quota */
.quota-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.quota-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quota-bar-track {
  background: var(--bg);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.quota-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}
.quota-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}
.quota-warning {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.quota-warning.safe {
  background: var(--green-light);
  color: #166534;
}
.quota-warning.warn {
  background: var(--accent-light);
  color: var(--accent-dark);
}
.quota-warning.over {
  background: var(--red-light);
  color: #991b1b;
}

/* Compare table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
}
.compare-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}
.compare-table td {
  font-size: 14px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.compare-table tr:last-child td {
  border-bottom: none;
}
.compare-table .highlight {
  background: var(--green-light);
  font-weight: 600;
}
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--green);
  color: white;
  margin-left: 6px;
  vertical-align: middle;
}

/* Footer */
footer {
  text-align: left;
  padding: 32px 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
}
footer a {
  color: var(--accent);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}
footer h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 16px;
  margin-bottom: 4px;
}
footer h3:first-child {
  margin-top: 0;
}
footer .footer-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0 20px;
}
footer .footer-bottom {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.brand-flag {
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.threads-link {
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
}

.threads-link:hover {
  text-decoration: underline;
}

/* Loading */
.loading {
  text-align: center;
  padding: 16px;
}
.loading-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 2px;
  animation: bounce 1.4s infinite ease-in-out both;
}
.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Button */
.btn {
  width: 100%;
  padding: 14px;
  background: var(--text);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 8px;
}
.btn:hover {
  opacity: 0.85;
}
.btn:active {
  transform: scale(0.99);
}

/* Responsive */
@media (max-width: 380px) {
  .price-grid {
    gap: 6px;
  }
  .price-value {
    font-size: 18px;
  }
  .result-hero .amount {
    font-size: 36px;
  }
}
