:root {
  color-scheme: light;
  --text: #181817;
  --secondary: #64645f;
  --line: #dcdcd7;
  --background: #f6f6f3;
  --surface: #ffffff;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }

.site-header {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.header-inner {
  width: min(960px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  color: var(--text);
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.sign-out {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
  cursor: pointer;
}
.sign-out:hover { color: var(--text); }

.page {
  width: min(960px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 80px;
}
.tabs {
  display: flex;
  gap: 30px;
  margin-bottom: 24px;
}
.tabs a {
  position: relative;
  padding: 7px 0 10px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 520;
  text-decoration: none;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); font-weight: 650; }
.tabs a.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  content: "";
}

.catalog-panel,
.detail-panel,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
}
.page-heading {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.page-heading h1 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.page-heading h1 span {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0;
}
.search input {
  width: 230px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cecec8;
  border-radius: 7px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
}
.search input::placeholder { color: #868681; }
.search input:focus { border-color: #73736d; box-shadow: 0 0 0 3px rgba(0, 0, 0, .055); }

.media-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 18px;
  align-items: center;
  min-height: 76px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background .12s ease;
}
.media-item:last-child { border-bottom: 0; border-radius: 0 0 11px 11px; }
.media-item:hover { background: #f8f8f6; }
.item-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.item-title strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-title small {
  color: var(--secondary);
  font-size: 12.5px;
  font-style: normal;
}
.item-title .item-meta {
  margin-top: 2px;
  color: #555550;
  font-size: 11.5px;
}
.chevron {
  color: #85857f;
  font-size: 20px;
  line-height: 1;
  text-align: right;
}
.empty { margin: 0; padding: 26px 24px; color: var(--secondary); font-size: 13px; }

.detail-page { max-width: 760px; }
.back {
  display: inline-block;
  margin: 0 0 18px 2px;
  color: var(--secondary);
  font-size: 13px;
  text-decoration: none;
}
.back:hover { color: var(--text); }
.detail-panel { padding: 32px 40px 34px; }
.detail-header { padding-bottom: 14px; }
.detail-header h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 28px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.08;
}
.detail-header h2 { margin: 10px 0 0; color: var(--secondary); font-size: 16px; font-weight: 420; }
.summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 4px 0;
}
.summary > div { display: block; padding: 0; border: 0; }
.summary dt,
.summary dd { margin: 0; font-size: 13px; line-height: 1.5; }
.summary dt { margin-bottom: 3px; color: var(--secondary); }
.evidence-section { margin-top: 24px; }
.evidence-section > h2 { margin: 0 0 14px; font-size: 16px; font-weight: 680; letter-spacing: -0.015em; }
.evidence-item { padding: 0; }
.evidence-title { display: flex; align-items: baseline; gap: 7px; }
.evidence-title strong { font-size: 13px; font-weight: 650; }
.evidence-title span { color: var(--secondary); font-size: 11.5px; text-transform: capitalize; }
.evidence-item p { margin: 8px 0; color: #3f3f3b; font-size: 13px; line-height: 1.55; }
.evidence-item code {
  color: #555550;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.login-page {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 48px 24px;
}
.login-panel { width: min(400px, 100%); padding: 38px; }
.login-panel h1 { margin: 0 0 26px; font-size: 25px; font-weight: 680; letter-spacing: -0.035em; }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 7px; color: #3f3f3b; font-size: 12.5px; font-weight: 550; }
.login-form input {
  width: 100%;
  height: 41px;
  padding: 0 11px;
  border: 1px solid #cecec8;
  border-radius: 7px;
  outline: none;
  background: var(--surface);
}
.login-form input:focus { border-color: #181817; box-shadow: none; }
.login-form button {
  height: 41px;
  margin-top: 2px;
  border: 0;
  border-radius: 7px;
  background: var(--text);
  color: #fff;
  font-weight: 620;
  cursor: pointer;
}
.login-form button:hover { background: #323230; }
.errorlist { margin: 0; padding: 10px 11px; border-radius: 7px; background: #fbeaea; color: #9f2626; font-size: 12px; list-style: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .header-inner,
  .page { width: min(100% - 28px, 960px); }
  .page { padding-top: 25px; }
  .tabs { gap: 24px; margin-bottom: 18px; overflow-x: auto; }
  .tabs a { flex: 0 0 auto; }
  .page-heading { min-height: 0; align-items: stretch; flex-direction: column; gap: 16px; padding: 20px; }
  .search input { width: 100%; }
  .media-item { grid-template-columns: minmax(0, 1fr) 16px; gap: 14px; padding: 14px 18px; }
  .media-item time,
  .source-count { display: none; }
  .detail-page { padding-top: 25px; }
  .detail-panel { padding: 30px 24px 34px; }
  .summary > div { grid-template-columns: 100px 1fr; gap: 16px; }
  .login-panel { padding: 30px 26px; }
}
