
/* V170 — visual polish only. No business logic. */
html, body, #root { width: 100%; min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
* { box-sizing: border-box; }
img, svg, canvas { max-width: 100%; }
main, section, article, .ledger-cell { min-width: 0; }

.ledger-cell {
  border-radius: 10px;
  overflow: hidden;
}

button, [role="button"], a {
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea, button {
  font: inherit;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  white-space: nowrap;
}

td {
  vertical-align: middle;
}

@media (min-width: 1024px) {
  .ledger-cell {
    transition: box-shadow .16s ease, border-color .16s ease, transform .16s ease;
  }
  .ledger-cell:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, .055);
  }

  /* Keep wide data pages readable without squeezing columns */
  .overflow-x-auto {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, currentColor 18%, transparent) transparent;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  /* Comfortable touch targets */
  button,
  [role="button"],
  input:not([type="checkbox"]):not([type="radio"]),
  select {
    min-height: 40px;
  }

  textarea {
    min-height: 96px;
  }

  /* Cards use the screen efficiently */
  .ledger-cell {
    border-radius: 9px;
  }

  .ledger-cell.p-4,
  .ledger-cell.lg\:p-5 {
    padding: 14px !important;
  }

  /* Horizontal tables scroll cleanly instead of breaking layout */
  .overflow-x-auto,
  .hidden.overflow-x-auto.md\:block,
  .hidden.overflow-x-auto.lg\:block {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }

  table {
    min-width: 680px;
  }

  th, td {
    font-size: 11.5px;
    line-height: 1.35;
  }

  /* Forms and action groups */
  .flex.w-full.flex-col.gap-2.sm\:w-auto.sm\:flex-row,
  .flex.flex-col.gap-2.sm\:flex-row,
  .flex.flex-col-reverse.gap-2.sm\:flex-row {
    gap: 8px;
  }

  /* Dialogs should never exceed the visible viewport */
  [class*="fixed"][class*="inset-0"] > div {
    max-height: 94dvh;
  }

  /* Prevent long identifiers/amounts from stretching cards */
  .font-mono,
  .tabular,
  .tabular-nums {
    overflow-wrap: anywhere;
  }

  h1 { line-height: 1.18; }
  h2, h3 { line-height: 1.25; }

  /* Give mobile charts enough breathing room while avoiding overflow */
  .recharts-responsive-container,
  .recharts-wrapper,
  .recharts-surface {
    max-width: 100% !important;
  }
}

@media (max-width: 420px) {
  .ledger-cell {
    border-radius: 8px;
  }

  .eyebrow {
    letter-spacing: .09em;
  }

  /* Compact status stamps on narrow phones */
  .stamp {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
}
