/* Sign-in page (hosted mode), in the same creator look as the home page */
body.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-wrap { width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.auth-logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 20px; margin-bottom: 28px; }
.auth-logo span { width: 8px; height: 20px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent-2)); }
.auth-side h1 { margin: 0; font-size: 36px; line-height: 1.12; letter-spacing: -0.02em; color: var(--heading); }
.auth-side p { color: var(--muted); font-size: 16px; margin: 12px 0 0; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px;
             box-shadow: 0 18px 40px -28px color-mix(in srgb, var(--accent) 60%, transparent); }
.auth-card h2 { margin: 0 0 4px; font-size: 22px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
.auth-card > .muted { margin: 0 0 18px; font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.auth-field input { flex: none; box-sizing: border-box; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg);
                    color: var(--ink); font: inherit; font-size: 15px; font-weight: 400; outline: 0; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.auth-form button.big, .auth-row button.primary { height: 44px; font-size: 15px; justify-content: center; }
.auth-forgot { text-align: right; font-size: 13px; margin-top: -4px; }
.auth-err { margin: 0; min-height: 1em; color: var(--err); font-size: 13px; }
.auth-err:empty { display: none; }
.auth-alt { margin: 18px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.auth-card a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-card a:hover { text-decoration: underline; }
a.button.google { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border-radius: 9px;
                  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 15px; }
a.button.google:hover { border-color: var(--muted); text-decoration: none; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.auth-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
             background: var(--soft); color: var(--accent); margin-bottom: 12px; }
.auth-note { font-size: 15px; }
@media (max-width: 820px) { .auth-wrap { grid-template-columns: 1fr; gap: 24px; } .auth-side h1 { font-size: 28px; } }

/* Split screen: a brand panel showing what the app does (the AI camera at work), the form beside it */
body.auth-page { display: block; padding: 16px; }
body.auth-page .auth-wrap { width: 100%; min-height: calc(100vh - 32px); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; align-items: stretch; }
.auth-page .auth-card { align-self: center; justify-self: center; width: min(420px, calc(100% - 48px)); }
.auth-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
             padding: 44px clamp(28px, 4vw, 56px); border-radius: 28px; color: #fff; isolation: isolate;
             background: radial-gradient(70% 60% at 85% 10%, rgba(218, 119, 242, .55), transparent 70%),
                         radial-gradient(60% 50% at 0% 100%, rgba(77, 171, 247, .35), transparent 70%),
                         linear-gradient(160deg, #2b1470 0%, #4a23b5 50%, #6a1b8f 100%); }
.auth-side::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
                     background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 22px 22px;
                     mask-image: linear-gradient(180deg, #000, transparent 75%); }
.auth-side .auth-logo { color: #fff; margin-bottom: 22px; }
.auth-side .auth-logo span { background: linear-gradient(#fff, #e5dbff); }
.auth-side h1 { color: #fff; font-size: clamp(28px, 3vw, 40px); max-width: 17ch; }
.auth-side h1 em { font-style: normal; background: linear-gradient(90deg, #ffd8a8, #faa2c1 50%, #d0bfff);
                   -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-side p { color: rgba(255, 255, 255, .78); max-width: 40ch; }

.auth-visual { position: relative; margin: 30px 0 0; width: min(100%, calc((100vh - 450px) * 1.75)); min-width: 340px; padding: 0 22% 9% 0; }
.av-window { position: relative; width: 100%; border-radius: 16px; overflow: hidden; background: #160f30;
             border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 30px 60px -24px rgba(10, 4, 40, .8); }
.av-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; font-size: 11.5px; color: rgba(255, 255, 255, .6); }
.av-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.av-bar span { margin-left: 8px; }
.av-bar b { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px;
            font-size: 10.5px; color: #fff; background: rgba(255, 255, 255, .12); }
.av-bar b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff6b6b; box-shadow: 0 0 0 3px rgba(255, 107, 107, .25);
                    animation: av-blink 1.6s ease-in-out infinite; }
.av-wide { display: block; width: 100%; height: auto; }
.av-crop { fill: none; stroke: #fff; stroke-width: 2.2; stroke-dasharray: 6 4; }
.av-timeline { position: relative; padding: 9px 12px 11px; }
.av-shots { display: flex; gap: 3px; height: 14px; }
.av-shots span { border-radius: 4px; background: #748ffc; }
.av-shots span:nth-child(1) { flex: 46; } .av-shots span:nth-child(2) { flex: 50; background: #38d9a9; } .av-shots span:nth-child(3) { flex: 4; }
.av-wave { height: 14px; margin-top: 5px; opacity: .5;
           background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 5px);
           mask-image: linear-gradient(180deg, transparent 0 30%, #000 30% 70%, transparent 70%),
                       repeating-linear-gradient(90deg, #000 0 15px, transparent 15px 22px, #000 22px 31px, transparent 31px 34px);
           mask-composite: add; }
.av-playhead { position: absolute; top: 4px; bottom: 6px; left: 12px; width: 2px; border-radius: 2px; background: #fff;
               box-shadow: 0 0 8px rgba(255, 255, 255, .8); animation: av-play 8s linear infinite; animation-delay: var(--av-t, 0s); }

.av-phone { position: absolute; right: 0; top: 6%; width: 27%; aspect-ratio: 9 / 19; border-radius: 24px; overflow: hidden;
            border: 5px solid #0f0a22; background: #0f0a22; box-shadow: 0 30px 60px -18px rgba(10, 4, 40, .9), 0 0 0 1px rgba(255, 255, 255, .12); }
.av-phone::before { content: ""; position: absolute; z-index: 2; top: 6px; left: 50%; translate: -50% 0; width: 32%; height: 8px;
                    border-radius: 99px; background: #0f0a22; }
.av-phone svg { display: block; width: 100%; height: 100%; }
.av-track { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.av-caption { position: absolute; left: 7%; right: 7%; bottom: 13%; padding: 5px 4px; border-radius: 7px; text-align: center;
              font-size: clamp(9px, .95vw, 12px); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1.25;
              color: #fff; background: rgba(0, 0, 0, .55); animation: av-cap1 8s steps(1) infinite; animation-delay: var(--av-t, 0s); }
.av-caption b { color: #ffd43b; }
.av-caption.c2 { animation-name: av-cap2; }
.av-res { position: absolute; top: 18px; right: 8px; padding: 2px 6px; border-radius: 5px; font-size: 9px; font-weight: 700;
          color: #fff; background: rgba(0, 0, 0, .4); }

.av-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.av-features div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 11px 12px;
                   border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.av-features i { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-style: normal;
                 font-size: 12px; font-weight: 800; color: #2b1470; background: linear-gradient(135deg, #ffd8a8, #faa2c1); }
.av-features b { font-size: 13.5px; color: #fff; }
.av-features span { font-size: 12px; line-height: 1.3; color: rgba(255, 255, 255, .7); }
@keyframes av-blink { 50% { opacity: .35; } }
@keyframes av-play { to { left: calc(100% - 14px); } }
@keyframes av-cap1 { 0% { opacity: 1; } 47% { opacity: 0; } 96% { opacity: 1; } }
@keyframes av-cap2 { 0% { opacity: 0; } 47% { opacity: 1; } 96% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .av-playhead, .av-bar b::before, .av-caption { animation: none; } .av-caption.c2 { display: none; } }

@media (max-height: 780px) {
  .auth-side { padding-top: 28px; padding-bottom: 26px; }
  .auth-side .auth-logo { margin-bottom: 14px; }
  .auth-side h1 { font-size: clamp(26px, 2.6vw, 34px); }
  .auth-visual { margin-top: 20px; }
}
@media (max-width: 900px) {
  body.auth-page .auth-wrap { grid-template-columns: 1fr; min-height: 0; gap: 20px; }
  .auth-side { padding: 26px 24px; }
  .auth-visual, .av-features { display: none; }
  .auth-page .auth-card { width: 100%; max-width: 480px; }
}

/* Account menu in the app's header (hosted mode) */
.account { position: relative; }
.account > button { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; }
.account .avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
                   color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.account .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px; padding: 6px;
                 background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.3); }
.account .menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 13px; }
.account .menu .who strong { display: block; font-size: 14px; }
.account .menu button { width: 100%; border: 0; background: transparent; justify-content: flex-start; padding: 8px 10px; border-radius: 8px; }
.account .menu button:hover { background: var(--soft); }
/* YouTube import on the hosted service: only for whoever the youtube_import setting allows */
body.no-youtube .nb-yt { display: none; }
body.no-exports .export-only { display: none !important; }
.exports-off { display: none; }
body.no-exports .exports-off { display: revert; }

/* Credits (hosted mode): balance in the header, Credits window */
.credits-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; margin-right: 8px;
                background: var(--soft); border-color: transparent; color: var(--ink); font-size: 13px; }
.credits-pill strong { color: var(--accent); }
.credits-pill .unit { color: var(--muted); }
.credits-pill.low strong { color: var(--err); }
.account { display: flex; align-items: center; }
.credits-dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0 0 18px; width: min(520px, calc(100vw - 32px));
                  background: var(--panel); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.credits-dialog::backdrop { background: rgba(20, 16, 40, .45); }
.credits-dialog > * { margin-left: 20px; margin-right: 20px; }
.cd-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.cd-head h2 { margin: 0; font-size: 19px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
.cd-head button { border: 0; background: transparent; }
.cd-balance { display: flex; flex-direction: column; align-items: flex-start; margin-top: 10px; padding: 14px 16px; border-radius: 14px;
              background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--panel)), color-mix(in srgb, var(--accent-2) 10%, var(--panel))); }
.cd-balance strong { font-size: 34px; line-height: 1.1; color: var(--accent); }
.cd-costs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.cd-costs div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.cd-costs strong { font-size: 16px; color: var(--ink); }
.cd-note { font-size: 12.5px; margin-top: 10px; }
.cd-more { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.credits-dialog h3 { font-size: 14px; margin-top: 14px; margin-bottom: 6px; }
.cd-history { list-style: none; padding: 0; margin-top: 0; max-height: 240px; overflow-y: auto; font-size: 13px; }
.cd-history li { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cd-history .delta { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cd-history .delta.pos { color: var(--ok); } .cd-history .delta.neg { color: var(--err); }
