/* camera chốn riêng, controls: tools on the stage, the adjust panel, tabs, the effect strip, capture modes
   and the shutter row. Everything a thumb needs sits in the lower half; touch targets are 44 px or more. */

.controls { display: grid; gap: var(--space-2); flex: none; }

/* Tools column on the right edge of the picture. */
.tools {
  position: absolute; top: var(--space-3); right: var(--space-2); display: grid; gap: var(--space-2);
  /* On short phones the column wraps into a second column to its left instead of running off the picture. */
  grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 44px); max-height: calc(100% - var(--space-3) * 2); direction: rtl;
}
.tool {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: oklch(14% 0.016 var(--hue) / 0.62); color: var(--ink); direction: ltr;
  transition: background var(--dur-state) var(--ease-out), color var(--dur-state) var(--ease-out);
}
.tool .ico { width: 21px; height: 21px; }
.tool[aria-pressed="true"], .tool.is-set { background: var(--ink); color: var(--bg); }
.tool b { position: absolute; right: -2px; bottom: -2px; min-width: 20px; padding: 0 4px; border-radius: 999px; background: var(--lamp); color: var(--lamp-ink); font: 700 10px / 16px var(--font-body); }
.tool b:empty { display: none; }
.app[data-busy="1"] .tools { opacity: 0.4; pointer-events: none; }

/* Adjust panel: a slider row and option swatches for the selected item. */
.panel { display: grid; gap: var(--space-2); min-height: 44px; }
.panel:empty { display: none; }
.adjust { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--space-3); }
.adjust__label { font-size: var(--step--1); font-weight: 600; color: var(--ink-2); max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adjust__value { min-width: 2.6em; text-align: right; font-size: var(--step--1); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.adjust__hint { font-size: var(--step--1); color: var(--ink-3); }
.fav { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); }
.fav[aria-pressed="true"] { color: var(--lamp); }
.fav[aria-pressed="true"] .ico { fill: currentColor; }

input[type="range"] { width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--lamp) var(--fill, 50%), var(--surface-2) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-2); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--lamp); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border: 3px solid var(--bg); border-radius: 50%; background: var(--ink); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 3px solid var(--bg); border-radius: 50%; background: var(--ink); }

.swatches, .chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); }
.swatches::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.swatch { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.swatch i { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 0.18); }
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.chips .chip { flex: none; }

.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-3); border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-size: var(--step--1); font-weight: 500; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip__dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px oklch(50% 0 0 / 0.35); }

/* Tabs. */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 44px; min-width: 44px; padding: 0 var(--space-3); border: 0; border-radius: 999px; background: none; color: var(--ink-3); font-weight: 600; font-size: var(--step--1); }
.tab[aria-selected="true"] { background: var(--surface-2); color: var(--ink); }
.tab .ico { width: 18px; height: 18px; vertical-align: -4px; }
.tab[aria-selected="true"] .ico { fill: var(--lamp); stroke: var(--lamp); }

/* Strip: horizontal scroll of live tiles. */
.strip { display: flex; align-items: flex-start; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding: 2px var(--space-4) var(--space-1); scroll-padding-inline: var(--space-4); overscroll-behavior-x: contain; }
.strip::-webkit-scrollbar { display: none; }
.tile { position: relative; flex: none; display: grid; justify-items: center; gap: 4px; width: 68px; padding: 0; border: 0; background: none; color: var(--ink-2); -webkit-touch-callout: none; user-select: none; }
.tile__art { width: 60px; height: 60px; border-radius: 16px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); display: block; }
.tile__name { max-width: 68px; font-size: 11px; line-height: 1.25; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile[aria-pressed="true"] .tile__art { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.tile[aria-pressed="true"] .tile__name { color: var(--ink); font-weight: 600; }
.tile.is-on::after { content: ""; position: absolute; top: 2px; left: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 2px var(--bg); }
.tile__star { position: absolute; top: -2px; right: 2px; width: 16px; height: 16px; color: var(--lamp); fill: var(--lamp); stroke: var(--bg); stroke-width: 1.5; }
.strip__group { flex: none; align-self: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-3); padding: 0 2px; }
.strip__empty { padding: var(--space-3) 0; font-size: var(--step--1); color: var(--ink-3); }

/* Capture modes and their options. */
.mode-opts { display: grid; gap: var(--space-2); }
.mode-opts__row { justify-content: safe center; }
.mode-opts__note { margin: 0; font-size: var(--step--1); color: var(--ink-3); text-align: center; text-wrap: balance; }
.modes { display: flex; gap: var(--space-1); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); justify-content: safe center; }
.modes::-webkit-scrollbar { display: none; }
.modes button { position: relative; flex: none; min-height: 44px; padding: 0 var(--space-3); border: 0; background: none; color: var(--ink-3); font-family: var(--font-hand); font-weight: 600; font-size: var(--step-0); border-radius: 999px; white-space: nowrap; }
.modes button[aria-pressed="true"] { color: var(--ink); }
.modes button[aria-pressed="true"]::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--lamp); }
.modes button:disabled { opacity: 0.4; cursor: not-allowed; }

.shutter-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; padding-bottom: var(--space-1); }
.shutter-row > .thumb { grid-column: 1; justify-self: start; }
.shutter-row > .shutter { grid-column: 2; }
.shutter-row > .roundbtn { grid-column: 3; justify-self: end; }
.shutter { position: relative; width: 76px; height: 76px; padding: 0; border: 4px solid var(--ink); border-radius: 50%; background: transparent; display: grid; place-items: center; transition: transform var(--dur-press) var(--ease-out); }
.shutter i { width: 56px; height: 56px; border-radius: 50%; background: var(--lamp); transition: border-radius var(--dur-state) var(--ease-out), background var(--dur-state) var(--ease-out), transform var(--dur-state) var(--ease-out); }
.shutter:active { transform: scale(0.95); }
.shutter:disabled { opacity: 0.5; cursor: not-allowed; }
.app[data-mode="video"] .shutter i, .app[data-mode="boomerang"] .shutter i { background: var(--coral); }
.shutter.is-recording i { border-radius: 10px; transform: scale(0.55); }
.thumb { width: 52px; height: 52px; padding: 0; border: 2px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-height: 700px) {
  .tile { width: 60px; }
  .tile__art { width: 52px; height: 52px; border-radius: 14px; }
  .shutter { width: 68px; height: 68px; }
  .shutter i { width: 50px; height: 50px; }
}
