/* ============================================================
   Draw Music Tool - Windows 95 / MS Paint styling
   ============================================================ */

:root{
  --face:      #c0c0c0;
  --face-lit:  #dfdfdf;
  --hilite:    #ffffff;
  --shadow:    #808080;
  --dark:      #000000;
  --title-a:   #000080;
  --title-b:   #1084d0;
  --sel:       #000080;
  --text:      #000000;
  --font: "MS Sans Serif", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0;
  background: #008080;                 /* classic teal desktop */
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  -webkit-font-smoothing: none;
  overflow: hidden;
  overscroll-behavior: none;           /* no rubber-banding on touch */
}

/* Nothing in the chrome should be selectable or long-press-able: a drag on a
   phone is always meant as a control gesture, never as a text selection. */
body{
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.field, .dialog-body{
  -webkit-user-select: text;
  user-select: text;
}

/* Kill the 300ms tap delay and double-tap zoom on controls. Ranges take
   touch-action:none so a drag moves the slider instead of scrolling the rail
   it lives in. */
.btn, .tool, .tb-btn, .menu-label, .menu-pop button, .swatch, .color-grid button,
select, input[type=number]{
  touch-action: manipulation;
}
input[type=range]{ touch-action: none; }

/* ---------- Bevels ---------- */
.raised{
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
}
.sunken{
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--face-lit);
}

/* ---------- Window ---------- */
.window{
  position: absolute;
  inset: 10px;
  display: flex;
  flex-direction: column;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
  padding: 2px;
  min-width: 720px;
  min-height: 520px;
}

.titlebar{
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 2px 0 3px;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: #fff;
  user-select: none;
  flex: 0 0 auto;
}
.titlebar-icon{ display:flex; align-items:center; }
.titlebar-text{
  flex: 1 1 auto;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
}
.titlebar-buttons{ display: flex; gap: 2px; }
.tb-btn{
  width: 17px; height: 15px;
  padding: 0;
  font-family: var(--font);
  font-size: 10px;
  line-height: 1;
  background: var(--face);
  border: 1px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
  cursor: default;
  display: flex; align-items: center; justify-content: center;
}
.tb-btn:active{
  border-color: var(--dark) var(--hilite) var(--hilite) var(--dark);
  box-shadow: none;
}
.tb-btn span{ transform: translateY(-1px); }

/* ---------- Menu bar ---------- */
.menubar{
  display: flex;
  gap: 0;
  padding: 1px 2px;
  flex: 0 0 auto;
  user-select: none;
  border-bottom: 1px solid var(--shadow);
}
.menu{ position: relative; }
.menu-label{
  display: inline-block;
  padding: 2px 7px;
  cursor: default;
}
.menu.open .menu-label{ background: var(--sel); color: #fff; }
@media (hover: hover){
  .menu-label:hover{ background: var(--sel); color: #fff; }
}
.menu-pop{
  display: none;
  position: absolute;
  top: 100%; left: 0;
  z-index: 50;
  min-width: 150px;
  padding: 2px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: 2px 2px 0 rgba(0,0,0,.35), inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
}
.menu.open .menu-pop{ display: block; }
.menu-pop button{
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 3px 8px;
  border: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 12px;
  text-align: left;
  cursor: default;
  color: var(--text);
}
.menu-pop button:hover:not(.disabled){ background: var(--sel); color: #fff; }
.menu-pop button.disabled{ color: var(--shadow); text-shadow: 1px 1px 0 var(--hilite); }
.menu-pop .acc{ color: inherit; opacity: .75; }
.menu-pop hr{
  border: 0;
  border-top: 1px solid var(--shadow);
  border-bottom: 1px solid var(--hilite);
  margin: 3px 2px;
}

/* ---------- Generic controls ---------- */
.btn{
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  background: var(--face);
  padding: 3px 8px;
  min-height: 23px;
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
  cursor: default;
  user-select: none;
  white-space: nowrap;
}
.btn:active,
.btn.down{
  border-color: var(--dark) var(--hilite) var(--hilite) var(--dark);
  box-shadow: inset 1px 1px 0 var(--shadow);
  padding: 4px 7px 2px 9px;
}
.btn:focus{ outline: 1px dotted #000; outline-offset: -4px; }
.btn.btn-wide{ min-width: 66px; }
.btn.full{ width: 100%; margin-top: 4px; }

.field{
  font-family: var(--font);
  font-size: 12px;
  background: #fff;
  color: #000;
  padding: 2px 3px;
  height: 22px;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark);
}
.field.num{ width: 54px; text-align: right; }
.field.tiny{ font-size: 11px; height: 20px; width: 100%; padding: 0 2px; }
select.field{ cursor: default; }

.unit{ color: #303030; }

.lcd{
  display: inline-block;
  min-width: 34px;
  padding: 2px 4px;
  text-align: center;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 12px;
  color: #00ff66;
  background: #001a0a;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark);
}
.lcd.small{ min-width: 30px; font-size: 11px; padding: 1px 2px; }

/* ---------- Sliders ---------- */
input[type=range]{
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  margin: 0;
  cursor: default;
}
input[type=range]::-webkit-slider-runnable-track{
  height: 6px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark);
}
input[type=range]::-moz-range-track{
  height: 6px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark);
}
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance: none;
  width: 12px; height: 22px;
  margin-top: -10px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
}
input[type=range]::-moz-range-thumb{
  width: 10px; height: 20px;
  border-radius: 0;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
}
.hrange{ width: 100%; height: 22px; min-width: 90px; }

.vslider{
  position: relative;
  width: 26px;
  height: 112px;
  margin: 4px 0 3px;
}
.vslider.short{ height: 84px; }
.vslider.mini{ width: 22px; height: 78px; margin: 2px 0; }
.vslider input[type=range]{
  position: absolute;
  top: 50%; left: 50%;
  width: 112px;
  height: 24px;
  transform: translate(-50%, -50%) rotate(-90deg);
}
.vslider.short input[type=range]{ width: 84px; }
.vslider.mini input[type=range]{ width: 78px; height: 20px; }

/* ---------- Top bar ---------- */
.topbar{
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px 5px 5px;
  flex: 0 0 auto;
}
.group{
  position: relative;
  padding: 9px 7px 6px;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark);
}
.group.grow{ flex: 1 1 auto; min-width: 130px; }
.group-title{
  position: absolute;
  top: -8px; left: 6px;
  padding: 0 3px;
  background: var(--face);
  font-size: 11px;
}
.group-body{
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
}
.group.grow .group-body .hrange{ flex: 1 1 auto; }

/* ---------- Workspace ---------- */
.workspace{
  display: flex;
  gap: 5px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 5px 5px;
}

/* Tool box */
.toolbox{
  flex: 0 0 auto;
  width: 92px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
  overflow-y: auto;
  scrollbar-width: thin;
}
.tool-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.tool{
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 3px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
  cursor: default;
  display: flex; align-items: center; justify-content: center;
}
.tool svg{ width: 100%; height: 100%; display: block; }
.tool:active{
  border-color: var(--dark) var(--hilite) var(--hilite) var(--dark);
  box-shadow: none;
}
.tool.active{
  border-color: var(--dark) var(--hilite) var(--hilite) var(--dark);
  box-shadow: none;
  background-color: var(--face-lit);
  background-image:
    linear-gradient(45deg, rgba(0,0,0,.09) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.09) 75%),
    linear-gradient(45deg, rgba(0,0,0,.09) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.09) 75%);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
}

.opt-title{ font-size: 11px; margin-bottom: 2px; }

.palette{ margin-top: auto; padding-top: 10px; }
.swatch{
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-bottom: 2px;
  padding: 2px 3px;
  font-family: var(--font);
  font-size: 11px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 2px solid transparent;
  cursor: default;
}
@media (hover: hover){
  .swatch:hover{
    border-color: var(--hilite) var(--shadow) var(--shadow) var(--hilite);
  }
}
.swatch.open{
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  background: var(--face-lit);
}
.swatch i{
  width: 15px; height: 13px;
  flex: 0 0 auto;
  display: inline-block;
  border: 1px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
}

/* ---------- Colour picker popup ---------- */
.color-pop{
  position: fixed;
  z-index: 200;
  width: 154px;
  padding: 5px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: 2px 2px 0 rgba(0,0,0,.35), inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
}
.color-pop[hidden]{ display: none; }
.color-pop-title{
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 4px;
  padding: 1px 3px;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: #fff;
}
.color-grid{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 3px;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark);
}
.color-grid button{
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  cursor: default;
}
@media (hover: hover){
  .color-grid button:hover{ outline: 1px dotted #000; outline-offset: 1px; }
}
.color-grid button.current{ outline: 2px solid #000; outline-offset: -1px; }
.color-pop-foot{
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
.color-pop-foot .btn{ flex: 1 1 0; padding: 3px 2px; font-size: 11px; }
.native-color{
  position: absolute;
  left: 8px; bottom: 8px;
  width: 1px; height: 1px;
  padding: 0; border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Canvas */
.canvas-frame{
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark);
  overflow: hidden;
}
#paint{
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
#paint.erasing{ cursor: cell; }

/* FX rack */
.rack{
  flex: 0 0 auto;
  width: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilite) var(--dark) var(--dark) var(--hilite);
  box-shadow: inset 1px 1px 0 var(--face-lit), inset -1px -1px 0 var(--shadow);
  overflow-y: auto;
}
.rack-title{ font-size: 11px; font-weight: bold; }
.fx{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 3px 5px;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark);
}
.fx-name{ font-size: 11px; margin-bottom: 1px; }
.fx select{ margin-top: 4px; }

.fx.mix{ padding: 5px 2px 5px; }
.mix-row{ display: flex; gap: 3px; justify-content: center; }
.mix-ch{ display: flex; flex-direction: column; align-items: center; }
.mix-dot{
  width: 13px; height: 11px;
  display: block;
  margin-top: 2px;
  border: 1px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
}
.fx.mix .lcd{ margin-top: 4px; }

/* ---------- Status bar ---------- */
.statusbar{
  display: flex;
  gap: 3px;
  padding: 2px 4px 1px;
  flex: 0 0 auto;
}
.status-cell{
  padding: 2px 5px;
  font-size: 11px;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  box-shadow: inset 1px 1px 0 rgba(0,0,0,.35);
  white-space: nowrap;
  overflow: hidden;
  min-width: 62px;
}
.status-cell.grow{ flex: 1 1 auto; min-width: 0; }

/* ---------- Phone audio tip ----------
   Classic Windows tooltip colours. Floats above the status bar rather than
   sitting in the window's flex column, so showing it does not resize the
   canvas mid-drawing. Only ever shown on iOS / Android - see js/app.js. */
.audio-tip{
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 42px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: #ffffe1;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
  font-size: 12px;
  line-height: 1.35;
}
.audio-tip[hidden]{ display: none; }
.audio-tip span{ flex: 1 1 auto; }
.audio-tip .btn{ flex: 0 0 auto; }

/* ---------- Dialogs ---------- */
.modal-veil{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-veil[hidden]{ display: none; }
.window.dialog{
  position: static;
  inset: auto;
  width: 330px;
  min-width: 0;
  min-height: 0;
  height: auto;
}
.dialog-body{ padding: 12px 14px 10px; }
.dialog-body p{ margin: 0 0 9px; line-height: 1.45; }
.dialog-body .dim{ color: #404040; }
.dialog-buttons{ display: flex; justify-content: center; margin-top: 12px; }

/* Row of link buttons in the About dialog. They are anchors so they can open a
   new tab, so they need the bits a <button> gets for free: no underline, the
   dialog text colour, and centred label with the same box metrics as .btn. */
.dialog-links{ display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
a.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
}
a.btn:visited{ color: var(--text); }

/* ============================================================
   Narrow windows - one step down from the desktop layout
   ============================================================ */
@media (max-width: 900px){
  .window{ min-width: 0; }
  .topbar{ flex-wrap: wrap; }
  .toolbox{ width: 82px; }
  .rack{ width: 100px; }
}

/* ============================================================
   Compact layout - phones and narrow windows

   The side rails shrink to thin strips so the canvas keeps as much width as
   possible: the tools stack in a single column, the mixer faders stack too,
   and the numeric readouts step aside.
   ============================================================ */
@media (max-width: 760px){

  body{ position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; }

  .window{
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    height: 100vh;
    height: 100dvh;              /* tracks the phone's collapsing URL bar */
    min-width: 0;
    min-height: 0;
    padding: 2px;
    padding-left: max(2px, env(safe-area-inset-left));
    padding-right: max(2px, env(safe-area-inset-right));
    padding-bottom: max(2px, env(safe-area-inset-bottom));
  }

  /* ---- chrome ---- */
  .titlebar{ height: 22px; }
  .titlebar-text{ font-size: 11px; }
  .menu-label{ padding: 3px 7px; }

  /* ---- top bar ---- */
  .topbar{ gap: 4px; padding: 6px 4px 4px; }
  .group{ padding: 8px 4px 4px; }
  .group.grow{ min-width: 150px; }   /* keeps Bars off the first row */
  .group-title{ top: -7px; left: 4px; font-size: 10px; }
  .group-body{ gap: 4px; }
  .unit{ display: none; }
  .btn{ min-height: 26px; padding: 2px 6px; font-size: 11px; }
  .btn.btn-wide{ min-width: 50px; }
  .field{ height: 26px; font-size: 16px; }   /* 16px stops iOS zooming on focus */
  .field.num{ width: 50px; }
  select.field{ font-size: 12px; }
  .lcd{ min-width: 26px; font-size: 11px; padding: 2px; }
  .hrange{ min-width: 60px; }

  /* ---- workspace ---- */
  .workspace{ gap: 3px; padding: 0 3px 3px; }

  /* Tools stack vertically in a thin strip. */
  .toolbox{ width: 48px; padding: 3px; }
  .tool-grid{ grid-template-columns: 1fr; gap: 3px; }
  .tool{ padding: 4px; }
  .opt-title{ font-size: 9px; text-align: center; line-height: 1.15; }
  .btn.full{ margin-top: 3px; min-height: 24px; padding: 2px 1px; font-size: 10px; }
  .palette{ padding-top: 8px; }
  .swatch{ justify-content: center; padding: 2px 1px; margin-bottom: 3px; }
  .swatch span{ display: none; }             /* the colour chip is the label */
  .swatch i{ width: 24px; height: 16px; }

  /* Mixer and FX become one narrow column of faders. */
  .rack{ width: 54px; padding: 3px 2px; gap: 4px; }
  .rack-title{ font-size: 9px; }
  .fx{ padding: 3px 1px 4px; }
  .fx-name{ font-size: 9px; }
  .fx.mix{ padding: 4px 1px; }
  .mix-row{ flex-direction: column; gap: 5px; align-items: center; }
  .fx .lcd{ display: none; }                 /* readouts cost width we need */
  .mix-dot{ width: 22px; height: 10px; }
  .field.tiny{ font-size: 9px; height: 19px; }
  .vslider{ width: 28px; height: 70px; margin: 2px 0; }
  .vslider.short{ height: 56px; }
  .vslider.mini{ width: 28px; height: 54px; }
  .vslider input[type=range]{ width: 70px; }
  .vslider.short input[type=range]{ width: 56px; }
  .vslider.mini input[type=range]{ width: 54px; height: 24px; }

  /* ---- status bar ---- */
  .statusbar{ padding: 2px 3px 0; }
  .status-cell{ min-width: 0; padding: 2px 4px; font-size: 10px; }
  #statusVoices{ display: none; }

  /* ---- colour picker ---- */
  .color-pop{ width: 198px; }
  .color-grid{ grid-template-columns: repeat(6, 1fr); gap: 3px; }
}

/* ============================================================
   Short screens - phones held in landscape

   Height is the scarce axis here, not width: drop the menu bar, flatten the
   header and shorten every fader, but put the tools back into two columns.
   ============================================================ */
@media (max-height: 540px) and (orientation: landscape){
  .menubar{ display: none; }
  .titlebar{ height: 18px; }
  .titlebar-text{ font-size: 11px; }

  .topbar{ flex-wrap: nowrap; gap: 4px; padding: 5px 4px 3px; }
  .group{ padding: 7px 4px 3px; }
  .group-title{ top: -7px; font-size: 10px; }

  .toolbox{ width: 78px; padding: 3px; }
  .tool-grid{ grid-template-columns: 1fr 1fr; }
  .swatch{ justify-content: flex-start; }
  .swatch span{ display: none; }

  .rack{ width: 106px; }
  .mix-row{ flex-direction: row; gap: 3px; }
  .fx .lcd{ display: none; }
  .vslider{ width: 26px; height: 56px; }
  .vslider.short{ height: 48px; }
  .vslider.mini{ width: 26px; height: 48px; }
  .vslider input[type=range]{ width: 56px; }
  .vslider.short input[type=range]{ width: 48px; }
  .vslider.mini input[type=range]{ width: 48px; }

  #statusHint{ display: none; }
}

/* ============================================================
   Touch input - fingers need bigger targets than a mouse pointer
   ============================================================ */
@media (pointer: coarse){
  .tool{ min-height: 40px; }
  .btn{ min-height: 28px; }
  .menu-pop button{ padding: 8px 10px; }
  .menu-label{ padding: 5px 9px; }
  .color-grid button{ min-height: 28px; }
  .tb-btn{ width: 22px; height: 18px; }

  /* iOS zooms the page whenever a text field smaller than 16px takes focus. */
  .field{ height: 26px; font-size: 16px; }
  select.field{ font-size: 12px; }

  input[type=range]::-webkit-slider-thumb{
    width: 16px; height: 26px; margin-top: -12px;
  }
  input[type=range]::-moz-range-thumb{ width: 14px; height: 24px; }
}
