:root {
  color-scheme: dark;
  --bg: #161718;
  --panel: #202528;
  --panel-2: #1b2222;
  --panel-3: #111;
  --line: #30383c;
  --text: #e8e8e8;
  --muted: #9ca1a5;
  --accent: #3182ce;
  --accent-2: #58a6ff;
  --sidebar-width: 260px;
  --list-width: 38vw;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #aeb4b8;
  font-size: 29px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--text);
}

.icon-button.active {
  color: var(--accent-2);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 6px minmax(300px, var(--list-width)) 6px minmax(360px, 1fr);
  grid-template-areas: "sidebar resize-left list resize-right reader";
  height: 100vh;
  overflow: hidden;
}

.shell.resizing {
  cursor: col-resize;
  user-select: none;
}

.resizer {
  position: relative;
  z-index: 5;
  background: #050505;
  cursor: col-resize;
}

.resizer[data-resizer="left"] {
  grid-area: resize-left;
}

.resizer[data-resizer="right"] {
  grid-area: resize-right;
}

.resizer::after {
  content: "";
  position: absolute;
  inset: 0 -4px;
}

.resizer:hover,
.shell.resizing .resizer {
  background: #4b565c;
}

.sidebar {
  grid-area: sidebar;
  position: relative;
  padding: 38px 10px 16px;
  background: var(--panel);
  border-right: 1px solid #050505;
  overflow-y: auto;
  min-width: 0;
}

.toolbar {
  position: absolute;
  top: 4px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.toolbar button,
.import {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 24px;
}

.import input {
  display: none;
}

.sidebar h2 {
  margin: 18px 0 6px;
  color: #737b80;
  font-size: 13px;
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  color: #d8d8d8;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
}

.nav.active {
  background: #3b4247;
}

.nav strong {
  min-width: 34px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #111519;
  text-align: center;
}

.folder-group {
  margin-bottom: 2px;
}

.folder-nav {
  font-size: 17px;
  font-weight: 700;
}

.feed-list {
  margin: 4px 0 8px;
}

.feed-nav {
  min-height: 34px;
  padding-left: 28px;
  font-size: 16px;
}

.feed-nav span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subscribe {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 6px;
  margin-top: 18px;
}

.subscribe input,
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #2b3033;
  color: var(--text);
  padding: 7px 9px;
}

.subscribe button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
}

.export {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent-2);
  text-decoration: none;
}

.list-pane {
  grid-area: list;
  display: grid;
  grid-template-rows: 50px 1fr;
  background: var(--panel-2);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.list-pane header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 5px 12px;
  border-bottom: 1px solid #060606;
}

.list-pane h1 {
  margin: 0;
  font-size: 16px;
}

.list-pane p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.entry-list {
  overflow-y: auto;
  min-height: 0;
  padding: 12px;
}

.entry-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 10px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.entry-card.active {
  background: var(--accent);
}

.entry-card.read {
  opacity: 0.68;
}

.entry-title,
.entry-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-title {
  -webkit-line-clamp: 2;
  font-weight: 700;
}

.entry-summary {
  -webkit-line-clamp: 2;
  color: var(--muted);
}

.hn-meta {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-card.active .entry-summary,
.entry-card.active .hn-meta {
  color: #d7e9ff;
}

.entry-time {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.reader-pane {
  grid-area: reader;
  display: grid;
  grid-template-rows: 50px 1fr;
  min-width: 0;
  min-height: 0;
  background: var(--panel-3);
}

.reader-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 36%);
  gap: 18px;
  align-items: center;
  padding: 5px 18px;
  border-bottom: 1px solid #060606;
  background: #343a3a;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.document-button {
  font-size: 27px;
}

.search-box {
  position: relative;
  justify-self: end;
  width: min(100%, 560px);
}

.search-box span {
  position: absolute;
  left: 12px;
  top: 50%;
  color: #9aa0a3;
  font-size: 24px;
  transform: translateY(-52%);
  pointer-events: none;
}

.search-box input {
  height: 36px;
  padding-left: 42px;
}

.article-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 26px clamp(24px, 5vw, 68px) 60px;
}

.article-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid #505050;
  border-radius: 4px;
  color: var(--muted);
}

.article-scroll > h1 {
  margin: 22px 0 18px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
}

.article-content {
  color: #f0f0f0;
  font-size: 20px;
  line-height: 1.55;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
}

.article-content a,
.read-more {
  color: var(--accent-2);
}

.read-more {
  display: inline-block;
  margin-top: 22px;
  font-size: 20px;
  text-decoration: none;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: var(--sidebar-width) 6px 1fr;
    grid-template-areas: "sidebar resize-left list";
  }

  .reader-pane,
  .resizer[data-resizer="right"] {
    display: none;
  }
}

@media (max-width: 680px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-areas: "list";
  }

  .sidebar,
  .resizer {
    display: none;
  }
}
