@font-face { font-family: "DM Sans"; src: url("/dm-sans.woff2") format("woff2"); font-display: swap; }
:root {
  color-scheme: light;
  --page: #f7f8fa; --sheet: #fff; --ink: #222832; --muted: #525b67;
  --rule: #acb3be; --key: #1e4a75; --on: #fff; --drill-tint: #e6eff7; --bad: #8c2435;
  font: 1rem/1.45 "DM Sans", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #1c2026; --sheet: #282e37; --ink: #f2f4f7; --muted: #c4ccd6;
  --rule: #737b88; --key: #a9cee8; --on: #15304a; --drill-tint: #293d51; --bad: #ffb4c3;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
a { color: var(--key); text-underline-offset: .16em; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: default; }
:focus-visible { outline: 2px solid var(--key); outline-offset: 3px; }
body > :is(header, footer) { border-bottom: 1px solid var(--rule); background: var(--sheet); }
body > footer { border-top: 1px solid var(--rule); border-bottom: 0; }
body > :is(header, footer) > div:not(.app-meta) {
  max-width: 71rem; padding: .65rem 1.2rem; margin: auto; display: flex;
  align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem;
}
body > :is(header, footer) nav { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
body > :is(header, footer) nav a { display: inline-flex; min-height: 2.25rem; align-items: center; font-size: .88rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 750; }
.brand img { width: 1.85rem; height: 1.85rem; border-radius: 3px; }
main { max-width: 71rem; margin: auto; padding: 1.8rem 1.2rem 2.8rem; }

.drill-workspace h1 { margin: 0 0 .4rem; font-size: clamp(1.68rem,5vw,2.45rem); line-height: 1.12; }
.drill-lead { color: var(--muted); margin: 0 0 1.25rem; }
#tool { display: grid; grid-template-columns: minmax(0,5fr) minmax(0,6fr); gap: 1rem; align-items: start; }
#tool section { min-width: 0; padding: 1rem; border: 1px solid var(--rule); background: var(--sheet); }
#tool h2 { margin: 0; font-size: 1.22rem; }
.drill-row { display: flex; align-items: center; gap: .4rem .85rem; flex-wrap: wrap; justify-content: space-between; margin-bottom: .65rem; }
#tool label { font-weight: 700; }
#tool :is(button,select,input), #tool input::file-selector-button, #install { font: inherit; }
#tool :is(button,select,input[type="number"]), #tool input::file-selector-button, #install { color: var(--ink); border: 1px solid var(--rule); background: var(--sheet); min-height: 2.6rem; border-radius: 4px; padding: .32rem .64rem; }
#tool .drill-primary { color: var(--on); background: var(--key); border-color: var(--key); font-weight: 750; margin-top: .65rem; }
#drill-file { width: 100%; }
#drill-name { color: var(--muted); overflow-wrap: anywhere; }
#drill-scale { min-width: 0; border: 1px solid var(--rule); margin: .5rem 0; padding: .6rem; }
#drill-scale select, #drill-scale input { width: 100%; min-width: 0; margin-top: .25rem; }
.drill-fields { display: grid; grid-template-columns: minmax(0,1.4fr) repeat(2,minmax(0,1fr)); gap: .6rem; margin: .3rem 0 .7rem; }
#drill-summary, #drill-detail { color: var(--muted); margin: .3rem 0; }
#drill-error { color: var(--bad); }
.drill-table { overflow: auto; max-height: 21rem; }
.drill-table table { width: 100%; border-collapse: collapse; }
.drill-table th, .drill-table td { padding: .42rem .65rem; text-align: left; border-bottom: 1px solid var(--rule); }
.drill-table th { background: var(--drill-tint); }
#drill-detail { margin: .75rem 0; }
#drill-view { overflow: auto; max-height: 16rem; padding: .65rem; background: var(--drill-tint); }
@media (max-width: 760px) {
  main { padding: .95rem .8rem 1.5rem; }
  #tool { display: block; }
  #tool section { padding: .8rem; }
}
