/* ProImage Resizer 2.0 — design tokens + base. Light mode only, flat surfaces, no gradients. */

:root {
  color-scheme: light;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f6;
  --border: #e3e7ee;
  --border-strong: #cdd4e0;

  --text: #1a2233;
  --text-2: #546075;
  --text-3: #5d687b; /* 4.5:1 or better on white, --bg and --surface-3 (WCAG AA) */

  --primary: #2563eb;
  --primary-hover: #1e53cc;
  --primary-soft: #eaf1ff;
  --primary-border: #bcd1fb;

  --accent: #7c3aed;
  --accent-soft: #f3edff;

  --success: #0f7b57;
  --success-soft: #e7f6ef;
  --warning: #a35a05;
  --warning-soft: #fdf3e2;
  --danger: #c8283c;
  --danger-soft: #fdecee;

  --radius-s: 6px;
  --radius: 8px;
  --radius-l: 12px;

  --shadow-s: 0 1px 2px rgba(20, 30, 55, 0.06);
  --shadow-m: 0 6px 20px rgba(20, 30, 55, 0.12);
  --shadow-l: 0 20px 56px rgba(20, 30, 55, 0.22);

  --topbar-h: 52px;
  --nav-h: 58px;
  --font: Inter, 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

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

svg.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #cfd6e2;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #b7c0d0;
  background-clip: content-box;
  border: 2px solid transparent;
}

kbd {
  font: 600 11px var(--font);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text-2);
}

/* Fallback banner (file:// or script failure) */
.boot-banner {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
}
.boot-banner .card {
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-m);
  padding: 28px;
}
.boot-banner h1 {
  margin: 0 0 8px;
  font-size: 20px;
}
.boot-banner p {
  color: var(--text-2);
  margin: 8px 0;
}
.boot-banner code {
  font-family: var(--mono);
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 4px;
}
.boot-banner a {
  color: var(--primary);
  font-weight: 600;
}

/* Reduced motion: no transitions or animations (a slow, non-spinning indicator keeps "busy" visible). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Touch screens: 44 px targets (the pointer-agnostic minimum is 24 px). */
@media (pointer: coarse) {
  .btn,
  .icon-btn,
  .tool-btn,
  .bottom-nav button,
  .chip-btn,
  select.select {
    min-height: 44px;
  }
  .icon-btn,
  .tool-btn {
    min-width: 44px;
  }
}
