/* Serhard News: app shell, feed and source management. Brand tokens only. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: var(--space-3); left: var(--space-3); z-index: 30; padding: var(--space-3); background: var(--sheet); }
.skip-link:not(:focus) { clip-path: inset(50%); }
.wrap.wide { max-width: 1280px; }
.brand { align-items: center; gap: 10px; text-decoration: none; }
.brand .product { font-weight: 700; font-size: 1.05rem; color: var(--ink); padding-left: 10px; border-left: 1px solid var(--rule); line-height: 1.2; }
.mono { font-family: var(--font-mono); font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.875rem; }
.notice { margin: 0 0 var(--space-4); padding: 10px 14px; border-radius: var(--radius-md); background: var(--row-rule); color: var(--match); }
.notice-flag { background: var(--flag-bg); color: var(--flag); }

/* Shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--space-8); align-items: start; padding-top: var(--space-6); }
.single { padding-block: var(--space-10); }
main { min-width: 0; outline: 0; padding-bottom: var(--space-14); }
.side { position: sticky; top: calc(var(--head-h) + var(--space-4)); display: grid; gap: var(--space-6); max-height: calc(100vh - var(--head-h) - var(--space-8)); overflow-y: auto; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: var(--radius-md); color: var(--ink-soft); font-weight: 600; font-size: 0.94rem; text-decoration: none; }
.side nav a span:not(.count) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side nav a .icon { color: var(--muted); }
.side nav a:hover { background: var(--sheet); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.side nav a[aria-current="page"] .icon { color: var(--signal); }
.side-label { margin: var(--space-4) 0 2px; padding-left: 10px; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.count { font: 600 0.75rem var(--font-mono); color: var(--ink-soft); background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; padding: 0 7px; }
.side-out { display: grid; gap: var(--space-2); padding: var(--space-3) 10px 0; border-top: 1px solid var(--rule); }
.side-out .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Feed */
.feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.feed-head h1, main > h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 4px; }
.feed-head .hint { margin: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 12px; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--sheet); color: var(--muted); }
.search:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; color: var(--ink); min-height: 38px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--paper); }
.seg a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: calc(var(--radius-md) - 2px); color: var(--ink-soft); font-weight: 600; font-size: 0.875rem; text-decoration: none; border: 1px solid transparent; }
.seg a[aria-current="true"] { background: var(--sheet); color: var(--ink); border-color: var(--control-border); }
.items { display: grid; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--sheet); overflow: hidden; }
.item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--space-3); padding: 14px 16px; border-bottom: 1px solid var(--row-rule); }
.item:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--rule); font: 700 0.95rem var(--font-mono); color: var(--ink-soft); }
.item-main { min-width: 0; }
.item-title { margin: 0 0 4px; font-size: 1.02rem; line-height: 1.35; letter-spacing: -0.005em; }
.item-title a { color: var(--ink); text-decoration: none; }
.item-title a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.item-title a:visited, .item.is-read .item-title a { color: var(--muted); font-weight: 500; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; font-size: 0.82rem; color: var(--muted); }
.item-meta a { color: var(--ink-soft); }
.item-summary { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item.is-read .item-summary { display: none; }
.item-actions { display: flex; gap: 2px; align-items: flex-start; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: var(--radius-md); background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--paper); border-color: var(--rule); color: var(--ink); }
.icon-btn .icon { width: 18px; height: 18px; }
form[action$="/unstar"] .icon-btn { color: var(--signal); }
.badge { display: inline-flex; padding: 0 7px; border: 1px solid var(--control-border); border-radius: var(--radius-md); font-weight: 700; font-size: 0.75rem; color: var(--ink); }
.empty { padding: var(--space-10) var(--space-6); text-align: center; }
.empty h2 { margin: 0 0 6px; }
.more { text-align: center; margin-top: var(--space-6); }

/* Sources and settings */
.panel { padding: clamp(16px, 2.4vw, 24px); margin-bottom: var(--space-6); }
.panel h2 { font-size: 1.1rem; margin: 0 0 var(--space-4); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.panel-head h2 { margin: 0; }
.panel-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.grid-form label { display: grid; gap: 6px; font-weight: 700; font-size: 0.875rem; color: var(--ink-soft); min-width: 0; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .hint { font-weight: 400; margin: 0; }
.grid-form input, .grid-form select, .grid-form textarea, .inline input {
  width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--ink); background: var(--paper);
  border: 1px solid var(--control-border); border-radius: var(--radius-md);
}
.grid-form input:focus, .grid-form select:focus, .grid-form textarea:focus, .inline input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.form-actions { display: flex; gap: var(--space-2); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--row-rule); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.table .sub { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; overflow-wrap: anywhere; }
.table .err { display: block; color: var(--flag); font-size: 0.8rem; margin-top: 4px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row-actions .edit { flex-basis: 100%; }
.row-actions .edit summary { list-style: none; cursor: pointer; display: inline-flex; float: right; }
.row-actions .edit summary::-webkit-details-marker { display: none; }
.row-actions .edit[open] { padding: var(--space-4); margin-top: var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper); }
.row-actions .edit[open] summary { float: none; margin-bottom: var(--space-3); }
.danger { margin-top: var(--space-3); }
.status { display: inline-flex; padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: 0.75rem; border: 1px solid var(--control-border); color: var(--ink-soft); }
.status--ok { color: var(--match); border-color: currentColor; }
.status--flag { color: var(--flag); border-color: currentColor; background: var(--flag-bg); }
.status--off { color: var(--muted); }
.topic-list { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.topic-list li, .inline { display: flex; gap: var(--space-2); align-items: center; }
.inline input { max-width: 320px; }
.import input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.import label:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.gate { max-width: 560px; }
.gate h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.045em; line-height: 1.02; margin: 0 0 var(--space-4); }

@media (max-width: 900px) {
  .site-head nav { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); padding-top: var(--space-3); }
  .side { position: static; max-height: none; }
  .side nav { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .side nav a { flex: none; }
  .side-label, .side-out { display: none; }
}
@media (max-width: 600px) {
  .item { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .avatar { display: none; }
  .item-actions { justify-content: flex-start; margin-left: -8px; }
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .feed-head { flex-direction: column; align-items: flex-start; }
  .table thead { display: none; }
  .table tr { display: grid; padding: 8px 0; border-bottom: 1px solid var(--row-rule); }
  .table td { border: 0; padding: 4px 0; }
  .row-actions { justify-content: flex-start; }
}
