:root {
  --ink: #171713;
  --muted: #6f6d65;
  --paper: #f4f0e8;
  --paper-2: #ebe6dc;
  --white: #fffdf8;
  --tomato: #f25633;
  --tomato-dark: #c93a1f;
  --lime: #d9ee79;
  --sage: #a7b8a0;
  --line: rgba(23, 23, 19, 0.15);
  --soft-line: rgba(23, 23, 19, 0.09);
  --shadow: 0 26px 70px rgba(40, 34, 24, 0.12);
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --sidebar: 316px;
  --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

* { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: hidden;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}

@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}

img, video, canvas, svg { max-width: 100%; }
main, article, section { min-width: 0; }

button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(242, 86, 51, 0.3);
  outline-offset: 3px;
}

.hidden, [hidden] { display: none !important; }
.mobile-only, .mobile-header { display: none; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.library-panel {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 30px 24px 22px;
  color: #f7f3ea;
  background: #20211d;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.auth-button { display: flex; width: 100%; align-items: center; justify-content: space-between; margin: -16px 0 14px; padding: 9px 11px; color: rgba(247,243,234,.72); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 11px; cursor: pointer; font-size: 10px; }
.auth-button span { padding: 3px 7px; color: #20211d; background: var(--lime); border-radius: 999px; font-weight: 850; }
.auth-button b { font-weight: 700; }
.owner-mode .auth-button span { color: white; background: var(--tomato); }

.guest-banner { position: sticky; top: 0; z-index: 16; display: flex; min-height: 48px; align-items: center; gap: 13px; padding: 8px clamp(18px,4vw,54px); color: #f7f3ea; background: rgba(32,33,29,.94); border-bottom: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(18px); }
.guest-banner > span { flex: 0 0 auto; color: var(--lime); font-family: "DM Sans",sans-serif; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.guest-banner p { margin: 0; flex: 1; color: rgba(247,243,234,.72); font-size: 11px; }
.guest-banner button { color: #20211d; background: var(--lime); border: 0; border-radius: 999px; padding: 7px 11px; cursor: pointer; font-size: 10px; font-weight: 800; }
.login-card { max-width: 430px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

/* 마크 자체가 배경을 포함한다. 컨테이너는 크기와 그림자만 맡는다. */
.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(201, 58, 31, 0.28);
  border-radius: 9.8px;
}

.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.04em; }
.brand small { display: block; margin-top: 2px; color: rgba(247,243,234,0.56); font-size: 11px; letter-spacing: -0.02em; }

.primary-button, .secondary-button, .danger-button, .icon-button, .back-link {
  border: 0;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms ease, color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.primary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  color: #fff;
  background: var(--tomato);
  border-radius: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.primary-button:hover { background: var(--tomato-dark); transform: translateY(-2px); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: 0.56; transform: none; }
.primary-button.full { width: 100%; }

.library-panel > .primary-button {
  justify-content: flex-start;
  min-height: 54px;
  margin-bottom: 14px;
  padding: 0 17px;
  color: #20211d;
  background: var(--lime);
  border-radius: 16px;
}

.library-panel > .primary-button span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(32,33,29,0.18);
  border-radius: 8px;
  font-size: 18px;
}

.library-panel > .primary-button:hover { background: #e7f699; }

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: rgba(247,243,234,0.52);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px;
}

.search-box:focus-within { border-color: rgba(217,238,121,0.55); background: rgba(255,255,255,0.09); }
.search-box input { width: 100%; height: 45px; color: #fff; background: transparent; border: 0; outline: 0; font-size: 13px; }
.search-box input::placeholder { color: rgba(247,243,234,0.4); }

.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 3px 12px;
  color: rgba(247,243,234,0.48);
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-heading span:last-child {
  min-width: 22px;
  padding: 3px 7px;
  color: #20211d;
  background: var(--sage);
  border-radius: 999px;
  text-align: center;
}

.recipe-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}

.list-card {
  display: grid;
  width: 100%;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
  padding: 9px;
  color: #f7f3ea;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms var(--ease);
}

.list-card:hover { background: rgba(255,255,255,0.06); }
.list-card.active { background: rgba(217,238,121,0.12); border-color: rgba(217,238,121,0.22); }
.list-card.group-card { grid-template-columns: 50px minmax(0, 1fr) 18px; }
.list-card.group-card.expanded { background: rgba(217,238,121,0.16); border-color: rgba(217,238,121,0.28); }
.list-thumb { display: grid; width: 50px; height: 50px; place-items: center; object-fit: cover; overflow: hidden; background: #33342e; border-radius: 11px; font-size: 19px; }
.text-thumb { color: #20211d; background: var(--sage); font-family: "Instrument Serif", serif; font-size: 25px; }
.list-card strong { display: block; overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.list-card small { display: block; margin-top: 5px; color: rgba(247,243,234,0.45); font-size: 10px; }
.group-thumb-stack { position: relative; display: block; width: 50px; height: 50px; }
.group-thumb-stack .list-thumb { position: relative; z-index: 2; }
.group-thumb-stack i { position: absolute; inset: 4px -4px -4px 4px; z-index: 1; background: #484940; border: 1px solid rgba(255,255,255,0.12); border-radius: 11px; }
.group-thumb-stack b { position: absolute; right: -5px; bottom: -5px; z-index: 3; display: grid; min-width: 21px; height: 21px; place-items: center; padding: 0 5px; color: #20211d; background: var(--lime); border: 2px solid #20211d; border-radius: 999px; font-family: "DM Sans", sans-serif; font-size: 9px; }
.group-arrow { color: rgba(247,243,234,0.48); font-size: 21px; transition: transform 180ms var(--ease), color 180ms ease; }
.group-card.expanded .group-arrow { color: var(--lime); transform: translateX(3px); }
.status-mini { color: var(--lime); }
.empty-list { padding: 32px 12px; color: rgba(247,243,234,0.42); font-size: 12px; line-height: 1.8; text-align: center; }

.group-drawer-scrim {
  position: fixed;
  inset: 0 0 0 var(--sidebar);
  z-index: 17;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(23,23,19,0.08);
  border: 0;
  backdrop-filter: blur(0);
  transition: opacity 220ms ease, backdrop-filter 220ms ease;
}

.group-drawer-scrim.open { pointer-events: auto; opacity: 1; backdrop-filter: blur(2px); }

.group-drawer {
  position: fixed;
  top: 16px;
  bottom: 16px;
  left: var(--sidebar);
  z-index: 19;
  width: min(390px, calc(100vw - var(--sidebar) - 32px));
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background: rgba(255,253,248,0.88);
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 0 28px 28px 0;
  box-shadow: 24px 20px 70px rgba(40,34,24,0.18);
  backdrop-filter: blur(24px) saturate(1.18);
  transform: translateX(calc(-100% - 18px)) scale(0.98);
  transform-origin: left center;
  transition: transform 280ms var(--ease), opacity 180ms ease;
}

.group-drawer.open { pointer-events: auto; opacity: 1; transform: translateX(0) scale(1); }
.group-drawer > div { display: flex; height: 100%; flex-direction: column; padding: 28px 24px 22px; }
.group-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.drawer-eyebrow { color: var(--tomato); font-family: "DM Sans", sans-serif; font-size: 9px; font-weight: 800; letter-spacing: 0.15em; }
.group-drawer-head h2 { margin: 8px 0 0; font-size: 28px; font-weight: 900; letter-spacing: -0.065em; line-height: 1.08; }
.group-drawer-close { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; color: var(--muted); background: rgba(235,230,220,0.8); border: 1px solid var(--soft-line); border-radius: 50%; cursor: pointer; font-size: 20px; }
.group-drawer-close:hover { color: var(--ink); background: #fff; }
.group-summary { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 13px; margin: 22px 0 17px; padding: 12px; background: rgba(235,230,220,0.65); border: 1px solid rgba(23,23,19,0.06); border-radius: 17px; }
.group-summary img { width: 58px; height: 58px; object-fit: cover; border-radius: 13px; }
.group-summary strong, .group-summary span { display: block; }
.group-summary strong { font-size: 13px; }
.group-summary span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.group-recipe-list { min-height: 0; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: rgba(23,23,19,0.18) transparent; }
.group-recipe-row { display: grid; width: 100%; grid-template-columns: 34px minmax(0, 1fr) auto 18px; align-items: center; gap: 10px; padding: 13px 8px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--soft-line); cursor: pointer; text-align: left; transition: padding 180ms var(--ease), background 180ms ease, border-radius 180ms ease; }
.group-recipe-row:hover, .group-recipe-row.active { padding-inline: 12px; background: rgba(255,255,255,0.72); border-radius: 13px; }
.group-recipe-row.active { box-shadow: inset 3px 0 0 var(--tomato); }
.group-index { color: rgba(23,23,19,0.34); font-family: "Instrument Serif", serif; font-size: 20px; }
.group-recipe-row strong { display: block; overflow: hidden; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.group-recipe-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.group-recipe-row em { padding: 5px 7px; color: #a33e2a; background: rgba(242,86,51,0.11); border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 800; white-space: nowrap; }
.group-recipe-row > i { color: rgba(23,23,19,0.34); font-size: 12px; font-style: normal; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 18px 4px 0;
  color: rgba(247,243,234,0.44);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
}

.health-dot { width: 7px; height: 7px; background: #aaa; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,255,255,0.04); }
.health-dot.ok { background: #b9dc63; }
.health-dot.bad { background: #ff7559; }

.content-panel {
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 18%, rgba(217,238,121,0.22), transparent 25%),
    linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
    var(--paper);
}

.welcome-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(350px, 0.88fr) minmax(470px, 1.12fr);
  align-items: center;
  gap: clamp(42px, 6vw, 100px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 70px clamp(44px, 6vw, 100px);
  overflow: hidden;
}

.welcome-copy { position: relative; z-index: 2; container-type: inline-size; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-family: "DM Sans", sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.13em; }
.eyebrow i { width: 7px; height: 7px; background: var(--tomato); border-radius: 50%; box-shadow: 0 0 0 4px rgba(242,86,51,0.12); }

.welcome-copy h1 {
  margin: 28px 0 24px;
  /* 뷰포트가 아니라 컬럼 너비를 기준으로 잡아야 사이드바가 있는 데스크톱에서 제목이 잘리지 않는다. */
  font-size: clamp(46px, 16.4cqw, 88px);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.welcome-copy h1 span { display: block; white-space: nowrap; }
.welcome-copy h1 em { display: block; color: var(--tomato); font-family: "Instrument Serif", "Noto Sans KR", serif; font-size: 1.08em; font-weight: 400; letter-spacing: -0.065em; white-space: nowrap; }
.welcome-copy > p { max-width: 540px; margin: 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.8; letter-spacing: -0.035em; }

.welcome-actions { display: flex; align-items: center; gap: 22px; margin-top: 38px; }
.primary-button.large { min-height: 60px; padding: 0 24px 0 27px; border-radius: 16px; font-size: 15px; box-shadow: 0 13px 28px rgba(201,58,31,0.18); }
.primary-button.large span { display: grid; width: 28px; height: 28px; place-items: center; color: var(--ink); background: var(--white); border-radius: 9px; }
.frame-note { display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px 9px 12px; color: var(--muted); background: rgba(255,255,255,0.55); border: 1px solid var(--soft-line); border-radius: 999px; font-size: 11px; line-height: 1.35; white-space: nowrap; }
.frame-note strong { color: var(--ink); font-family: "Instrument Serif", serif; font-size: 30px; font-weight: 400; line-height: 1; }
.frame-note small { font-size: 11px; }

.welcome-art {
  position: relative;
  width: 100%;
  max-width: 650px;
  min-height: 620px;
  justify-self: center;
}

.art-stamp {
  position: absolute;
  top: 0;
  right: 2%;
  z-index: 1;
  color: rgba(23,23,19,0.2);
  font-family: "DM Sans", sans-serif;
  font-size: clamp(24px, 2.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.82;
  text-align: right;
  transform: rotate(6deg);
}

.reel-card {
  position: absolute;
  top: 8%;
  left: 3%;
  z-index: 2;
  width: 52%;
  min-width: 260px;
  padding: 12px;
  background: #20211d;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 30px;
  box-shadow: var(--shadow);
  transform: rotate(-5deg);
  animation: enter-left 700ms var(--ease) both;
}

.reel-top, .reel-bottom { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 7px; color: rgba(255,255,255,0.62); font-family: "DM Sans", sans-serif; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; }
.reel-bottom span:first-child { color: var(--lime); }
.reel-bottom span:last-child { display: grid; width: 22px; height: 22px; place-items: center; color: #20211d; background: var(--lime); border-radius: 50%; }
.dish-scene { position: relative; height: 390px; overflow: hidden; background: #ba5942; border-radius: 20px; }
.dish-scene::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 72% 18%, rgba(255,255,255,0.28), transparent 24%), linear-gradient(145deg, transparent 40%, rgba(51,18,10,0.18)); }
.dish-shadow { position: absolute; left: 13%; right: 5%; bottom: 10%; height: 24%; background: rgba(65,21,11,0.24); border-radius: 50%; filter: blur(10px); transform: rotate(-8deg); }
.dish-plate { position: absolute; left: 10%; right: 7%; bottom: 13%; height: 48%; background: #efe5cc; border: 8px solid #f9f3e6; border-radius: 50%; transform: rotate(-8deg); box-shadow: inset 0 0 0 20px #dbd0b5; }
.dish-sauce { position: absolute; left: 24%; right: 19%; bottom: 22%; height: 28%; background: repeating-radial-gradient(ellipse at center, #d9a648 0 10px, #efd07b 11px 18px, #ad6f2d 19px 21px); border-radius: 50%; transform: rotate(-8deg); }
.dish-leaf { position: absolute; z-index: 2; width: 34px; height: 14px; background: #587049; border-radius: 100% 0 100% 0; }
.leaf-one { left: 48%; bottom: 37%; transform: rotate(19deg); }
.leaf-two { left: 54%; bottom: 34%; transform: rotate(104deg); }
.scan-line { position: absolute; inset: 34% 9% auto; height: 1px; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.scan-line::before, .scan-line::after { content: ""; position: absolute; top: -3px; width: 7px; height: 7px; background: var(--lime); border-radius: 50%; }
.scan-line::after { right: 0; }

.recipe-ticket {
  position: absolute;
  right: 1%;
  bottom: 6%;
  z-index: 3;
  width: 53%;
  min-width: 275px;
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px 28px 28px 28px;
  box-shadow: var(--shadow);
  transform: rotate(4deg);
  animation: enter-right 800ms 80ms var(--ease) both;
}

.ticket-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-family: "DM Sans", sans-serif; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; }
.ticket-head i { width: 9px; height: 9px; background: var(--tomato); border-radius: 50%; }
.recipe-ticket h2 { margin: 42px 0 24px; font-size: clamp(31px, 3vw, 45px); font-weight: 900; letter-spacing: -0.07em; line-height: 1.02; }
.ticket-meta { display: flex; gap: 7px; margin-bottom: 28px; }
.ticket-meta span { padding: 6px 10px; background: var(--paper-2); border-radius: 999px; font-size: 10px; font-weight: 700; }
.recipe-ticket ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.recipe-ticket li { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--soft-line); font-size: 11px; }
.recipe-ticket b { font-family: "DM Sans", sans-serif; }
.art-caption { position: absolute; right: 1%; bottom: 0; color: var(--muted); font-family: "DM Sans", sans-serif; font-size: 9px; font-weight: 700; letter-spacing: 0.12em; }

@keyframes enter-left { from { opacity: 0; transform: translate(24px, 24px) rotate(-1deg); } }
@keyframes enter-right { from { opacity: 0; transform: translate(-24px, 28px) rotate(0deg); } }

.recipe-view { max-width: 1320px; min-height: 100vh; margin: 0 auto; padding: 36px clamp(40px, 6vw, 92px) 90px; }
.recipe-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.back-link { padding: 10px 0; color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; }
.back-link:hover { color: var(--ink); transform: translateX(-3px); }
.toolbar-actions { display: flex; gap: 8px; }
.secondary-button, .danger-button { min-height: 42px; padding: 0 16px; background: rgba(255,255,255,0.48); border: 1px solid var(--line); border-radius: 12px; font-size: 12px; font-weight: 700; }
.secondary-button:hover { background: var(--white); border-color: rgba(23,23,19,0.28); }
.danger-button { color: #b74732; }
.danger-button:hover { color: #fff; background: #b74732; border-color: #b74732; }

.recipe-hero { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr); gap: clamp(38px, 6vw, 80px); align-items: center; padding-bottom: 62px; border-bottom: 1px solid var(--line); }
/* 상세 화면에서는 프레임을 자르지 않는다. 이미지가 로드되면 JS가 실제 비율을
   --cover-ratio에 넣고, 지나치게 긴 세로 이미지만 화면 높이에 맞춰 여백과 함께 축소한다. */
.cover-wrap { position: relative; width: 100%; height: auto; min-height: 320px; max-height: min(70svh, 560px); aspect-ratio: var(--cover-ratio, 4 / 3); overflow: hidden; background: radial-gradient(circle at 50% 38%, #eee9de 0, #d7d0c3 72%); border-radius: 7px 32px 32px 32px; box-shadow: var(--shadow); transition: aspect-ratio 220ms var(--ease); }
.cover-wrap > img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; background: rgba(244,240,232,0.2); }
.cover-placeholder { position: relative; display: grid; height: 100%; place-items: center; overflow: hidden; background: #9ba998; }
.placeholder-plate { position: absolute; width: 68%; aspect-ratio: 1.25; background: #eee4cc; border: clamp(12px, 2vw, 24px) solid #f7f2e7; border-radius: 50%; box-shadow: 0 28px 45px rgba(37,55,36,0.16); transform: rotate(-8deg); }
.placeholder-food { position: absolute; width: 40%; aspect-ratio: 1.35; background: repeating-radial-gradient(ellipse, #e5b85d 0 12px, #c77b38 13px 18px, #e9cd7c 19px 27px); border-radius: 50%; transform: rotate(-8deg); }
.cover-placeholder small { position: absolute; right: 18px; bottom: 18px; color: rgba(255,255,255,0.7); font-family: "DM Sans", sans-serif; font-size: 9px; font-weight: 700; letter-spacing: 0.14em; }
.source-chip { position: absolute; right: 14px; bottom: 14px; padding: 10px 14px; color: #fff; background: rgba(28,29,25,0.82); border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; backdrop-filter: blur(8px); font-size: 11px; font-weight: 700; text-decoration: none; }
.title-block h1 { max-width: 620px; margin: 18px 0 15px; font-size: clamp(42px, 5vw, 74px); font-weight: 900; letter-spacing: -0.075em; line-height: 1.03; overflow-wrap: anywhere; }
.author { color: var(--muted); font-size: 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 24px 0 28px; }
.tag { padding: 7px 11px; background: var(--lime); border-radius: 999px; font-size: 11px; font-weight: 700; border: 0; color: inherit; font-family: inherit; }
button.tag { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
button.tag:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(32,33,29,0.18); }
.related-recipes { margin: -8px 0 24px; }
.related-recipes > small { display: block; margin-bottom: 9px; color: var(--muted); font-size: 10px; }
.related-recipes > div { display: flex; flex-wrap: wrap; gap: 7px; }
.related-chip { max-width: 100%; padding: 8px 11px; overflow: hidden; color: var(--muted); background: rgba(255,255,255,0.46); border: 1px solid var(--line); border-radius: 10px; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.related-chip:hover, .related-chip.active { color: var(--ink); background: var(--white); border-color: rgba(23,23,19,0.24); }
.related-chip.active { box-shadow: inset 0 -2px 0 var(--tomato); }
.meta-row { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.meta-item { padding: 18px 16px; border-right: 1px solid var(--line); }
.meta-item:first-child { padding-left: 0; }
.meta-item:last-child { border-right: 0; }
.meta-item small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.meta-item strong { font-size: 14px; }
.confidence { margin-top: 22px; }
.confidence-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 11px; }
.confidence-head span { color: var(--muted); }
.confidence-track, .progress-track { height: 6px; overflow: hidden; background: rgba(23,23,19,0.1); border-radius: 999px; }
.confidence-fill { height: 100%; background: var(--tomato); border-radius: inherit; }
.processing-card { margin-top: 20px; padding: 18px; background: #e6edc7; border-radius: 14px; }
.processing-card.failed { background: #f3d7cf; }
.processing-card h3 { margin: 0 0 5px; font-size: 13px; }
.processing-card p { margin: 0 0 12px; color: var(--muted); font-size: 11px; }
.progress-fill { height: 100%; background: #657541; border-radius: inherit; transition: width 400ms ease; }

.recipe-body { display: grid; grid-template-columns: minmax(280px, 0.82fr) minmax(380px, 1.18fr); gap: clamp(50px, 8vw, 110px); padding-top: 62px; }
.section-title { display: flex; align-items: center; gap: 11px; margin: 0 0 25px; font-size: 23px; font-weight: 900; letter-spacing: -0.055em; }
.section-title span { width: 10px; height: 10px; background: var(--tomato); border-radius: 50% 50% 50% 0; }
.ingredient-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ingredient-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 17px 2px; border-bottom: 1px solid var(--soft-line); font-size: 13px; }
.ingredient-list small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.amount { flex: 0 0 auto; font-family: "DM Sans", sans-serif; font-weight: 700; text-align: right; }
.source-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: #91a44c; border-radius: 50%; }
.source-dot.inferred { background: #d49a52; }
.step-list { display: grid; gap: 12px; }
.step-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 15px; padding: 21px; background: rgba(255,255,255,0.46); border: 1px solid var(--soft-line); border-radius: 18px; transition: background 180ms ease, transform 180ms var(--ease); }
.step-card:hover { background: var(--white); transform: translateX(3px); }
.step-number { display: grid; width: 40px; height: 40px; place-items: center; color: var(--white); background: var(--ink); border-radius: 12px 12px 12px 3px; font-family: "Instrument Serif", serif; font-size: 20px; }
.step-card p { margin: 3px 0 12px; font-size: 14px; line-height: 1.75; }
.step-detail { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 9px; }
.info-box { margin-top: 22px; padding: 20px; background: rgba(167,184,160,0.22); border: 1px solid rgba(100,120,94,0.16); border-radius: 18px; }
.info-box.warning { background: rgba(242,86,51,0.08); border-color: rgba(242,86,51,0.15); }
.info-box h3 { margin: 0 0 10px; font-size: 13px; }
.info-box ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.evidence-list { display: grid; gap: 8px; }
.evidence-item { color: var(--muted); font-size: 10px; line-height: 1.6; }
.evidence-item strong { color: var(--ink); }
.screen-text-box { margin-top: 14px; border: 1px solid rgba(52, 47, 39, .12); border-radius: 16px; background: rgba(255,255,255,.42); overflow: hidden; }
.screen-text-box summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 14px; padding: 15px 17px; font-size: 11px; font-weight: 750; }
.screen-text-box summary::-webkit-details-marker { display: none; }
.screen-text-box summary span { color: var(--muted); font-weight: 550; }
.screen-text-box > div { padding: 0 17px 14px; display: grid; gap: 7px; }
.screen-text-box p { margin: 0; display: grid; grid-template-columns: 44px 1fr; gap: 8px; font-size: 10px; line-height: 1.55; color: var(--muted); }
.screen-text-box time { color: var(--accent); font-variant-numeric: tabular-nums; }

.variation-section { margin: 0 clamp(20px, 5vw, 72px) 64px; padding: clamp(24px, 4vw, 44px); border: 1px solid rgba(255,255,255,.62); border-radius: 30px; background: linear-gradient(135deg, rgba(255,255,255,.62), rgba(244,238,226,.55)); box-shadow: 0 24px 70px rgba(50,42,28,.08); backdrop-filter: blur(22px); }
.variation-heading { max-width: 620px; margin-bottom: 24px; }
.variation-heading h2 { margin: 8px 0 6px; font-family: "Instrument Serif", "Noto Sans KR", serif; font-size: clamp(32px, 4vw, 48px); font-weight: 500; line-height: 1; }
.variation-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.variation-grid { display: grid; gap: 12px; }
.variation-card { border: 1px solid rgba(54,46,34,.12); border-radius: 20px; background: rgba(255,255,255,.66); overflow: hidden; transition: border-color .2s; }
.variation-card[open] { border-color: rgba(214,91,50,.32); }
.variation-card summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: minmax(0,1fr) auto 28px; align-items: center; gap: 18px; padding: 18px 20px; }
.variation-card summary::-webkit-details-marker { display: none; }
.variation-card summary span { display: grid; gap: 3px; min-width: 0; }
.variation-card summary small { color: var(--accent); font-size: 8px; letter-spacing: .14em; font-weight: 800; text-transform: uppercase; }
.variation-card summary strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.variation-card summary em { color: var(--muted); font-size: 10px; font-style: normal; }
.variation-card summary > i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: white; font-style: normal; transition: transform .2s; }
.variation-card[open] summary > i { transform: rotate(45deg); }
.variation-content { display: grid; grid-template-columns: minmax(220px,.7fr) 1.3fr; gap: 28px; padding: 4px 20px 22px; border-top: 1px solid rgba(54,46,34,.08); }
.variation-content h3 { margin: 18px 0 10px; font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.variation-ingredients, .variation-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.variation-ingredients li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 10px; background: rgba(245,241,233,.8); font-size: 11px; }
.variation-ingredients b { color: var(--accent); font-weight: 700; }
.variation-steps li { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: start; font-size: 11px; line-height: 1.6; }
.variation-steps i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(214,91,50,.12); color: var(--accent); font-style: normal; font-size: 9px; font-weight: 800; }
.step-ingredients { margin-top: 10px; }
.step-ingredients > small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.step-ingredients > div { display: flex; flex-wrap: wrap; gap: 6px; }
.step-ingredients > div > span { padding: 6px 9px; border: 1px solid rgba(111,126,87,.2); border-radius: 999px; background: rgba(111,126,87,.1); color: var(--sage); font-size: 10px; font-weight: 700; }
.step-ingredients b { color: var(--ink); font-weight: 850; }
.variation-steps .step-ingredients { margin-top: 7px; }
.variation-steps .step-ingredients > div > span { padding: 4px 7px; font-size: 9px; }
.variation-steps small { display: block; color: var(--muted); font-size: 9px; }

@media (max-width: 720px) {
  .variation-section { margin: 0 14px 34px; padding: 22px 16px; border-radius: 24px; }
  .variation-card summary { grid-template-columns: minmax(0,1fr) 28px; gap: 10px; padding: 16px; }
  .variation-card summary em { display: none; }
  .variation-content { grid-template-columns: 1fr; gap: 4px; padding: 2px 16px 18px; }
}
.empty-section { color: var(--muted); font-size: 12px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(22,23,19,0.68);
  backdrop-filter: blur(10px);
}

.modal-card { position: relative; width: min(100%, 590px); max-height: calc(100vh - 48px); overflow-y: auto; padding: 36px; background: var(--white); border: 1px solid rgba(255,255,255,0.55); border-radius: 8px 28px 28px 28px; box-shadow: 0 35px 100px rgba(0,0,0,0.28); animation: modal-in 250ms var(--ease) both; }
.modal-card.edit-card { width: min(100%, 720px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.modal-close { position: absolute; top: 18px; right: 18px; display: grid; width: 38px; height: 38px; place-items: center; background: var(--paper-2); border: 0; border-radius: 50%; cursor: pointer; font-size: 20px; }
.modal-card h2 { margin: 13px 0 8px; font-size: 32px; font-weight: 900; letter-spacing: -0.06em; }
.modal-intro { margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 25px; padding: 4px; background: var(--paper-2); border-radius: 12px; }
.segmented.import-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.segmented button { min-height: 42px; background: transparent; border: 0; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: var(--white); box-shadow: 0 4px 12px rgba(40,34,24,0.07); }
.import-mode-note { display: grid; gap: 4px; padding: 15px 16px; color: var(--ink); background: linear-gradient(135deg, rgba(210,243,94,0.28), rgba(255,255,255,0.72)); border: 1px solid rgba(131,149,77,0.22); border-radius: 14px; }
.import-mode-note b { font-size: 12px; }
.import-mode-note span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.form-stack { display: grid; gap: 17px; }
.form-stack label { color: var(--ink); font-size: 11px; font-weight: 700; }
.form-stack label > span { float: right; color: var(--muted); font-size: 9px; font-weight: 500; }
.form-stack input:not([type="file"]), .form-stack textarea { width: 100%; margin-top: 8px; padding: 13px 14px; color: var(--ink); background: #f5f1e9; border: 1px solid transparent; border-radius: 11px; outline: 0; resize: vertical; font-size: 13px; font-weight: 400; transition: border-color 160ms ease, background 160ms ease; }
.form-stack input:not([type="file"]) { height: 47px; }
.form-stack input:focus, .form-stack textarea:focus { background: #fff; border-color: rgba(242,86,51,0.45); }
.form-grid { display: grid; gap: 12px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.drop-zone { display: grid; min-height: 185px; place-items: center; align-content: center; gap: 7px; background: #f5f1e9; border: 1px dashed rgba(23,23,19,0.28); border-radius: 16px; cursor: pointer; text-align: center; transition: background 160ms ease, border-color 160ms ease; }
.drop-zone:hover { background: #edf2d6; border-color: #83954d; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { float: none !important; display: grid; width: 43px; height: 43px; place-items: center; color: var(--ink) !important; background: var(--lime); border-radius: 13px; font-size: 20px !important; }
.drop-zone small { color: var(--muted); font-weight: 400; }
.form-error { margin: -10px 0 18px; padding: 12px 14px; color: #8d2f20; background: rgba(242,86,51,0.1); border: 1px solid rgba(242,86,51,0.24); border-radius: 12px; font-size: 11px; font-weight: 700; line-height: 1.55; }
.privacy-note { margin: 20px 0 0; padding-top: 17px; color: var(--muted); border-top: 1px solid var(--soft-line); font-size: 9px; line-height: 1.6; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; max-width: min(380px, calc(100vw - 48px)); padding: 14px 18px; color: #fff; background: #20211d; border: 1px solid rgba(255,255,255,0.12); border-radius: 13px; box-shadow: 0 16px 42px rgba(0,0,0,0.22); font-size: 12px; font-weight: 600; }

@media (max-width: 1180px) {
  :root { --sidebar: 280px; }
  .library-panel { padding-inline: 19px; }
  .welcome-view { grid-template-columns: minmax(310px, 0.9fr) minmax(400px, 1.1fr); gap: 28px; padding-inline: 42px; }
  .welcome-art { min-height: 560px; }
  .dish-scene { height: 350px; }
  .recipe-ticket { padding: 25px; }
  .recipe-body { gap: 50px; }
}

@media (max-width: 930px) {
  :root { --sidebar: 270px; }
  .welcome-view { min-height: auto; grid-template-columns: 1fr; padding: 78px 55px 110px; }
  .welcome-copy { max-width: 680px; }
  .welcome-copy h1 { font-size: clamp(60px, 9vw, 88px); }
  .welcome-art { width: min(100%, 610px); min-height: 580px; }
  .recipe-hero { grid-template-columns: 1fr; }
  .cover-wrap { min-height: 260px; max-height: min(68svh, 560px); }
  .recipe-body { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  /* iOS Safari는 16px보다 작은 입력창에 초점을 맞추면 페이지를 자동 확대한다.
     입력 후 사용자가 다시 축소해야 하는 현상을 막되, 손가락 확대 기능은 그대로 둔다. */
  input:not([type="file"]), textarea, select { font-size: 16px !important; }
  .app-shell, .content-panel, .recipe-view, .recipe-hero > *, .recipe-body > * { width: 100%; max-width: 100%; min-width: 0; }
  .mobile-only, .mobile-header { display: flex; }
  .app-shell { display: block; }
  .library-panel { width: min(88vw, 330px); transform: translateX(-105%); box-shadow: 24px 0 70px rgba(0,0,0,0.28); transition: transform 260ms var(--ease); }
  .library-panel.open { transform: translateX(0); }
  .group-drawer-scrim { inset: 0; z-index: 38; background: rgba(22,23,19,0.48); }
  .group-drawer-scrim.open { backdrop-filter: blur(5px); }
  .group-drawer { top: auto; right: 0; bottom: 0; left: 0; z-index: 40; width: 100%; max-height: min(78svh, 720px); border-width: 1px 0 0; border-radius: 26px 26px 0 0; transform: translateY(105%) scale(1); transform-origin: bottom center; }
  .group-drawer.open { transform: translateY(0) scale(1); }
  .group-drawer > div { padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); }
  .group-drawer-head h2 { font-size: 25px; }
  .group-summary { margin-block: 17px 12px; }
  .group-recipe-row { min-height: 62px; }
  .content-panel { min-height: 100svh; }
  .mobile-header { position: sticky; top: 0; z-index: 10; height: 66px; align-items: center; justify-content: space-between; padding: 0 16px; background: rgba(244,240,232,0.86); border-bottom: 1px solid var(--soft-line); backdrop-filter: blur(14px); }
  .mobile-logo { font-size: 17px; font-weight: 900; letter-spacing: -0.05em; }
  .icon-button { display: grid; width: 42px; height: 42px; place-items: center; padding: 0; background: rgba(255,255,255,0.5); border: 1px solid var(--soft-line); border-radius: 12px; font-size: 20px; }
  .icon-button.accent { color: #fff; background: var(--tomato); border-color: var(--tomato); }
  .menu-lines, .menu-lines::before { display: block; width: 17px; height: 1.5px; background: currentColor; content: ""; }
  .menu-lines::before { transform: translateY(5px); }
  .welcome-view { min-height: calc(100svh - 66px); padding: 44px 20px 68px; gap: 42px; }
  .welcome-copy h1 { margin: 19px 0 18px; font-size: clamp(48px, 14.1vw, 68px); }
  .welcome-copy h1 em { font-size: 1em; }
  .welcome-copy > p { max-width: 510px; font-size: 14px; line-height: 1.75; }
  .welcome-actions { align-items: flex-start; flex-direction: column; gap: 15px; margin-top: 28px; }
  .primary-button.large { width: 100%; }
  .frame-note { max-width: none; }
  .welcome-art { min-height: 500px; }
  .art-stamp { right: 0; font-size: 25px; }
  .reel-card { top: 4%; left: 0; width: 58%; min-width: 0; border-radius: 23px; }
  .dish-scene { height: 315px; border-radius: 15px; }
  .recipe-ticket { right: 0; bottom: 4%; width: 57%; min-width: 0; padding: 21px; border-radius: 5px 22px 22px 22px; }
  .recipe-ticket h2 { margin: 30px 0 18px; font-size: clamp(27px, 7.8vw, 39px); }
  .recipe-ticket ul li:nth-child(3) { display: none; }
  .art-caption { display: none; }
  .recipe-view { padding: 22px 18px 70px; }
  .recipe-toolbar { margin-bottom: 20px; }
  .recipe-hero { gap: 32px; padding-bottom: 40px; }
  .cover-wrap { min-height: 240px; max-height: min(70svh, 600px); }
  .title-block h1 { font-size: clamp(40px, 13vw, 60px); }
  .recipe-body { gap: 48px; padding-top: 42px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-card, .modal-card.edit-card { width: 100%; max-height: 92svh; padding: 28px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .modal-card h2 { font-size: 28px; }
  .form-grid.three { grid-template-columns: 1fr; }
  .toast { right: 16px; bottom: 16px; }
}

@media (max-width: 620px) {
  .segmented.import-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .welcome-view { padding-inline: 17px; }
  .welcome-copy h1 { font-size: clamp(43px, 13.2vw, 54px); }
  .welcome-art { min-height: 440px; }
  .reel-card { width: 62%; padding: 9px; }
  .dish-scene { height: 275px; }
  .recipe-ticket { width: 61%; padding: 18px; }
  .recipe-ticket h2 { margin: 24px 0 16px; font-size: 25px; }
  .ticket-meta { margin-bottom: 18px; }
  .recipe-ticket li { padding: 8px 0; font-size: 10px; }
  .cover-wrap { min-height: 220px; max-height: min(68svh, 560px); }
  .meta-item { padding-inline: 10px; }
  .step-card { grid-template-columns: 36px minmax(0, 1fr); padding: 17px; }
  .step-number { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   정리 · 배율 · 내보내기 (2026-08 고도화)
   ============================================================ */

/* 사이드바 빠른 필터 */
.quick-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.quick-filters .chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 11px;
  color: rgba(247,243,234,0.62); background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 999px;
  cursor: pointer; font-size: 11px; font-weight: 700; letter-spacing: -0.02em;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.quick-filters .chip:hover { color: #f7f3ea; background: rgba(255,255,255,0.1); }
.quick-filters .chip.active { color: #20211d; background: var(--lime); border-color: transparent; }
.quick-filters .chip b { font-family: "DM Sans", sans-serif; font-size: 10px; opacity: 0.7; }
.quick-filters .chip.active b { opacity: 0.55; }

/* 폴더 */
.folder-block { margin-top: 22px; }
.block-heading {
  display: flex; align-items: center; justify-content: space-between; margin: 0 3px 8px;
  color: rgba(247,243,234,0.44); font-family: "DM Sans", sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
}
.text-button { padding: 0; color: var(--lime); background: none; border: 0; cursor: pointer; font-size: 10px; font-weight: 700; }
.folder-list { display: grid; gap: 2px; max-height: 168px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.16) transparent; }
.folder-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 8px 10px;
  color: rgba(247,243,234,0.78); background: transparent;
  border: 1px solid transparent; border-radius: 10px;
  cursor: pointer; font-size: 12px; text-align: left;
}
.folder-row:hover { background: rgba(255,255,255,0.06); }
.folder-row.active { color: #20211d; background: var(--sage); border-color: transparent; font-weight: 700; }
.folder-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-row b { flex: 0 0 auto; font-family: "DM Sans", sans-serif; font-size: 10px; opacity: 0.6; }

/* 접이식 사이드바 섹션 — 기본은 제목만 보여 나의 레시피가 메인이 된다 */
.block-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 0; color: inherit; background: none; border: 0;
  cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit;
}
.block-toggle:hover { color: rgba(247,243,234,0.85); }
.block-toggle .chev { display: inline-block; font-style: normal; transition: transform 160ms var(--ease); }
.block-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.block-toggle b { font-family: "DM Sans", sans-serif; opacity: 0.6; }
.block-toggle em {
  max-width: 110px; overflow: hidden;
  padding: 2px 8px; color: #20211d; background: var(--lime);
  border-radius: 999px; font-style: normal; letter-spacing: normal; text-transform: none;
  text-overflow: ellipsis; white-space: nowrap;
}
.folder-list:not([hidden]) { margin-top: 4px; }
.tag-cloud:not([hidden]) { margin-top: 6px; }
.folder-list[hidden], .tag-cloud[hidden] { display: none; }

/* 태그 필터 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.16) transparent; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  color: rgba(247,243,234,0.78); background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 999px;
  cursor: pointer; font-size: 11px; font-weight: 600;
}
.tag-chip:hover { color: #f7f3ea; background: rgba(255,255,255,0.1); }
.tag-chip.active { color: #20211d; background: var(--lime); border-color: transparent; font-weight: 700; }
.tag-chip b { font-family: "DM Sans", sans-serif; font-size: 10px; opacity: 0.6; }

/* 정렬 */
.library-heading .sort-select { min-width: 0; }
.sort-select select {
  max-width: 132px; padding: 4px 6px;
  color: rgba(247,243,234,0.72); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  cursor: pointer; font-family: inherit; font-size: 10px; font-weight: 600; letter-spacing: 0;
  text-transform: none;
}
.sort-select select:focus { outline: 2px solid rgba(217,238,121,0.4); }
.sort-select option { color: #20211d; }
.sidebar-count { margin-left: auto; }
.sidebar-count b { min-width: 22px; padding: 3px 7px; color: #20211d; background: var(--sage); border-radius: 999px; font-family: "DM Sans", sans-serif; font-size: 10px; }

/* 목록 카드 뱃지 */
.card-star { margin-left: 5px; color: var(--lime); font-size: 10px; vertical-align: 1px; }
.card-folder { display: inline-block; margin-right: 6px; padding: 1px 6px; color: rgba(247,243,234,0.7); background: rgba(255,255,255,0.08); border-radius: 999px; font-size: 9px; }

/* 상세 툴바 */
.toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
.icon-toggle {
  display: grid; width: 42px; height: 42px; place-items: center;
  color: var(--muted); background: rgba(255,255,255,0.48);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 15px;
  transition: color 160ms ease, background 160ms ease, transform 160ms var(--ease);
}
.icon-toggle:hover { transform: translateY(-1px); }
.icon-toggle.on { color: #8a6a00; background: #fbf0b8; border-color: rgba(180,150,20,0.4); }
.publish-button.on { color: #31421f; background: rgba(217,238,121,.72); border-color: rgba(126,151,64,.35); }
.cooked-note { font-size: 11px; }

/* 인분 배율 */
.scale-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  margin: -8px 0 22px; padding: 13px 15px;
  background: rgba(255,255,255,0.6); border: 1px solid var(--soft-line); border-radius: 16px;
}
.scale-label { color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: -0.03em; }
.scale-stepper { display: flex; align-items: center; gap: 4px; padding: 3px; background: var(--paper-2); border-radius: 11px; }
.scale-stepper button {
  display: grid; width: 30px; height: 30px; place-items: center;
  color: var(--ink); background: var(--white); border: 1px solid var(--soft-line);
  border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 700;
}
.scale-stepper button:disabled { cursor: default; opacity: 0.35; }
.scale-stepper button:not(:disabled):hover { background: var(--lime); border-color: transparent; }
.scale-stepper output { min-width: 66px; font-family: "DM Sans", sans-serif; font-size: 13px; font-weight: 700; text-align: center; }
.scale-chips { display: flex; gap: 5px; }
.scale-chips button {
  min-height: 30px; padding: 0 12px; color: var(--muted);
  background: var(--white); border: 1px solid var(--soft-line); border-radius: 9px;
  cursor: pointer; font-family: "DM Sans", sans-serif; font-size: 12px; font-weight: 700;
}
.scale-chips button.active { color: #20211d; background: var(--lime); border-color: transparent; }
.scale-origin { color: var(--muted); font-size: 10px; }
.scale-reset { margin-left: auto; padding: 0; color: var(--tomato); background: none; border: 0; cursor: pointer; font-size: 11px; font-weight: 700; }
.amount.scaled { color: var(--tomato-dark); }
.amount.scaled em { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-style: normal; font-weight: 500; text-decoration: line-through; }
.scale-notice { margin: 12px 0 0; color: var(--muted); font-size: 10px; }

/* 폴더 · 내보내기 모달 */
.modal-card.compact { width: min(100%, 480px); }
.folder-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.folder-chip { min-height: 34px; padding: 0 13px; color: var(--muted); background: var(--paper-2); border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 600; }
.folder-chip:hover { background: #e3ddd0; }
.folder-chip.active { color: #20211d; background: var(--lime); }
.folder-empty { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.export-text { width: 100%; margin-bottom: 18px; padding: 14px; color: var(--ink); background: #f5f1e9; border: 1px solid transparent; border-radius: 12px; outline: 0; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.7; }

/* 인쇄 */
.print-sheet { display: none; }

@media print {
  @page { size: A4; margin: 14mm 13mm; }
  body { background: #fff; }
  body.printing .app-shell,
  body.printing .modal-backdrop,
  body.printing .toast,
  body.printing .group-drawer,
  body.printing .group-drawer-scrim { display: none !important; }
  body.printing .print-sheet { display: block; }
  .print-page { color: #111; font-family: "Noto Sans KR", sans-serif; }
  .print-page header { padding-bottom: 10px; border-bottom: 2px solid #111; }
  .print-brand { font-family: "DM Sans", sans-serif; font-size: 9pt; font-weight: 700; letter-spacing: 0.14em; }
  .print-page h1 { margin: 6px 0 4px; font-size: 24pt; font-weight: 900; letter-spacing: -0.04em; }
  .print-meta { margin: 0; color: #555; font-size: 9.5pt; }
  .print-columns { display: grid; grid-template-columns: 38% 1fr; gap: 22px; margin-top: 18px; }
  .print-page h2 { margin: 0 0 8px; font-size: 12pt; font-weight: 800; }
  .print-page section + h2 { margin-top: 16px; }
  .print-page ul { margin: 0 0 14px; padding: 0; list-style: none; }
  .print-page ul li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #e2ded4; font-size: 10pt; }
  .print-page ul.print-tips li { display: list-item; margin-left: 16px; border: 0; list-style: disc; }
  .print-page ol { margin: 0; padding-left: 18px; }
  .print-page ol li { margin-bottom: 9px; font-size: 10pt; line-height: 1.6; break-inside: avoid; }
  .print-page i { color: #777; font-size: 8.5pt; font-style: normal; }
  .print-page b { white-space: nowrap; }
  .print-variation { margin-top: 18px; padding-top: 12px; border-top: 1px solid #ccc; break-inside: avoid; }
  .print-variation h3 { margin: 0 0 8px; font-size: 11pt; font-weight: 800; }
  .print-page footer { margin-top: 20px; padding-top: 8px; border-top: 1px solid #ddd; color: #888; font-size: 8pt; word-break: break-all; }
}

@media (max-width: 820px) {
  .guest-banner { position: static; flex-wrap: wrap; gap: 5px 10px; padding: 10px 16px; }
  .guest-banner p { min-width: 230px; font-size: 10px; }
  .quick-filters { margin-top: 12px; }
  .folder-list { max-height: 132px; }
  .toolbar-actions { gap: 6px; }
  .toolbar-actions .secondary-button, .toolbar-actions .danger-button { min-height: 38px; padding: 0 12px; font-size: 11px; }
  .icon-toggle { width: 38px; height: 38px; }
  .scale-bar { gap: 8px 10px; padding: 12px; }
  .scale-reset { margin-left: 0; }
}

/* 마무리 다듬기 */
.list-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-block h1 { text-wrap: balance; }
