:root {
  font-family: Inter, Pretendard, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17191f;
  background: #f5f6f8;
  line-height: 1.65;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f5f6f8; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { appearance: none; }

.topbar {
  min-height: 64px;
  border-bottom: 1px solid #e2e5ea;
  background: rgba(255,255,255,.94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.topbar-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { font-size: 21px; font-weight: 800; letter-spacing: -.65px; white-space: nowrap; }
.brand strong { font-weight: 500; color: #6d7480; }
.topbar nav { display: flex; align-items: center; gap: 18px; font-size: 14px; color: #555b66; }
.topbar nav a:hover, .link-button:hover { color: #111318; }
.nav-cta { border: 1px solid #d5d9e0; border-radius: 9px; padding: 6px 10px; background: white; }
.inline { display: inline; }
.link-button { border: 0; background: none; padding: 0; cursor: pointer; color: #555b66; }

.messages { width: min(960px, calc(100% - 32px)); margin: 18px auto -14px; }
.message { padding: 11px 14px; border: 1px solid #d9dde4; border-radius: 12px; background: white; font-size: 14px; }
.message.success { border-color: #b9dfc8; background: #f2fbf5; }
.message.info { border-color: #cfd9ee; background: #f4f7fd; }

.container { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 88px; }
.hero { padding: 52px 0 58px; }
.hero h1, .document h1, .editor h1, section > .section-head h1 {
  margin: 6px 0 12px;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.12;
  letter-spacing: -2px;
}
.hero-copy, .lead { max-width: 720px; color: #626974; font-size: 17px; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 1.7px; color: #767d88; }
.muted { color: #707681; }

.search { display: flex; gap: 8px; margin-top: 30px; max-width: 760px; }
.search input { flex: 1; min-width: 0; padding: 15px 16px; border: 1px solid #d2d6dd; border-radius: 13px; background: white; outline: none; }
.search input:focus, input:focus, textarea:focus, select:focus { border-color: #8d949f; box-shadow: 0 0 0 3px rgba(35,39,47,.07); outline: none; }
.search button, .button {
  border: 1px solid #17191f;
  border-radius: 11px;
  padding: 11px 17px;
  background: #17191f;
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  font-weight: 650;
}
.button:hover { opacity: .9; }
.button.secondary { background: white; color: #262a31; border-color: #d3d7de; }
.button.small { padding: 8px 12px; border-radius: 9px; font-size: 13px; }
.button.wide { width: 100%; }

.stats { display: flex; gap: 22px; margin-top: 18px; color: #777e89; font-size: 13px; }
.stats strong { color: #1c1f25; }
.tag-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: -14px 0 44px; }
.tag, .card-tags a, .card-tags span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eaedf1;
  color: #5c636f;
  font-size: 12px;
}
.tag.active { background: #20232a; color: white; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.section-head, .document-head, .actions, .form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-head { margin-bottom: 20px; }
.section-head h2 { margin: 5px 0 0; font-size: 27px; letter-spacing: -.8px; }
.article-list, .history-list { display: grid; gap: 10px; }
.article-card, .history-item, .auth-card, .editor, .document {
  background: white;
  border: 1px solid #e0e3e8;
  box-shadow: 0 1px 0 rgba(16,24,40,.02);
}
.article-card { padding: 19px 21px; border-radius: 15px; display: flex; justify-content: space-between; gap: 18px; transition: border-color .15s ease, transform .15s ease; }
.article-card:hover { border-color: #c8cdd5; transform: translateY(-1px); }
.article-card h3 { margin: 0 0 5px; font-size: 18px; letter-spacing: -.3px; }
.article-card p { margin: 0; color: #666d78; font-size: 14px; }
.article-meta { min-width: 125px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: #818792; font-size: 12px; }

.document { border-radius: 20px; padding: clamp(24px, 5vw, 42px); }
.document-head { align-items: flex-start; }
.document-head h1 { font-size: clamp(34px, 6vw, 52px); }
.actions { justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }
.document-meta { display: flex; flex-wrap: wrap; gap: 14px; border-top: 1px solid #eceef2; border-bottom: 1px solid #eceef2; padding: 12px 0; margin-top: 24px; color: #7a808a; font-size: 12px; }
.document-meta a { text-decoration: underline; text-underline-offset: 2px; }
.document-body { margin-top: 34px; font-size: 16.5px; color: #25282f; overflow-wrap: anywhere; }
.document-body p { margin: 0 0 1.15em; }
.document-footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #eceef2; margin-top: 42px; padding-top: 18px; color: #808691; font-size: 12px; }
.document-footer a { text-decoration: underline; }
.lock-badge { border-radius: 999px; padding: 6px 10px; background: #fff3d8; color: #8a5b00; font-size: 12px; font-weight: 700; }
.revision-tags { margin: 20px 0 -12px; color: #777e89; font-size: 13px; }

.history-item { padding: 14px 17px; border-radius: 13px; display: grid; grid-template-columns: minmax(150px, 1fr) 120px 120px minmax(160px, 1fr); gap: 16px; align-items: center; }
.history-item:hover { border-color: #c8cdd5; }
.history-item span { color: #767d88; font-size: 13px; }

.auth-card, .editor { width: min(720px, 100%); margin: 0 auto; padding: clamp(24px, 5vw, 34px); border-radius: 18px; }
.auth-card { width: min(520px, 100%); }
.auth-card h1, .editor h1 { font-size: 34px; letter-spacing: -1.1px; margin: 5px 0 7px; }
.stack-form { margin-top: 25px; }
.field { margin-bottom: 18px; }
label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 13px; }
input[type=text], input[type=password], input[type=email], input[type=search], textarea, select {
  width: 100%;
  border: 1px solid #d3d7de;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: #1c1f25;
}
textarea { resize: vertical; min-height: 120px; }
.helptext { display: block; color: #858b95; font-size: 11px; margin-top: 5px; }
.helptext ul { padding-left: 18px; }
.errorlist { color: #b42318; font-size: 12px; margin: 6px 0; padding-left: 18px; }
.form-actions { margin-top: 26px; justify-content: flex-end; }
.auth-note { margin: 20px 0 0; color: #777e89; font-size: 13px; text-align: center; }
.auth-note a { color: #1e2229; text-decoration: underline; }

.empty { padding: 34px; text-align: center; border: 1px dashed #ccd1d9; border-radius: 14px; color: #7c828d; background: rgba(255,255,255,.5); }
.empty p { margin: 7px 0 14px; }
.footer { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 36px; border-top: 1px solid #e1e4e9; color: #898f99; display: flex; justify-content: space-between; gap: 16px; font-size: 11px; }

@media (max-width: 760px) {
  .topbar-inner { width: min(100% - 24px, 960px); min-height: 58px; align-items: flex-start; padding: 15px 0 12px; }
  .topbar nav { gap: 10px; flex-wrap: wrap; justify-content: flex-end; font-size: 12px; }
  .brand { font-size: 18px; padding-top: 1px; }
  .container { width: min(100% - 24px, 960px); padding-top: 26px; }
  .hero { padding: 30px 0 46px; }
  .hero h1 { letter-spacing: -1.4px; }
  .search { flex-direction: column; }
  .search button { min-height: 44px; }
  .section-head, .document-head { align-items: flex-start; flex-direction: column; }
  .article-card { flex-direction: column; }
  .article-meta { align-items: flex-start; min-width: 0; }
  .history-item { grid-template-columns: 1fr; gap: 4px; }
  .document-footer { flex-direction: column; }
  .footer { width: min(100% - 24px, 960px); flex-direction: column; }
}
