.home {
  max-width: 1080px;
}

.home-heading {
  margin-bottom: 24px;
}

.home-heading .eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.home-heading h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
}

.home-heading p:not(.eyebrow) {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 28px;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 34px;
}

.home-stats div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.home-stats strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.home-stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.home-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.home-section h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.home-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-note-grid a {
  display: block;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.home-note-grid a:hover {
  border-color: var(--accent);
}

.home-note-grid strong,
.home-note-grid span {
  display: block;
}

.home-note-grid strong {
  margin-bottom: 8px;
}

.home-note-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.tag-page {
  max-width: 1080px;
}

.tag-page-heading {
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent) 14%, transparent),
      transparent 46%
    ),
    var(--panel);
  box-shadow: var(--shadow);
}

.tag-page-heading .eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.tag-page-heading h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.05;
}

.tag-page-heading p {
  margin: 12px 0 0;
  color: var(--muted);
}

.tag-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tag-result-grid a {
  display: grid;
  gap: 8px;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(54, 42, 29, 0.045);
}

.tag-result-grid a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tag-result-grid strong,
.tag-result-grid span,
.tag-result-grid em {
  display: block;
}

.tag-result-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tag-result-grid em {
  align-self: end;
  color: var(--accent-dark);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.category-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: end;
}

.tag-result-grid .category-badges em {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  color: var(--accent-dark);
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.tag-page-more {
  margin-top: 18px;
}

.editor {
  display: grid;
  gap: 16px;
  max-width: 980px;
}

.editor form:first-child {
  display: grid;
  gap: 16px;
}

.structured-editor label {
  display: grid;
  gap: 7px;
}

.structured-editor label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.title-input,
.category-input,
.structured-editor input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.title-input:focus,
.category-input:focus,
.structured-editor input:focus,
.editor textarea:focus {
  border-color: var(--accent);
}

.title-input {
  font-size: 28px;
  font-weight: 800;
}

.editor textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 16px;
  line-height: 1.6;
  outline: none;
}

.editor textarea.short {
  min-height: 120px;
}

.markdown-editor textarea.raw-markdown {
  min-height: 62vh;
  font-family:
    ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.empty-state {
  max-width: 720px;
  margin: 80px auto;
  text-align: center;
}

.empty-state h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
}

.empty-state p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
