@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;500;700&display=swap");

:root {
  --bg: #0a080e;
  --panel: #f6f4ed;
  --panel-soft: #fffdf7;
  --ink: #171417;
  --ink-soft: #68616a;
  --line: rgba(23, 20, 23, 0.12);
  --line-dark: rgba(246, 244, 237, 0.14);
  --teal: #10b9a6;
  --pink: #ff7fa0;
  --lime: #d7f57a;
  --violet: #8e7cff;
  --shadow: 0 18px 42px rgba(10, 8, 14, 0.18);
  --font-display: "Bebas Neue", sans-serif;
  --font-ui: "Inter", "Noto Sans KR", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  color: inherit;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #000;
}

.gate__panel {
  width: min(380px, 88vw);
  text-align: center;
}

.gate__brand {
  color: var(--panel);
  font-family: var(--font-display);
  font-size: 72px;
  letter-spacing: 0.18em;
  line-height: 0.9;
}

.gate__label {
  margin: 12px 0 48px;
  color: #8f8792;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.gate__input {
  width: 100%;
  height: 46px;
  border: 0;
  border-bottom: 1px solid rgba(246, 244, 237, 0.28);
  outline: 0;
  background: transparent;
  color: var(--panel);
  letter-spacing: 0.18em;
  text-align: center;
}

.gate__button {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  border: 1px solid rgba(246, 244, 237, 0.22);
  background: transparent;
  color: var(--panel);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.22em;
}

.gate__button:hover {
  border-color: rgba(246, 244, 237, 0.72);
}

.gate__message {
  min-height: 18px;
  margin: 14px 0 0;
  color: var(--pink);
  font-size: 11px;
  font-weight: 700;
}

.app {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(90deg, #101015 0 304px, var(--panel) 304px 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 18px;
  color: var(--panel);
  background: #101015;
  border-right: 1px solid var(--line-dark);
}

.brand-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--lime));
  color: #07100f;
  font-weight: 800;
}

.brand-row h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.04em;
}

.brand-row p {
  margin: 4px 0 0;
  color: #9e97a2;
  font-size: 12px;
}

.moc-tab,
.moc-row,
.back-btn {
  border-radius: 8px;
  text-decoration: none;
}

.moc-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.moc-tab {
  height: 36px;
  border: 1px solid var(--line-dark);
  background: transparent;
  color: #b9b2bd;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.moc-tab.is-active,
.moc-tab:hover {
  color: var(--panel);
  border-color: rgba(255, 127, 160, 0.66);
  background: rgba(255, 127, 160, 0.1);
}

.moc-panel__label {
  margin-bottom: 10px;
  color: #9e97a2;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.moc-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  margin-bottom: 7px;
  border: 1px solid transparent;
  background: rgba(246, 244, 237, 0.04);
  color: #d9d4dc;
  cursor: pointer;
  padding: 0 12px;
}

.moc-row.is-active,
.moc-row:hover {
  border-color: rgba(215, 245, 122, 0.46);
  background: rgba(215, 245, 122, 0.1);
}

.workspace {
  min-width: 0;
  padding: 22px 30px 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  background: linear-gradient(var(--panel) 72%, rgba(246, 244, 237, 0));
}

.search-box {
  position: relative;
}

.search-box span {
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--teal);
  transform: translateY(-50%);
}

.search-box input,
.filter-row select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  outline: 0;
}

.search-box input:focus,
.filter-row select:focus {
  border-color: rgba(16, 185, 166, 0.72);
  box-shadow: 0 0 0 3px rgba(16, 185, 166, 0.16);
}

.search-box input {
  padding: 0 14px 0 38px;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-row select {
  padding: 0 10px;
  font-size: 12px;
}

.list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.list-head h2,
.detail-main h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
}

.result-count {
  color: var(--ink-soft);
  font-size: 13px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(254px, 1fr));
  gap: 16px;
}

.ref-card {
  overflow: hidden;
  min-height: 342px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.ref-card:hover,
.ref-card:focus-visible {
  border-color: rgba(16, 185, 166, 0.56);
  transform: translateY(-2px);
  outline: 0;
}

.media-preview {
  position: relative;
  height: 178px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #16141d;
}

.media-preview__surface {
  position: absolute;
  inset: 16px;
  display: grid;
  align-content: end;
  gap: 8px;
  border: 1px solid rgba(246, 244, 237, 0.18);
  border-radius: 8px;
  padding: 14px;
  color: var(--panel);
  background:
    linear-gradient(135deg, rgba(16, 185, 166, 0.4), rgba(142, 124, 255, 0.26)),
    #17151f;
}

.media-preview__surface span {
  width: fit-content;
  border-radius: 6px;
  background: rgba(255, 127, 160, 0.2);
  padding: 4px 7px;
  color: #ffd9e3;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.media-preview__surface strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview__strips {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  gap: 5px;
}

.media-preview__strips i {
  display: block;
  width: 28px;
  height: 48px;
  border-radius: 6px;
  background: rgba(246, 244, 237, 0.18);
}

.text-preview {
  display: grid;
  align-content: space-between;
  min-height: 178px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
  background: #fffaf0;
}

.text-preview p {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.text-preview span {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

.ref-card--law .text-preview,
.ref-card--law .media-preview__surface {
  background:
    linear-gradient(135deg, rgba(215, 245, 122, 0.46), rgba(255, 127, 160, 0.18)),
    #fffdf7;
}

.ref-card__body {
  padding: 14px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

.chip {
  border-radius: 6px;
  background: #ebe6dc;
  color: #554e57;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
}

.ref-card__body h3 {
  margin: 12px 0 8px;
  font-size: 17px;
  line-height: 1.28;
}

.ref-card__body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
  color: #5d5660;
  font-size: 11px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--ink-soft);
  background: var(--panel-soft);
}

.back-btn {
  height: 38px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  cursor: pointer;
  padding: 0 12px;
  font-weight: 700;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.detail-main,
.detail-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
}

.detail-main {
  padding: 24px;
}

.detail-summary {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}

.detail-preview {
  margin: 20px 0;
}

.note-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

.note-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.note-section p,
.note-section li {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.detail-side {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.side-block {
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.side-block:last-child {
  border-bottom: 0;
}

.side-block span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.side-block strong,
.side-block a {
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .app {
    display: block;
    background: var(--panel);
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .topbar,
  .detail-shell {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 18px;
  }
}
