html, body {
  width: 100%;
  overflow-x: hidden;
}

:root {
  --bg: #0b0c10;
  --card: #12141a;
  --text: #e9eef7;
  --muted: #a7b0c0;
  --border: #2a2f3a;
  --focus: #7aa2ff;
  --danger: #ff6b6b;
  --radius: 16px;
}
[data-theme="light"] {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #12141a;
  --muted: #5f6776;
  --border: #d8dce6;
  --focus: #4c6fff;
  --danger: #e5484d;
}


.theme-toggle {
  align-self: flex-end;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* Chrome, Edge, Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}
/* * { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
} */



*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(255,255,255,.06), transparent 60%),
              radial-gradient(1000px 600px at 90% 20%, rgba(255,255,255,.05), transparent 55%),
              var(--bg);
  color: var(--text);
}

.hidden {
  display: none;
}

.container {
  padding: 16px;
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

h1 {
  margin: 8px 0 4px;
  font-size: 24px;
  letter-spacing: 0.2px;
}

.card {
  /* background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px; */

    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.field { margin-bottom: 12px; }
.field:last-of-type { margin-bottom: 14px; }

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}

input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  caret-color: var(--text);
  padding: 12px 12px;
  font-size: 16px;
}

input::placeholder { color: rgba(233, 238, 247, 0.35); }

.currency-toggle {
  border: 0;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 0 12px;
  min-width: 74px;
  font-weight: 600;
  cursor: pointer;
  border-left: 1px solid var(--border);
}

.currency-toggle:active { transform: scale(0.98); }

.input-wrap:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.18);
}

.hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.primary {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.primary:active { transform: scale(0.99); }

.results h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.rows { display: grid; gap: 10px; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.row span { color: var(--muted); font-size: 13px; }
.row strong { font-size: 16px; }

.total strong { font-size: 18px; }

.bad {
  color: var(--danger);
  font-weight: 700;
}


.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--muted);
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  position: relative;
  transition: 0.2s ease;
}

.switch-ui::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--text);
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: 0.2s ease;
}

.switch input:checked + .switch-ui {
  background: rgba(122, 162, 255, 0.25);
  border-color: var(--focus);
}

.switch input:checked + .switch-ui::after {
  left: 21px;
}

.switch-text {
  white-space: nowrap;
}

.value-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.resto-hint {
  font-size: 12px;
  color: var(--danger);
  line-height: 1;
}

.negative {
  color: var(--danger);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 12px 16px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.06),
    rgba(255,255,255,.02)
  );
  backdrop-filter: blur(8px);

  border-bottom: 1px solid var(--border);
}

.app-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.app-header .theme-toggle {
  font-size: 16px;
  padding: 6px 8px;
}




/* new resizable screen */

body {
  min-height: 100dvh;
}

.app-header {
  position: static; 
}

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px 16px;
}


.app-layout {
  display: grid;
  grid-template-rows: auto auto; 
  gap: 10px;
}

.card {
  padding: 12px;
}

.field { margin-bottom: 10px; }
label { margin-bottom: 6px; }
input { padding: 10px 12px; }
.row { padding: 9px 10px; }

.row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-logo {
  height: 24px;
  width: 24px;
}
.app-branding {
  display: flex;
  align-items: center;
  gap: 8px;

    text-decoration: none;   /* remove underline */
  color: inherit;          /* inherit text color */

}
.app-branding:hover .app-title {
  opacity: 0.85;
}

@media (max-height: 700px) {
  .card { padding: 10px; }
  input { padding: 9px 10px; }
  .row { padding: 8px 10px; }
}
 

/* Motion-safe: disable animations for users who prefer reduced motion */
/* @media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
} */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Subtle load-in */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Quick pop when value updates */
@keyframes pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Tiny shake for insufficient funds */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

/* Apply load animation to cards */
.card { animation: riseIn 320ms ease both; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Make the second field animate in (instead of display:none) */
.hidden { display: none; }

/* We'll use a "collapsible" style instead of hidden for animation */
.collapsible {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 220ms ease, opacity 220ms ease, transform 220ms ease;
}

.collapsible.is-open {
  max-height: 130px; /* enough for your field; can increase if needed */
  opacity: 1;
  transform: translateY(0);
}

/* Resto value animation classes (triggered by JS) */
.result-pop {
  animation: pop 160ms ease;
}

.result-shake {
  animation: shake 180ms ease;
}

.currency-toggle,
.theme-toggle {
  transition: transform 120ms ease, opacity 120ms ease;
}

.currency-toggle:active,
.theme-toggle:active {
  transform: scale(0.97);
}

.result-pop { animation: pop 180ms ease; }
.result-shake { animation: shake 220ms ease; }


.app-footer {
  margin-top: 12px;
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  color: var(--muted);
  font-size: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.divider {
  opacity: 0.6;
}

.footer-note {
  opacity: 0.6;
}

.app-footer {
  border-top: 1px solid var(--border);
}

/* Info page headings/links */
.page-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.page-title{
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  font-weight: 700;
}
.page-link{
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.page-link:hover{ color: var(--text); text-decoration: underline; }
.muted{ color: var(--muted); font-size: 13px; margin: 8px 0; }

.source-link{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
}
.source-link:hover{ border-bottom-color: var(--text); }

/* Accordion (no Bootstrap) */
.accordion{ display:grid; gap: 10px; margin-top: 6px; }
.acc-item{
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.acc-btn{
  list-style: none;
  cursor: pointer;
  padding: 12px 12px;
  font-weight: 700;
  color: var(--text);
  user-select: none;
}
.acc-btn::-webkit-details-marker{ display:none; }
.acc-btn::after{
  content: "▾";
  float: right;
  opacity: 0.7;
}
.acc-item[open] .acc-btn::after{ content: "▴"; }

.acc-content{
  padding: 0 12px 12px;
  color: var(--text);
}
.acc-content p{ margin: 10px 0; color: var(--text); }
.acc-content ul{ margin: 8px 0 0 18px; color: var(--text); }
.acc-content li{ margin: 6px 0; }

/* Feedback form controls */
select, textarea{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}
textarea{ resize: vertical; min-height: 110px; }

select:focus, textarea:focus{
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(122,162,255,0.18);
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.github-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}