/* Studio shared components (base tokens, nav and controls live in css/base/). */
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.local { background: var(--green-bg); color: var(--green); }
.tag.ai { background: var(--orange-bg); color: var(--orange); }
.tag.gpu { background: #efe8fd; color: #6b3fd4; }
.cost { color: var(--orange); } .free { color: var(--green); }
.state { font-weight: 600; font-size: 12px; }
.state.PENDING, .state.CANCELLED, .state.REJECTED { color: #8a8f98; }
.state.GENERATING, .state.COMPOSITING, .state.VALIDATING { color: var(--blue); }
.state.READY_FOR_REVIEW { color: #e67e22; } .state.APPROVED, .state.EXPORTED { color: #27ae60; }
.state.FAILED, .state.BLOCKED { color: #eb5757; } .state.PAUSED { color: var(--purple); }
.bar { height: 8px; background: #e8ebf1; border-radius: 999px; overflow: hidden; min-width: 90px; }
.bar > div { height: 100%; background: var(--blue); border-radius: inherit; transition: width .3s; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px; cursor: pointer;
        box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: #bcd0fb; box-shadow: var(--shadow); transform: translateY(-1px); }
.card img { width: 100%; height: 200px; object-fit: contain; background: #f3f5f9; border-radius: 8px; }
.card .t { font-weight: 600; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checker { background-color: #f3f5f9; border-radius: 8px; }
.scroll { overflow: auto; }
.kv td:first-child { color: var(--muted); padding-right: 10px; white-space: nowrap; border: 0; padding: 2px 10px 2px 0; }
.kv td { border: 0; padding: 2px 0; }
label.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* image viewer */
#lightbox { width: 96vw; height: 94vh; max-width: none; max-height: none; padding: 0; border: none; border-radius: 10px;
            background: #1c1e22; overflow: hidden; }
#lightbox::backdrop { background: rgba(0, 0, 0, .75); }
#lightbox .lb-wrap { position: absolute; inset: 0 0 48px 0; display: flex; align-items: center; justify-content: center;
                     overflow: hidden; background: repeating-conic-gradient(#2a2d33 0 25%, #23262b 0 50%) 0 0 / 24px 24px; }
#lightbox .lb-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; touch-action: none;
                    user-select: none; transition: transform .08s ease-out; }
#lightbox .lb-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; display: flex; gap: 6px;
                    align-items: center; justify-content: center; background: #111317; color: #ddd; }
#lightbox .lb-info { margin-right: 10px; font-size: 13px; }
img.zoomable { cursor: zoom-in; }
.card { position: relative; }
.card .zoombtn { position: absolute; top: 14px; right: 14px; opacity: .85; padding: 2px 6px; }
.card .zoombtn:hover { opacity: 1; }

/* Phone-style chat popup (💬 Chat): one GIF of the character on top, text bubbles below */
.phone-back { position: fixed; inset: 0; background: rgba(15,18,25,.35); z-index: 900; opacity: 0; transition: opacity .25s; }
.phone-back.open { opacity: 1; }
.phone { position: fixed; z-index: 901; left: 50%; bottom: 0; width: min(380px, 100vw); height: min(760px, 94vh);
         transform: translate(-50%, 105%); transition: transform .32s cubic-bezier(.2,.8,.2,1);
         background: #fff; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25);
         display: flex; flex-direction: column; overflow: hidden; border: 8px solid #1f2430; border-bottom: 0; }
.phone.open { transform: translate(-50%, 0); }
.phone-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #eceef2; }
.phone-top b { flex: 1; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-top .x { border: 0; background: #f0f2f5; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 15px; }
.phone-stage { height: 38%; min-height: 200px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; position: relative; }
.phone-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.phone-stage .emo { position: absolute; left: 10px; bottom: 8px; font-size: 11px; background: rgba(255,255,255,.85);
                    border-radius: 10px; padding: 2px 8px; color: #555; }
.phone-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fafbfc; }
.phone-log .msg { max-width: 80%; padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.35; white-space: pre-wrap; word-wrap: break-word; }
.phone-log .me { align-self: flex-end; background: #2f80ed; color: #fff; border-bottom-right-radius: 4px; }
.phone-log .bot { align-self: flex-start; background: #e9ebef; color: #1f2430; border-bottom-left-radius: 4px; }
.phone-log .err { align-self: center; color: #c0392b; font-size: 12px; text-align: center; }
.phone-log .typing { color: #888; }
.phone-in { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #eceef2; }
.phone-in input { flex: 1; border: 1px solid #d0d5dd; border-radius: 20px; padding: 9px 14px; font: inherit; font-size: 14px; }
.phone-in button { border: 0; background: #2f80ed; color: #fff; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 16px; }
.phone-in button:disabled { opacity: .5; }

/* queue report (Tạo animation) */
.qsum { border: 1px solid #eceef2; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #fafbfc; }
.qtiles { display: flex; gap: 6px; flex-wrap: wrap; }
.qt { flex: 1; min-width: 78px; background: #fff; border: 1px solid #eceef2; border-radius: 6px; padding: 5px 8px; display: flex; flex-direction: column; }
.qt b { font-size: 18px; line-height: 1.2; } .qt span { font-size: 11px; color: #6b7280; }
.qchar { background: #fff3d6; color: #6b5200; border-radius: 10px; padding: 1px 8px; text-decoration: none; font-size: 12px; }

/* character avatar (head crop, transparent) */
.card .t img.avatar, img.avatar { width: 28px; height: 28px; min-width: 28px; border-radius: 50%; object-fit: cover;
  background: #eef1f6; border: 1px solid var(--line); margin: 0; }
img.avatar.big { width: 112px; height: 112px; }
.card .selbox { position: absolute; top: 14px; left: 14px; background: #fff; border-radius: 6px; padding: 2px 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); line-height: 0; z-index: 2; }
.card .selbox input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
