/* InstantPalette - favicon and app icon maker (/icon-generator) only.
   Layer 5: loaded after tokens.css, base.css, site.css and tools.css, and nothing else loads it.

   Only what is specific to this tool: the preview stage with its mock tab, phone and Android icon, the contrast
   readout, the symbol, shape and color choices, the file rows and the real sizes. Panels, sliders, segmented controls,
   buttons and code blocks come from the shared layers. The two page colors behind the previews are fixed in both
   themes, because they stand for other people's light and dark browsers. */

/* ================= Preview ================= */
.ig-main { min-width: 0; margin: 0 0 16px; order: var(--o); container: igm / inline-size; }
.ig-l { --page: #FFFFFF; --bar: #D9D9D9; --on: #1F1F1F; --dim: #575757; }
.ig-d { --page: #1F1F1F; --bar: #0E0E0E; --on: #F3F3F3; --dim: #B8B8B8; }
.ig-stage {
  display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 16px 20px; align-items: center;
  padding: 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--raised);
}
.ig-stage canvas, .ig-true canvas { display: block; flex: none; }
.ig-big { justify-self: center; border-radius: var(--r); }
.ig-big canvas { width: 208px; height: 208px; }
/* No shape: a gray check shows what is clear, and both grays keep a light and a dark mark visible */
.ig-big.clear { background: repeating-conic-gradient(#9A9A9A 0 25%, #B4B4B4 0 50%) 0 0 / 26px 26px; }

.ig-mocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ig-tab { padding: 6px 8px 0; border-radius: var(--r); background: var(--bar); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-1) 14%, transparent); }
.ig-tab > div {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px;
  border-radius: var(--r) var(--r) 0 0; background: var(--page); color: var(--on);
  font: 400 12px/1 var(--f-sans);
}
.ig-tab span { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.ig-tab .i { width: 14px; height: 14px; color: var(--dim); }
.ig-home, .ig-and { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ig-home > span, .ig-and > span { font: 400 12px/1.3 var(--f-sans); color: var(--ink-2); text-align: center; }
.ig-tiles { display: grid; grid-template-columns: 48px 48px; gap: 10px; padding: 10px; border-radius: 18px; background: #C9C9C9; }
.ig-tiles canvas, .ig-tiles i { width: 48px; height: 48px; border-radius: 22.5%; }
.ig-tiles i { background: #B1B1B1; }
.ig-mask { position: relative; width: 104px; height: 104px; margin: auto 0; }
.ig-mask canvas { width: 104px; height: 104px; border-radius: 50%; }
.ig-mask svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.ig-minis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line-2); }
.ig-mini { display: flex; align-items: flex-end; justify-content: center; gap: 24px; padding: 10px 8px 8px; background: var(--page); }
.ig-mini:first-child { border-radius: var(--r) 0 0 var(--r); }
.ig-mini:last-child { border-radius: 0 var(--r) var(--r) 0; }
.ig-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ig-fig figcaption { font: 500 12px/1 var(--f-mono); color: var(--dim); white-space: nowrap; }

/* ================= Contrast readout ================= */
.ig-read { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; }
.ig-aa {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--r); background: var(--sw, var(--sunken)); color: var(--ink, #000);
  font: 700 18px/1 var(--f-sans);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-1) 14%, transparent);
}
.ig-aa svg { width: 24px; height: 24px; }
.ig-read p { margin: 0; flex: 1 1 200px; min-width: 0; }
.ig-read b { display: block; font: 600 14px/1.35 var(--f-sans); }
.ig-read p span { font: 400 13px/1.4 var(--f-sans); color: var(--ink-2); }
.ig-read .mono { font: 500 13px/1.4 var(--f-mono); color: var(--ink-1); margin-right: 3px; }

/* ================= Mark ================= */
.ig-letters > .field { flex: 1 1 auto; }
.ig-letters > .ig-tx { flex: 1 1 110px; }
.ig-tx .tinput { font-weight: 600; }
#seg-wt button { flex: 1 1 auto; text-align: center; }
.ig-symbols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px 2px; }
.ig-symbols button {
  display: grid; place-items: center; height: 46px;
  border: 1px solid transparent; border-radius: var(--r); color: var(--ink-1);
}
.ig-symbols svg { width: 24px; height: 24px; }
.ig-symbols button[aria-checked="true"], .ig-shapes button[aria-checked="true"] { background: var(--sunken); border-color: var(--ink-1); box-shadow: inset 0 0 0 1px var(--ink-1); }
@media (hover: hover) and (pointer: fine) { .ig-symbols button:hover, .ig-shapes button:hover { border-color: var(--ink-1); } }
.ig-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }

/* ================= Shape and color ================= */
.ig-shapes { display: flex; flex-wrap: wrap; gap: 4px; }
.ig-shapes button { flex: 1 1 auto; }
.ig-shapes button {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 44px; min-height: 56px; padding: 6px 3px;
  border: 1px solid transparent; border-radius: var(--r);
  color: var(--ink-1); font: 500 12px/1.1 var(--f-sans); letter-spacing: -.02em;
}
.ig-sh { width: 24px; height: 24px; }
.ig-sh svg { display: block; width: 100%; height: 100%; }
.ig-chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px; }
.ig-chip {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--ink-3); border-radius: var(--r);
  background: var(--sw, var(--sunken)); color: var(--ink, #000);
}
.ig-chip .i { opacity: 0; stroke-width: 2.4; }
.ig-chip[aria-checked="true"] { box-shadow: 0 0 0 2px var(--raised), 0 0 0 4px var(--ink-1); }
.ig-chip[aria-checked="true"] .i { opacity: 1; }
.ig-chip:focus-visible { outline-offset: 5px; }
@media (hover: hover) and (pointer: fine) { .ig-chip:hover { border-color: var(--ink-1); } }
#seg-gd button, #seg-ac button { flex: 1 1 auto; text-align: center; }
#seg-ac button, #seg-gd button { min-width: 44px; padding: 0 6px; }

/* ================= Export ================= */
.ig-zip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; }
.ig-zip .tprimary { flex: 1 1 200px; }
.ig-zip .field-hint { flex: 1 1 220px; }
.ig-files { margin: 0 0 12px; gap: 10px; }
.ig-files .btn-o { flex: 1 1 130px; min-height: 44px; }
.ig-png { flex: 1 1 290px; display: flex; gap: 10px; }
.ig-png .tselect { flex: 1 1 130px; width: auto; }
.codeout pre { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.codeout .btn-o { height: 40px; min-height: 40px; }
@media (hover: none), (pointer: coarse) { .codeout .btn-o { height: 44px; min-height: 44px; } }

/* ================= Real sizes ================= */
.twork .ig-real { grid-column: 1 / -1; }
.ig-real .field-hint { margin: 0 0 10px; }
.ig-true { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line-2); }
.ig-strip {
  display: flex; flex-wrap: wrap; align-items: flex-end; align-content: center; justify-content: center; gap: 16px 12px;
  padding: 16px 9px; background: var(--page);
}
.ig-strip.ig-l { border-radius: var(--r-lg) 0 0 0; }
.ig-strip.ig-d { border-radius: 0 var(--r-lg) 0 0; order: 1; }
.ig-512 {
  grid-column: 1 / -1; order: 2; overflow-x: auto;
  padding: 12px 0; border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: linear-gradient(90deg, #FFFFFF 50%, #1F1F1F 50%);
}
.ig-512:focus-visible { outline: 2px solid #8C8C8C; outline-offset: -3px; }
.ig-512 .ig-fig { width: 512px; margin: 0 auto; }
.ig-512 figcaption { padding: 4px 8px; border-radius: var(--r-xs); background: #FFFFFF; color: #1F1F1F; }
/* Phones: the light strip over the dark one, since 192 pixels need a row of their own */
@container tpage (max-width: 439px) {
  .ig-true { grid-template-columns: minmax(0, 1fr); }
  .ig-strip.ig-l { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .ig-strip.ig-d { border-radius: 0; }
}
@container tpage (min-width: 916px) {
  .ig-true { grid-template-columns: minmax(0, 1fr) 512px minmax(0, 1fr); }
  .ig-512 { grid-column: auto; order: 0; padding: 16px 0 12px; border-radius: 0; overflow: visible; }
  .ig-strip.ig-l { border-radius: var(--r-lg) 0 0 var(--r-lg); }
  .ig-strip.ig-d { border-radius: 0 var(--r-lg) var(--r-lg) 0; order: 1; }
}

@container tpage (min-width: 690px) { .ig-main { order: 0; } }
/* Too narrow for six in a row: two rows of three */
@container tpage (max-width: 339px) { .ig-shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container tpage (min-width: 690px) and (max-width: 886px) { .ig-shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ================= Narrow columns ================= */
@container igm (max-width: 500px) {
  .ig-stage { grid-template-columns: 160px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .ig-big canvas { width: 160px; height: 160px; }
  .ig-mocks { gap: 10px 4px; }
  .ig-tab { grid-column: 1 / -1; }
  .ig-tab > div { height: 30px; }
  .ig-tiles { grid-template-columns: 38px 38px; gap: 8px; padding: 9px; border-radius: 15px; }
  .ig-tiles canvas, .ig-tiles i { width: 38px; height: 38px; }
  .ig-mask, .ig-mask canvas { width: 88px; height: 88px; }
  .ig-mini { gap: 18px; }
}
/* Phones: the tabs beside the icon, the two device icons in a row of their own */
@container igm (max-width: 439px) {
  .ig-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ig-mocks { display: contents; }
  .ig-big { grid-row: 1 / 3; }
  .ig-big canvas { width: 136px; height: 136px; }
  .ig-tab { grid-column: 2; }
  .ig-mini { gap: 12px; }
}
/* Landscape phones: a shorter preview, so a control is on screen with it */
@media (orientation: landscape) and (max-height: 500px) {
  .ig-minis { display: none; }
}
