/*
 * The interface face, for the pages that cannot reach the design tokens.
 *
 * draw.css is loaded by three pages and only one of them loads styles.css, so
 * the iPad controller reaches no design tokens at all. That is why the whole
 * Draw panel had been rendering in the device's own system-ui font while the
 * rest of the app was not. The stack is written literally here for that reason
 * - a var() would resolve to nothing on the controller - and the face is served
 * from the same /fonts/ path every page uses.
 *
 * Buttons, selects and inputs are named individually because they do not
 * inherit a font family from their container; styles.css settles that with
 * `button, select { font: inherit }`, and the controller never loads it.
 *
 * For the same reason every colour below is written `var(--token, #literal)`.
 * Inside the app the token wins and this panel matches the other menus; on the
 * controller, where no token resolves, the fallback is the value this
 * stylesheet always carried, so that page looks exactly as it did. Never drop
 * a fallback here, and never reach for a token that styles.css alone defines
 * without one.
 *
 * Sizes are in rem rather than px so the panel answers to the control-panel
 * scale the way every other menu does. The metrics match the app's `button`
 * rule: 0.85rem type, a 0.72rem radius, 0.62rem/0.85rem padding and a 2.45rem
 * minimum height. Before this, the Draw panel was set a size larger than the
 * rest of the interface, with squarer buttons and a 24px Georgia heading that
 * no other menu uses.
 */
@font-face {
  font-family: "Nunito Sans";
  src: url("/fonts/nunito-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

.draw-controls,
.draw-controller,
.controller-layout,
.draw-controls button,
.draw-controls select,
.draw-controls input,
.draw-controller button,
.draw-controller select,
.draw-controller input,
.controller-layout button,
.controller-layout select,
.controller-layout input {
  font-family: "Nunito Sans", "Segoe UI", Arial, sans-serif;
}

.draw-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; overflow: hidden; }
.draw-overlay[data-active="true"] { pointer-events: auto; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.draw-overlay > * { pointer-events: none; }
.draw-canvas { background: transparent; border: 0; border-radius: 0; overflow: hidden; }
.draw-controls { font: 400 1rem/1.35 "Nunito Sans", "Segoe UI", Arial, sans-serif; color: var(--text-primary, #eff7f1); min-width: 0; }
.menu.draw-controls { width: min(460px, calc(100vw - 24px)); gap: 0.72rem; padding: 0.85rem; }
#mtt-single-orbit-app[data-draw-palette="true"] .menu.draw-controls { right: 106px; width: min(460px, calc(100vw - 130px)); }
.draw-heading { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.draw-heading strong { font-size: 0.9rem; font-weight: 700; color: var(--text-strong, #ffffff); }
.draw-session-status { color: var(--text-muted, #b4c8bb); font-size: 0.85rem; }
.draw-tool-row, .draw-actions, .draw-widths { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.draw-tool-row > button, .draw-widths > button { flex: 1; }
.draw-controls button, .draw-controls select { border: 1px solid var(--control-border, #53665a); border-radius: 0.72rem; background: var(--surface, #24332a); color: var(--text-primary, #f2f7f4); font: inherit; font-size: 0.85rem; font-weight: 600; padding: 0.62rem 0.85rem; min-height: 2.45rem; cursor: pointer; }
.draw-controls button:hover { border-color: var(--mtt-forest-green, #364c3e); background: var(--control-hover, #364c3e); }
.draw-controls button[aria-pressed="true"] { background: var(--mtt-forest-green, #426951); border-color: var(--mtt-lighter-green, #b5e5c5); box-shadow: inset 0 0 0 1px var(--mtt-lighter-green, #b5e5c5); }
.draw-controls button:disabled { opacity: .64; cursor: default; }
.draw-controls :focus-visible { outline: 3px solid var(--mtt-lighter-green, #dbf1df); outline-offset: 2px; }
.draw-palette { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.4rem; }
.draw-controls .draw-swatch { background: var(--swatch); min-height: 30px; height: 30px; padding: 0; border: 1px solid #657b6b; border-radius: 50%; }
.draw-controls .draw-swatch:hover { background: var(--swatch); }
.draw-controls .draw-swatch[aria-pressed="true"] { background: var(--swatch); box-shadow: 0 0 0 2px #18221c, 0 0 0 4px #e9ffef; border-color: #53665a; }
.draw-widths button { display: grid; place-items: center; }
.draw-widths span { display: block; width: 80%; min-width: 18px; border-radius: 8px; background: currentColor; }
.draw-options { display: grid; gap: 0.45rem; }
.draw-controls label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.85rem; font-weight: 600; }
.draw-controls select { max-width: 210px; }
.draw-secondary { display: grid; gap: 0.45rem; }
.draw-controls .menu-subheading { margin-top: 1.15rem; padding-top: 0.7rem; border-top: 1px solid var(--control-border, #405447); color: var(--text-strong, #ffffff); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.01em; }
.draw-controls .menu-note { margin: 0; color: var(--text-muted, #b9d0c1); font-size: 0.85rem; font-weight: 400; line-height: 1.55; letter-spacing: 0.01em; }
.draw-controls .control-label { display: block; margin: 0.35rem 0 -0.15rem; color: var(--text-muted, #b9d0c1); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.01em; }
.draw-controls .select-control { display: grid; gap: 0.45rem; width: 100%; }
.draw-controls .menu-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.draw-controls .menu-row > button { flex: 1; }
.draw-controls p { margin: 0; color: var(--text-muted, #b9d0c1); font-size: 0.85rem; }
.draw-controls .draw-feedback:empty { display: none; }
.draw-stepper { display: flex; gap: 0.4rem; align-items: center; }
.draw-stepper > span { flex: 1; }
.draw-stepper output { min-width: 2.9rem; text-align: center; }
.draw-clear-confirm { padding: 0.62rem 0.85rem; border: 1px solid #df9e82; border-radius: 0.72rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.85rem; }
.draw-check { justify-content: flex-start !important; }
/* The same drawn checkbox as every other menu. Written out here with literal
   fallbacks because the iPad controller loads this file without styles.css and
   resolves no token; checked is a selected button's fill and border, unchecked
   is an unselected one's edge. */
.draw-check input,
.draw-controls input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 19px; height: 19px; margin: 0; flex: 0 0 auto; border: 1px solid var(--border-subtle, rgba(164, 222, 173, 0.2)); border-radius: 0.34rem; background: transparent center / 100% 100% no-repeat; cursor: pointer; transition: background-color 130ms ease, border-color 130ms ease; }
.draw-check input:checked,
.draw-controls input[type="checkbox"]:checked { border-color: var(--mtt-forest-green, #355e3b); background-color: var(--mtt-forest-green, #355e3b); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.6 8.4l2.9 2.9 5.9-5.9'/%3E%3C/svg%3E"); }
.draw-padding-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
/* The pairing dialog: the code gets the screen, because lining a camera up
   with a 220px square in the corner of a menu is the hard way to do it. The
   backdrop follows the code's own `hidden`, so host.js keeps sole control of
   when this is up and nothing has to be kept in step by hand. */
.draw-pairing-backdrop { display: none; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.72); padding: 4vmin; place-items: center; }
.draw-pairing-backdrop:has(.draw-pairing:not([hidden])) { display: grid; }
.draw-pairing-dialog { position: relative; display: grid; gap: 0.72rem; max-width: min(92vw, 34rem); max-height: 92vh; overflow-y: auto; padding: 1.15rem; border: 1px solid var(--border-subtle, rgba(164, 222, 173, 0.2)); border-radius: 1.2rem; background: var(--surface, #1b291f); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45); }
.draw-pairing-close { position: absolute; top: 0.6rem; right: 0.6rem; width: 2.45rem; min-height: 2.45rem; padding: 0; display: grid; place-items: center; font-size: 1.3rem; line-height: 1; }
.draw-pairing { display: grid; justify-items: center; gap: 0.72rem; overflow-wrap: anywhere; text-align: center; }
/* Sized against the SHORTER viewport side so it stays square and whole in
   either orientation, and capped so it cannot outgrow a large monitor. The
   code is drawn scalable, so this is resolution, not blur. */
.draw-pairing svg { width: min(58vmin, 26rem); height: auto; padding: 0.5rem; border-radius: 0.5rem; background: white; }
.draw-pairing a { color: var(--legend-heading, #c8eace); font-size: 0.85rem; }
.draw-controls [hidden] { display: none !important; }
.draw-desktop-palette { position: fixed; z-index: 7; top: 50%; right: max(8px, env(safe-area-inset-right)); transform: translateY(-50%); display: grid; grid-template-columns: repeat(2, 30px); gap: 0.45rem; padding: 0.62rem; border: 1px solid var(--control-border, #53665a); border-radius: 1.2rem; background: #142019e8; box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45); }
.draw-desktop-palette[hidden] { display: none; }
.draw-desktop-palette .draw-swatch { box-sizing: border-box; width: 30px; height: 30px; padding: 0; border: 1px solid #657b6b; border-radius: 50%; background: var(--swatch); cursor: pointer; }
.draw-desktop-palette .draw-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #18221c, 0 0 0 4px #e9ffef; }
.draw-desktop-palette .draw-swatch:focus-visible { outline: 3px solid var(--mtt-lighter-green, #dbf1df); outline-offset: 2px; }
@media (max-width: 550px) { .draw-palette { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; } .draw-controls .draw-swatch { height: 34px; } }
