/* Shared by every tool in /tools: a Windows XP Silver dialog, matching the Dank Industries desktop.
   Each tool adds its own small stylesheet after this one. */
:root {
  --ink: #101014;
  --muted: #4a4b59;
  --face: #e0dfe3;
  --edge: #9293aa;
  --select: #316ac5;
  --net: #0b4fae;
  --host: #a6531a;
  --silver-button: linear-gradient(#fff 0, #f0f0f6 35%, #c9cadb 85%, #b6b7ca 100%);
  font: 14px/1.45 Tahoma, Verdana, 'DejaVu Sans', sans-serif;
  color: var(--ink);
  background: #5a7edc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 24px 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px dotted var(--ink); outline-offset: 1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.calc {
  max-width: 720px; margin: 0 auto; padding: 16px 18px 18px;
  background: var(--face); border: 1px solid #7b7c96; border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 24px rgb(0 0 0 / .35);
}
.calc.wide { max-width: 980px; }
.calc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { margin: 0 0 12px; font-size: 20px; }
h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 0 6px; font-size: 15px; }
h2 small { color: var(--muted); font-size: 12px; font-weight: 400; }
.pop-out { font-size: 12px; }

.calc-form label, .field-label { display: block; margin-bottom: 4px; font-weight: 700; }
.calc-row { display: flex; gap: 6px; }
.calc-row input, .text-input, select {
  flex: 1; min-width: 0; height: 34px; padding: 0 8px;
  font: 16px/1 Consolas, 'Lucida Console', monospace; background: #fff; border: 1px solid #7f9db9; border-radius: 0;
}
select { flex: none; font: inherit; padding-right: 4px; }
input[aria-invalid='true'] { border-color: #c03020; }
.button, .calc-row button, .examples button {
  padding: 0 14px; background: var(--silver-button); border: 1px solid #55567a; border-radius: 3px; cursor: pointer;
}
.button { min-height: 30px; }
.button:hover, .calc-row button:hover, .examples button:hover { border-color: #e8962e; }
.button:disabled { color: var(--muted); cursor: default; border-color: #9293aa; }
.hint { margin: 6px 0; color: var(--muted); font-size: 12px; }
code { font-family: Consolas, 'Lucida Console', monospace; }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; }
.examples button { min-height: 26px; padding: 0 8px; font: 12px Consolas, 'Lucida Console', monospace; }

.message { margin: 10px 0 0; color: var(--muted); }
.message:empty { margin: 0; }
.message.error { color: #a01c0c; font-weight: 700; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #a5acb2; }
th, td { padding: 4px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #e3e3ea; }
tbody th { width: 9.5em; font-weight: 400; color: var(--muted); white-space: nowrap; }
thead th { font-size: 12px; color: var(--muted); background: linear-gradient(#fff, #e6e6ee); border-bottom: 1px solid #a5acb2; white-space: nowrap; }
tr:nth-child(even) { background: #f5f5f9; }
.copy {
  padding: 1px 4px; margin: -1px -4px; font: 15px/1.4 Consolas, 'Lucida Console', monospace; text-align: left;
  background: none; border: 1px solid transparent; border-radius: 2px; cursor: copy; overflow-wrap: anywhere;
}
.copy:hover { background: #eef3fc; border-color: #b7c9ea; }
.copy.copied { color: #fff; background: var(--select); }
td small { display: block; color: var(--muted); font-size: 12px; }
.scroll-x { overflow-x: auto; }
.credit { margin: 14px 0 0; color: var(--muted); font-size: 12px; }

/* Inside the desktop window: the window already has a title bar and frame. */
.embedded, .embedded body { padding: 0; background: var(--face); }
.embedded .calc { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
.embedded h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* the window bar shows it */
.embedded .calc-head { justify-content: flex-end; margin-bottom: -18px; }

@media (max-width: 520px) {
  :root { background: var(--face); }
  body { padding: 0; }
  .calc { border-radius: 0; border-inline: 0; padding: 14px 12px; }
  .calc-row input, .text-input, select { height: 44px; }
  .calc-row button, .button { min-height: 44px; }
  .examples button { min-height: 36px; }
  tbody th { width: auto; padding-right: 4px; }
}
