/* Shiklo Colors — the home screen (/), the category pages and the 404 page. Their layout and look are the Shiklo
   sites' own (/shiklo/style.css, loaded first): the home is built like the home of tools.shiklo.com and
   code.shiklo.com (.page, .top-bars, .tool-area, .home[data-view=modern] with its hero and .home-block sections), the
   other pages like their tool pages. This file only adds the app's own parts in the theme's colours: the two big
   buttons, the picture tiles and circles, the folded For parents. Touch targets at least 44 px. */
.muted { color: var(--muted); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Buttons are the theme's (tf-btn); on these pages they are big enough for a child's finger. */
.tool-area .tf-btn, dialog .tf-btn, .undo-bar .tf-btn { min-height: 44px; }
.tool-area .tf-btn.tf-btn-sm, dialog .tf-btn.tf-btn-sm { min-height: 40px; font-size: 14px; }
.tf-btn.danger { color: var(--danger); }
a.tf-btn { text-decoration: none; } /* the theme's buttons are <button>s; here some are links */

/* The one ad: its own block, well away from the buttons, labelled. */
.ad { margin: 0 auto; max-width: 970px; text-align: center; }
.ad small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.ad .ad-box { min-height: 90px; }

/* The hero (the sites' .home-hero): the two big buttons under the line, then the facts; on the right a picture in its
   real colours (a tap colours it), as the sites' illustration. */
/* No zoom on a double tap (a child taps quickly); pinching still zooms the page. */
html { touch-action: manipulation; }

/* Hero buttons: compact, icon beside the word (owner, 2026-10-25: half the size). */
.home-hero .cards { display: flex; flex-wrap: wrap; margin: 0 0 18px; gap: 12px; }
.home-hero .card {
  flex: 0 1 auto; min-width: 200px; flex-direction: row; gap: 10px; min-height: 72px; padding: 10px 16px; font-size: 20px;
  white-space: nowrap; background: var(--surface);
}
.home-hero .card svg { width: 40px; height: 40px; flex: none; }
.home-hero .card:hover, .home-hero .card:focus-visible { background: var(--accent-soft); }
/* The illustration (a boy holding a tablet, the picture half coloured on its screen), in a wider column than the
   sites' 230 px art. */
@media (min-width: 769px) { #home .home-hero { grid-template-columns: minmax(0, 1fr) 320px; } } /* phones: the sites' one column */
#hero { align-self: end; margin: 0 0 -24px; transition: transform .15s; }
#hero:hover, #hero:focus-visible { transform: scale(1.03); }
#hero .boy { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgba(11, 31, 77, .18)); }

/* The two big cards. */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 190px;
  border-radius: calc(var(--radius) + 8px); border: 1px solid var(--border); background: var(--accent-soft); color: var(--accent);
  text-decoration: none; font-size: 26px; text-align: center; padding: 14px; transition: transform .12s, background-color .15s;
}
.card:hover, .card:focus-visible { transform: translateY(-2px); background: var(--accent-soft-hover); }
.card b { color: var(--text); }
.card svg { width: 59px; height: 59px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.card .c1 { fill: #e03131; stroke: none; }
.card .c2 { fill: #40c057; stroke: none; }
.card .c3 { fill: #f783ac; stroke: none; }

/* Continue: the last drawing, one tap back; its picture is the button's icon. */
.card-continue img {
  width: 44px; height: 44px; flex: none; object-fit: contain; padding: 2px; background: #fff;
  border: 1px solid var(--selected-border); border-radius: 8px;
}

/* Drawings and pictures: big thumbnails. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.grid.big { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
/* New pictures: one row that scrolls sideways. */
.grid.strip {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(140px, 160px);
  overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity;
}
.grid.strip > * { scroll-snap-align: start; }
.tile {
  position: relative; display: flex; flex-direction: column; border-radius: calc(var(--radius) + 4px); background: var(--surface);
  border: 1px solid var(--border); overflow: hidden; color: var(--text); text-decoration: none;
}
a.tile:hover, a.tile:focus-visible, .tile .thumb:focus-visible { background: var(--accent-soft); }
/* Square picture boxes: wide and tall drawings side by side make even rows. */
.tile img, .tile .thumb { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: #fff; }
.tile .thumb img { height: 100%; padding: 6px; }
a.tile.pic img { padding: 8px; }
.tile-name { padding: 6px 48px 8px 10px; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.tile.pic .tile-name { padding-right: 10px; text-align: center; }
.more {
  position: absolute; right: 4px; bottom: 2px; width: 44px; height: 40px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center;
}
.more:hover, .more:focus-visible { background: var(--accent-soft); color: var(--accent); }
.more svg { width: 24px; height: 24px; fill: currentColor; }

/* Categories: big circles (not .cat: the theme styles that as a category chip). */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.cat-circle {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: calc(var(--radius) + 4px);
  color: var(--text); text-decoration: none; text-align: center;
}
.cat-circle:hover, .cat-circle:focus-visible { background: var(--accent-soft); }
.cat-circle img {
  width: 112px; height: 112px; border-radius: 50%; object-fit: contain; background: #fff; padding: 8px;
  border: 1px solid var(--border);
}
.cat-circle b { font-size: 17px; }
.cat-circle small { color: var(--muted); font-size: 13px; }

.cat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cat-head h1 { margin: 0; font-size: 26px; }
.cat-head .tf-btn svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.note { padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.note.warn { border-color: #f59f00; }
#persist-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* For parents: a card of the theme. */
.parents { padding: 18px 20px; background: var(--surface); border-radius: calc(var(--radius) + 4px); border: 1px solid var(--border); }
.parents h3 { font-size: 18px; margin: 20px 0 4px; }
.parents > summary h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); }
/* Folded: its title and a one-line summary, a chevron that turns when it opens. */
.parents > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; list-style: none; cursor: pointer; }
.parents > summary::-webkit-details-marker { display: none; }
.parents > summary h2 { margin: 0; }
.parents > summary::after {
  content: ""; width: 10px; height: 10px; margin-left: auto; align-self: center; border: solid var(--accent);
  border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); transition: transform .15s;
}
.parents[open] > summary { margin-bottom: 14px; }
.parents[open] > summary::after { transform: rotate(-135deg); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.bin { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.bin li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bin img { width: 64px; height: 48px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--selected-border); }
.bin-info { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.bin-actions { display: flex; gap: 8px; margin-left: auto; }
.bin-info small { color: var(--muted); }

/* Sheets: the ⋯ of a drawing, Rename. */
dialog.sheet {
  width: min(460px, calc(100vw - 24px)); border: 1px solid var(--border); border-radius: calc(var(--radius) + 8px); padding: 18px;
  background: var(--surface); color: var(--text); box-shadow: 0 20px 48px rgba(11, 31, 77, .35);
}
dialog.sheet::backdrop { background: rgba(11, 31, 77, .45); }
dialog.sheet h2 { margin: 0 0 14px; font-size: 20px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 10px; }
.actions button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 84px; padding: 10px 4px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.actions button:hover, .actions button:focus-visible { background: var(--accent-soft); color: var(--accent); }
.actions svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.actions .danger { color: var(--danger); }
.sheet .done { display: flex; margin: 14px auto 0; min-width: 140px; }
#rename-input {
  width: 100%; min-height: 48px; padding: 0 12px; margin-bottom: 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 19px;
}

/* Deleted · Undo, and short messages: the header's navy. */
.undo-bar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: calc(var(--radius) + 4px); max-width: calc(100vw - 24px);
  background: var(--nav); color: #fff; font-weight: 600; box-shadow: 0 20px 48px rgba(11, 31, 77, .45);
}

@media (max-width: 520px) {
  .cards { gap: 10px; }
  .card { min-height: 130px; font-size: 21px; }
  .home-hero .card { flex: 1 1 140px; min-width: 0; min-height: 64px; font-size: 17px; padding: 8px 10px; }
  .card-continue img { width: 36px; height: 36px; }
  .home-hero .card svg { width: 32px; height: 32px; }
  .card svg { width: 45px; height: 45px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .cat-circle img { width: 86px; height: 86px; }
  .cat-circle b { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* Category pages for search (/coloring-pages/<category>/) and the 404 page: the sites' tool-page layout. */
.page-title { font-size: 30px; margin: 0 0 6px; }
.tool-area > .block + .block, .tool-area > .grid + .ad, .tool-area > .ad + .block { margin-top: 26px; }
.tool-area > .block h2 { font-size: 22px; margin: 0 0 12px; }
.lead { max-width: 760px; margin: 0 0 18px; color: var(--text); }
.links { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; list-style: none; }
.links a { font-weight: 600; color: var(--accent); }
