:root {
  --paper: #fbfaf5;
  --ink: #285988;
  --ocean: #168fdb;
  --ocean-deep: #086cba;
  --coral: #ff8f8e;
}

* { box-sizing: border-box; }

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
}

body {
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }

.manjo-home {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
}

.hero-artwork {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: block;
  overflow: hidden;
}

.hero-artwork img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.manjo-home::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: clamp(7rem, 15vh, 10rem);
  background: linear-gradient(180deg, rgba(251, 250, 245, 0.94) 0%, rgba(251, 250, 245, 0.62) 55%, transparent 100%);
  content: "";
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  min-height: 5.6rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 1.25rem clamp(1.5rem, 4vw, 4.75rem) 1rem;
}

.brand {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 0.45rem;
  color: var(--ocean-deep);
  transform: rotate(-1.5deg);
  transform-origin: left center;
}

.brand::after {
  position: absolute;
  right: -0.65rem;
  bottom: -0.42rem;
  left: 0.1rem;
  height: 0.42rem;
  border-top: 3px solid #4cb4ec;
  border-radius: 50%;
  content: "";
  opacity: 0.86;
  transform: rotate(-2deg);
}

.brand-korean {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 950;
  letter-spacing: -0.1em;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.9);
}

.brand-english {
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-paw {
  position: relative;
  top: -0.42rem;
  width: 0.35rem;
  height: 0.35rem;
  color: var(--coral);
  font-size: 0.42rem;
  line-height: 1;
  text-shadow: -5px -3px 0 var(--coral), 0 -6px 0 var(--coral), 5px -3px 0 var(--coral);
}

.primary-nav ul {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1.15rem, 2.7vw, 3.15rem);
  padding: 0.35rem 0 0;
  margin: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 0.2rem 0.12rem 0.55rem;
  color: #496879;
  font-size: clamp(0.9rem, 1.13vw, 1.08rem);
  font-weight: 850;
  letter-spacing: -0.055em;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.92);
  transition: color 160ms ease, transform 160ms ease;
}

.nav-link::before,
.nav-link::after {
  position: absolute;
  right: 50%;
  bottom: 0.18rem;
  left: 50%;
  height: 3px;
  border-radius: 999px;
  background: var(--ocean);
  content: "";
  transition: left 180ms ease, right 180ms ease;
}

.nav-link::after {
  bottom: 0.02rem;
  height: 2px;
  opacity: 0.48;
  transform: rotate(-3deg);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ocean-deep);
  transform: translateY(-2px);
}

.nav-link:hover::before,
.nav-link:hover::after,
.nav-link:focus-visible::before,
.nav-link:focus-visible::after {
  right: 0;
  left: 0;
}

.nav-link:focus-visible,
.brand:focus-visible {
  border-radius: 0.2rem;
  outline: 3px solid var(--coral);
  outline-offset: 6px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 50%;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--ocean-deep);
  background: #fff;
  font-weight: 800;
  transform: translate(-50%, -180%);
}

.skip-link:focus { transform: translate(-50%, 0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .manjo-home::before {
    height: 9.6rem;
    background: linear-gradient(180deg, rgba(251, 250, 245, 0.97) 0%, rgba(251, 250, 245, 0.73) 68%, transparent 100%);
  }

  .hero-artwork img { object-position: center top; }

  .site-header {
    min-height: 8rem;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1rem 0.75rem;
  }

  .brand { align-self: flex-start; gap: 0.35rem; }
  .brand-korean { font-size: 1.25rem; }
  .brand-english { font-size: 0.65rem; }

  .primary-nav ul {
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0;
  }

  .nav-link {
    min-width: 2.9rem;
    padding: 0.2rem 0.12rem 0.52rem;
    font-size: clamp(0.82rem, 3.8vw, 0.98rem);
    text-align: center;
  }
}

@media (max-width: 380px) {
  .site-header { padding-inline: 0.7rem; }
  .nav-link { min-width: 2.55rem; font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
/* Palette. applyTheme() in supabase.js overwrites these from the admin theme tab.
   The main stylesheet's own names (--paper --ink --ocean --ocean-deep --coral) are
   derived from them below, so changing the palette moves the whole site. */
:root {
  --main: #49b3ec;
  --main-dark: #168fdb;
  --main-deep: #086cba;
  --main-light: #e3f2fc;
  --sub: #ff8f8e;
  --bg: #fbfaf5;
  --card: #ffffff;
  --logo: #086cba;
  --text: #285988;
  --text-mid: #496879;
  --text-soft: #7b93a4;
  --line: rgba(40, 89, 136, 0.13);
  --tape: rgba(73, 179, 236, 0.24);
  --shadow: 0 8px 22px rgba(40, 89, 136, 0.10);
  --shadow-hover: 0 14px 34px rgba(40, 89, 136, 0.17);
  --radius-md: 14px;
  --transition: .2s ease;
  --fs-display: 1;
  --fs-title: 1;
  --fs-body: 1;
  --fs-label: 1;
  --page-width: 1120px;
  --header-h: 76px;

  /* fx.js loading cover uses this as the mascot, shown without a circular frame */
  --char: url('/assets/mascot.png');

  --paper: var(--bg);
  --ink: var(--text);
  --ocean: var(--main-dark);
  --ocean-deep: var(--main-deep);
  --coral: var(--sub);
  --sky: var(--main);
}

body.dark, html.dark {
  --main: #7fd3fb;
  --main-dark: #a9e4ff;
  --main-deep: #d2f0ff;
  --main-light: #23374f;
  --sub: #ffa8ae;
  --bg: #101a2a;
  --card: #18263c;
  --logo: #a9e4ff;
  --text: #e9eff8;
  --text-mid: #bac7d9;
  --text-soft: #90a1b9;
  --line: rgba(233, 239, 248, 0.16);
  --tape: rgba(127, 211, 251, 0.22);
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.5);
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Header tools sit next to the menu on every page */
.header-right { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2.2rem); }
.hdr-tools { display: inline-flex; align-items: center; gap: 7px; }
.hdr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 13px; border: 1.5px solid var(--ocean); border-radius: 2px;
  background: rgba(255, 255, 255, .82); color: var(--ocean-deep);
  box-shadow: 2px 2px 0 rgba(22, 143, 219, .22);
  font-family: inherit; font-size: calc(11.5px * var(--fs-label));
  font-weight: 900; letter-spacing: .02em; cursor: pointer; white-space: nowrap;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}
.hdr-btn:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(22, 143, 219, .22); background: #fff; }
.hdr-btn.dk { width: 32px; padding: 0; font-size: 13px; }
body.dark .hdr-btn { background: rgba(24, 38, 60, .8); }

/* Main page: dark variant and the FOUC gate */
body.dark .manjo-home { background: #101a2a; }
body.dark .manjo-home::before { background: linear-gradient(180deg, rgba(16, 26, 42, .95) 0%, rgba(16, 26, 42, .68) 55%, transparent 100%); }
body.dark .hero-artwork img { filter: brightness(.72) saturate(.9); }
body.dark .nav-link { color: #b9cbd8; text-shadow: 1px 1px 0 rgba(0, 0, 0, .55); }
body.dark .brand { color: var(--main-dark); }
body.dark .brand-korean { text-shadow: 1px 1px 0 rgba(0, 0, 0, .55); }
body.home .manjo-home { opacity: 0; transition: opacity .3s; }
body.home.ready .manjo-home { opacity: 1; }
@media (prefers-reduced-motion: reduce) { body.home .manjo-home { opacity: 1; } }

@media (max-width: 720px) {
  .header-right { width: 100%; flex-direction: column; align-items: stretch; gap: .7rem; }
  .hdr-tools { justify-content: flex-end; }
}

/* Base utility classes. The admin page loads this stylesheet and depends on
   these names, so they stay plain here and get restyled per page below. */
.container { max-width: var(--page-width); margin: 0 auto; padding: 0 20px; }
.card, .paper {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: var(--shadow); padding: clamp(18px, 2.4vw, 30px);
  margin-bottom: 18px;
}
.card.taped::after, .paper.taped::after {
  content: ""; position: absolute; top: -14px; left: 26px; width: 74px; height: 27px;
  background: repeating-linear-gradient(90deg, var(--tape) 0 8px, rgba(255, 255, 255, .32) 8px 16px), var(--main-light);
  opacity: .9; clip-path: polygon(3% 10%, 100% 0, 95% 92%, 0 100%); pointer-events: none;
}
.card-title, .paper-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
  color: var(--main-deep); font-size: calc(17px * var(--fs-title)); font-weight: 1000; letter-spacing: -.02em;
}
.card-title::before, .paper-title::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); flex-shrink: 0;
}
.sec-label { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; color: var(--coral); font-size: calc(11px * var(--fs-label)); font-weight: 1000; letter-spacing: .2em; }
.sec-label::before { content: ""; width: 26px; height: 3px; border-radius: 999px; background: currentColor; }
.page-title { color: var(--main-deep); font-size: calc(30px * var(--fs-display)); font-weight: 1000; margin: 22px 0 4px; letter-spacing: -.03em; }
.page-subtitle { color: var(--text-soft); font-size: calc(13px * var(--fs-body)); margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: 1.5px solid var(--main-light); border-radius: 999px;
  background: var(--card); color: var(--main-deep);
  font-size: calc(13px * var(--fs-body)); font-weight: 800; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--main); border-color: var(--main); color: #fff; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--main-light); color: var(--main-deep); font-size: calc(11px * var(--fs-label)); font-weight: 800; }
.badge-pink { background: var(--sub); color: #fff; }
.chip, .tag {
  display: inline-flex; align-items: center; margin: 0 6px 6px 0; padding: 6px 13px;
  border: 1.5px solid var(--main-light); border-radius: 999px; background: var(--card);
  color: var(--main-deep); font-size: calc(12.5px * var(--fs-body)); font-weight: 800;
}
.chip.no { border-color: rgba(255, 143, 150, .45); color: var(--coral); }
.input {
  width: 100%; box-sizing: border-box; padding: 10px 13px; margin: 0;
  border: 1.5px solid var(--main-light); border-radius: 10px; background: var(--card);
  color: var(--text); font-family: inherit; font-size: calc(13.5px * var(--fs-body));
}
.input:focus { outline: none; border-color: var(--main); }
.input-label { display: block; margin-bottom: 5px; color: var(--text-mid); font-size: calc(12px * var(--fs-label)); font-weight: 800; }
.form-field { margin-bottom: 13px; }
.hint { font-size: calc(11.5px * var(--fs-label)); color: var(--text-soft); margin-top: 6px; line-height: 1.7; word-break: break-all; }
.hint code { background: var(--main-light); color: var(--main-deep); padding: 2px 6px; border-radius: 5px; font-size: 11px; }
.hint b { color: var(--main-deep); }
.spinner { width: 22px; height: 22px; margin: 20px auto; border: 3px solid var(--main-light); border-top-color: var(--main); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 34px 16px; text-align: center; color: var(--text-soft); font-size: calc(13.5px * var(--fs-body)); font-weight: 700; line-height: 1.9; }
.empty-icon { display: block; font-size: 30px; margin-bottom: 8px; }
.empty-sub { font-size: calc(12px * var(--fs-label)); color: var(--text-soft); font-weight: 600; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  padding: 11px 20px; border-radius: 999px; background: var(--main-deep); color: #fff;
  font-size: calc(13px * var(--fs-body)); font-weight: 800;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 1000;
}
.toast.show { opacity: 1; }

footer { text-align: center; color: var(--text-soft); font-size: calc(12px * var(--fs-body)); line-height: 1.7; margin-top: 24px; padding-bottom: 24px; }

/* ============================================================
   Sub pages. Geometry rule: every block is a piece of paper taped
   onto the desk. Square corners, slight rotation, tape or a clip.
   Circles are reserved for bubbles, the buoy and the avatar.
   Nothing here touches the admin page, which uses the plain base
   classes above.
   ============================================================ */
:root {
  --hand: "Segoe Print", "Comic Sans MS", "Malgun Gothic", cursive;
  --pp-cream: #fdfcf7;
  --pp-sky: #eaf5fd;
  --pp-coral: #fff4f2;
  --pp-edge: rgba(40, 89, 136, .14);
  --pp-lift: 0 10px 20px rgba(40, 89, 136, .11);
  --pp-lift-hi: 0 16px 30px rgba(40, 89, 136, .18);
}
body.dark {
  --pp-cream: #17253a;
  --pp-sky: #16293f;
  --pp-coral: #221f33;
  --pp-edge: rgba(233, 239, 248, .14);
  --pp-lift: 0 10px 20px rgba(0, 0, 0, .42);
  --pp-lift-hi: 0 16px 30px rgba(0, 0, 0, .5);
}

/* Full bleed background photo. It lives on <html> because body carries
   overflow-x:hidden, which makes it a scroll container and stops a fixed
   background from painting past the first screen. The blur is baked into the
   JPEG, never a CSS filter. */
html.page {
  overflow-x: hidden;          /* the page head cutout bleeds past the right edge */
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(251, 250, 245, .96) 0%, rgba(251, 250, 245, .94) 16%, rgba(251, 250, 245, .80) 42%, rgba(251, 250, 245, .84) 72%, rgba(251, 250, 245, .93) 100%),
    url('assets/bg-paper.jpg');
  background-repeat: no-repeat, no-repeat;
  background-position: center, center top;
  background-size: 100% 100%, cover;
  background-attachment: fixed, fixed;
}
html.page.dark {
  background-color: #101a2a;
  background-image:
    linear-gradient(180deg, rgba(16, 26, 42, .97) 0%, rgba(16, 26, 42, .95) 16%, rgba(16, 26, 42, .88) 42%, rgba(16, 26, 42, .91) 72%, rgba(16, 26, 42, .96) 100%),
    url('assets/bg-paper.jpg');
}
/* embedded: the iframe box is thousands of pixels tall, so cover would blow the
   photo up. tile it down the page instead. */
html.page.embed { background-attachment: scroll, scroll; background-size: 100% 100%, 100% 900px; background-repeat: no-repeat, repeat-y; }
body.page { background: transparent; overflow-x: hidden; }   /* the cutout bleeds past the right edge */

/* page frame, previously inherited from the old main stylesheet */
.site-shell { position: relative; isolation: isolate; }
.paper-grain {
  position: absolute; z-index: 0; inset: 0; opacity: .3; pointer-events: none;
  background-image:
    repeating-linear-gradient(101deg, transparent 0 6px, rgba(40, 89, 136, .05) 6px 7px),
    repeating-linear-gradient(9deg, transparent 0 9px, rgba(40, 89, 136, .04) 9px 10px);
  mix-blend-mode: multiply;
}
body.dark .paper-grain { opacity: .14; mix-blend-mode: screen; }
.skip-link { position: fixed; z-index: 10; top: .75rem; left: 50%; padding: .7rem 1rem;
  border-radius: 999px; color: var(--ocean-deep); background: #fff; font-weight: 800; transform: translate(-50%, -180%); }
.skip-link:focus { transform: translate(-50%, 0); }

body.page .site-shell { min-height: 100svh; display: flex; flex-direction: column; }
body.page .site-header { position: relative; z-index: 4; }
.page-main { position: relative; z-index: 3; flex: 1; padding: 0 clamp(16px, 5vw, 76px); }
.wrap { opacity: 0; transition: opacity .3s; }
body.ready .wrap { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .wrap { opacity: 1; } }

/* --- page head ---------------------------------------------- */
.page-head { position: relative; z-index: 3; max-width: var(--page-width); margin: 0 auto;
  padding: clamp(26px, 5vh, 56px) 0 clamp(20px, 4vh, 38px); min-height: clamp(220px, 30vw, 360px); }
.head-char {
  position: absolute; z-index: -1; right: clamp(-30px, 1vw, 40px); bottom: -18px;
  width: auto; height: clamp(230px, 30vw, 400px);
  filter: drop-shadow(0 12px 18px rgba(40, 89, 136, .2)); pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 74%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 74%, transparent 99%);
}
.head-char + * { position: relative; }
@media (max-width: 900px) { .head-char { height: 190px; right: -24px; opacity: .82; } }
@media (max-width: 560px) { .head-char { height: 150px; right: -34px; opacity: .6; } }
.page-head .eyebrow {
  display: inline-flex; align-items: center; margin: 0 0 14px; padding: 6px 15px;
  background: var(--coral); color: #fff; font-size: calc(11px * var(--fs-label));
  font-weight: 1000; letter-spacing: .18em; transform: rotate(-1.2deg);
  box-shadow: 3px 3px 0 rgba(255, 143, 142, .28);
}
.page-head .eyebrow::before { content: none; }
.head-title { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0 16px; margin: 0; }
.head-title__en {
  color: transparent;
  background: repeating-linear-gradient(-12deg, #e6f4fd 0 3px, #49b3ec 3px 5px, #e6f4fd 5px 9px);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: clamp(1.8px, .22vw, 3.4px) var(--ocean);
  filter: drop-shadow(3px 4px 0 rgba(22, 143, 219, .13)) drop-shadow(0 0 12px rgba(255, 255, 255, .9));
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: calc(clamp(3.2rem, 7.4vw, 6.4rem) * var(--fs-display));
  font-weight: 1000; line-height: .84; letter-spacing: -.06em; transform: rotate(-1.6deg);
}
.head-title__ko {
  color: var(--sky); font-family: "Arial Rounded MT Bold", "Malgun Gothic", sans-serif;
  font-size: calc(clamp(1.2rem, 2.2vw, 1.9rem) * var(--fs-title));
  font-weight: 1000; letter-spacing: -.07em; line-height: 1.5;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(22, 143, 219, .15); transform: rotate(-2.2deg);
}
body.dark .head-title__ko { text-shadow: 2px 2px 0 rgba(0, 0, 0, .5); }
.page-lead {
  position: relative; display: inline-block; max-width: 44em; margin: 20px 0 0 6px;
  padding: 11px 16px 11px 18px; background: var(--pp-cream); border: 1px solid var(--pp-edge);
  box-shadow: var(--pp-lift); color: var(--text-mid);
  font-size: calc(clamp(.88rem, 1.02vw, 1.02rem) * var(--fs-body));
  font-weight: 700; letter-spacing: -.03em; line-height: 1.8; transform: rotate(-.5deg);
}
.page-lead::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--sky); }
.pf-name, .pf-catch { text-shadow: 0 1px 0 rgba(255, 255, 255, .85), 0 0 14px rgba(255, 255, 255, .7); }
body.dark .pf-name, body.dark .pf-catch { text-shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 0 14px rgba(16, 26, 42, .8); }
.head-title__ko { text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(22, 143, 219, .15), 0 0 16px rgba(255, 255, 255, .8); }

/* --- the paper piece ---------------------------------------- */
.sheet { position: relative; z-index: 3; max-width: var(--page-width); margin: 0 auto clamp(24px, 4vh, 44px); }
body.page .card {
  position: relative; margin: 0 0 26px; padding: clamp(20px, 2.4vw, 30px);
  background: var(--pp-cream); border: 1px solid var(--pp-edge); border-radius: 2px;
  box-shadow: var(--pp-lift); transition: box-shadow var(--transition), transform var(--transition);
}
body.page .card, .notice-item, .pf-photo, .viewer-card, .poster, .item-card,
.ovod-card, .page-lead, .askbox, .ov-box { backdrop-filter: saturate(1.05); }
body.page .card:nth-of-type(4n+1) { transform: rotate(-.45deg); }
body.page .card:nth-of-type(4n+2) { transform: rotate(.35deg); background: var(--pp-sky); }
body.page .card:nth-of-type(4n+3) { transform: rotate(-.28deg); }
body.page .card:nth-of-type(4n+4) { transform: rotate(.42deg); background: var(--pp-coral); }
body.page .card:hover { box-shadow: var(--pp-lift-hi); }
body.page .grid-2 .card { margin-bottom: 0; }
body.page .grid-2, body.page .grid-3 { margin-bottom: 26px; }

/* pinboard: pieces flow into two columns so the page reads as a collage
   rather than a stack of full width bands */
.pinboard { column-count: 2; column-gap: 26px; }
.pinboard > .card { break-inside: avoid; display: inline-block; width: 100%; }
.pinboard > .card.wide { display: block; column-span: all; }
.pinboard .info-list { column-gap: 34px; }
.info-list.one { grid-template-columns: 1fr; }
.body-copy { margin: 0; color: var(--text-mid); font-size: calc(13.8px * var(--fs-body)); font-weight: 700; line-height: 1.95; }
@media (max-width: 900px) { .pinboard { column-count: 1; } }

/* gingham masking tape, like the polaroid on the cover */
.tape {
  position: absolute; z-index: 2; width: 86px; height: 27px; opacity: .92; pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(73, 179, 236, .5) 0 7px, transparent 7px 14px),
    repeating-linear-gradient(0deg, rgba(73, 179, 236, .5) 0 7px, transparent 7px 14px);
  background-color: rgba(255, 255, 255, .82);
  clip-path: polygon(3% 12%, 100% 0, 96% 90%, 0 100%);
}
.tape--tl { top: -13px; left: 22px; transform: rotate(-4deg); }
.tape--tr { top: -13px; right: 26px; transform: rotate(5deg); }
.tape--tc { top: -14px; left: 50%; margin-left: -43px; transform: rotate(-2deg); }
body.dark .tape { background-color: rgba(24, 38, 60, .82); }
.clip {
  position: absolute; z-index: 2; top: -14px; left: 26px; width: 22px; height: 40px;
  border: 3px solid #a9b5bb; border-radius: 11px 11px 6px 6px; transform: rotate(14deg); pointer-events: none;
}

/* --- section header: FILE numbering ------------------------- */
body.page .card-title {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 11px; margin: 0 0 18px;
  color: var(--main-deep); font-size: calc(18px * var(--fs-title)); font-weight: 1000; letter-spacing: -.03em;
}
body.page .card-title::before { content: none; }
body.page .card-title .num {
  align-self: center; padding: 3px 8px; background: var(--coral); color: #fff;
  font-family: "Arial Rounded MT Bold", sans-serif; font-size: calc(11px * var(--fs-label));
  font-weight: 1000; font-style: normal; letter-spacing: .1em; transform: rotate(-3deg);
  box-shadow: 2px 2px 0 rgba(255, 143, 142, .3);
}
body.page .card-title em {
  font-family: var(--hand); font-size: calc(11.5px * var(--fs-label)); font-style: normal;
  font-weight: 700; letter-spacing: .1em; color: var(--sky);
}
.hand { font-family: var(--hand); }

/* --- squared controls: no pills anywhere on the paper -------- */
body.page .btn, .hdr-btn {
  border-radius: 2px; border: 1.5px solid var(--ocean); background: var(--pp-cream);
  color: var(--main-deep); box-shadow: 2px 2px 0 rgba(22, 143, 219, .22);
  font-weight: 900; letter-spacing: .02em;
}
body.page .btn:hover, .hdr-btn:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(22, 143, 219, .22); background: var(--pp-sky); }
body.page .btn-primary { background: var(--ocean); border-color: var(--ocean); color: #fff; }
body.page .btn-primary:hover { background: var(--main-deep); }
.hdr-btn { height: 32px; padding: 0 13px; font-size: calc(11.5px * var(--fs-label)); }
.hdr-btn.dk { width: 32px; padding: 0; }
body.dark .hdr-btn { background: var(--pp-cream); }

body.page .chip, body.page .tag {
  display: inline-flex; margin: 0 7px 7px 0; padding: 6px 11px; border-radius: 2px;
  border: 1px dashed rgba(22, 143, 219, .55); background: var(--card);
  color: var(--main-deep); font-size: calc(12.5px * var(--fs-body)); font-weight: 800;
}
body.page .chip:nth-child(3n+2) { transform: rotate(-1.1deg); }
body.page .chip:nth-child(3n) { transform: rotate(.9deg); }
body.page .chip.no { border-color: rgba(255, 143, 142, .65); color: var(--coral); }
body.page .tag { border-style: solid; border-color: var(--pp-edge); background: var(--pp-sky); }
body.page .badge { border-radius: 2px; }
body.page .input { border-radius: 2px; border-color: rgba(22, 143, 219, .35); background: var(--card); }

/* --- empty state: a doodled speech bubble -------------------- */
body.page .empty {
  position: relative; max-width: 380px; margin: 8px auto; padding: 26px 22px;
  border: 2px solid rgba(22, 143, 219, .45); border-radius: 20px 20px 20px 4px;
  background: var(--card); text-align: center; color: var(--text-mid);
  font-size: calc(13.5px * var(--fs-body)); font-weight: 750; line-height: 1.95;
}
body.page .empty .empty-icon {
  display: block; margin-bottom: 6px; color: var(--sky);
  font-family: var(--hand); font-size: 22px; font-weight: 700; letter-spacing: .04em;
}
body.page .empty-sub { display: block; margin-top: 6px; color: var(--text-soft); font-family: var(--hand); font-size: calc(12px * var(--fs-label)); font-weight: 600; }

/* --- wave + footer ------------------------------------------ */
.wave-strip {
  position: relative; z-index: 3; height: clamp(74px, 10vw, 124px); margin-top: 30px;
  background:
    repeating-linear-gradient(-8deg, transparent 0 9px, rgba(255, 255, 255, .12) 9px 11px),
    linear-gradient(180deg, #5cc3f2, #168fdb);
  clip-path: polygon(0 30%, 5% 23%, 10% 29%, 16% 18%, 22% 25%, 28% 15%, 34% 24%, 40% 10%, 47% 23%, 54% 14%, 61% 24%, 68% 9%, 75% 22%, 82% 12%, 89% 23%, 95% 13%, 100% 19%, 100% 100%, 0 100%);
}
.wave-strip .buoy { position: absolute; right: 9%; bottom: 16px; width: 40px; height: 40px; border: 8px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px var(--coral), inset 0 0 0 2px var(--coral); transform: rotate(12deg); }
.wave-strip .ripple { position: absolute; height: 18px; border-top: 3px solid rgba(255, 255, 255, .72); border-radius: 50%; }
.wave-strip .r-1 { top: 50%; left: 7%; width: 20%; transform: rotate(-2deg); }
.wave-strip .r-2 { top: 68%; right: 26%; width: 24%; transform: rotate(2deg); }
body.page footer {
  position: relative; z-index: 3; margin-top: -1px; padding: 0 clamp(16px, 5vw, 76px) 20px;
  background: #168fdb; color: rgba(255, 255, 255, .95); text-align: center;
  font-size: calc(11.5px * var(--fs-label)); font-weight: 900; letter-spacing: .12em; line-height: 2;
}

/* --- inquiry modal: a note torn out and taped up ------------- */
.askmask { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(24, 44, 62, .42); z-index: 900; }
.askmask.on { display: flex; }
.askbox {
  position: relative; width: min(420px, 100%); padding: 28px 24px 22px;
  background: var(--pp-cream); border: 1px solid var(--pp-edge); border-radius: 2px;
  box-shadow: var(--pp-lift-hi); transform: rotate(-.8deg);
}
.askbox::before {
  content: ""; position: absolute; top: -14px; left: 50%; margin-left: -43px; width: 86px; height: 27px;
  background-image:
    repeating-linear-gradient(90deg, rgba(73, 179, 236, .5) 0 7px, transparent 7px 14px),
    repeating-linear-gradient(0deg, rgba(73, 179, 236, .5) 0 7px, transparent 7px 14px);
  background-color: rgba(255, 255, 255, .82);
  clip-path: polygon(3% 12%, 100% 0, 96% 90%, 0 100%);
}
.askbox h3 { margin: 0 0 3px; color: var(--main-deep); font-size: calc(19px * var(--fs-title)); font-weight: 1000; letter-spacing: -.03em; }
.askbox p { margin: 0 0 15px; color: var(--sky); font-family: var(--hand); font-size: calc(12px * var(--fs-label)); font-weight: 700; letter-spacing: .04em; }
.askbox .input { border-radius: 2px; }
.askbox textarea { min-height: 118px; resize: vertical; }
.ask-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.askbox .btn { border-radius: 2px; border: 1.5px solid var(--ocean); background: var(--card); color: var(--main-deep); box-shadow: 2px 2px 0 rgba(22, 143, 219, .22); font-weight: 900; }
.askbox .btn-primary { background: var(--ocean); color: #fff; }

/* --- detail overlay ----------------------------------------- */
.ov { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(24, 44, 62, .42); z-index: 500; }
.ov.show { display: flex; }
.ov-box {
  position: relative; width: min(430px, 100%); max-height: 82vh; overflow: auto; padding: 26px 22px;
  background: var(--pp-cream); border: 1px solid var(--pp-edge); border-radius: 2px;
  box-shadow: var(--pp-lift-hi); transform: rotate(-.6deg);
}
body.embed .askmask, body.embed .ov, body.embed .lightbox { position: absolute; top: 0; left: 0; right: 0; bottom: auto; }
body.embed .askmask.on, body.embed .ov.show, body.embed .lightbox.open { align-items: flex-start; }
body.embed .page { min-height: 0; }
body.embed #fx, body.embed #fxload { position: absolute; }

@media (max-width: 760px) {
  .hdr-tools { gap: 6px; }
  .hdr-btn { height: 29px; padding: 0 9px; font-size: 11px; }
  .hdr-btn.dk { width: 29px; padding: 0; }
  .head-title { gap: 0 10px; }
  body.page .card { padding: 18px 16px; }
  body.page .grid-2, body.page .grid-3 { gap: 20px; }
}
/* ============================================================
   Category pieces. Same rule as above: squared paper, tape,
   handwriting for captions, circles only for drops and faces.
   ============================================================ */

/* --- profile ------------------------------------------------ */
.pf-top { display: grid; grid-template-columns: 250px 1fr; gap: 30px; align-items: start; margin-bottom: 30px; }
@media (max-width: 860px) { .pf-top { grid-template-columns: 1fr; gap: 22px; } }
.pf-photo {
  position: relative; margin: 0; padding: 13px 13px 16px; background: #ffffff;
  border: 1px solid var(--pp-edge); box-shadow: var(--pp-lift); transform: rotate(-3.2deg);
}
body.dark .pf-photo { background: #1b2a41; }
#avatarWrap { position: relative; aspect-ratio: 4/5; overflow: hidden; cursor: pointer;
  background: linear-gradient(135deg, rgba(227, 242, 252, .85), rgba(255, 244, 242, .9)); }
#avatarWrap img { width: 100%; height: 100%; object-fit: cover; }
#avatarEmoji { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 54px; }
.pf-photo .cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 11px;
  color: var(--text-soft); font-family: var(--hand); font-size: calc(12px * var(--fs-label)); font-weight: 700; }
.pf-photo .cap b { color: var(--coral); }

.pf-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 4px 0 8px;
  color: var(--main-deep); font-size: calc(36px * var(--fs-display)); font-weight: 1000; letter-spacing: -.06em; }
.pf-name .dday {
  padding: 4px 10px; background: var(--coral); color: #fff; font-size: calc(11px * var(--fs-label));
  font-weight: 1000; letter-spacing: .1em; transform: rotate(-2.5deg); box-shadow: 2px 2px 0 rgba(255, 143, 142, .3);
}
.pf-catch { margin: 0 0 18px; color: var(--main-deep); font-family: var(--hand);
  font-size: calc(15px * var(--fs-body)); font-weight: 700; letter-spacing: .02em; }
.pf-quote {
  position: relative; margin: 0; padding: 20px 22px;
  background: var(--card); border: 2px solid rgba(22, 143, 219, .42); border-radius: 22px 22px 22px 5px;
  color: var(--main-deep); font-family: var(--hand);
  font-size: calc(15px * var(--fs-body)); font-weight: 700; line-height: 1.95;
}
.pf-quote::after { content: ""; position: absolute; left: 26px; bottom: -13px; width: 0; height: 0;
  border: 7px solid transparent; border-top-color: rgba(22, 143, 219, .42); border-bottom: 0; }

/* filled-in form on ruled paper */
.info-list { display: grid; grid-template-columns: repeat(2, 1fr) ; column-gap: 30px; }
@media (max-width: 640px) { .info-list { grid-template-columns: 1fr; } }
.info-row { display: flex; align-items: baseline; gap: 10px; padding: 11px 2px; border-bottom: 1px dashed var(--pp-edge); min-width: 0; }
.info-row .k { flex-shrink: 0; width: 82px; color: var(--coral); font-family: var(--hand);
  font-size: calc(11.5px * var(--fs-label)); font-weight: 700; letter-spacing: .1em; }
.info-row .v { min-width: 0; color: var(--text); font-size: calc(13.5px * var(--fs-body)); font-weight: 800; word-break: break-word; }

.stat { display: grid; grid-template-columns: 88px 1fr 32px; align-items: center; gap: 11px; margin-bottom: 11px; }
.stat .sn { color: var(--text-mid); font-size: calc(12.5px * var(--fs-body)); font-weight: 800; }
.stat .sb { height: 13px; border: 1.5px solid rgba(22, 143, 219, .4); background: var(--card); }
.stat .sb i { display: block; height: 100%;
  background: repeating-linear-gradient(-45deg, var(--sky) 0 4px, rgba(110, 200, 244, .55) 4px 8px); }
.stat .sv { text-align: right; color: var(--main-deep); font-family: var(--hand);
  font-size: calc(12.5px * var(--fs-label)); font-weight: 700; }

.ms { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--pp-edge); }
.ms:last-child { border-bottom: 0; }
.ms .mst { flex-shrink: 0; padding: 3px 9px; border: 1.5px solid rgba(22, 143, 219, .45);
  color: var(--main-deep); font-size: calc(11px * var(--fs-label)); font-weight: 900; }
.ms .msc { color: var(--text); font-size: calc(13.5px * var(--fs-body)); font-weight: 750; }
.ms.done .mst { background: var(--sky); border-color: var(--sky); color: #fff; }
.ms.done .msc { text-decoration: line-through; color: var(--text-soft); }

.dayrow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; }
.dayrow .d { position: relative; padding: 14px 4px 12px; background: var(--card);
  border: 1px solid var(--pp-edge); text-align: center; color: var(--text-soft);
  font-size: calc(13px * var(--fs-body)); font-weight: 900; }
.dayrow .d small { display: block; margin-top: 5px; font-family: var(--hand);
  font-size: calc(10.5px * var(--fs-label)); font-weight: 700; letter-spacing: .08em; }
.dayrow .d.on { background: var(--pp-sky); border-color: var(--sky); color: var(--main-deep); box-shadow: 3px 3px 0 rgba(22, 143, 219, .18); }
.dayrow .d.on::after { content: ""; position: absolute; top: -7px; left: 50%; margin-left: -17px; width: 34px; height: 13px;
  background-image: repeating-linear-gradient(90deg, rgba(73, 179, 236, .5) 0 5px, transparent 5px 10px);
  background-color: rgba(255, 255, 255, .85); transform: rotate(-4deg); }
.dayrow .d:nth-child(2n).on { transform: rotate(-1deg); }
.dayrow .d:nth-child(3n).on { transform: rotate(1.2deg); }
@media (max-width: 560px) { .dayrow { grid-template-columns: repeat(4, 1fr); } }

.linkrow { display: flex; flex-wrap: wrap; gap: 11px; }
.linkrow a { display: inline-flex; align-items: center; gap: 7px; padding: 11px 17px;
  background: var(--card); border: 1.5px solid var(--ocean); box-shadow: 3px 3px 0 rgba(22, 143, 219, .22);
  color: var(--main-deep); font-size: calc(13px * var(--fs-body)); font-weight: 900;
  transition: transform var(--transition), box-shadow var(--transition); }
.linkrow a:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(22, 143, 219, .22); }

.ovod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.ovod-card { padding: 11px 11px 13px; background: #ffffff; border: 1px solid var(--pp-edge); box-shadow: var(--pp-lift); }
.ovod-card:nth-child(2n) { transform: rotate(-.8deg); }
.ovod-card:nth-child(2n+1) { transform: rotate(.7deg); }
body.dark .ovod-card { background: #1b2a41; }
.ovod-embed { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.ovod-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ovod-title { margin-top: 9px; color: var(--text); font-family: var(--hand);
  font-size: calc(13px * var(--fs-body)); font-weight: 700; }

/* --- notice: notes pinned to the board ---------------------- */
.count-line { display: inline-block; padding: 5px 11px; background: var(--pp-sky); border: 1px dashed rgba(22, 143, 219, .5);
  color: var(--main-deep); font-family: var(--hand); font-size: calc(12.5px * var(--fs-label)); font-weight: 700; transform: rotate(-1deg); }
.searchbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.searchbar .input { max-width: 300px; }
#notice-list { max-width: 840px; }
.notice-item {
  position: relative; padding: 21px 24px 23px; margin-bottom: 22px; background: var(--pp-cream);
  border: 1px solid var(--pp-edge); box-shadow: var(--pp-lift); cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}
.notice-item:nth-child(3n+1) { transform: rotate(-.55deg); margin-left: 0; margin-right: 46px; }
.notice-item:nth-child(3n+2) { transform: rotate(.45deg); background: var(--pp-sky); margin-left: 36px; margin-right: 10px; }
.notice-item:nth-child(3n) { transform: rotate(-.32deg); background: var(--pp-coral); margin-left: 16px; margin-right: 30px; }
@media (max-width: 700px) { .notice-item { margin-left: 0 !important; margin-right: 0 !important; } }
.notice-item::after { content: ""; position: absolute; top: -12px; left: 30px; width: 74px; height: 24px;
  background-image:
    repeating-linear-gradient(90deg, rgba(73, 179, 236, .5) 0 7px, transparent 7px 14px),
    repeating-linear-gradient(0deg, rgba(73, 179, 236, .5) 0 7px, transparent 7px 14px);
  background-color: rgba(255, 255, 255, .82); clip-path: polygon(3% 12%, 100% 0, 96% 90%, 0 100%); transform: rotate(-3deg); }
.notice-item:nth-child(2n)::after { left: auto; right: 30px; transform: rotate(4deg); }
body.dark .notice-item::after { background-color: rgba(24, 38, 60, .82); }
.notice-item:hover { box-shadow: var(--pp-lift-hi); }
.notice-item.pinned { border-color: var(--sky); border-width: 2px; }
.notice-pin { display: inline-block; margin-right: 10px; padding: 3px 9px; background: var(--coral); color: #fff;
  font-size: calc(10.5px * var(--fs-label)); font-weight: 1000; letter-spacing: .1em; transform: rotate(-2deg); }
.notice-title { color: var(--main-deep); font-size: calc(15.5px * var(--fs-body)); font-weight: 900; letter-spacing: -.02em; }
.notice-date { float: right; margin-top: 3px; padding: 2px 8px; background: var(--card); border: 1px dashed var(--pp-edge);
  color: var(--text-soft); font-family: var(--hand); font-size: calc(11.5px * var(--fs-label)); font-weight: 700; }
.notice-content { display: none; margin-top: 15px; padding-top: 15px; border-top: 1px dashed var(--pp-edge);
  color: var(--text-mid); font-size: calc(13.5px * var(--fs-body)); font-weight: 650; line-height: 1.95; white-space: pre-wrap; }
.notice-item.open .notice-content { display: block; }
.post-img { display: block; width: 100%; max-width: 520px; margin: 0 0 13px; padding: 8px; background: #ffffff;
  border: 1px solid var(--pp-edge); box-shadow: var(--pp-lift); }

/* --- schedule: a notebook page ------------------------------ */
.cal-bar { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 20px; }
.cal-bar button { width: 32px; height: 32px; border: 1.5px solid var(--ocean); background: var(--card);
  color: var(--main-deep); font-size: 13px; font-weight: 900; cursor: pointer; box-shadow: 2px 2px 0 rgba(22, 143, 219, .22); }
.cal-bar button:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(22, 143, 219, .22); }
#calTitle { min-width: 168px; text-align: center; color: var(--main-deep);
  font-size: calc(20px * var(--fs-title)); font-weight: 1000; letter-spacing: -.03em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid rgba(22, 143, 219, .28); border-bottom: 1px solid rgba(22, 143, 219, .28); background: var(--card); }
.cal-dow { padding: 10px 0; border-top: 1px solid rgba(22, 143, 219, .28); border-right: 1px solid rgba(22, 143, 219, .28);
  background: var(--pp-sky); text-align: center; color: var(--main-deep); font-family: var(--hand);
  font-size: calc(12px * var(--fs-label)); font-weight: 700; letter-spacing: .1em; }
.cal-dow:first-child { color: var(--coral); }
.cal-cell { min-height: 92px; padding: 6px 6px 7px; border-top: 1px solid rgba(22, 143, 219, .28);
  border-right: 1px solid rgba(22, 143, 219, .28); overflow: hidden; }
.cal-cell.hasband { overflow: visible; }
.cal-cell.other { background: rgba(22, 143, 219, .05); opacity: .55; }
.cal-cell.has { cursor: pointer; }
.cal-cell.has:hover { background: rgba(22, 143, 219, .06); }
.cal-date { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center;
  color: var(--text-mid); font-family: var(--hand); font-size: calc(12.5px * var(--fs-label)); font-weight: 700; }
/* today is circled by hand, not filled */
.cal-cell.today .cal-date { border: 2px solid var(--coral); border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
  color: var(--coral); transform: rotate(-6deg); }
.cal-cell.hl { box-shadow: inset 0 0 0 2px var(--coral); }
.ev { margin-top: 4px; padding: 2px 6px; font-size: calc(10.5px * var(--fs-label)); font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Band spans cells; negative margin must equal cell padding + right border. */
.band { position: relative; margin: 4px -7px 0 -6px; height: 20px; z-index: 1; display: flex; align-items: center; overflow: hidden; }
.band span { padding-left: 8px; font-size: calc(10.5px * var(--fs-label)); font-weight: 800; white-space: nowrap; }
.band.b-start { margin-left: 0; }
.band.b-end { margin-right: 0; }
.cal-cell:nth-child(7n) .band { margin-right: 0; }
.cal-cell:nth-child(7n+1) .band { margin-left: 0; }
.c-green { background: #d8f2e4; color: #1c6f4b; }
.c-pink { background: #ffe1e6; color: #b64d5f; }
.c-yellow { background: #fdf0c8; color: #8a6a12; }
.c-orange { background: #ffe2cd; color: #a25a20; }
.c-blue { background: #d9edfd; color: #1a6fa8; }
.c-purple { background: #e8e0fb; color: #5f45a8; }
.c-red { background: #ffdcdc; color: #b23a3a; }
.c-gray { background: #e7eaef; color: #5b6676; }
body.dark .c-green { background: #1d3a2e; color: #93e0bb; }
body.dark .c-pink { background: #3d2630; color: #ffb7c3; }
body.dark .c-yellow { background: #3b3520; color: #f0d68a; }
body.dark .c-orange { background: #3c2b1e; color: #f5bb8c; }
body.dark .c-blue { background: #1d3348; color: #9fd4f6; }
body.dark .c-purple { background: #2e2846; color: #c4b3f2; }
body.dark .c-red { background: #3d2626; color: #f4a3a3; }
body.dark .c-gray { background: #2a3242; color: #b3bdcc; }

.up-item { display: grid; grid-template-columns: 100px 1fr auto auto; align-items: center; gap: 13px;
  padding: 13px 16px; margin-bottom: 11px; background: var(--card); border: 1px solid var(--pp-edge);
  border-left: 4px solid var(--sky); cursor: pointer; transition: transform var(--transition); }
.up-item:hover { transform: translateX(3px); }
.up-item .up-d1 { color: var(--main-deep); font-family: var(--hand); font-size: calc(13px * var(--fs-body)); font-weight: 700; }
.up-item .up-title { color: var(--text); font-size: calc(13.5px * var(--fs-body)); font-weight: 800; min-width: 0; }
.up-item .up-time { color: var(--text-soft); font-family: var(--hand); font-size: calc(12px * var(--fs-label)); font-weight: 700; }
.up-badge { padding: 3px 10px; font-size: calc(11px * var(--fs-label)); font-weight: 900; }
@media (max-width: 640px) { .up-item { grid-template-columns: 1fr auto; } .up-item .up-time { grid-column: 1 / -1; } }
.m-date { color: var(--main-deep); font-size: calc(18px * var(--fs-title)); font-weight: 1000; letter-spacing: -.03em; margin-bottom: 13px; }
.m-badge { display: inline-block; margin-bottom: 11px; padding: 3px 11px; font-size: calc(11px * var(--fs-label)); font-weight: 900; }
.m-part { display: flex; gap: 13px; padding: 10px 0; border-top: 1px dashed var(--pp-edge); }
.m-part .pt { flex-shrink: 0; width: 68px; color: var(--coral); font-family: var(--hand);
  font-size: calc(12.5px * var(--fs-label)); font-weight: 700; }
.m-part .pn { color: var(--text); font-size: calc(13.5px * var(--fs-body)); font-weight: 800; }
.m-desc { margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--pp-edge); color: var(--text-mid);
  font-size: calc(13px * var(--fs-body)); font-weight: 650; line-height: 1.85; white-space: pre-wrap; }
.m-close { width: 100%; margin-top: 17px; padding: 10px; border: 1.5px solid var(--ocean); background: var(--ocean);
  color: #fff; font-size: calc(13px * var(--fs-body)); font-weight: 900; cursor: pointer; }

/* --- work: crew polaroids ----------------------------------- */
.viewer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 22px; }
.viewer-card { position: relative; padding: 11px 11px 14px; background: #ffffff; border: 1px solid var(--pp-edge);
  box-shadow: var(--pp-lift); text-align: center; cursor: pointer; transition: box-shadow var(--transition); }
body.dark .viewer-card { background: #1b2a41; }
.viewer-card:nth-child(3n+1) { transform: rotate(-1.6deg); }
.viewer-card:nth-child(3n+2) { transform: rotate(1.3deg); }
.viewer-card:nth-child(3n) { transform: rotate(-.7deg); }
.viewer-card:hover { box-shadow: var(--pp-lift-hi); }
.viewer-card::after { content: ""; position: absolute; top: -10px; left: 50%; margin-left: -26px; width: 52px; height: 19px;
  background-image: repeating-linear-gradient(90deg, rgba(73, 179, 236, .5) 0 6px, transparent 6px 12px);
  background-color: rgba(255, 255, 255, .8); transform: rotate(-3deg); }
.viewer-av, .viewer-av-fb { width: 100%; aspect-ratio: 1/1; object-fit: cover;
  background: linear-gradient(135deg, rgba(227, 242, 252, .85), rgba(255, 244, 242, .9)); }
.viewer-av-fb { display: flex; align-items: center; justify-content: center; color: var(--main-deep); font-size: 34px; font-weight: 1000; }
.viewer-nick { margin-top: 10px; color: var(--text); font-family: var(--hand);
  font-size: calc(13.5px * var(--fs-body)); font-weight: 700; }
.viewer-id { color: var(--text-soft); font-size: calc(10.5px * var(--fs-label)); font-weight: 700; }
.viewer-total { display: inline-block; margin-top: 9px; padding: 3px 10px; background: var(--coral); color: #fff;
  font-size: calc(11px * var(--fs-label)); font-weight: 1000; transform: rotate(-2deg); }
#modal-top { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.modal-av, .modal-av-fb { width: 54px; height: 54px; object-fit: cover; border: 4px solid #ffffff; box-shadow: var(--pp-lift); }
.modal-av-fb { display: flex; align-items: center; justify-content: center; background: var(--pp-sky); color: var(--main-deep); font-size: 21px; font-weight: 1000; }
.modal-nick { color: var(--main-deep); font-size: calc(17px * var(--fs-title)); font-weight: 1000; }
.modal-id { color: var(--text-soft); font-family: var(--hand); font-size: calc(11.5px * var(--fs-label)); font-weight: 700; }
.modal-x { margin-left: auto; width: 30px; height: 30px; border: 1.5px solid var(--pp-edge); background: var(--card);
  color: var(--text-soft); font-size: 13px; cursor: pointer; }
.upbo-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px dashed var(--pp-edge); }
.upbo-row .nm { color: var(--text); font-size: calc(13.5px * var(--fs-body)); font-weight: 800; }
.upbo-row .ev { margin: 0; background: var(--coral); color: #fff; padding: 2px 8px; }
.upbo-row .ct { margin-left: auto; color: var(--main-deep); font-family: var(--hand);
  font-size: calc(14px * var(--fs-body)); font-weight: 700; }
.modal-empty { padding: 22px 0; text-align: center; color: var(--text-soft); font-family: var(--hand);
  font-size: calc(13px * var(--fs-body)); font-weight: 700; }

/* --- dress: album of polaroids ------------------------------ */
.seg { display: inline-flex; gap: 0; }
.seg-btn { padding: 9px 17px; border: 1.5px solid var(--ocean); background: var(--card); color: var(--main-deep);
  font-size: calc(12.5px * var(--fs-body)); font-weight: 900; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 0; }
.seg-btn.active { background: var(--ocean); color: #fff; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0 24px; }
.cat-tab { padding: 8px 15px; border: 1px dashed rgba(22, 143, 219, .55); background: var(--card);
  color: var(--text-mid); font-size: calc(12.5px * var(--fs-body)); font-weight: 900; cursor: pointer; }
.cat-tab.active { border-style: solid; border-color: var(--ocean); background: var(--pp-sky); color: var(--main-deep); box-shadow: 3px 3px 0 rgba(22, 143, 219, .2); }
.cat-tab .cnt { margin-left: 6px; font-family: var(--hand); font-size: calc(11.5px * var(--fs-label)); opacity: .8; }
.poster-grid, .item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px; }
.poster, .item-card { position: relative; padding: 12px 12px 16px; background: #ffffff; border: 1px solid var(--pp-edge);
  box-shadow: var(--pp-lift); cursor: pointer; transition: box-shadow var(--transition); }
body.dark .poster, body.dark .item-card { background: #1b2a41; }
.poster:nth-child(3n+1), .item-card:nth-child(3n+1) { transform: rotate(-1.4deg); }
.poster:nth-child(3n+2), .item-card:nth-child(3n+2) { transform: rotate(1.1deg); }
.poster:nth-child(3n), .item-card:nth-child(3n) { transform: rotate(-.6deg); }
.poster:hover, .item-card:hover { box-shadow: var(--pp-lift-hi); }
.poster::before, .item-card::before { content: ""; position: absolute; z-index: 2; top: -11px; left: 24px;
  width: 62px; height: 21px;
  background-image:
    repeating-linear-gradient(90deg, rgba(73, 179, 236, .5) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(0deg, rgba(73, 179, 236, .5) 0 6px, transparent 6px 12px);
  background-color: rgba(255, 255, 255, .82); clip-path: polygon(3% 12%, 100% 0, 96% 90%, 0 100%); transform: rotate(-4deg); }
.poster:nth-child(2n)::before, .item-card:nth-child(2n)::before { left: auto; right: 24px; transform: rotate(5deg); }
.poster img, .item-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.poster .ph-ph, .item-card .ph { display: flex; width: 100%; aspect-ratio: 3/4; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(227, 242, 252, .85), rgba(255, 244, 242, .9)); font-size: 40px; }
.poster .p-top { position: absolute; z-index: 3; top: 20px; right: 20px; }
.poster .p-brand { display: none; }
.poster .p-new { display: inline-block; padding: 3px 8px; background: var(--coral); color: #fff;
  font-size: calc(10px * var(--fs-label)); font-weight: 1000; letter-spacing: .1em; transform: rotate(4deg);
  box-shadow: 2px 2px 0 rgba(255, 143, 142, .3); }
.poster .p-bottom, .item-cap { padding-top: 11px; }
.poster .p-cat { display: inline-block; margin-bottom: 5px; padding: 2px 8px; background: var(--pp-sky);
  color: var(--main-deep); font-size: calc(10px * var(--fs-label)); font-weight: 900; letter-spacing: .06em; }
.poster .p-name, .item-cap .name { color: var(--text); font-family: var(--hand);
  font-size: calc(14.5px * var(--fs-body)); font-weight: 700; }
.poster .p-meta { margin-top: 3px; color: var(--text-soft); font-family: var(--hand);
  font-size: calc(11px * var(--fs-label)); font-weight: 700; letter-spacing: .06em; }
.poster .p-desc, .item-cap .desc { margin-top: 5px; color: var(--text-soft); font-size: calc(11.5px * var(--fs-label));
  font-weight: 650; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.dress-pager, #pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 28px; }
.pg { min-width: 32px; height: 32px; padding: 0 9px; border: 1.5px solid var(--ocean); background: var(--card);
  color: var(--main-deep); font-size: calc(12.5px * var(--fs-body)); font-weight: 900; cursor: pointer; }
.pg.active { background: var(--ocean); color: #fff; }
.lightbox { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px;
  background: rgba(12, 34, 52, .72); z-index: 800; }
.lightbox.open { display: flex; }
.lb-inner { padding: 14px 14px 18px; background: #ffffff; box-shadow: var(--pp-lift-hi); transform: rotate(-1deg); }
.lightbox img { display: block; max-width: min(520px, 86vw); max-height: 70vh; }
.lb-cap { margin-top: 12px; text-align: center; }
.lb-cap .n { color: var(--main-deep); font-family: var(--hand); font-size: calc(16px * var(--fs-body)); font-weight: 700; }
.lb-cap .d { margin-top: 5px; color: var(--text-soft); font-size: calc(12.5px * var(--fs-label)); font-weight: 650; line-height: 1.7; }
.lightbox-close { position: fixed; top: 16px; right: 18px; width: 36px; height: 36px; border: 1.5px solid #fff;
  background: rgba(255, 255, 255, .92); color: #234; font-size: 15px; font-weight: 900; cursor: pointer; z-index: 801; }
