/* Global styles for Compound Returns Calculator */

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.card {
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240);
  background: #fff;
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  min-width: 0;
}

[data-theme="dark"] .card {
  background: rgb(15 23 42);
  border-color: rgb(30 41 59);
}

.card h2 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.metric {
  border-radius: .75rem;
  border: 1px solid rgb(226 232 240);
  background: #fff;
  padding: .7rem;
}

[data-theme="dark"] .metric {
  background: rgb(15 23 42);
  border-color: rgb(30 41 59);
}

.field {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.field > span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgb(100 116 139);
  padding-left: 0.35rem;
}

.field input,
.field select {
  border: 1px solid rgb(226 232 240);
  border-radius: .4rem;
  padding: .3rem .5rem;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  width: 100%;
  color: inherit;
  box-sizing: border-box;
}

.field input:disabled,
.field select:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: .6;
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select {
  background: rgb(2 6 23);
  border-color: rgb(51 65 85);
}

[data-theme="dark"] .field input:disabled,
[data-theme="dark"] .field select:disabled {
  background: rgb(15 23 42);
  color: rgb(100 116 139);
  opacity: .5;
}

.pbtn {
  padding: .2rem .5rem;
  border-radius: .5rem;
  font-size: .75rem;
  border: 1px solid rgb(226 232 240);
  line-height: 1.2;
}

[data-theme="dark"] .pbtn {
  border-color: rgb(51 65 85);
}

.pbtn:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.preset-btn {
  border: 1px solid rgb(226 232 240);
  border-radius: 9999px;
  padding: .4rem .9rem;
  font-size: .8rem;
  background: #fff;
  white-space: nowrap;
}

.preset-btn:hover {
  border-color: rgb(16 185 129);
  color: rgb(5 150 105);
}

[data-theme="dark"] .preset-btn {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
}

.num {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .75rem;
  padding: .35rem .5rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.btn-primary {
  border-radius: .75rem;
  background: rgb(4 120 87);
  color: #fff;
  padding: .6rem 1.1rem;
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
}

.btn-primary:hover {
  background: rgb(6 95 70);
}

.btn-secondary {
  border-radius: .75rem;
  border: 1px solid rgb(226 232 240);
  padding: .6rem 1.1rem;
  font-size: .9rem;
  white-space: nowrap;
}

[data-theme="dark"] .btn-secondary {
  border-color: rgb(51 65 85);
}

@media (min-width: 768px) {
  .card {
    padding: 1rem;
  }
  .field {
    gap: .25rem;
  }
  .field > span {
    font-size: .68rem;
  }
  .field input,
  .field select {
    font-size: .85rem;
    padding: .4rem .55rem;
    border-radius: .5rem;
  }
  .card h2 {
    font-size: 1.2rem;
    margin-bottom: .75rem;
  }
  .pbtn {
    font-size: .83rem;
    padding: .28rem .55rem;
  }
  .preset-btn {
    font-size: .83rem;
    padding: .45rem 1rem;
  }
  .num {
    font-size: .8rem;
    padding: .38rem .55rem;
  }
  .btn-primary,
  .btn-secondary {
    font-size: .95rem;
    padding: .7rem 1.4rem;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 0.75rem;
  }
  .card h2 {
    font-size: 1.1rem;
    margin-bottom: .5rem;
  }
  .metric {
    padding: .6rem;
  }
  .metric > div:first-child {
    font-size: .6rem !important;
  }
  .metric > div:nth-child(2) {
    font-size: .9rem !important;
  }
  .field > span {
    font-size: .6rem;
  }
  .field input,
  .field select {
    font-size: .8rem;
    padding: .35rem .5rem;
  }
  .num {
    font-size: .75rem;
    padding: .3rem .4rem;
  }
  .btn-primary,
  .btn-secondary {
    font-size: .85rem;
    padding: .6rem .8rem;
    white-space: nowrap;
    line-height: 1.2;
  }
}

@media (max-width: 640px) {
  .presets-row {
    gap: .25rem;
  }
  .presets-row h2 {
    font-size: .7rem;
  }
  .preset-btn {
    font-size: .56rem;
    padding: .16rem .36rem;
  }
}

.card > * {
  min-width: 0;
}

.metric > div:nth-child(2),
.metric > div:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.overflow-auto {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid rgb(16 185 129);
  outline-offset: 2px;
}

.pbtn:focus-visible,
.preset-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid rgb(16 185 129);
  outline-offset: 2px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.25,0.46,0.45,0.94), transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay {
  transition-delay: 0.15s;
}

@media (max-width: 767px) {
  .reveal-delay {
    transition-delay: 0s;
  }
}

