:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f7;
  --line: #dde5ea;
  --text: #17202a;
  --muted: #6a7884;
  --accent: #ec5b4f;
  --accent-strong: #d93f35;
  --teal: #2b9c94;
  --teal-soft: #e6f5f3;
  --amber-soft: #fff4db;
  --shadow: 0 18px 40px rgba(31, 45, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 320px;
  padding: 22px;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 22px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(31, 45, 61, 0.08);
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.brand p,
.eyebrow {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel,
.control-group {
  margin-bottom: 18px;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel-header,
.button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.panel-title,
.control-group label {
  display: block;
  margin-bottom: 10px;
  color: #394652;
  font-size: 14px;
  font-weight: 800;
}

.check-row {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
  color: #303b45;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.button-row button,
.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #34414d;
  font-weight: 700;
}

.button-row button:first-child {
  flex: 1;
  background: var(--text);
  color: white;
}

.ghost-button {
  color: var(--muted);
}

.favorite-summary {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.chips {
  display: flex;
  min-height: 32px;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #42505c;
  font-size: 12px;
  font-weight: 700;
}

.content {
  margin-left: 320px;
  padding: 28px 36px 48px;
}

.content-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-badge {
  min-width: 72px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-strong);
  text-align: center;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.binder-tabs {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 76px;
  margin: 0 0 20px;
  padding: 18px 18px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.6)),
    repeating-linear-gradient(155deg, rgba(214, 218, 210, 0.28) 0 2px, transparent 2px 13px);
}

.binder-tabs::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(203, 211, 214, 0.28));
  pointer-events: none;
}

.binder-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 46px;
  padding: 0 18px 0 36px;
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f6df3f;
  color: #17202a;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(31, 45, 61, 0.08);
}

.binder-tab::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 14px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 0 0 2px rgba(23, 32, 42, 0.08);
}

.binder-tab.tab-1 {
  background: #ff8b6f;
}

.binder-tab.tab-2 {
  background: #111820;
  color: white;
}

.binder-tab.tab-3 {
  background: #12b6a5;
  color: white;
}

.binder-tab.tab-4 {
  background: #95b9ff;
}

.binder-tab.active {
  min-height: 56px;
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(31, 45, 61, 0.16);
}

.catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.media-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #dfe9ed;
}

.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #dfe9ed;
}

.play-badge {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  background: rgba(23, 32, 42, 0.76);
  color: white;
  font-size: 23px;
  transform: translate(-50%, -50%);
}

.media-type {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(23, 32, 42, 0.78);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.favorite-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #7c8790;
  font-size: 24px;
  line-height: 1;
}

.favorite-button.active {
  background: var(--amber-soft);
  color: var(--accent-strong);
}

.card-body {
  padding: 15px;
}

.card-title {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-title h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.card-title span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.client-name {
  margin: -3px 0 10px;
  color: #9aa6af;
  font-size: 12px;
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #465561;
  font-size: 12px;
  font-weight: 800;
}

.tag.primary {
  background: var(--teal-soft);
  color: var(--teal);
}

.specs {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #43505b;
  font-size: 13px;
}

.compact-specs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 8px;
}

.specs div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  border-top: 1px solid #edf1f4;
  padding-top: 7px;
  min-width: 0;
}

.specs dt {
  color: var(--muted);
}

.specs dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.empty {
  grid-column: 1 / -1;
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 8px;
  background: var(--text);
  color: white;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 880px) {
  .sidebar {
    position: static;
    width: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    margin-left: 0;
    padding: 24px 18px 36px;
  }

  .content-header h2 {
    font-size: 27px;
  }

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

  .compact-specs {
    column-gap: 12px;
  }

  .binder-tabs {
    overflow-x: auto;
  }

  .binder-tab {
    min-width: 112px;
  }
}

@media (min-width: 881px) and (max-width: 1240px) {
  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
