/* Shared look for every tool bundle in public/tools/<slug>/index.html.
   The bundles run inside an iframe on the tool page, so they cannot use the site's Tailwind classes.
   The colours mirror the site's tokens in src/app/globals.css; restyle them here in one place. */
:root {
  --bg: transparent;
  --surface: #ffffff;
  --surface-sunken: #f3efe7;
  --ink: #24292d;
  --ink-muted: #5c666b;
  --border: #cdc5b4;
  --button: #b9441c;
  --button-hover: #a03a17;
  --button-ink: #ffffff;
  --focus: #3e6d7a;
  --teal: #3e6d7a;
  --radius: 10px;
  color-scheme: light;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Public Sans', ui-sans-serif, -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body {
  padding: 16px;
}

h2,
h3 {
  margin: 0 0 8px;
  line-height: 1.25;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

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

input[type='text'],
input[type='number'],
input[type='date'],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

textarea {
  resize: vertical;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px #dbe8ea;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--button);
  color: var(--button-ink);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--button-hover);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button--quiet {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

.button--quiet:hover {
  background: var(--surface-sunken);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.row > .field {
  flex: 1 1 120px;
  min-width: 0;
}

.stack > * + * {
  margin-top: 16px;
}

.muted {
  color: var(--ink-muted);
  font-size: 14px;
}

.result {
  padding: 16px;
  border-radius: var(--radius);
  background: #fbeee3;
  border-left: 4px solid #df5f34;
  font-size: 20px;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 0;
}

.stats div {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.stats dt {
  font-size: 13px;
  color: var(--ink-muted);
}

.stats dd {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

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