@import url("https://fonts.googleapis.com/css2?family=Pacifico&display=swap");
@import url("https://cdn.jsdelivr.net/gh/sunn-us/SUIT/fonts/variable/woff2/SUIT-Variable.css");

:root {
  --primary: #00c9a7;
  --secondary: #c4fcef;
  --accent: #fbeaff;
  --bg: #eafff9;
  --bg-soft: #f7fffc;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.76);
  --ink: #10221f;
  --muted: #5f7671;
  --line: rgba(16, 34, 31, 0.1);
  --line-soft: rgba(16, 34, 31, 0.055);
  --shadow: 0 16px 44px rgba(0, 201, 167, 0.12);
  --shadow-soft: 0 8px 28px rgba(16, 34, 31, 0.07);
  --font-main: "Pacifico", "Brush Script MT", cursive;
  --font-ui: "SUIT Variable", "SUIT", "Noto Sans KR", "Malgun Gothic", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--secondary) 0 34%, var(--bg-soft) 34% 88%, var(--accent) 88% 100%);
  color: var(--ink);
  font-family: var(--font-ui);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line-soft);
  background: rgba(196, 252, 239, 0.45);
  backdrop-filter: blur(22px);
  padding: 22px 18px;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(0, 201, 167, 0.32);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #08342d;
  font-size: 12px;
  font-weight: 760;
  box-shadow: var(--shadow-soft);
}

.brand__home {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  margin: 0;
  font-family: var(--font-main);
  padding: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.08;
  text-align: left;
  transition: color 0.16s ease, transform 0.16s ease;
}

.brand__home:hover {
  color: #008d79;
  transform: translateY(-1px);
}

.brand p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.moc-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-pill,
.ghost-btn,
.save-btn,
.back-btn,
.stage-clear {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.nav-pill {
  height: 36px;
  color: var(--muted);
  font-size: 12px;
}

.nav-pill.is-active,
.nav-pill:hover,
.ghost-btn:hover,
.back-btn:hover,
.stage-clear:hover {
  border-color: rgba(0, 201, 167, 0.4);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.sidebar__label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 680;
  text-transform: uppercase;
}

.tree {
  font-size: 13.5px;
  line-height: 1.5;
}

.tree-dir {
  margin: 2px 0;
}

.tree-dir summary {
  cursor: pointer;
  font-weight: 560;
  padding: 4px 0;
}

.tree-children {
  margin-left: 15px;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.tree-file {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  min-width: 0;
  padding: 22px 28px 48px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 2.1fr);
  gap: 14px;
  align-items: center;
  padding: 0 0 18px;
  background: linear-gradient(rgba(234, 255, 249, 0.94) 70%, rgba(234, 255, 249, 0));
  backdrop-filter: blur(8px);
}

.search-box {
  position: relative;
}

.search-box__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--primary);
  transform: translateY(-50%);
}

.search-box input,
.filters select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass-strong);
  color: var(--ink);
  outline: none;
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.58) inset;
}

.search-box input:focus,
.filters select:focus,
textarea:focus {
  border-color: rgba(0, 201, 167, 0.6);
  box-shadow: 0 0 0 4px rgba(0, 201, 167, 0.12);
}

.search-box input {
  padding: 0 14px 0 38px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(88px, 1fr));
  gap: 8px;
  min-width: 0;
}

.filters select {
  min-width: 0;
  padding: 0 9px;
  font-size: 12px;
}

.list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 0 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 720;
  text-transform: uppercase;
}

.list-head h2,
.detail-top h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 720;
  line-height: 1.14;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
}

.card-grid {
  display: block;
}

.card-grid__inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.axis-group {
  margin-top: 26px;
}

.axis-group:first-child {
  margin-top: 0;
}

.axis-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.axis-group__head h3 {
  margin: 0;
  font-size: 18px;
}

.axis-group__head span {
  color: var(--muted);
  font-size: 12px;
}

.ref-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transform-origin: 50% 62%;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.2, 1), border-color 0.18s ease, box-shadow 0.18s ease;
}

.ref-card:hover {
  border-color: rgba(0, 201, 167, 0.28);
  box-shadow: 0 18px 42px rgba(16, 34, 31, 0.1);
  transform: translateY(-2px);
}

.ref-card:focus-visible {
  outline: 3px solid rgba(0, 201, 167, 0.35);
  outline-offset: 3px;
}

.ref-card.is-popping {
  animation: pudding-pop 0.38s cubic-bezier(0.22, 1.18, 0.36, 1);
}

.ref-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.preview-single,
.preview-moodboard {
  position: absolute;
  inset: 0;
}

.preview-single {
  display: grid;
  place-items: center;
  padding: 18px 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(196, 252, 239, 0.32)),
    rgba(255, 255, 255, 0.35);
}

.preview-single img,
.mood-cut img {
  width: 100%;
  height: 100%;
}

.preview-single img {
  max-width: 86%;
  max-height: 92%;
  border: 1px solid rgba(16, 34, 31, 0.12);
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 12px 30px rgba(16, 34, 31, 0.12);
  transition: transform 0.2s ease;
}

.mood-cut img {
  object-fit: cover;
}

.ref-card:hover .preview-single img {
  transform: scale(1.025);
}

.preview-moodboard {
  background:
    radial-gradient(circle at 18% 20%, rgba(251, 234, 255, 0.74), transparent 32%),
    radial-gradient(circle at 85% 78%, rgba(0, 201, 167, 0.22), transparent 34%),
    rgba(255, 255, 255, 0.35);
}

.mood-cut {
  position: absolute;
  display: block;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(16, 34, 31, 0.16);
}

.mood-cut--0 {
  left: 8%;
  top: 10%;
  width: 42%;
  height: 64%;
  transform: rotate(-5deg);
}

.mood-cut--1 {
  right: 7%;
  top: 8%;
  width: 46%;
  height: 48%;
  transform: rotate(4deg);
}

.mood-cut--2 {
  left: 34%;
  bottom: 8%;
  width: 42%;
  height: 44%;
  transform: rotate(-1deg);
}

.mood-cut--3 {
  left: 4%;
  bottom: 8%;
  width: 29%;
  height: 38%;
  transform: rotate(6deg);
}

.mood-cut--4 {
  right: 6%;
  bottom: 7%;
  width: 25%;
  height: 34%;
  transform: rotate(-7deg);
}

.preview-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #0d3c35;
  font-size: 11px;
  font-weight: 760;
  padding: 5px 8px;
  backdrop-filter: blur(14px);
}

.preview-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: #123c36;
  cursor: pointer;
  line-height: 1;
  opacity: 0;
  transform: translateY(-50%) scale(0.92);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
  backdrop-filter: blur(16px);
}

.preview-nav--prev {
  left: 10px;
}

.preview-nav--next {
  right: 10px;
}

.ref-card:hover .preview-nav,
.ref-card:focus-within .preview-nav {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.preview-nav:hover {
  background: rgba(255, 255, 255, 0.86);
}

.preview-dots {
  position: absolute;
  right: 12px;
  bottom: 13px;
  z-index: 3;
  display: flex;
  gap: 4px;
}

.preview-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(16, 34, 31, 0.24);
}

.preview-dots .is-active {
  width: 14px;
  background: var(--primary);
}

.ref-card__body {
  padding: 12px;
}

.ref-card__meta,
.caption-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.ref-card__meta span,
.caption-meta span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.62);
}

.ref-card__title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin: 10px 0 6px;
}

.ref-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.card-favorite {
  display: flex;
  gap: 1px;
  padding-top: 1px;
}

.card-heart-btn {
  display: grid;
  place-items: center;
  width: 19px;
  height: 24px;
  border: 0;
  background: transparent;
  color: rgba(16, 34, 31, 0.18);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  transition: color 0.14s ease, transform 0.14s ease;
}

.card-heart-btn:hover,
.card-heart-btn.is-active {
  color: #e74fae;
  transform: translateY(-1px) scale(1.12);
}

.ref-card p {
  display: -webkit-box;
  min-height: 42px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chip-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: #4f6963;
  font-size: 11px;
  padding: 4px 8px;
}

.obsidian-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ref-card__tags {
  margin-top: 9px;
}

.obsidian-tag {
  border: 1px solid rgba(16, 34, 31, 0.08);
  border-radius: 999px;
  color: #31514b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  padding: 6px 8px;
  box-shadow: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.obsidian-tag--0 {
  background: rgba(0, 201, 167, 0.16);
}

.obsidian-tag--1 {
  background: rgba(255, 111, 183, 0.14);
}

.obsidian-tag--2 {
  background: rgba(124, 92, 255, 0.13);
}

.obsidian-tag--3 {
  background: rgba(255, 212, 71, 0.18);
}

.obsidian-tag--4 {
  background: rgba(53, 167, 255, 0.13);
}

.obsidian-tag--5 {
  background: rgba(255, 138, 76, 0.15);
}

.obsidian-tag--more {
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.obsidian-tag:hover {
  border-color: rgba(0, 201, 167, 0.32);
  background: rgba(255, 255, 255, 0.72);
  color: #0f3d36;
  transform: translateY(-1px);
}

.detail-view {
  min-width: 0;
}

.detail-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.back-btn {
  height: 40px;
  padding: 0 14px;
}

.back-btn--icon {
  display: grid;
  place-items: center;
  width: 52px;
  padding: 0;
  color: rgba(16, 34, 31, 0.62);
  line-height: 1;
}

.detail-top__title {
  min-width: 0;
}

.favorite-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.heart-row {
  display: flex;
  gap: 4px;
}

.heart-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(251, 234, 255, 0.54);
  color: rgba(16, 34, 31, 0.22);
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
  transition: transform 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.heart-btn:hover,
.heart-btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: #e774c7;
  transform: translateY(-1px) scale(1.05);
}

.heart-btn:disabled,
.card-heart-btn:disabled,
.stage-clear:disabled {
  cursor: default;
}

.is-static-viewer .heart-btn:not(.is-active),
.is-static-viewer .card-heart-btn:not(.is-active) {
  opacity: 0.5;
}

.stage-clear {
  height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.chevron {
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  opacity: 0.76;
}

.chevron--left {
  transform: translateX(2px) rotate(-45deg);
}

.chevron--right {
  transform: translateX(-2px) rotate(135deg);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 346px;
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.contents-panel,
.side-rail,
.rail-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 32px rgba(16, 34, 31, 0.055);
}

.contents-panel {
  padding: 14px;
}

.side-rail {
  display: grid;
  gap: 16px;
  align-self: start;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.rail-card {
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.ghost-btn,
.save-btn {
  height: 34px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.save-btn {
  border-color: rgba(0, 201, 167, 0.42);
  background: var(--primary);
  color: #062f28;
}

.save-btn:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.slides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.media-section {
  margin-top: 18px;
  border: 1px solid rgba(16, 34, 31, 0.045);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.28);
  padding: 12px;
}

.media-section:first-of-type {
  margin-top: 0;
}

.media-section h4 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.slide-thumb {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 34, 31, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 7px 18px rgba(16, 34, 31, 0.045);
}

.slide-thumb__button {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 0;
  background: rgba(255, 255, 255, 0.36);
  cursor: zoom-in;
  padding: 0;
}

.slide-thumb img,
.slide-thumb video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide-thumb figcaption {
  padding: 7px 9px;
  color: var(--muted);
  font-size: 11px;
}

#propertiesStatus,
#memoStatus {
  color: var(--muted);
  font-size: 11px;
}

.property-table {
  display: grid;
  gap: 6px;
  max-height: 390px;
  overflow: auto;
  padding-right: 4px;
}

.property-row {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 7px 0;
}

.property-key,
.memo-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.memo-field span {
  color: #173b35;
}

.property-key {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-key button {
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
  text-overflow: ellipsis;
}

.property-key button:hover {
  color: #008d79;
}

.property-grip {
  color: rgba(16, 34, 31, 0.35);
  font-size: 13px;
  line-height: 1;
}

.property-row input,
.property-row textarea,
.memo-field input,
.memo-field textarea {
  display: block;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  outline: none;
  padding: 8px 10px;
}

.property-link {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(0, 201, 167, 0.18);
  border-radius: 12px;
  background: rgba(196, 252, 239, 0.22);
  color: #008d79;
  font-size: 13px;
  min-width: 0;
  min-height: 34px;
  padding: 8px 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-link:hover {
  border-color: rgba(0, 201, 167, 0.44);
  background: rgba(255, 255, 255, 0.78);
}

.property-row input,
.memo-field input {
  overflow: hidden;
  min-height: 34px;
  text-overflow: ellipsis;
}

.property-row input[readonly],
.property-row textarea[readonly],
.memo-field input[readonly],
.memo-field textarea[readonly] {
  color: rgba(16, 34, 31, 0.74);
  background: rgba(255, 255, 255, 0.52);
  cursor: default;
}

.property-row textarea,
.memo-field textarea {
  min-height: 64px;
  resize: vertical;
}

.property-row textarea {
  font-family: var(--font-mono);
  font-size: 12px;
}

.caption-block {
  padding: 16px 2px 2px;
}

.source-link {
  display: inline-block;
  margin: 12px 0 2px;
  color: #b056a2;
  font-size: 13px;
  font-weight: 820;
  text-decoration: none;
}

.caption-section {
  margin-top: 18px;
}

.caption-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.caption-section p,
.caption-section li {
  color: #243c37;
  font-size: 14px;
  line-height: 1.65;
}

.caption-section ul {
  margin: 0;
  padding-left: 18px;
}

.tag-cloud {
  margin-top: 20px;
}

.preview-missing,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  font-size: 13px;
}

.preview-missing--large {
  min-height: 360px;
}

.recommend-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 178px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.related-card {
  display: grid;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
  scroll-snap-align: start;
}

.related-card__thumb {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
  box-shadow:
    0 12px 28px rgba(16, 34, 31, 0.11),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.related-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.22) inset;
  pointer-events: none;
}

.related-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card__label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.recs-arrows {
  display: flex;
  gap: 6px;
}

.recs-arrows button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  cursor: pointer;
}

.memo-card {
  display: grid;
  gap: 10px;
}

.memo-field {
  display: grid;
  gap: 6px;
}

.memo-field textarea {
  min-height: 86px;
}

.is-detail-view .app-shell {
  grid-template-columns: clamp(190px, 14vw, 220px) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.is-detail-view .sidebar {
  padding: 14px 12px;
}

.is-detail-view .brand {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.is-detail-view .brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 11px;
}

.is-detail-view .brand__home {
  font-size: 18px;
}

.is-detail-view .brand p {
  font-size: 11.5px;
}

.is-detail-view .moc-nav {
  gap: 6px;
  margin-bottom: 14px;
}

.is-detail-view .nav-pill {
  height: 32px;
  font-size: 11.5px;
}

.is-detail-view .sidebar__label {
  margin-bottom: 8px;
  font-size: 10.5px;
}

.is-detail-view .tree {
  font-size: 12px;
  line-height: 1.42;
}

.is-detail-view .tree-children {
  margin-left: 10px;
  padding-left: 8px;
}

.is-detail-view .tree-file {
  font-size: 11.5px;
}

.is-detail-view .workspace {
  height: 100vh;
  overflow: hidden;
  padding: 14px 16px 18px;
}

.is-detail-view .toolbar {
  display: none;
}

.is-detail-view .detail-view {
  height: 100%;
}

.is-detail-view .detail-top {
  gap: 12px;
  margin-bottom: 12px;
}

.is-detail-view .detail-top h2 {
  font-size: 22px;
}

.is-detail-view .back-btn {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.is-detail-view .favorite-control {
  gap: 8px;
}

.is-detail-view .heart-btn {
  width: 28px;
  height: 28px;
  font-size: 18px;
}

.is-detail-view .stage-clear {
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.is-detail-view .detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 14px;
  height: calc(100vh - 84px);
  align-items: stretch;
  min-height: 0;
}

.is-detail-view .contents-panel,
.is-detail-view .side-rail {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.is-detail-view .contents-panel {
  border-radius: 16px;
  padding: 10px;
}

.is-detail-view .side-rail {
  gap: 12px;
  padding-right: 2px;
}

.is-detail-view .rail-card {
  border-radius: 16px;
  padding: 12px;
}

.is-detail-view .panel-head {
  margin-bottom: 8px;
}

.is-detail-view .panel-head h3 {
  font-size: 16px;
}

.is-detail-view .eyebrow {
  margin-bottom: 5px;
  font-size: 10px;
}

.is-detail-view .ghost-btn,
.is-detail-view .save-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.is-detail-view .slides-grid {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.is-detail-view .media-section {
  margin-top: 12px;
  border-radius: 14px;
  padding: 10px;
}

.is-detail-view .media-section h4 {
  margin-bottom: 8px;
  font-size: 12px;
}

.is-detail-view .slide-thumb {
  border-radius: 12px;
}

.is-detail-view .slide-thumb__button {
  aspect-ratio: 4 / 4.35;
}

.is-detail-view .slide-thumb figcaption {
  padding: 5px 8px;
}

.is-detail-view .property-table {
  max-height: 226px;
}

.is-detail-view .property-row {
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 0;
}

.is-detail-view .property-key,
.is-detail-view .memo-field span {
  font-size: 11.5px;
}

.is-detail-view .property-row input,
.is-detail-view .memo-field input {
  min-height: 31px;
}

.is-detail-view .property-row textarea,
.is-detail-view .memo-field textarea {
  min-height: 56px;
}

.is-detail-view .memo-card {
  gap: 8px;
}

.library-view {
  min-width: 0;
}

.library-hero,
.library-selected,
.library-shelf,
.site-footer {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 32px rgba(16, 34, 31, 0.055);
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin: 10px 0 16px;
  padding: 18px;
}

.library-hero h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.library-hero p,
.library-shelf p,
.library-selected p {
  color: #365b54;
  font-size: 14px;
  line-height: 1.6;
}

.library-selected {
  margin-bottom: 16px;
  padding: 16px;
}

.library-selected h3 {
  margin: 0;
  font-size: 22px;
}

.library-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.library-rule-row span {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px;
}

.library-shelves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.library-shelf {
  padding: 16px;
}

.library-shelf__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.library-shelf__head h3 {
  margin: 0;
  font-size: 18px;
}

.library-shelf__head span {
  color: var(--muted);
  font-size: 12px;
}

.library-property-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.library-property {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(16, 34, 31, 0.075);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  padding: 10px;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.library-property:hover,
.library-property.is-active {
  border-color: rgba(0, 201, 167, 0.34);
  background: rgba(196, 252, 239, 0.28);
  transform: translateY(-1px);
}

.library-property strong {
  font-size: 13px;
}

.library-property span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding: 16px 18px;
}

.site-footer strong {
  display: block;
  font-size: 16px;
}

.site-footer span {
  color: var(--muted);
  font-size: 12.5px;
}

.footer-link {
  border: 1px solid rgba(0, 201, 167, 0.26);
  border-radius: 999px;
  background: rgba(196, 252, 239, 0.42);
  color: #0d3c35;
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  padding: 10px 14px;
  white-space: nowrap;
}

.footer-link:hover {
  background: rgba(255, 255, 255, 0.78);
}

.is-detail-view .site-footer {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  height: 100vh;
  overflow: hidden;
  padding: 18px 22px;
  background: rgba(7, 24, 21, 0.72);
  backdrop-filter: blur(22px);
}

.lightbox__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(224px, 22vw, 282px);
  gap: 18px;
  height: calc(100vh - 36px);
  min-height: 0;
}

.lightbox__main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.lightbox__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #fff;
  font-size: 17px;
  font-weight: 720;
  padding: 4px 54px 16px 4px;
}

.lightbox__title span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 520;
}

.lightbox__stage {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}

.lightbox__stage > img,
.lightbox__stage > video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 214px);
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.lightbox__annotation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.13);
  padding: 12px;
  backdrop-filter: blur(18px);
}

.annotation-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.annotation-head h3 {
  margin: 0;
  color: #fff;
  font-size: 14px;
}

#annotationStatus {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.annotation-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  max-height: 94px;
  overflow: auto;
}

.annotation-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
}

.annotation-item strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.annotation-item p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1.45;
}

.lightbox__annotation textarea {
  min-height: 52px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
  padding: 10px 12px;
}

.lightbox__close {
  position: fixed;
  top: 14px;
  right: calc(clamp(224px, 22vw, 282px) + 42px);
  z-index: 280;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  font-size: 26px;
}

.lightbox__related {
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.11));
  backdrop-filter: blur(24px) saturate(1.2);
  padding: 14px;
  scrollbar-color: rgba(255, 255, 255, 0.52) transparent;
}

.lightbox__related h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 15px;
}

.lightbox__related-list {
  display: grid;
  gap: 12px;
  scroll-snap-type: y proximity;
}

.lightbox__related .related-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px;
  transition: background 0.16s ease, transform 0.16s ease;
}

.lightbox__related .related-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.lightbox__related .related-card__label {
  color: rgba(255, 255, 255, 0.78);
}

.lightbox__related .related-card__thumb {
  aspect-ratio: 1 / 1;
  border-color: rgba(255, 255, 255, 0.26);
  border-radius: 16px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 238px 1fr;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .lightbox__layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .lightbox__close {
    right: 18px;
  }

  .lightbox__related {
    max-height: none;
  }

  .library-shelves,
  .library-rule-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 18px 16px 36px;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .detail-top {
    grid-template-columns: 1fr;
  }

  .favorite-control {
    flex-wrap: wrap;
  }

  .site-footer,
  .library-hero {
    display: grid;
  }
}

@keyframes pudding-pop {
  0% {
    transform: translateY(-2px) scale(1);
  }
  34% {
    transform: translateY(1px) scale(0.97, 1.035);
  }
  66% {
    transform: translateY(-3px) scale(1.025, 0.985);
  }
  100% {
    transform: translateY(-2px) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ref-card,
  .ref-card.is-popping,
  .preview-nav,
  .card-heart-btn,
  .preview-single img {
    animation: none;
    transition: none;
  }
}
