/* Layout: small centered header (mascot logo, nav, socials) above a wide edge-to-edge
   thumbnail grid with centered captions. The work is the only color on the page.
   Deliberately light-only. */
:root {
  --bg: #f3f3f3;
  --surface: #ffffff;
  --ink: #1b1b1b;
  --sub: #8f8f8f;
  --faint: #bdbdbd;
  --line: #e2e2e2;
  --accent: #f0709f;
  --brand-x: #000000;
  --brand-youtube: #ff0000;
  --cap-title: #444444;
  --frame: #6b6e75; /* thumbnail frame: a mid slate grey with a slight cool tint */
  --deep: #3a3b3f; /* deep slate grey: the pop-up's close button on hover */

  /* one family site-wide, like the reference: Proxima Nova when an Adobe Fonts kit is linked,
     otherwise its free look-alike Figtree; Korean falls through to Pretendard */
  --font-body: "proxima-nova", "Proxima Nova", Figtree, Pretendard, "Noto Sans JP", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  /* in Japanese, kanji should come from the Japanese face rather than the Korean one */
  --font-body-ja: "proxima-nova", "Proxima Nova", Figtree, "Noto Sans JP", Pretendard, "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --font-caption: var(--font-body);
  --font-mono: var(--font-body);

  --gutter: 8px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
}
/* Japanese has no spaces between words, so it needs normal line breaking (keep-all would never wrap) */
html:lang(ja) { --font-body: var(--font-body-ja); }
html:lang(ja) body { word-break: normal; line-break: strict; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar: just the language switch (and the editor's +) on the right ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) 16px;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.top-tools { display: flex; align-items: center; gap: 14px; }
/* JP / KR / EN switcher */
.lang {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.lang button {
  font: inherit;
  letter-spacing: inherit;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--sub);
  cursor: pointer;
  transition: color .2s;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* "+" (add a video), only for signed-in editors */
.add-work {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--ink);
  transition: background .2s, color .2s, transform .2s;
}
.add-work svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.add-work:hover { background: var(--ink); color: var(--surface); transform: rotate(90deg); }

/* logo: the image drawn on white blends into the card instead of showing a white box */
.profile-logo img { width: auto; max-width: none; mix-blend-mode: multiply; transition: transform .3s ease; }
.mascot { transition: transform .3s ease; }
.mascot path:first-child { fill: var(--surface); stroke: var(--ink); stroke-width: 2.2; }
.mascot circle { fill: var(--ink); }
.mascot .mouth { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }

/* ---------- home: ABOUT, PROFILE and the closing words over a faint looping video ---------- */
/* the video (heroVideo in data.js) is softened and fades out at its top and bottom edges */
.home-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: 104px 96px;
}
/* the wrapper holds the fade; the video inside is blurred and scaled up a touch so its own
   soft edges stay hidden, and anything past the wrapper is clipped before the fade applies */
.home-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  opacity: .24;
  pointer-events: none;
  /* long eased fade (not a straight ramp) so neither edge shows a line */
  -webkit-mask-image: var(--soft-edges);
  mask-image: var(--soft-edges);
  --soft-edges: linear-gradient(to bottom,
    transparent 0%, rgb(0 0 0 / .06) 5%, rgb(0 0 0 / .2) 10%, rgb(0 0 0 / .42) 16%,
    rgb(0 0 0 / .68) 22%, rgb(0 0 0 / .88) 28%, #000 34%,
    #000 66%, rgb(0 0 0 / .88) 72%, rgb(0 0 0 / .68) 78%,
    rgb(0 0 0 / .42) 84%, rgb(0 0 0 / .2) 90%, rgb(0 0 0 / .06) 95%, transparent 100%);
}
.home-bg video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) saturate(1.15);
  transform: scale(1.03);
}

/* each home section: centered text; ABOUT opens with a bolder greeting line */
.home-sec {
  max-width: 960px;
  margin: 80px auto 0;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  text-align: center;
}
.home-intro > .about { margin-top: 0; }
.sec-lead {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.home-text {
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.95;
  color: var(--cap-title);
}
.outro .home-text { margin-top: 0; }

/* profile card: big logo on the left, name / role / contact / links / tools on the right */
/* the card hugs its contents and sits centered, so no empty band is left on its right */
.profile-card {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 44px 88px 44px 80px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 40px rgb(0 0 0 / .05);
  text-align: left;
}
.profile-logo { flex: none; display: grid; place-items: center; }
.profile-logo img { height: 108px; }
.profile-logo:hover img { transform: translateY(-3px) rotate(-6deg); }
.profile-logo .mascot { width: 110px; height: 84px; }
.profile-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.profile-name { font-size: 26px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); line-height: 1.2; }
.profile-role { font-size: 14px; font-weight: 700; letter-spacing: 0.03em; color: var(--cap-title); }
.profile-contact { font-size: 13px; font-weight: 700; letter-spacing: 0.03em; color: var(--sub); }
.profile-contact span { color: var(--cap-title); }
.profile .social { margin-top: 8px; }
.profile-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: stretch;
  gap: 10px;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.tools-label { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--sub); margin-right: 4px; }
.tools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tools li {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cap-title);
}

.home-works { margin-top: 40px; }

/* ---------- WORKS label with the MV / PV / VJ tags, above the grid ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1400px;
  margin: 8px auto 0;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.nav a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--sub);
  transition: color .2s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
/* category tags: small outlined pills, filled when active */
.nav-tags { display: flex; gap: 6px; }
.nav .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: color .2s, background-color .2s, border-color .2s;
}
.nav .tag:hover { color: var(--ink); border-color: var(--ink); }
.nav .tag[aria-current="page"] { color: var(--surface); background: var(--ink); border-color: var(--ink); }
.nav + .grid { margin-top: 24px; }
.nav + .empty { margin-top: 48px; }

/* X and Instagram logos in their brand colors, side by side, each with its name */
.social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.social a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cap-title);
  white-space: nowrap;
  transition: color .2s;
}
.social a:hover { color: var(--ink); }
.social svg { flex: none; transition: transform .2s; }
.social a:hover svg { transform: scale(1.12); }
.social .x svg { width: 19px; height: 19px; fill: var(--brand-x); }
.social .instagram svg { width: 22px; height: 22px; }
.social .youtube svg { width: 28px; height: 20px; }
.social .youtube .yt-bg { fill: var(--brand-youtube); }
.social .youtube .yt-play { fill: #ffffff; }

/* ---------- main ---------- */
#view {
  min-width: 0;
  outline: none;
  padding-bottom: 64px;
}
#view.enter > * { animation: rise .45s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes rise { from { opacity: .3; transform: translateY(8px); } }


.foot {
  margin-top: 72px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

/* ---------- works grid: 4 columns of 16:9 thumbnails, centered two-line captions (cappu) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px 14px;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}

/* full WORKS list: one section per category, headed by its pill, the count and a hairline */
.works-group:first-of-type { margin-top: 20px; }
.works-group + .works-group { margin-top: 72px; }
.group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1400px;
  margin: 0 auto 22px;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  font-size: 12px;
}
.group-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--surface);
  background: var(--ink);
  transition: background-color .2s;
}
a.group-tag:hover { background: var(--accent); }
.group-count { font-weight: 500; color: var(--sub); }
.group-rule { flex: 1; height: 1px; background: var(--line); }

.card { display: flex; flex-direction: column; gap: 14px; min-width: 0; text-align: center; }
/* thumbnail in a square-cornered dark-grey frame with a soft drop below; it lifts a little on hover */
.card-media {
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  background: var(--line);
  border: 1.5px solid var(--frame);
  box-shadow: 0 5px 0 rgb(0 0 0 / .1);
  transition: transform .3s ease, box-shadow .3s ease;
}
.card:hover .card-media { transform: translateY(-3px); box-shadow: 0 8px 0 rgb(0 0 0 / .12); }
.card-media > * { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .3, 1); }
.card:hover .card-media > * { transform: scale(1.04); }
.card-cap { padding-inline: 10px; }
.card-title {
  font-family: var(--font-caption);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--cap-title);
}

/* ---------- placeholder art (shown until real images are added) ---------- */
.ph {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 1px 1px, rgb(255 255 255 / .35) 1.2px, transparent 1.6px) 0 0 / 14px 14px,
    linear-gradient(var(--ang, 135deg), var(--a), var(--b));
  overflow: hidden;
}
.ph-label {
  position: relative;
  z-index: 1;
  padding: 0 8%;
  font-weight: 700;
  font-size: clamp(1rem, 2.1vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-align: center;
  color: #ffffff;
  text-shadow: 2px 2px 0 rgb(27 27 27 / .8);
  transform: rotate(-4deg);
}
.ph-dot { position: absolute; border-radius: 50%; background: rgb(255 255 255 / .45); }
.ph-dot.d1 { width: 38%; aspect-ratio: 1; left: -8%; bottom: -18%; }
.ph-dot.d2 { width: 16%; aspect-ratio: 1; right: 8%; top: 10%; background: rgb(255 255 255 / .3); }
.ph.big .ph-label { font-size: clamp(1.6rem, 4.4vw, 3.2rem); }

/* ---------- a work in a pop-up: the page stays behind it, blurred ---------- */
html.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex; /* (not grid: the box's 100% width must resolve against the window) */
  align-items: center;
  justify-content: center;
  padding: 24px max(16px, env(safe-area-inset-left, 0px));
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(243 243 243 / .55);
  -webkit-backdrop-filter: blur(14px) saturate(.9);
  backdrop-filter: blur(14px) saturate(.9);
  animation: modal-fade .25s ease both;
}
/* same language as the thumbnails: thin slate frame, square corners, soft drop below.
   Its width also follows the window height so the 16:9 video always fits on screen. */
.modal-box {
  position: relative;
  width: min(1100px, 100%, calc((100dvh - 112px) * 16 / 9));
  background: var(--surface);
  border: 1.5px solid var(--frame);
  box-shadow: 0 8px 0 rgb(0 0 0 / .08), 0 24px 60px rgb(0 0 0 / .14);
  animation: modal-pop .3s cubic-bezier(.2, .7, .3, 1) both;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* close: a thin grey ✕; on hover its square fills deep grey and the ✕ turns white */
.modal-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sub);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.modal-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.modal-close:hover, .modal-close:focus-visible { background: var(--deep); color: var(--surface); }
.modal-close:focus-visible { outline: none; } /* the filled square itself marks keyboard focus */
.modal .stills { padding: var(--gutter); }
.modal-box:focus { outline: none; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  background: var(--ink);
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player > img { width: 100%; height: 100%; object-fit: cover; }
.player .play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.player .play span {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--surface);
  display: grid; place-items: center;
  box-shadow: 0 6px 24px rgb(0 0 0 / .2);
}
.player .play svg { width: 20px; height: 20px; fill: var(--ink); margin-left: 4px; }

.stills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); }
.stills > * { aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; }
.stills > *:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.stills img { width: 100%; height: 100%; object-fit: cover; }

.empty { color: var(--sub); text-align: center; }
.empty a { color: var(--ink); text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* narrower screens: the profile card stacks, everything centered */
@media (max-width: 760px) {
  .home-sec { margin-top: 64px; }
  .home-intro { padding-block: 72px 64px; }
  .sec-lead { font-size: 18px; }
  .profile-card { width: auto; flex-direction: column; gap: 22px; padding: 36px 24px; text-align: center; }
  .profile-body { align-items: center; }
  .profile-logo img { height: 96px; }
  .profile-name { font-size: 24px; }
  .profile .social { justify-content: center; }
  .profile-tools, .tools { justify-content: center; }
  .home-text { font-size: 15px; line-height: 1.95; }
  .home-works { margin-top: 32px; }
}

@media (max-width: 560px) {
  .top, .nav, .home-sec {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .stills { grid-template-columns: minmax(0, 1fr); }
  .stills > *:first-child:nth-last-child(odd) { grid-column: auto; }
  .group-head {
    margin-bottom: 16px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .works-group + .works-group { margin-top: 48px; }
}

/* touch screens: bigger tap areas for the language switch and the WORKS / MV / PV / VJ tags
   (the look stays the same, only the clickable area around them grows) */
@media (pointer: coarse) {
  .lang { gap: 2px; }
  .lang button { padding: 10px 7px; }
  .nav { gap: 16px; }
  .nav > a { padding-block: 10px; }
  .nav-tags { gap: 8px; }
  .nav .tag { padding: 9px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- edit mode (#edit) ---------- */
.editor {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.ed-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.ed-head h1 { font-size: 20px; font-weight: 700; }
.ed-note { font-size: 12px; color: var(--sub); margin-top: 4px; }
.ed-note code { font-size: 12px; color: var(--cap-title); }
.ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ed-status { font-size: 12px; color: var(--sub); max-width: 46ch; }
.ed-status.ok { color: #2a9d63; }
.ed-status.warn { color: #b7791f; }
.ed-status.err { color: #d23b5c; }
.ed-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.ed-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.ed-btn:hover { border-color: var(--ink); }

.ed-body { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
.ed-side { display: grid; gap: 12px; }
.ed-add {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 12px;
  border: 1px dashed var(--faint);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.ed-add:hover { border-color: var(--ink); background: var(--surface); }
/* editor list, one group per category: a small MV / PV / VJ pill and the count above each */
.ed-groups { display: grid; gap: 18px; max-height: 70vh; overflow-y: auto; }
.ed-group { display: grid; gap: 8px; }
.ed-group-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ed-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--surface);
  background: var(--ink);
}
.ed-group-head small { font-size: 12px; font-weight: 500; color: var(--sub); }
.ed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ed-list .ed-empty { padding: 4px 2px; }
.ed-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow .15s, transform .15s, background .15s;
}
.ed-item.is-active { background: var(--surface); border-color: var(--line); }
/* picked up for reordering */
.ed-list.is-sorting, .ed-list.is-sorting .ed-pick { cursor: grabbing; }
.ed-item.is-dragging {
  position: relative;
  z-index: 2;
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: 0 10px 24px rgb(0 0 0 / .14);
  transform: scale(1.02);
}
.ed-grip {
  flex: none;
  display: grid;
  place-items: center;
  width: 14px;
  height: 28px;
  color: var(--faint);
  cursor: grab;
  touch-action: none;
}
.ed-grip svg { width: 8px; height: 14px; fill: currentColor; }
.ed-item:hover .ed-grip { color: var(--sub); }
.ed-thumb img { -webkit-user-drag: none; pointer-events: none; }
.ed-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.ed-thumb { flex: none; width: 72px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px; background: var(--line); }
.ed-thumb > * { width: 100%; height: 100%; object-fit: cover; }
.ed-thumb .ph-label { font-size: 7px; text-shadow: 1px 1px 0 rgb(27 27 27 / .8); }
.ed-item-text { min-width: 0; display: grid; }
.ed-item-text b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-item-text small { font-size: 11px; color: var(--sub); }
.ed-item-tools { display: flex; gap: 2px; }
.ed-item-tools button {
  width: 24px; height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  font-size: 12px;
}
.ed-item-tools button:hover:not(:disabled) { background: var(--line); color: var(--ink); }
.ed-item-tools button:disabled { opacity: .3; cursor: default; }
.ed-hint, .ed-empty { font-size: 12px; color: var(--sub); }

.ed-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.ed-form { display: grid; gap: 16px; }
.ed-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ed-field { display: grid; gap: 6px; min-width: 0; }
.ed-field label { font-size: 12px; font-weight: 700; }
.ed-field label span { font-weight: 400; color: var(--sub); margin-left: 4px; }
.ed-field input, .ed-field textarea, .ed-field select {
  font: inherit;
  font-size: 13px;
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.ed-field textarea { resize: vertical; line-height: 1.7; }
.ed-field input:focus, .ed-field textarea:focus, .ed-field select:focus { outline: none; border-color: var(--ink); }
/* category dropdown: native arrow replaced by a chevron that matches the rest of the form */
.ed-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  cursor: pointer;
}
.ed-help { font-size: 11px; color: var(--sub); }
.ed-help.err { color: #d23b5c; }
.ed-preview { display: grid; gap: 10px; position: sticky; top: 16px; }
.ed-label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--sub); }
.ed-card { max-width: 340px; pointer-events: none; }
.ed-video .player { max-width: 100%; }

@media (max-width: 1100px) {
  .ed-main { grid-template-columns: minmax(0, 1fr); }
  .ed-preview { position: static; }
}
@media (max-width: 760px) {
  .ed-body { grid-template-columns: minmax(0, 1fr); }
  .ed-groups { max-height: none; }
}

/* ---------- editor sign-in (#login) ---------- */
.login {
  max-width: 360px;
  margin: 40px auto 0;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.login h1 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.login-note { font-size: 13px; color: var(--cap-title); line-height: 1.7; }
.login-note code { font-size: 12px; background: var(--surface); padding: 1px 5px; border-radius: 4px; }
.login-form { display: grid; gap: 10px; }
.login-form label { font-size: 12px; font-weight: 700; }
.login-form input {
  font: inherit;
  font-size: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.login-form input:focus { outline: none; border-color: var(--ink); }
.login-form .ed-btn { justify-self: start; margin-top: 4px; }
.login-msg { font-size: 12px; color: #d23b5c; min-height: 1.5em; }
