:root {
    --bg: #0b0f17;
    --panel: #111827;
    --muted: #8b98a5;
    --text: #e5e7eb;
    --accent: hsl(160, 57%, 55%);
    --line: #1f2937;
    --chip: #0f172a;
    --top-dark: rgba(17, 24, 39, .7);
    --top-light: #618F3D; /*#c7f5c7b3;*/
    --topfg-dark: var(--text);
    --topfg-light: #F3EFB7;
    /*rgba(244, 245, 199, 0.7);*/
    --top: var(--top-dark);
    --topfg: var(--topfg-dark);
}

* {
    box-sizing: border-box
}

html, body{
  margin:0;
  padding:0;
  height:100%;
  overflow:hidden;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,sans-serif;
}

body{
  display:grid;
  grid-template-rows: auto 1fr auto;
  min-height:100vh;
}
/* === HEADER === */
.top {
    /*border-bottom: 1px solid var(--line);*/
    /*background: var(--top);*/
    background: linear-gradient(
      0deg,
      var(--bg) 0%,
      var(--bg) 15%,
      var(--top) 15%,
      var(--top) 100%
    );
    /*backdrop-filter: blur(6px);*/
    align-items: center;
    color: var(--topfg);
}

.wrap {
    width: 100%;
    display: flex;
    gap: 12px;
    margin: 0 auto;
    padding: 0px 16px 5px 16px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    transform: translateY(4px);
    border:4px solid var(--top);
    box-shadow:0 0 0 4px var(--bg);
}

.brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand .title {
    font-size: 22px;
    font-weight: 600;
}

.sub {
    color: var(--topfg);
    font-size: 13px;
}

.tools {
    margin: top 0px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tools-row {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    /* ← яркая рамка всегда */
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 0 0 2px var(--accent);
    /* ← мягкое свечение */
}

.hint {
    font-size: 12px;
    color: var(--topfg);
    margin-top: 4px;
}

/* === LAYOUT (GRID + SPLITTER) === */
main.wrap.layout{
  display:grid;
  grid-template-columns: var(--sb, 320px) 8px 1fr;
  gap:0;
  min-height:0;
  height:auto;
}

/* sidebar */
.sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    min-height:0
    padding-right: 20px;
    padding-left: 15px;
}

/* content */
.content {
    overflow: auto;
    min-width: 0;
    padding-left: 14px;
}

/* archive */
#archive {
    display: none;
}

/* splitter */
#splitter {
    cursor: col-resize;
    background: rgba(255, 255, 255, 0.05);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    border: 1px solid var(--line);
}

#splitter:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* === SIDEBAR === */
.sidebox {
    margin-bottom: 14px;
}

.sidehdr {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

/* === TAGS === */
.tagcloud{
  display:flex;
  flex-wrap:wrap;
  align-content:flex-start;
  gap:6px;
  padding:4px;
  margin:-4px;
}

.tagchip{
  display:inline-flex;
  justify-content:flex-start;
  width:auto;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:var(--chip);
  cursor:pointer;
  font-size:13px;
  border:1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* .tagchip:hover{ border-color:var(--accent); } */
.tagchip:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
    transform: scale(1.2);
    transform: 2s;
}

.tagchip.active {
    background: var(--accent);
    color: #000;
}

.tagchip .cnt {
    margin-left: 6px;
    font-size: 11px;
    opacity: .7;
}

/* === YEARS === */
/* archive */
#yearsNav {
    display: none;
}

.years-top {
    margin-bottom: 10px;
}

.years {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.years a {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--chip);
    font-size: 12px;
    text-decoration: none;
    color: var(--text);
}

.years a:hover {
    border: 1px solid var(--accent);
}

/* === STATS === */
.stats {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

/* === RESULTS === */
#results {
    overflow: visible;
    margin-right: 8px;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* пост */
.postlink {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.postlink:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
    background: var(--chip);
    transform: scale(1.01, 1.05);
}

.postlink .t {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.postlink .ext {
    opacity: .5;
}

/* === UTILS === */
.muted {
    color: var(--muted)
}

.small {
    font-size: 12px
}

button.btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #020617;
    color: var(--text);
    cursor: pointer;
}

button.btn:hover {
    border-color: var(--accent);
}

/* === Scrollbars (Firefox + Chromium/WebKit) === */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) rgba(255, 255, 255, 0.06);
}

/* Chromium/WebKit */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0);
    /* чтобы выглядел "пухлее" */
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.32);
    background-clip: padding-box;
}

/* === LIGHT THEME === */
.light {
    --bg: #fdfdf0d2;
    --panel: #ffffff;
    --muted: #6b7280;
    --text: #111827;
    --accent: rgb(55, 205, 155);
    /*hsl(160, 57%, 40%);*/
    --line: #e5e7eb;
    --chip: #d8f3ea;
    /*#c2f1e2; rgb(180, 236, 168); rgb(246, 255, 244); #f1f5f9;*/
    --top: var(--top-light);
    --topfg: var(--topfg-light);
}

/* фон инпута в светлой теме */
.light .search {
    background: #ffffff;
}

/* кнопки */
.light button.btn {
    background: #ffffff;
}

/* скроллбар (чуть темнее) */
.light * {
    scrollbar-color: rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.05);
}

/* === TOGGLE SWITCH === */
.theme-switch {
    justify-content: right;
    position: relative;
    width: 50px;
    height: 26px;
}

.theme-switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--top-light);
    border-radius: 26px;
    transition: 0.3s;
}

/* кружок */
.slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    transition: .3s;
    /* по умолчанию (dark) */
    background: linear-gradient(90deg, #111827 0%, #111827 50%, var(--accent) 50%, var(--accent) 100%);
}

/* в светлой теме — меняем ориентацию */
.light .slider::before {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 50%, #111827 50%, #111827 100%);
}

/* включено */
.theme-switch input:checked+.slider {
    background-color: var(--top-dark);
}

.theme-switch input:checked+.slider::before {
    transform: translateX(24px);
}

.tools-row .theme-switch {
    margin-left: auto;
}

/* === FOOTER  === */
.footer{
  padding:4px 16px;
  border-top:1px solid var(--line);
}
