/* Shared layout: mypage (dark) + admin (light) */
.public-main:has(.mgmt-shell){
  max-width:none;
  width:100%;
  margin:0;
  padding:28px clamp(12px,1.6vw,22px) 64px;
}
/* Account: side-by-side cards — use the width, avoid a long scroll */
.account-page{width:100%;margin:0;display:flex;flex-direction:column;gap:22px}
.account-page > .account-head{margin-top:12px;margin-bottom:8px}
.account-page > .mgmt-status:empty{display:none;margin:0;min-height:0;padding:0}
.account-head{
  display:flex;gap:20px;align-items:center;justify-content:center;
  width:fit-content;max-width:100%;margin:0 auto;
  padding:8px 0 16px;border:0;border-radius:0;background:transparent;
}
.account-head-meta{min-width:0;flex:0 1 auto;display:flex;flex-direction:column;gap:10px}
.account-name-field{display:flex;flex-direction:column;gap:8px;font-size:15px;font-weight:600;color:#d5e3f7;margin:0}
.account-name-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.account-name-row input{
  width:min(320px,70vw);min-height:48px;margin:0;
  border-radius:10px;padding:12px 14px;font:inherit;font-size:18px;font-weight:600;
  background:#080f20;color:#fff;border:1px solid #7c9fce66;
}
.account-name-row .button{min-height:48px;padding:12px 18px;margin:0;align-self:center;font-size:15px}
.profile-email{margin:0;color:#c6d6eb;font-size:16px;word-break:break-all}
.profile-avatar{
  position:relative;flex:none;
  width:168px;height:168px;margin:0;
  padding:0;border:0;border-radius:50%;
  background:transparent;cursor:pointer;
}
.profile-avatar-face{
  display:grid;place-items:center;
  width:100%;height:100%;border-radius:50%;overflow:hidden;
  color:#fff;font-weight:700;font-size:52px;
  background:hsl(var(--avatar-hue,210) 48% 42%);
  box-shadow:0 0 0 3px #ffffff22;
}
.profile-avatar-face.has-photo{background:#1a2438}
.profile-avatar-face img{width:100%;height:100%;object-fit:cover;display:block}
.profile-avatar-edit{
  position:absolute;right:4px;top:4px;z-index:2;
  width:36px;height:36px;border-radius:50%;
  display:grid;place-items:center;
  color:#0b1220;background:#fff;
  box-shadow:0 3px 10px #0007;
}
.profile-avatar:hover .profile-avatar-edit,
.profile-avatar:focus-visible .profile-avatar-edit{transform:scale(1.06)}
.account-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  align-items:start;
}
.account-page .auth-panel.account-security{
  max-width:none;width:100%;margin:0;padding:0;
  border:0;background:transparent;box-shadow:none;
  display:contents;
}
.account-page .account-block{
  margin:0;padding:16px 18px;
  border:1px solid #7aa8fa33;border-radius:16px;
  background:#0a1220aa;
}
.account-page .account-block h3{margin:0 0 12px;font-size:15px}
.account-page .account-block.danger{border-color:#ff8fa044}
.account-page .mgmt-status{min-height:1.2em;margin:0}
.account-page .account-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.account-page .button{width:auto;align-self:flex-start}
@media(max-width:900px){
  .account-grid{grid-template-columns:1fr}
}
@media(max-width:560px){
  .account-head{flex-wrap:wrap;justify-content:flex-start;width:100%}
}
.mgmt-shell{
  display:grid;
  grid-template-columns:minmax(148px,168px) minmax(0,1fr);
  gap:12px;
  align-items:start;
  width:100%;
  max-width:1680px;
  margin:0 auto;
}
/* Mypage: horizontal tabs — no vertical sidebar scroll */
.mypage-root .mgmt-shell{
  grid-template-columns:1fr;
  gap:14px;
}
.mgmt-nav{
  position:sticky;
  top:16px;
  align-self:start;
  height:fit-content;
  width:100%;
  padding:10px 8px;
  border-radius:12px;
}
.mypage-root .mgmt-nav{
  position:static;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  padding:10px 12px;
}
.mgmt-nav h2{
  margin:0 0 8px;
  padding:0 8px;
  font-size:11px;
  letter-spacing:.14em;
  font-weight:700;
}
.mypage-root .mgmt-nav h2{
  width:auto;
  margin:0 10px 0 0;
  padding:0;
  flex:none;
}
.mgmt-nav a,
.mgmt-nav button.nav-link{
  display:block;
  width:100%;
  text-align:left;
  background:transparent;
  border:0;
  text-decoration:none;
  padding:7px 10px;
  border-radius:8px;
  font-size:12.5px;
  line-height:1.3;
  margin:0 0 1px;
}
.mypage-root .mgmt-nav a,
.mypage-root .mgmt-nav button.nav-link{
  display:inline-flex;
  width:auto;
  margin:0;
  text-align:center;
  padding:8px 12px;
  font-size:13px;
}
.mgmt-panel{min-width:0;width:100%}
.mgmt-panel [data-panel] > .page-heading,
.mgmt-panel .page-heading{margin-bottom:16px}
.mgmt-panel [data-panel] > .page-heading h1,
.mgmt-panel .page-heading h1{
  font-size:clamp(22px,2.2vw,30px)!important;
  line-height:1.25!important;
  margin:6px 0 0!important;
  letter-spacing:.01em;
}
.mgmt-panel .page-heading .eyebrow{margin:0}
.mgmt-panel .page-heading .muted,
.mgmt-panel .page-heading p{margin:8px 0 0;font-size:14px}
.mgmt-toolbar{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 16px;align-items:end}
.mgmt-toolbar label{display:flex;flex-direction:column;gap:6px;font-size:12px}
.mgmt-toolbar input,
.mgmt-toolbar select{
  border-radius:10px;
  padding:9px 12px;
  font:inherit;
  min-width:140px;
}
.mgmt-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.mgmt-card{padding:16px;border-radius:14px}
.mgmt-card small{display:block;font-size:11px;letter-spacing:.12em}
.mgmt-card strong{display:block;margin-top:8px;font-size:26px;line-height:1.2}
.mgmt-card span{display:block;margin-top:6px;font-size:13px}
.mgmt-table-wrap{overflow:auto;border-radius:14px}
.mgmt-table{width:100%;border-collapse:collapse;font-size:13px;min-width:720px}
.mgmt-table th,
.mgmt-table td{
  padding:10px 12px;
  text-align:left;
  vertical-align:middle;
}
.mgmt-table th{font-weight:600}
.mgmt-table td.mgmt-col-action{
  width:1%;
  white-space:nowrap;
  padding:8px 10px;
  text-align:right;
}
.mgmt-row-action{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  margin:0;
  min-width:0;
  min-height:0;
  width:auto;
  height:auto;
  padding:5px 10px;
  border-radius:7px;
  font:inherit;
  font-size:12px;
  font-weight:600;
  line-height:1.2;
  letter-spacing:.02em;
  white-space:nowrap;
  cursor:pointer;
  box-shadow:none;
  text-decoration:none;
}
.mgmt-row-action:focus-visible{outline:2px solid #2f6fed;outline-offset:2px}
.mgmt-row-action:active{transform:translateY(1px)}
.mgmt-row-actions{display:inline-flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:flex-end}
.mgmt-pager{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:14px;font-size:13px}
.mgmt-empty,
.mgmt-status{padding:18px;border-radius:14px}
.mgmt-status:empty{display:none;padding:0;border:0;margin:0}
.mgmt-detail{margin-top:16px;padding:16px 18px;border-radius:14px}
.mgmt-detail h3{margin:0 0 8px;font-size:18px}
.mgmt-detail pre{
  white-space:pre-wrap;
  word-break:break-word;
  font-size:12px;
  margin:0;
  line-height:1.55;
}
.mgmt-badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
}
.mgmt-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}

/* Works library: competitor-style cover grid (Higgsfield / Kling library) */
.works-heading{
  display:flex;flex-wrap:wrap;gap:16px 24px;align-items:flex-end;justify-content:space-between;
  margin:0 0 22px;
}
.works-heading > div{min-width:0;flex:1}
.works-heading h1{margin:0 0 6px}
.works-heading p{margin:0;font-size:15px;line-height:1.45;color:#92a7c7}
.works-new{flex:none;min-height:48px;padding:12px 20px;font-size:15px;text-decoration:none}
.works-toolbar{
  display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:space-between;
  margin:0 0 22px;
}
.works-chips{display:flex;flex-wrap:wrap;gap:8px}
.works-chip{
  min-height:40px;padding:8px 16px;border-radius:999px;font:inherit;font-size:15px;font-weight:600;
  color:#c6d6eb;background:#0d1628;border:1px solid #7aa8fa44;cursor:pointer;
}
.works-chip[aria-pressed=true]{color:#fff;background:#1c2d4f;border-color:#8ad4ff88}
.works-chip:hover{background:#15243f}
.works-search{display:flex;flex-wrap:wrap;gap:10px;align-items:center;flex:1 1 280px;justify-content:flex-end}
.works-search input[type=search],
.works-search input[name=q]{
  flex:1 1 220px;max-width:360px;min-height:48px;
  border-radius:12px;padding:12px 14px;font:inherit;font-size:16px;
  background:#080f20;color:#fff;border:1px solid #7c9fce66;
}
.works-search .button{min-height:48px;padding:12px 18px;font-size:15px}
.works-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:18px;
}
.works-tile{
  display:flex;flex-direction:column;gap:12px;min-width:0;
  color:inherit;text-decoration:none;border-radius:16px;
  transition:transform .18s ease, box-shadow .18s ease;
}
.works-tile:hover{transform:translateY(-2px)}
.works-tile:focus-visible{outline:2px solid #2f6fed;outline-offset:3px}
.works-tile-media{
  position:relative;aspect-ratio:4/3;border-radius:16px;overflow:hidden;
  border:1px solid #7aa8fa33;background:#0a1220;
  box-shadow:0 10px 28px #00000055;
}
.works-tile-media img{
  width:100%;height:100%;object-fit:cover;display:block;
}
.works-tile-empty{
  width:100%;height:100%;display:grid;place-items:center;
  background:linear-gradient(145deg,#1a2f52,#0b1220 55%,#152238);
}
.works-tile-empty[data-tone="1"]{background:linear-gradient(145deg,#243a28,#0b1220 55%,#1a2830)}
.works-tile-empty[data-tone="2"]{background:linear-gradient(145deg,#3a2448,#0b1220 55%,#221830)}
.works-tile-empty[data-tone="3"]{background:linear-gradient(145deg,#3a2a18,#0b1220 55%,#241c14)}
.works-tile-empty[data-tone="4"]{background:linear-gradient(145deg,#183848,#0b1220 55%,#142028)}
.works-tile-empty span{
  width:64px;height:64px;border-radius:18px;display:grid;place-items:center;
  font-size:28px;font-weight:700;color:#e8f1ff;letter-spacing:.02em;
  background:#ffffff14;border:1px solid #ffffff22;
}
.works-tile-play{
  position:absolute;left:50%;top:50%;width:48px;height:48px;margin:-24px 0 0 -24px;
  border-radius:999px;background:#00000088;border:1px solid #ffffff55;
  pointer-events:none;
}
.works-tile-play::before{
  content:"";position:absolute;left:19px;top:15px;
  border-style:solid;border-width:9px 0 9px 14px;border-color:transparent transparent transparent #fff;
}
.works-tile-badge{
  position:absolute;left:10px;bottom:10px;
  padding:5px 10px;border-radius:999px;font-size:12px;font-weight:700;line-height:1.2;
  color:#fff;background:#00000099;border:1px solid #ffffff22;backdrop-filter:blur(6px);
}
.works-tile-body{min-width:0;padding:0 2px 4px}
.works-tile-body h2{
  margin:0 0 6px;font-size:18px;line-height:1.3;font-weight:700;color:#fff;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.works-tile-body p{
  margin:0;font-size:14px;line-height:1.4;color:#a9bdd8;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.works-empty{margin:12px 0;font-size:16px;color:#c6d6eb;grid-column:1/-1}
@media(max-width:640px){
  .works-search{justify-content:stretch}
  .works-search input[type=search],
  .works-search input[name=q]{max-width:none}
}

/* —— My page: keep FrameGlitch dark —— */
.public-main:has(.mypage-root){
  background:radial-gradient(ellipse at 12% 0%,#244a7a22,transparent 42%);
}
.mypage-root .mgmt-nav{
  border:1px solid var(--edge);
  background:linear-gradient(150deg,#142039c0,#0b1222);
}
.mypage-root .mgmt-nav h2{color:#8ad4ff}
.mypage-root .mgmt-nav a,
.mypage-root .mgmt-nav button.nav-link{color:#c6d6eb}
.mypage-root .mgmt-nav a[aria-current=page],
.mypage-root .mgmt-nav button.nav-link[aria-current=page]{background:#1c2d4f;color:#fff}
.mypage-root .mgmt-nav a:hover,
.mypage-root .mgmt-nav button.nav-link:hover{background:#15243f}
.mypage-root .mgmt-panel .page-heading .muted,
.mypage-root .mgmt-panel .page-heading p{color:#92a7c7}
.mypage-root .mgmt-toolbar label{color:#92a7c7}
.mypage-root .mgmt-toolbar input,
.mypage-root .mgmt-toolbar select{
  background:#080f20;
  color:#fff;
  border:1px solid #7c9fce66;
}
.mypage-root .mgmt-card{
  border:1px solid var(--edge);
  background:linear-gradient(150deg,#142039c0,#0b1222);
}
.mypage-root .mgmt-card small{color:#8ad4ff}
.mypage-root .mgmt-card strong{color:#fff}
.mypage-root .mgmt-card span{color:#92a7c7}
.mypage-root .mgmt-table-wrap{
  border:1px solid var(--edge);
  background:#0d1526aa;
}
.mypage-root .mgmt-table th,
.mypage-root .mgmt-table td{border-bottom:1px solid #7aa8fa22}
.mypage-root .mgmt-table th{color:#92a7c7;background:#121c3188}
.mypage-root .mgmt-table tr:hover td{background:#15233a55}
.mypage-root .mgmt-row-action{
  border:1px solid #7c9fce55;
  background:#15243f;
  color:#d7e7ff;
}
.mypage-root .mgmt-row-action:hover{
  background:#1e3258;
  border-color:#8ad4ff77;
  color:#fff;
}
.mypage-root .mgmt-pager{color:#92a7c7}
.mypage-root .mgmt-empty,
.mypage-root .mgmt-status{
  border:1px dashed #7c9fce44;
  color:#92a7c7;
}
.mypage-root .mgmt-status.error{border-color:#ff8fa055;color:#ffb9bd}
.mypage-root .mgmt-detail{
  border:1px solid var(--edge);
  background:#0d1526aa;
}
.mypage-root .mgmt-detail pre{color:#c6d6eb}
.mypage-root .mgmt-badge{
  border:1px solid #7c9fce55;
  color:#c6d6eb;
}
.mypage-root .mgmt-badge.warn{border-color:#ffcf6b66;color:#ffe2a3}
.mypage-root .mgmt-badge.ok{border-color:#6fd6a666;color:#9fe5d3}

/* —— Admin: white ops console (distinct from user UI) —— */
html.admin-theme,
body.admin-theme{
  background:#f4f6f9!important;
  color:#1a2333!important;
  color-scheme:light;
}
body.admin-theme .site-header{
  background:#ffffffee!important;
  border-bottom:1px solid #d7dee8!important;
}
body.admin-theme .site-header a{color:#31415a!important}
/* White logo asset on light admin header → dark mark */
body.admin-theme .site-header .site-logo img{
  filter:brightness(0) saturate(100%);
  opacity:.88;
}
body.admin-theme .site-footer{
  background:#fff!important;
  border-top:1px solid #d7dee8!important;
  color:#5b6b82!important;
}
body.admin-theme .site-footer a{color:#3d5270!important}
body.admin-theme .public-main,
.public-main:has(.admin-root){
  background:#f4f6f9!important;
  color:#1a2333!important;
}
.admin-root .mgmt-nav{
  border:1px solid #d7dee8;
  background:#fff;
  box-shadow:0 1px 2px #1a233308;
}
.admin-root .mgmt-nav h2{color:#2f6fed}
.admin-root .mgmt-nav a,
.admin-root .mgmt-nav button.nav-link{color:#3d4f68}
.admin-root .mgmt-nav a[aria-current=page],
.admin-root .mgmt-nav button.nav-link[aria-current=page]{
  background:#eaf1ff;
  color:#1a4fbf;
  font-weight:700;
}
.admin-root .mgmt-nav a:hover,
.admin-root .mgmt-nav button.nav-link:hover{background:#f0f3f8}
.admin-root .mgmt-panel .page-heading h1{color:#121a28!important}
.admin-root .mgmt-panel .page-heading .eyebrow{color:#2f6fed}
.admin-root .mgmt-panel .page-heading .muted,
.admin-root .mgmt-panel .page-heading p{color:#5b6b82}
.admin-root .mgmt-toolbar label{color:#5b6b82}
.admin-root .mgmt-toolbar input,
.admin-root .mgmt-toolbar select{
  background:#fff;
  color:#1a2333;
  border:1px solid #c8d2e0;
}
.admin-root .mgmt-toolbar input:focus,
.admin-root .mgmt-toolbar select:focus{
  outline:2px solid #2f6fed55;
  border-color:#2f6fed;
}
.admin-root .mgmt-card{
  border:1px solid #d7dee8;
  background:#fff;
  box-shadow:0 1px 2px #1a233308;
}
.admin-root .mgmt-card small{color:#2f6fed}
.admin-root .mgmt-card strong{color:#121a28}
.admin-root .mgmt-card span{color:#5b6b82}
.admin-root .mgmt-table-wrap{
  border:1px solid #d7dee8;
  background:#fff;
  box-shadow:0 1px 2px #1a233308;
}
.admin-root .mgmt-table th,
.admin-root .mgmt-table td{
  border-bottom:1px solid #e6ebf2;
  color:#1a2333;
}
.admin-root .mgmt-table th{
  color:#5b6b82;
  background:#f7f9fc;
}
.admin-root .mgmt-table tr:hover td{background:#f3f7ff}
.admin-root .mgmt-row-action{
  border:1px solid #c8d2e0;
  background:#fff;
  color:#1a4fbf;
}
.admin-root .mgmt-row-action:hover{
  background:#eaf1ff;
  border-color:#2f6fed88;
  color:#123a9a;
}
.admin-root .mgmt-pager{color:#5b6b82}
.admin-root .mgmt-empty,
.admin-root .mgmt-status{
  border:1px dashed #c8d2e0;
  background:#fff;
  color:#5b6b82;
}
.admin-root .mgmt-status.error{
  border-color:#e8a0a8;
  background:#fff5f6;
  color:#a33b46;
}
.admin-root .mgmt-detail{
  border:1px solid #d7dee8;
  background:#fff;
}
.admin-root .mgmt-detail h3{color:#121a28}
.admin-root .mgmt-detail pre{color:#31415a}
.admin-root .mgmt-badge{
  border:1px solid #c8d2e0;
  background:#f7f9fc;
  color:#3d4f68;
}
.admin-root .mgmt-badge.warn{
  border-color:#e6c27a;
  background:#fff8e8;
  color:#8a6410;
}
.admin-root .mgmt-badge.ok{
  border-color:#8ecfb0;
  background:#edfaf3;
  color:#1f7a4d;
}
.admin-root .notice,
.admin-root aside.notice{
  background:#fff;
  border:1px solid #d7dee8;
  color:#3d4f68;
}
.admin-root .button.secondary{
  background:#fff;
  color:#1a4fbf;
  border:1px solid #c8d2e0;
}
.admin-root .button.secondary:hover{
  background:#eaf1ff;
  border-color:#2f6fed88;
}
.admin-root .info-section{
  background:#fff;
  border:1px solid #d7dee8;
  border-radius:14px;
  padding:16px 18px;
  color:#31415a;
}
.admin-root .info-section h2{color:#121a28;margin-top:0}

@media(max-width:980px){
  .mgmt-shell{grid-template-columns:1fr;gap:14px;max-width:none}
  .mgmt-nav{
    position:static;
    display:flex;
    flex-wrap:wrap;
    gap:4px;
    padding:10px;
  }
  .mgmt-nav h2{width:100%;margin-bottom:4px}
  .mgmt-nav a,
  .mgmt-nav button.nav-link{width:auto}
  .mgmt-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .public-main:has(.mgmt-shell){padding:18px 12px 48px}
  .mgmt-cards{grid-template-columns:1fr}
  .mgmt-table{min-width:560px}
}
