/* ==========================================================================
   BELER Carbon Calculator — complete styles
   Matches the site's design system: Fraunces + IBM Plex, green palette,
   warm paper background, editorial-scientific feel.
   ========================================================================== */

/* ---------- Hero ---------- */
.calc-hero {
  padding: clamp(112px, 17vh, 160px) 0 clamp(48px, 6vw, 72px);
  background:
    radial-gradient(120% 90% at 88% -10%, rgba(46,157,99,.10), transparent 55%),
    radial-gradient(90% 80% at -10% 110%, rgba(31,111,67,.07), transparent 50%),
    var(--paper);
  overflow: hidden;
}
.calc-hero__title {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(2.4rem, 1.4rem + 4.5vw, 4.8rem);
  line-height: 1.0;
  letter-spacing: -.018em;
  margin: 26px 0 0;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  color: var(--ink);
}
.calc-hero__lede {
  margin-top: 22px;
  max-width: 50ch;
  font-size: clamp(1.05rem, .98rem + .4vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
}
.calc-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--paper-2);
  font-size: .88rem;
  color: var(--ink-soft);
}
.calc-badge__num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--green-deep);
  font-size: .82rem;
}

/* ---------- App section ---------- */
.calc-app {
  padding-block: clamp(40px, 6vw, 72px);
  background: var(--paper);
}

/* ---------- Tier selector ---------- */
.calc-tier {
  margin-bottom: clamp(32px, 4vw, 48px);
}
.calc-tier__label {
  font-size: .82rem;
  color: var(--ink-faint);
  margin-bottom: 14px;
  letter-spacing: .04em;
}
.calc-tier__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.calc-tier__opt {
  cursor: pointer;
}
.calc-tier__opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.calc-tier__opt-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.calc-tier__opt input:focus-visible + .calc-tier__opt-inner {
  outline: 2.5px solid var(--green-bright);
  outline-offset: 3px;
}
.calc-tier__opt input:checked + .calc-tier__opt-inner {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 5%, var(--paper-2));
  box-shadow: var(--shadow-sm);
}
.calc-tier__opt:hover .calc-tier__opt-inner {
  border-color: var(--green-mid);
}
.calc-tier__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--green-deep);
}
.calc-tier__desc {
  font-size: .92rem;
  color: var(--ink-soft);
}
.calc-tier__acc {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* ---------- Region selector ---------- */
.calc-region {
  margin-bottom: clamp(32px, 4vw, 48px);
  max-width: 420px;
}
.calc-region__label {
  display: block;
  font-size: .82rem;
  color: var(--ink-faint);
  margin-bottom: 10px;
  letter-spacing: .04em;
}
.calc-region__select {
  position: relative;
}
.calc-region__select select {
  width: 100%;
  padding: 14px 44px 14px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  appearance: none;
  cursor: pointer;
  transition: border-color .25s var(--ease);
}
.calc-region__select select:hover {
  border-color: var(--green-mid);
}
.calc-region__select select:focus {
  outline: 2.5px solid var(--green-bright);
  outline-offset: 2px;
}
.calc-region__chev {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}
.calc-region__note {
  margin-top: 8px;
  font-size: .82rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ---------- Category tabs ---------- */
.calc-categories {
  margin-bottom: clamp(28px, 3.5vw, 40px);
}
.calc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.calc-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.calc-tab:hover {
  border-color: var(--green-mid);
  color: var(--green-deep);
}
.calc-tab.is-active {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 8%, var(--paper-2));
  color: var(--green-deep);
}
.calc-tab:focus-visible {
  outline: 2.5px solid var(--green-bright);
  outline-offset: 3px;
}
.calc-tab__icon {
  font-size: 1.1rem;
  line-height: 1;
}
.calc-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--line);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.calc-tab.is-active .calc-tab__count {
  background: var(--green);
  color: #fff;
}
.calc-tab:hover .calc-tab__count {
  background: var(--green-mid);
  color: #fff;
}

/* ---------- Item panels ---------- */
.calc-panel {
  display: none;
}
.calc-panel.is-active {
  display: block;
}
.calc-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ---------- Item card ---------- */
.calc-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.calc-item:hover {
  border-color: var(--green-mid);
}
.calc-item.has-value {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 4%, var(--paper-2));
}
.calc-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.calc-item__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.12rem;
  color: var(--ink);
  line-height: 1.2;
  flex: 1;
}
.calc-item__unit {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-faint);
  white-space: nowrap;
  padding-top: 3px;
  flex-shrink: 0;
}
.calc-item__remove {
  display: none;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  transition: background .2s var(--ease), color .2s var(--ease);
  flex-shrink: 0;
}
.calc-item__remove:hover {
  background: rgba(200, 50, 50, .1);
  color: #c0392b;
}
.calc-item.has-value .calc-item__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Item input ---------- */
.calc-item__input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.calc-item__input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .95rem;
  line-height: 1.4;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  -moz-appearance: textfield;
}
.calc-item__input::-webkit-outer-spin-button,
.calc-item__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-item__input::placeholder {
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: .88rem;
}
.calc-item__input:hover {
  border-color: var(--green-mid);
}
.calc-item__input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31,111,67,.10);
  background: var(--paper);
}
.calc-item__input.has-value {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 5%, var(--paper));
  color: var(--green-deep);
  font-weight: 600;
}

/* ---------- Live preview ---------- */
.calc-item__preview {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-faint);
  min-height: 1.3em;
  line-height: 1.4;
}
.calc-item__preview.has-value {
  color: var(--green-deep);
}

/* ---------- Comparison presets ---------- */
.calc-presets {
  margin-top: clamp(28px, 4vw, 40px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
}
.calc-presets__title {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  margin-bottom: 14px;
}
.calc-presets__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.calc-preset {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  text-align: left;
}
.calc-preset:hover {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 5%, var(--paper-2));
  color: var(--green-deep);
}
.calc-preset:focus-visible {
  outline: 2.5px solid var(--green-bright);
  outline-offset: 3px;
}
.calc-preset__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.calc-preset__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.calc-preset__label {
  font-weight: 600;
  color: var(--ink);
  font-size: .9rem;
}
.calc-preset__desc {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-faint);
  font-weight: 400;
}

/* ---------- Actions ---------- */
.calc-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.calc-shortcut {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-faint);
  margin-left: auto;
}
.calc-shortcut kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-soft);
  margin: 0 2px;
}

/* ---------- Results ---------- */
.calc-results {
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: clamp(40px, 6vw, 72px);
  border-top: 2px solid var(--green);
}
.calc-results__inner {
  display: grid;
  gap: clamp(36px, 5vw, 56px);
}

/* Total */
.calc-total {
  text-align: center;
  padding: clamp(32px, 5vw, 56px);
  background:
    radial-gradient(120% 90% at 88% -10%, rgba(46,157,99,.10), transparent 55%),
    var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.calc-total__label {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  margin-bottom: 12px;
}
.calc-total__value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.8rem, 1.8rem + 4vw, 4.5rem);
  line-height: 1.0;
  color: var(--green-deep);
  font-variation-settings: "opsz" 144;
}
.calc-total__value sub {
  font-size: .35em;
  bottom: .15em;
}
.calc-total__tier {
  margin-top: 14px;
  font-size: 1rem;
  color: var(--ink-soft);
}
.calc-total__tier strong {
  color: var(--green-deep);
}

/* Ring chart */
.calc-ring {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.calc-ring__svg {
  width: 200px;
  height: 200px;
}
.calc-ring__track {
  fill: none;
  stroke: var(--paper-band);
  stroke-width: 18;
}
.calc-ring__arc {
  fill: none;
  stroke-width: 18;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset .8s var(--ease);
}
.calc-ring__arc--food { stroke: #2E9D63; }
.calc-ring__arc--fuel { stroke: #357A52; }
.calc-ring__arc--grid_electricity { stroke: #1F6F43; }
.calc-ring__arc--transport { stroke: #2E9D63; }
.calc-ring__arc--goods { stroke: #8AA396; }
.calc-ring__label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  fill: var(--ink);
  font-weight: 500;
}
.calc-ring__value {
  font-family: var(--font-mono);
  font-size: .82rem;
  fill: var(--ink-faint);
}
.calc-ring__legend {
  display: grid;
  gap: 12px;
}
.calc-ring__legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
}
.calc-ring__legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
.calc-ring__legend-dot--food { background: #2E9D63; }
.calc-ring__legend-dot--fuel { background: #357A52; }
.calc-ring__legend-dot--grid_electricity { background: #1F6F43; }
.calc-ring__legend-dot--transport { background: #2E9D63; }
.calc-ring__legend-dot--goods { background: #8AA396; }
.calc-ring__legend-name {
  font-size: .92rem;
  color: var(--ink-soft);
}
.calc-ring__legend-val {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-faint);
}

/* Uncertainty */
.calc-uncertainty {
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.calc-uncertainty__title {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  margin-bottom: 14px;
}
.calc-uncertainty__bar {
  position: relative;
  height: 32px;
  background: var(--paper-band);
  border-radius: 100px;
  overflow: hidden;
}
.calc-uncertainty__range {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, color-mix(in srgb, var(--green) 40%, transparent) 100%);
  border-radius: 100px;
  opacity: .3;
}
.calc-uncertainty__point {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-deep);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 2px var(--green);
}
.calc-uncertainty__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-faint);
}

/* Detail table */
.calc-detail__title {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  margin-bottom: 16px;
}
.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.calc-table th,
.calc-table td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.calc-table th {
  background: var(--paper-band);
  color: var(--green-deep);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .02em;
}
.calc-table td {
  color: var(--ink-soft);
}
.calc-table td:first-child {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
}

/* Expandable detail rows */
.calc-table__row {
  cursor: pointer;
  transition: background .2s var(--ease);
}
.calc-table__row:hover {
  background: color-mix(in srgb, var(--green) 3%, transparent);
}
.calc-table__row td:first-child {
  position: relative;
  padding-left: 22px;
}
.calc-table__row td:first-child::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.calc-table__row:hover td:first-child::before {
  opacity: 1;
}
.calc-table__detail {
  display: none;
}
.calc-table__detail.is-open {
  display: table-row;
}
.calc-table__detail td {
  padding: 16px 22px;
  background: var(--paper-2);
  border-top: 1px solid var(--line-soft);
  font-size: .88rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.calc-table__detail-inner {
  display: grid;
  gap: 8px;
}
.calc-table__detail-row {
  display: flex;
  gap: 8px;
}
.calc-table__detail-label {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-faint);
  min-width: 100px;
  flex-shrink: 0;
}
.calc-table__detail-val {
  color: var(--ink-soft);
}

/* Gaps */
.calc-gaps {
  padding: 24px;
  background: color-mix(in srgb, var(--ink) 3%, var(--paper-2));
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-faint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.calc-gaps__title {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.calc-gaps__note {
  font-size: .88rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.calc-gaps__list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}
.calc-gaps__list li {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-soft);
  padding: 8px 12px;
  background: var(--paper);
  border-radius: var(--radius-sm);
}

/* Share */
.calc-share {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.calc-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.calc-share__btn:hover {
  border-color: var(--green);
  color: var(--green-deep);
}
.calc-share__btn svg {
  width: 16px;
  height: 16px;
}
.calc-share__toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  background: var(--green-deep);
  color: var(--on-dark);
  border-radius: 100px;
  font-size: .92rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 200;
  pointer-events: none;
}
.calc-share__toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Methodology */
.calc-method {
  padding: 28px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.calc-method__title {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  margin-bottom: 14px;
}
.calc-method p {
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 10px;
}
.calc-method a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-color: rgba(31,111,67,.35);
  text-underline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .calc-tier__options { grid-template-columns: 1fr; }
  .calc-tabs { gap: 6px; }
  .calc-tab { padding: 10px 14px; font-size: .85rem; }
  .calc-tab__icon { font-size: 1rem; }
  .calc-panel__grid { grid-template-columns: 1fr; }
  .calc-actions { flex-direction: column; align-items: stretch; }
  .calc-actions .btn { width: 100%; justify-content: center; }
  .calc-shortcut { margin-left: 0; text-align: center; }
  .calc-ring { grid-template-columns: 1fr; justify-items: center; }
  .calc-ring__svg { width: 160px; height: 160px; }
  .calc-share { flex-direction: column; }
  .calc-presets__grid { flex-direction: column; }
}

@media (max-width: 480px) {
  .calc-hero__badges { flex-direction: column; gap: 8px; }
  .calc-badge { justify-content: center; }
  .calc-table th, .calc-table td { padding: 8px 10px; font-size: .85rem; }
}

/* ==========================================================================
   Preset v3: Quick Pick cards + Dropdown triggers + Active chips
   ========================================================================== */

.calc-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.calc-quick-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.calc-preset-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  cursor: pointer;
  transition: all .2s ease;
  text-align: left;
  font-family: var(--font-body);
  color: var(--ink);
  min-width: 160px;
  flex: 0 1 auto;
}
.calc-preset-card:hover {
  border-color: var(--green);
  background: rgba(31,111,67,.04);
  box-shadow: 0 2px 12px rgba(31,111,67,.08);
}
.calc-preset-card.is-active {
  border-color: var(--green);
  background: rgba(31,111,67,.08);
  box-shadow: 0 0 0 2px rgba(31,111,67,.15);
}
.calc-preset-card__icon { font-size: 1.5rem; flex-shrink: 0; }
.calc-preset-card__text { display: flex; flex-direction: column; gap: 2px; }
.calc-preset-card__label { font-weight: 600; font-size: .95rem; line-height: 1.2; }
.calc-preset-card__desc { font-size: .78rem; color: var(--ink-faint); line-height: 1.3; }

.calc-dropdown-triggers { display: flex; flex-wrap: wrap; gap: 8px; }

.calc-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--ink-soft);
  transition: all .2s ease;
  white-space: nowrap;
}
.calc-dropdown-trigger:hover { border-color: var(--green); color: var(--green); background: rgba(31,111,67,.04); }
.calc-dropdown-trigger__icon { font-size: 1rem; }
.calc-dropdown-trigger__chev { font-size: .7rem; margin-left: 2px; opacity: .6; }

.calc-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.calc-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(31,111,67,.10);
  border: 1px solid rgba(31,111,67,.25);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--green);
}
.calc-active-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(31,111,67,.15);
  color: var(--green);
  font-size: .75rem;
  cursor: pointer;
  padding: 0; line-height: 1;
  transition: background .15s;
}
.calc-active-chip__remove:hover { background: rgba(31,111,67,.30); }

.calc-dropdown-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.calc-dropdown-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.40); backdrop-filter: blur(4px); }
.calc-dropdown-modal__panel {
  position: relative; z-index: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  width: min(560px, 92vw);
  max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.calc-dropdown-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.calc-dropdown-modal__header h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; margin: 0; }
.calc-dropdown-modal__close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background .15s;
}
.calc-dropdown-modal__close:hover { background: var(--line); }
.calc-dropdown-modal__items { overflow-y: auto; padding: 12px 24px 20px; }

.calc-dropdown-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "icon label qty" "icon timeframe add";
  gap: 6px 14px; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.calc-dropdown-item:last-child { border-bottom: none; }
.calc-dropdown-item__icon { grid-area: icon; font-size: 1.3rem; }
.calc-dropdown-item__label { grid-area: label; font-weight: 500; font-size: .92rem; }
.calc-dropdown-item__qty { grid-area: qty; display: flex; align-items: center; gap: 6px; }
.calc-dropdown-item__qty-label { font-size: .75rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.calc-dropdown-item__input {
  width: 72px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper-2);
  font-family: var(--font-mono); font-size: .85rem;
  color: var(--ink); text-align: right;
  -moz-appearance: textfield;
}
.calc-dropdown-item__input::-webkit-outer-spin-button,
.calc-dropdown-item__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-dropdown-item__timeframe { grid-area: timeframe; display: flex; flex-wrap: wrap; gap: 10px; }
.calc-dropdown-item__timeframe label { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--ink-soft); cursor: pointer; }
.calc-dropdown-item__timeframe input[type="radio"] { accent-color: var(--green); }
.calc-dropdown-item__add {
  grid-area: add;
  padding: 8px 16px;
  border: 1.5px solid var(--green); border-radius: 10px;
  background: transparent; color: var(--green);
  font-family: var(--font-body); font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.calc-dropdown-item__add:hover { background: var(--green); color: #fff; }

@media (max-width: 720px) {
  .calc-quick-presets .calc-preset-card ~ .calc-preset-card ~ .calc-preset-card ~ .calc-preset-card { flex: 1 1 100%; }
}

/* Country dropdown items: flex row layout */
.calc-dropdown-item__desc {
  font-size: .78rem;
  color: var(--ink-faint);
  margin-top: 2px;
}
.calc-dropdown-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.calc-dropdown-item--country {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.calc-dropdown-item--country .calc-dropdown-item__icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.calc-dropdown-item--country .calc-dropdown-item__add {
  flex-shrink: 0;
}
