*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -1px;
}

.mono {
  font-family: var(--mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

/* Full-viewport zero-scroll workbench on desktop */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 480px;
  overflow: hidden;
  background: var(--bg);
}

.workbench {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(270px, 1fr) minmax(270px, 0.95fr);
  gap: 1px;
  background: var(--border);
}

/* Medium screens: input on left, two result panes stacked on right — still zero scroll */
@media (max-width: 979px) and (min-width: 720px) {
  .workbench {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .pane-input {
    grid-row: 1 / span 2;
  }
}

/* Mobile: natural vertical flow so touch controls stay comfortable */
@media (max-width: 719px) {
  html,
  body {
    height: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .workbench {
    flex: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .pane-input .pane-body {
    min-height: 190px;
  }

  .pane-result .pane-body {
    min-height: 180px;
    max-height: 280px;
  }
}
