/* Kadrora: independently implemented patterns selected from 21st.dev.
   Quiet surfaces; tactile actions; media as the visual focal point. */
:root { --atelier-raised: inset 0 1px 0 rgba(255,255,255,.16), 0 2px 3px rgba(0,0,0,.12); }
html[data-theme="light"] { --atelier-raised: inset 0 1px 0 #fff, 0 2px 3px rgba(35,42,60,.08); }
.pricing-shell .pricing-starter-cta {
  --cf-text: #f6f8ff;
  --cf-muted: #ccd4e5;
  --cf-accent: #b9cfff;
  background: #101722 !important;
  color: #f6f8ff !important;
}
.pricing-shell .pricing-starter-cta :is(h2, strong, .section-kicker, .button-ghost) { color: #f6f8ff !important; }
.pricing-shell .pricing-starter-cta > p { color: #ccd4e5 !important; }
.pricing-shell .pricing-starter-cta .button-ghost { background: #253147 !important; border-color: #7385a5 !important; }
.pricing-shell .pricing-starter-cta .button-ghost:focus-visible { outline: 2px solid #b9cfff; outline-offset: 4px; }
body.app-shell, body.public-shell { background: var(--cf-bg) !important; }
.cf-app-header, .public-nav { box-shadow: 0 1px 0 var(--cf-line) !important; border-radius: 0 !important; background: var(--cf-panel) !important; }
.creator-primary a, .credit-pill, .account-menu summary { box-shadow: none !important; }
.creator-primary a.active { box-shadow: var(--atelier-raised) !important; }
.theme-toggle { border-radius: 50% !important; background: var(--cf-panel-2) !important; box-shadow: var(--atelier-raised) !important; transition: background-color .18s, transform .18s; }
.theme-toggle:hover { transform: rotate(12deg); }
.button, .control-chip, .reference-add, .generate-button, .flow-actions a, .filter-bar button { box-shadow: var(--atelier-raised) !important; border-radius: 12px !important; }
.button:active, .control-chip:active, .generate-button:active { transform: translateY(1px); }
.generate-button, .button-dark { background: linear-gradient(180deg,#5375fb,#3155dc) !important; box-shadow: inset 0 1px 0 #89a0ff,0 2px 4px #1a33932b !important; }
#studio-app .cf-composer { background: var(--cf-panel) !important; border: 1px solid var(--cf-line-strong) !important; border-radius: 22px !important; box-shadow: 0 8px 30px rgba(0,0,0,.07) !important; }
#studio-app .composer-head { padding: 16px 20px !important; border-bottom: 0 !important; }
#studio-app .composer-body { padding: 0 20px !important; gap: 10px !important; }
#studio-app .image-composer-label small { font-size: 12px !important; }
#studio-app .prompt-card { border: 0 !important; background: transparent !important; border-radius: 0 !important; box-shadow: none !important; outline: none !important; }
#studio-app .prompt-card:focus-within { outline: none !important; }
#studio-app .prompt-card textarea { background: transparent !important; border: 0 !important; box-shadow: none !important; outline: none !important; padding: 14px 0 48px !important; min-height: 140px !important; max-height: 320px; resize: none; line-height: 1.65 !important; }
#studio-app .prompt-tools { padding-inline: 0 !important; }
#studio-app .composer-controls { padding: 14px 20px !important; border-top: 1px solid var(--cf-line) !important; }
#studio-app .control-chip { padding: 9px 11px !important; min-height: 42px !important; background: var(--cf-panel-2) !important; border: 1px solid var(--cf-line) !important; font-weight: 600 !important; }
#studio-app .reference-unified { display: flex !important; flex-direction: column; align-items: stretch !important; padding: 0 !important; }
#studio-app .reference-unified > label { min-height: 44px !important; padding: 4px 0 !important; width: fit-content !important; gap: 10px !important; }
#studio-app .reference-unified strong { font-size: 13px !important; font-weight: 600 !important; }
#studio-app .reference-unified small { font-size: 11px !important; margin-top: 0 !important; }
#studio-app .reference-add { width: 36px !important; height: 36px !important; flex-basis: 36px !important; background: var(--cf-panel-2) !important; }
.attachment-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-strip:empty { display: none; }
#studio-app .attachment-chip { display: flex; position: relative; align-items: center; gap: 8px; max-width: 100%; padding: 5px 8px 5px 5px; border: 1px solid var(--cf-line); border-radius: 12px; background: var(--cf-panel-2); }
#studio-app .attachment-chip img, .attachment-type { width: 42px; height: 42px; object-fit: cover; border-radius: 7px; display: grid; place-items: center; }
#studio-app .attachment-chip > span { font-size: 12px; }
#studio-app .attachment-chip button { position: static !important; width: 30px !important; height: 36px !important; background: transparent; border: 0; color: var(--cf-muted); cursor: pointer; }
#studio-app .reference-field:focus-within { outline: none; }
#studio-app .reference-field:focus-within .reference-add { outline: 2px solid var(--cf-accent); outline-offset: 3px; }
#studio-app .workspace-modes { background: var(--cf-input) !important; padding: 4px !important; box-shadow: none !important; border-radius: 12px !important; }
#studio-app .workspace-modes button { border-radius: 9px !important; box-shadow: none !important; font-size: 12px !important; }
#studio-app .workspace-modes button.active { background: var(--cf-panel) !important; box-shadow: var(--atelier-raised) !important; }
#studio-app .preset-summary { gap: 10px !important; }
#studio-app .preset-thumb { width: 40px !important; height: 40px !important; min-width: 40px !important; border-radius: 8px !important; box-shadow: none !important; }
#studio-app .preset-summary strong { font-size: 13px !important; }
#studio-app .preset-summary b { font-size: 11px !important; }
#studio-app .floating-panel { border-radius: 18px !important; box-shadow: 0 20px 65px #0003 !important; border: 1px solid var(--cf-line-strong) !important; }
#studio-app .model-option { box-shadow: none !important; border: 0 !important; border-radius: 10px !important; padding: 12px !important; }
#studio-app .model-option[hidden], #studio-app .preset-summary[hidden], #studio-app .reference-zone[hidden] { display: none !important; }
#studio-app .model-option.active { background: var(--cf-hover) !important; box-shadow: inset 3px 0 var(--cf-accent) !important; }
#studio-app .model-option small { line-height: 1.5; }
#studio-app.kind-video .cf-result-workspace { border: 0 !important; box-shadow: none !important; background: transparent !important; }
#studio-app.kind-video .generation-stage { border: 1px solid var(--cf-line) !important; box-shadow: none !important; background: var(--cf-input) !important; border-radius: 18px !important; }
.flow-explore .flow-hero { display: grid !important; grid-template-columns: 1fr 1.1fr !important; gap: 48px !important; align-items: center; padding: 32px 0 48px !important; background: transparent !important; box-shadow: none !important; border: 0 !important; }
.flow-explore .flow-actions a:not(:first-child) { background: var(--cf-panel-2) !important; color: var(--cf-text) !important; }
.flow-explore .flow-hero h1 { font-size: clamp(32px,4vw,54px) !important; line-height: 1.1 !important; letter-spacing: -.04em; }
.flow-explore .flow-hero-copy { position: static !important; }
.explore-bento { display: grid; grid-template-columns: 1.05fr 1fr; grid-template-rows: 175px 175px; gap: 12px; }
.explore-bento a { position: relative; overflow: hidden; border-radius: 18px; isolation: isolate; }
.explore-bento .bento-main { grid-row: span 2; }
.explore-bento img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.explore-bento a:hover img { transform: scale(1.035); }
.explore-bento a::after { content: ''; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent,#081019d9); z-index: 0; }
.explore-bento a > span { position: absolute; bottom: 18px; left: 18px; right: 12px; color: #fff; z-index: 1; }
.explore-bento strong, .explore-bento small { display: block; }
.explore-bento small { font-size: 11px; margin-bottom: 5px; color: #e6eaf3; }
.explore-bento strong { font-size: 17px; }
.model-lines a { box-shadow: none !important; border-radius: 0 !important; background: transparent !important; border-bottom: 1px solid var(--cf-line) !important; }
.model-lines a:hover { background: var(--cf-hover) !important; }
.filter-bar { gap: 6px !important; }
.filter-bar button { border: 1px solid transparent; background: transparent; padding: 9px 16px; color: var(--cf-muted); font: inherit; cursor: pointer; box-shadow: none !important; }
.filter-bar button.active { background: var(--cf-panel-2); color: var(--cf-text); border-color: var(--cf-line); box-shadow: var(--atelier-raised) !important; }
.library-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.library-card { border: 0 !important; box-shadow: none !important; background: transparent !important; overflow: hidden; }
.library-card[hidden], .empty-filter[hidden] { display: none !important; }
.library-preview { position: relative; aspect-ratio: 4/3; height: auto !important; border-radius: 16px; overflow: hidden; background: var(--cf-panel-2) !important; }
.library-preview img, .library-preview video { width: 100%; height: 100%; object-fit: contain; }
.library-meta { padding: 12px 2px !important; }
.result-actions>span { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.empty-library { grid-column: 1/-1; background: transparent !important; border: 1px dashed var(--cf-line-strong) !important; box-shadow: none !important; }
.empty-filter { padding: 40px; text-align: center; color: var(--cf-muted); }
.media-lightbox { width: min(1280px,calc(100vw - 24px)); height: min(860px,calc(100dvh - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 12px; overflow: hidden; border: 1px solid var(--cf-line-strong); border-radius: 20px; background: var(--cf-panel); color: var(--cf-text); }
.media-lightbox[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.media-lightbox::backdrop { background: #080b12c9; backdrop-filter: blur(6px); }
.lightbox-bar, .lightbox-footer { display: flex; align-items: center; gap: 16px; }
.lightbox-bar { min-height: 48px; justify-content: space-between; padding-bottom: 8px; }
.media-lightbox button { border: 1px solid var(--cf-line); background: var(--cf-panel-2); color: var(--cf-text); border-radius: 10px; min-width: 44px; height: 44px; cursor: pointer; font-size: 20px; }
#lightbox-media, .fullscreen-media { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: #050506; }
#lightbox-media img, #lightbox-media video, .fullscreen-media img, .fullscreen-media video { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; background: #050506; }
#lightbox-media > :is(img,video) {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  object-fit: contain;
}
.lightbox-footer { min-height: 52px; padding-top: 8px; overflow-x: auto; flex-wrap: nowrap; }
.lightbox-footer p { flex: 1; min-width: 0; max-height: 60px; overflow-y: auto; font-size: 13px; }
.lightbox-footer a { flex: 0 0 auto; padding: 9px 10px; border: 1px solid var(--cf-line); border-radius: 10px; color: var(--cf-accent); background: var(--cf-panel-2); font-size: 13px; }
.progress-line.is-indeterminate { overflow: hidden; }
.progress-line.is-indeterminate i { width: 34% !important; animation: progress-indeterminate 1.25s ease-in-out infinite; }
.result-action-button { padding: 0; border: 0; color: white; background: transparent; cursor: pointer; font-size: 9px; }
.job-wait .progress-line { width: min(260px,70%); margin: 10px 0 2px; }
.job-image-viewer .fullscreen-media { width: 100%; height: 100%; }
.job-image-viewer .fullscreen-media :is(img,video) { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Studio fullscreen: media owns the whole viewport; chrome floats above it. */
.studio-media-viewer {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #050506;
}
.studio-media-viewer[open] { display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr); }
.studio-media-viewer .fullscreen-media {
  position: relative;
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.studio-media-viewer .fullscreen-media > :is(img,video) {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  object-fit: contain;
}
.studio-media-viewer .lightbox-bar,
.studio-media-viewer .studio-viewer-footer {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  color: #fff;
  background: rgba(12,14,16,.72);
  box-shadow: 0 14px 40px rgba(0,0,0,.24);
  backdrop-filter: blur(18px);
}
.studio-media-viewer .lightbox-bar { top: 18px; min-height: 52px; padding: 4px 5px 4px 14px; }
.studio-media-viewer .studio-viewer-footer { bottom: 18px; min-height: 54px; padding: 8px; }
.studio-media-viewer .studio-viewer-footer p {
  margin: 0;
  color: rgba(255,255,255,.78);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.studio-media-viewer .studio-viewer-footer a {
  border-color: rgba(255,255,255,.14);
  color: #fff;
  background: rgba(255,255,255,.1);
}
@keyframes progress-indeterminate { from { transform: translateX(-115%); } to { transform: translateX(340%); } }
@media(max-width:900px) { .flow-explore .flow-hero { grid-template-columns: 1fr !important; gap: 28px !important; } .explore-bento { grid-template-rows: 160px 160px; } .library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:680px) {
  #studio-app.kind-video .cf-composer { order: 0 !important; }
  #studio-app.kind-video .cf-result-workspace { order: 1 !important; }
  .flow-explore .flow-hero h1 { max-width: 100% !important; }
  .flow-explore .flow-actions { flex-direction: row !important; flex-wrap: wrap; }
  #studio-app .composer-head { padding: 14px !important; }
  #studio-app .composer-body { padding: 0 14px !important; }
  #studio-app .composer-controls { padding: 14px !important; }
  .explore-bento { grid-template-rows: 140px 140px; gap: 8px; }
  .explore-bento a > span { left: 12px; bottom: 12px; }
  .explore-bento strong { font-size: 14px; }
  .library-grid { grid-template-columns: 1fr; }
  .media-lightbox { width: 100vw; height: 100dvh; max-height: none; margin: 0; padding: 10px; border: 0; border-radius: 0; }
  .lightbox-footer { max-height: 130px; flex-wrap: wrap; gap: 6px; overflow-y: auto; }
  .lightbox-footer p { flex-basis: calc(100% - 108px); }
  .lightbox-footer a { width: auto; flex: 1 1 auto; text-align: center; padding: 8px; }
  #media-lightbox .lightbox-footer { overflow-y: auto; overscroll-behavior: contain; }
  .studio-media-viewer .lightbox-bar { top: 10px; left: 10px; right: 10px; }
  .studio-media-viewer .studio-viewer-footer { bottom: 10px; left: 10px; right: 10px; max-height: none; }
  .studio-media-viewer .studio-viewer-footer p { display: none; }
}
@media(prefers-reduced-motion:reduce) { .theme-toggle, .explore-bento img { transition: none; } }
