.tags-main { max-width: 960px; padding-top: 1.25rem; }
.tags-intro { padding: 2rem 0 1rem; }
.tags-intro .eyebrow { color: var(--accent); margin: 0 0 .35rem; font-size: .8rem; text-transform: uppercase; }
.tags-intro h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: 0; }
.tags-intro h1 em { color: var(--accent); font-style: normal; }
.tags-intro p:last-child { max-width: 38rem; color: var(--muted); margin: .75rem 0 0; }
.tags-search { max-width: 52rem; margin: 1rem 0 1.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.tags-search > label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .85rem; }
.tags-search-row { display: flex; align-items: center; gap: .55rem; }
.tags-search-row > span { font-size: 1.15rem; color: var(--accent); }
.tags-search input, .tags-search select { min-width: 0; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: inherit; }
.tags-search input { flex: 1; }
.tags-search .btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.limit-label { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.tags-error { padding: .75rem 1rem; border: 1px solid #dc2626; border-radius: 8px; color: #ef4444; }
.tags-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0 1.5rem; }
.tags-summary > div { min-width: 0; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.tags-summary strong, .tags-summary span { display: block; }
.tags-summary strong { font-size: 1.35rem; color: var(--fg); }
.tags-summary span { color: var(--muted); font-size: .78rem; }
.tag-results-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr); gap: 1rem; align-items: start; margin-bottom: 2rem; }
.tag-analysis, .related-tags { min-width: 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin: 1rem 0 .55rem; }
.section-heading h2 { margin: 0; color: var(--fg); font-size: 1rem; letter-spacing: 0; text-transform: none; }
.section-heading > span, .related-tags > p { color: var(--muted); font-size: .82rem; }
.tag-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.tag-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem .1rem; border-bottom: 1px solid var(--line); }
.tag-list li > span, .tag-cloud small { color: var(--muted); font-size: .78rem; }
.tag-list a, .tag-cloud a { color: var(--accent); }
.sql-suggestion { margin-top: 1.4rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.sql-suggestion p, .empty-note { color: var(--muted); font-size: .85rem; }
.sql-suggestion textarea { display: block; width: 100%; margin: .5rem 0; padding: .65rem; resize: vertical; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: .84rem/1.5 ui-monospace, Consolas, monospace; }
.btn-small { padding: .4rem .7rem; border-radius: 6px; font-size: .83rem; }
.sql-suggestion .btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.tag-cloud { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem .7rem; }
.tag-cloud a { display: inline-flex; align-items: baseline; gap: .3rem; }
.timeline { margin-top: 2rem; }
.timeline > summary { cursor: pointer; list-style: none; }
.timeline-title { display: inline-flex; align-items: center; gap: .55rem; }
.timeline-title::before { content: ""; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid var(--accent); transition: transform 140ms ease; }
.timeline[open] .timeline-title::before { transform: rotate(90deg); }
.timeline-posts { margin-top: .5rem; }
.tag-post { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.tag-post > header, .tag-post > footer { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.tag-post > header div { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.tag-post > header strong { color: var(--fg); }
.tag-post > header span, .tag-post > footer { color: var(--muted); font-size: .8rem; }
.tag-post > header time, .tag-post > footer a { color: var(--muted); }
.tag-post-content { margin: .65rem 0; overflow-wrap: anywhere; }
.tag-post-content p { margin: 0 0 .45rem; }
.tag-post-content .invisible { display: none; }
.tag-post-content a { text-decoration: underline; text-underline-offset: .15em; }
.tag-post-content .ellipsis::after { content: "..."; }
.tag-post-image { display: block; max-width: min(100%, 36rem); max-height: 26rem; margin: .6rem 0; border-radius: 8px; object-fit: contain; }
.tag-post-content img.emoji { display: inline; height: 1.2em; width: auto; vertical-align: middle; }
.content-warning { margin: .5rem 0; }
.content-warning summary { cursor: pointer; color: var(--accent); }
@media (max-width: 680px) {
  .tags-search-row { flex-wrap: wrap; }
  .tags-search input { flex-basis: calc(100% - 2rem); }
  .limit-label { margin-left: 1.7rem; }
  .tags-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tag-results-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .tags-main { padding-left: .9rem; padding-right: .9rem; }
  .tags-summary span { font-size: .72rem; }
  .tag-post > header, .tag-post > footer { gap: .5rem; }
}
