/* NiceUI Animation Studio — app layout. Shares .gm-* control styles from styles.css. */
.an [hidden] { display: none !important; }
.an { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - var(--ap-bar, 52px)); height: calc(100dvh - var(--ap-bar, 52px)); }
.an-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; padding: 14px; }

/* stage */
.an-stage { position: relative; min-height: 0; overflow: hidden; border-radius: 20px; border: 1px solid var(--line-2); background: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 18px 18px, radial-gradient(120% 90% at 50% 0%, rgba(56,189,248,.08), transparent 60%), #05070a; }
html[data-theme="light"] .an-stage { background: radial-gradient(rgba(0,0,0,.08) 1px, transparent 1px) 0 0 / 18px 18px, radial-gradient(120% 90% at 50% 0%, rgba(14,165,233,.08), transparent 60%), #fafafa; }
.an-targets { position: absolute; inset: 0 0 56px; display: grid; place-items: center; padding: 24px; }
.an-card { width: min(380px, 100%); padding: 24px; border-radius: 18px; border: 1px solid rgba(255,255,255,.12); background: rgba(12,14,17,.86); color: #f3f4f6; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.an-card-tag { font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #7dd3fc; }
.an-card-h { margin-top: 10px; font-size: 22px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.2; }
.an-card-p { margin-top: 6px; font-size: 13.5px; color: #a3a8b0; }
.an-card-btn { display: inline-flex; margin-top: 16px; padding: 8px 14px; border-radius: 999px; background: #f3f4f6; color: #000; font-size: 13px; font-weight: 500; }
.an-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; background: #7dd3fc; color: #001018; font-size: 15px; font-weight: 500; box-shadow: 0 0 0 1px rgba(125,211,252,.4), 0 10px 36px -10px rgba(56,189,248,.7); }
.an-head { max-width: 14ch; text-align: center; font-size: clamp(34px, 5vw, 60px); font-weight: 500; line-height: 1.02; letter-spacing: -0.045em; color: var(--text); }
.an-icon { width: 104px; height: 104px; display: grid; place-items: center; border-radius: 28px; color: #7dd3fc; background: rgba(125,211,252,.08); border: 1px solid rgba(125,211,252,.3); }
.an-list { width: min(380px, 100%); display: grid; gap: 8px; }
.an-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--s2); font-size: 14px; color: var(--text); }
.an-dot { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--h) 85% 65%); }
.an-row-m { margin-left: auto; font: 11px var(--mono); color: var(--dim); }
.an-stage-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.an-pill { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.55); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.12); }
.an-pill button { height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; color: rgba(255,255,255,.72); }
.an-pill button:hover { color: #fff; }
.an-pill button[aria-pressed="true"] { background: #fff; color: #000; }
.an-replay { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 12px; background: #fff; color: #000; font-size: 13px; font-weight: 500; }
.an-replay:active { transform: scale(.97); }

/* curve strip */
.an-curve-strip { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--s1); }
.an-curve-box { display: grid; gap: 6px; }
.an-curve { width: 100%; aspect-ratio: 1; touch-action: none; overflow: visible; }
.an-grid-bg { fill: var(--s2); stroke: var(--line-2); }
.an-grid { stroke: var(--line); fill: none; }
.an-diag { stroke: var(--line-3); stroke-dasharray: 3 4; fill: none; }
.an-arm { stroke: var(--mute); stroke-width: 1.2; }
.an-path { fill: none; stroke: var(--sky); stroke-width: 2.6; stroke-linecap: round; }
.an-h { fill: var(--bg); stroke: var(--sky); stroke-width: 2.5; cursor: grab; outline: none; }
.an-h:focus-visible { stroke-width: 4; }
.an-h:active { cursor: grabbing; }
.an-marker { fill: #fff; }
.an-ease-val { font: 11px var(--mono); color: var(--mute); overflow-wrap: anywhere; }
.an-compare { display: grid; align-content: center; gap: 14px; min-width: 0; }
.an-compare-h { font-size: 13px; font-weight: 500; color: var(--mute); }
.an-track { position: relative; height: 30px; display: flex; align-items: center; border-radius: 999px; background: var(--s2); border: 1px solid var(--line); }
.an-track span { position: absolute; left: 12px; font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.an-track i { position: absolute; left: 0; top: 7px; width: 14px; height: 14px; margin-left: 0; border-radius: 50%; background: var(--sky); box-shadow: 0 0 14px var(--sky); }
.an-track:last-of-type i { background: var(--mute); box-shadow: none; }
.an-track i { transform: translateX(0); }
.an-tip { font-size: 12px; line-height: 1.5; color: var(--dim); }

/* side panel */
.an-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--s1); }
.an-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.an-scroll .gm-card { background: var(--s2); }
.an-group { margin-top: 2px; font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.an-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.an-presets button { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; color: var(--mute); text-align: left; transition: border-color .2s, color .2s; }
.an-presets button:hover { color: var(--text); border-color: var(--line-3); }
.an-presets button[aria-pressed="true"] { color: var(--text); border-color: var(--sky); box-shadow: 0 0 0 1px var(--sky); }
.an-pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.an-presets button[aria-pressed="true"] .an-pdot { background: var(--sky); }
.an-eases button[aria-pressed="true"] { color: var(--sky-ink); background: var(--sky); border-color: var(--sky); }
.an .gm-row { display: grid; gap: 6px; font-size: 13px; color: var(--mute); }
.an-seg3 { grid-template-columns: repeat(3, 1fr); }
.an-seg4 { grid-template-columns: repeat(4, 1fr); }
.an-export { display: grid; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--s1); }
.an-export .gm-code { max-height: 150px; }

@media (max-width: 1000px) {
  .an { height: auto; grid-template-columns: 1fr; }
  .an-stage { height: 56vh; min-height: 360px; }
  .an-side { border-left: 0; border-top: 1px solid var(--line); }
  .an-scroll { overflow: visible; }
  .an-export { position: sticky; bottom: 0; z-index: 5; }
}
@media (max-width: 560px) {
  .an-curve-strip { grid-template-columns: 1fr; }
  .an-curve-box { max-width: 240px; justify-self: center; width: 100%; }
  .an-pill button { padding: 0 8px; font-size: 12px; }
}
