/* SOGpt icon system

   Every icon in the product is drawn on one 24x24 grid. What makes a set look
   like a set is not the grid though — it is the weight the eye actually sees,
   and that is stroke-width scaled by however large the icon is rendered:

       rendered weight = stroke-width x (rendered size / 24)

   So a 17px icon at 1.6 and a 14px icon at 1.6 are NOT the same weight; the
   smaller one comes out 18% thinner and reads as a different family. Before
   this file the product had eighteen separate declarations producing twelve
   different rendered weights between 0.93px and 1.27px.

   One number fixes it: every icon renders at 1.06px. The pairs below are just
   1.06 x 24 / size, worked out once so nobody has to do it again.

       26px -> 0.98    20px -> 1.27    17px -> 1.5
       16px -> 1.59    15px -> 1.7     14px -> 1.82
       13px -> 1.96    12px -> 2.12

   Terminals are butt and joins are miter, product-wide. A drafting pen has a
   flat nib; a rounded terminal was the loudest source of softness in the old
   set, and the axonometric drawings this system now carries depend on corners
   meeting at a point rather than being rounded away.

   The one exception is .ic-dots below, which needs a round cap because a round
   cap is the only thing it draws.

   Use .icon with one of the size classes. Anything setting its own svg size
   should take its stroke from the same table. */

:root {
  --icon-weight: 1.06;   /* the rendered stroke every icon lands on, in px */
}

.icon,
svg[data-icon] {
  display: block;
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

.icon-20 { width: 20px; height: 20px; stroke-width: 1.27; }
.icon-17 { width: 17px; height: 17px; stroke-width: 1.5; }
.icon-16 { width: 16px; height: 16px; stroke-width: 1.59; }
.icon-15 { width: 15px; height: 15px; stroke-width: 1.7; }
.icon-14 { width: 14px; height: 14px; stroke-width: 1.82; }
.icon-13 { width: 13px; height: 13px; stroke-width: 1.96; }
.icon-12 { width: 12px; height: 12px; stroke-width: 2.12; }

/* A filled mark inside an otherwise stroked icon: a play triangle, a dot. */
.icon .ic-fill,
svg[data-icon] .ic-fill {
  fill: currentColor;
  stroke: none;
}

/* A zero-length path with a round cap draws a dot, so this is the one place
   in the product that keeps a round terminal — without it the path has no
   length and paints nothing at all. It also needs the extra weight to read. */
.icon .ic-dots,
svg[data-icon] .ic-dots {
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* ---- corrections to sets that predate this file ------------------------
   Each pair below was measured off the audit; the second number is chosen so
   the icon lands on 1.06px like everything else. Note these rules also force
   the size, so the weight is derived from the size set HERE, not from the one
   the component's own stylesheet asks for. */

/* The agent composer row had three weights and two sizes in a single row of
   four buttons — the most visible inconsistency in the product. */
.agent-context-button svg,
.agent-send svg,
.sog-attach-button svg,
.sog-voice-mic svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.5;
}

.theme-toggle svg,
.icon-button svg,
.agent-panel-tools svg,
.sogpt-mark svg,
.agent-launch-mark svg,
.preview-expand-button svg,
.capability-save svg,
.project-section > header button svg {
  stroke-width: 1.5;
  width: 17px;
  height: 17px;
}

.agent-jump-latest svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.12;
}

.ask-box button svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.59;
}

/* The sidebar nav sits in a 28px column; the icon centres in it and takes its
   colour from .nav / .nav.active like the glyphs it replaced. */
.nav i {
  display: grid;
  place-items: center;
}

/* ---- sprite icons ------------------------------------------------------
   Shapes live once as <symbol>s at the top of index.html and are pulled in
   with <use>. The wrappers they sit in (<b>, <i>, <span>) were sized for a
   text character, so they need to become boxes that centre a drawn one --
   only where they actually hold an icon, and only when nothing more specific
   already lays them out. */

.icon-26 { width: 26px; height: 26px; stroke-width: 0.98; }

b:has(> .icon),
i:has(> .icon),
span:has(> .icon) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.22em;
}

/* A wrapper holding nothing but an icon has no text to sit against. */
.canvas-empty span:has(> .icon),
.inspector-empty span:has(> .icon) {
  vertical-align: baseline;
}
