/* ==========================================================================
   NaceňTo.online - styly
   Mobile-first, plně responzivní, bez závislostí
   ========================================================================== */

/* --- Reset a základ --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

/* HTML5 [hidden] atribut musí přebít explicitní display: flex/grid/atd. */
[hidden] { display: none !important; }

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --border: #e7e5e4;
  --border-soft: #f0eee8;
  --text: #1c1917;
  --text-muted: #57534e;
  --text-subtle: #78716c;
  --text-faint: #a8a29e;

  --accent: #1c1917;
  --accent-text: #ffffff;

  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;

  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-text: #991b1b;
  --error: #dc2626;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-pop: 0 -8px 24px rgba(0,0,0,0.08);

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Header ----------------------------------------------------------- */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-name {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.brand-tld { color: var(--text-faint); font-weight: 400; }
.brand-tagline {
  font-size: 11px;
  color: var(--text-subtle);
  line-height: 1.2;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { background: #292524; }
.btn-primary:disabled {
  background: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.6;
}
.btn-icon { padding: 10px 12px; flex-shrink: 0; }

/* Schovat label tlačítek na úzkých displejích */
@media (max-width: 540px) {
  .btn-label { display: none; }
  .btn { padding: 8px 10px; }
}

/* --- Main layout ------------------------------------------------------ */
.app-main {
  padding: 16px 16px 200px;
}
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 1024px) {
  .app-main { padding-bottom: 32px; }
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 24px;
    align-items: start;
  }
}
.layout-inputs { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.layout-results { display: none; }
@media (min-width: 1024px) {
  .layout-results { display: block; }
}
.results-sticky {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Cards ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
@media (min-width: 640px) {
  .card { padding: 20px; }
}
.card-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.card-label-inline {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.card-label-sm {
  display: block;
  font-size: 12px;
  color: var(--text-subtle);
  margin-bottom: 6px;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.card-help {
  font-size: 12px;
  color: var(--text-subtle);
  margin-bottom: 12px;
}
.card-help-sm {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  line-height: 1.4;
}
.card-collapsible { padding: 0; overflow: hidden; }
.card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s;
}
@media (min-width: 640px) {
  .card-toggle { padding: 14px 20px; }
}
.card-toggle:hover { background: var(--surface-2); }
.card-toggle-left { display: flex; align-items: center; gap: 8px; }
.card-toggle .chevron { color: var(--text-faint); transition: transform 0.2s; }
.card-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.card-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 640px) {
  .card-body { padding: 0 20px 20px; }
}
.advanced-row { padding-top: 12px; }

/* --- Mode toggle ------------------------------------------------------ */
.mode-toggle {
  padding: 4px;
  display: flex;
  gap: 4px;
}
.mode-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
  text-align: center;
  line-height: 1.2;
}
.mode-btn:hover { background: var(--surface-2); }
.mode-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}
.mode-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 540px) {
  .mode-btn { font-size: 12px; padding: 10px 6px; }
  .mode-btn svg { display: none; }
  .mode-btn span {
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
  }
}
@media (max-width: 380px) {
  .mode-btn { font-size: 11px; padding: 9px 4px; }
}

/* --- Big input -------------------------------------------------------- */
.big-input-wrap {
  position: relative;
}
.big-input {
  width: 100%;
  padding: 16px 60px 16px 16px;
  font-size: 28px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  -moz-appearance: textfield;
  appearance: textfield;
}
@media (min-width: 640px) {
  .big-input { font-size: 36px; padding: 18px 70px 18px 18px; }
}
.big-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.big-input::-webkit-outer-spin-button,
.big-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.big-input-suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 18px;
  font-weight: 500;
  pointer-events: none;
}

/* --- Reverse result --------------------------------------------------- */
.reverse-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 12px;
}
.reverse-result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--success-text);
  margin-bottom: 4px;
}
.reverse-result-value {
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--success-text);
}
@media (min-width: 640px) {
  .reverse-result-value { font-size: 28px; }
}
.reverse-result-sub {
  font-size: 13px;
  color: var(--success-text);
  opacity: 0.8;
  margin-top: 2px;
}
.reverse-apply {
  margin-top: 12px;
  font-size: 13px;
  color: var(--success-text);
  text-decoration: underline;
  font-weight: 500;
}
.reverse-apply:hover { opacity: 0.7; }

/* --- Toggle grid ------------------------------------------------------ */
.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.toggle-grid:last-child { margin-bottom: 0; }
.toggle-btn {
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-subtle);
  transition: all 0.15s;
}
.toggle-btn:hover { border-color: var(--text-faint); }
.toggle-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.toggle-grid-small { margin-bottom: 0; }
.toggle-btn-sm {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-subtle);
  transition: all 0.15s;
}
.toggle-btn-sm:hover { border-color: var(--text-faint); }
.toggle-btn-sm.active {
  border-color: var(--accent);
  background: var(--surface-2);
  color: var(--text);
}

.vat-options {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vat-rate-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rate-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-subtle);
  transition: all 0.15s;
  white-space: nowrap;
}
.rate-btn:hover { border-color: var(--text-faint); }
.rate-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}
.rate-custom {
  flex: 1;
  min-width: 80px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}
.rate-custom:focus { outline: none; border-color: var(--accent); }

/* --- Generic input ---------------------------------------------------- */
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-with-suffix { position: relative; }
.input-with-suffix .input { padding-right: 36px; }
.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 12px;
  pointer-events: none;
}

/* --- Time grid -------------------------------------------------------- */
.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.time-add-wrap { display: flex; }
.time-add-wrap .btn { width: 100%; padding: 10px 16px; }
.time-preview {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 8px;
}
.time-preview strong { color: var(--text); }
@media (max-width: 480px) {
  .time-grid { grid-template-columns: 1fr 1fr; }
  .time-add-wrap { grid-column: 1 / -1; }
  .time-add-wrap .btn { width: 100%; }
}

/* --- Costs ------------------------------------------------------------ */
.costs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.costs-count { font-size: 11px; color: var(--text-subtle); }
.costs-list { display: flex; flex-direction: column; gap: 8px; }
.costs-empty {
  text-align: center;
  padding: 32px 16px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.costs-empty p { font-size: 13px; color: var(--text-subtle); }
.costs-empty-sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.cost-item {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: background 0.4s, border-color 0.4s;
}
.cost-item.just-added {
  background: var(--success-bg);
  border-color: var(--success-border);
  animation: cost-pulse 0.5s ease-out;
}
@keyframes cost-pulse {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.cost-icon {
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  flex-shrink: 0;
}
.cost-fields {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.cost-fields .input { background: var(--surface); padding: 8px 10px; font-size: 13px; }
.cost-fields .input.cost-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-subtle);
}
.cost-amount-wrap { position: relative; }
.cost-amount-wrap .input { padding-right: 32px; }
.cost-amount-suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-faint);
  pointer-events: none;
}
.cost-remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.cost-remove:hover { color: var(--error); background: var(--error-bg); }

@media (max-width: 480px) {
  .cost-fields { grid-template-columns: 1fr; }
}

/* --- Add cost --------------------------------------------------------- */
.add-cost-area { margin-top: 12px; }
.btn-add {
  width: 100%;
  padding: 12px 16px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-add:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface-2);
}

.category-picker {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.picker-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--text-subtle);
  margin-bottom: 8px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 480px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}
.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}
.category-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}
.category-btn svg { width: 20px; height: 20px; }

.picker-divider {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.custom-row {
  display: flex;
  gap: 6px;
}
.custom-row .input { padding: 10px 12px; }
.custom-row .input:first-child { flex: 1; min-width: 0; }
.custom-amount-wrap { position: relative; width: 110px; flex-shrink: 0; }
.custom-amount-wrap .input { padding-right: 32px; }
.custom-amount-suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-faint);
  pointer-events: none;
}
@media (max-width: 380px) {
  .custom-amount-wrap { width: 90px; }
}
.picker-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
}
.picker-close {
  width: 100%;
  margin-top: 8px;
  padding: 6px;
  font-size: 12px;
  color: var(--text-subtle);
}
.picker-close:hover { color: var(--text); }

/* --- Switch ----------------------------------------------------------- */
.advanced-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d6d3d1;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch[aria-pressed="true"] { background: var(--accent); }
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.switch[aria-pressed="true"] .switch-thumb { transform: translateX(18px); }

/* --- Results panel (desktop) ----------------------------------------- */
.result-headline {
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius);
  padding: 20px;
}
.result-headline-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.result-headline-value {
  font-size: 28px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.result-headline-meta {
  padding-top: 12px;
  border-top: 1px solid #44403c;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.result-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.result-meta-row .label { color: var(--text-faint); }
.result-meta-row .value { font-weight: 500; font-variant-numeric: tabular-nums; }

.status-card {
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
}
.status-card.ok { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.status-card.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.status-card.error { background: var(--error-bg); border-color: var(--error-border); color: var(--error-text); }
.status-card svg { flex-shrink: 0; margin-top: 2px; }
.status-card .status-title { font-size: 13px; font-weight: 500; }
.status-card .status-desc { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.breakdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.breakdown-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--text-subtle);
  margin-bottom: 10px;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
}
.breakdown-row .label { color: var(--text-muted); }
.breakdown-row .value {
  font-variant-numeric: tabular-nums;
}
.breakdown-row.muted .label,
.breakdown-row.muted .value {
  color: var(--text-subtle);
  font-size: 12px;
}
.breakdown-row.bold .label,
.breakdown-row.bold .value { font-weight: 500; }
.breakdown-row.negative .value { color: var(--error); }
.breakdown-row.accent .value { color: var(--success-text); }
.breakdown-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 0;
}
.breakdown-divider-strong {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.categories-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-row { font-size: 13px; }
.cat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.cat-row-name { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.cat-row-amount { font-weight: 500; font-variant-numeric: tabular-nums; }
.cat-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.cat-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }

/* --- Margin badge ----------------------------------------------------- */
.margin-badge {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.margin-badge.empty { background: rgba(255,255,255,0.1); color: var(--text-faint); }
.margin-badge.ok { background: var(--success-bg); color: var(--success-text); }
.margin-badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.margin-badge.error { background: var(--error-bg); color: var(--error-text); }
.margin-badge.dark.empty { background: #292524; color: var(--text-faint); }
.margin-badge.dark.ok { background: rgba(6, 95, 70, 0.3); color: #6ee7b7; }
.margin-badge.dark.warn { background: rgba(146, 64, 14, 0.3); color: #fcd34d; }
.margin-badge.dark.error { background: rgba(153, 27, 27, 0.3); color: #fca5a5; }

/* --- Mobilní spodní panel -------------------------------------------- */
.mobile-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 1024px) {
  .mobile-bottom { display: none; }
}
.mb-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: none;
}
.mb-bar-left { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.mb-bar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--text-subtle);
}
.mb-bar-value {
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.mb-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.mb-expand {
  border-top: 1px solid var(--border-soft);
  padding: 12px 16px 16px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.mb-bd-card {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mb-bd-card .breakdown-divider,
.mb-bd-card .breakdown-divider-strong { margin: 4px 0; }

/* --- Toast ------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (min-width: 1024px) {
  .toast { bottom: 24px; }
}

/* --- Noscript --------------------------------------------------------- */
.noscript {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  padding: 16px;
  margin: 16px;
  border-radius: 12px;
  text-align: center;
}

/* --- Loading state pro PDF ------------------------------------------- */
.btn.is-loading { opacity: 0.6; pointer-events: none; }
.btn.is-loading svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
