/* Diseño compartido: colores, separaciones, proporción de imagen y anchuras se definen aquí. */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #fff;
  --ink: #172027;
  --muted: #68737f;
  --border: #e2e6e9;
  --accent: #d94f32;
  --accent-soft: #fff0eb;
  --nav: #172027;
  --nav-muted: #a0afb9;
  --success: #238170;
  --danger: #b52e37;
  --radius: 14px;
  --sidebar: 228px;
  --gap: 22px;
  --image-ratio: 16/9;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #328cce;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.18;
  letter-spacing: -1px;
  margin-bottom: 10px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
h3 {
  font-size: 16px;
  margin-bottom: 10px;
}
small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.7px;
  color: var(--accent);
}
.stack {
  display: grid;
  gap: 18px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.grow {
  flex: 1;
}
.divider {
  margin: 0 10px;
  color: #a0a9b0;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 100;
  background: white;
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
.boot-message {
  text-align: center;
  padding: 20vh 20px;
  color: var(--muted);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -1.2px;
}
.brand:hover {
  text-decoration: none;
}
.brand-dot {
  color: #ef795c;
}
.brand img {
  border-radius: 9px;
}
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 32px 18px 20px;
  background: var(--nav);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 10;
  overflow-y: auto;
}
.sidebar .brand {
  padding: 0 10px 25px;
}
.sidebar-label {
  margin: 26px 14px 10px;
  color: var(--nav-muted);
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.nav-item {
  padding: 11px 13px;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #b9c5cd;
  font-weight: 500;
}
.nav-item:hover {
  background: #26343e;
  color: white;
  text-decoration: none;
}
.nav-item.active {
  background: #33434c;
  color: #fff;
}
.nav-item.active svg {
  color: #f58d72;
}
.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #33414b;
  padding: 20px 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer strong {
  font-size: 13px;
  display: block;
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-footer small {
  display: block;
  color: var(--nav-muted);
  font-size: 11px;
}
.avatar {
  height: 34px;
  width: 34px;
  border-radius: 50%;
  background: #435761;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.icon-button {
  background: none;
  border: 0;
  color: inherit;
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
}
.sidebar-footer .icon-button {
  margin-left: auto;
}
.workspace {
  margin-left: var(--sidebar);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 74px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  font-size: 12px;
  color: var(--muted);
}
.topbar strong {
  font-weight: 550;
  color: var(--ink);
}
.live-badge {
  font-size: 11px;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.live-badge > span {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
}
main {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 38px;
  flex: 1;
  outline: none;
}
.workspace-footer {
  padding: 20px 38px;
  color: #8b939a;
  font-size: 11px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
.workspace-footer span:first-child {
  font-weight: 700;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}
.page-heading p:last-child {
  margin: 0;
}
.page-heading .eyebrow {
  margin-bottom: 9px;
}
.button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 15px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}
.button:hover {
  background: #edf0f2;
  text-decoration: none;
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.button.primary:hover {
  background: #bf4027;
}
.button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.button.subtle {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.button.small {
  padding: 7px 10px;
  min-height: 32px;
}
.button svg {
  width: 16px;
  height: 16px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 14px 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.toolbar select {
  padding: 6px 27px 6px 8px;
  font-size: 12px;
  border: 0;
  background: #f5f6f8;
  min-height: 34px;
  width: auto;
}
.feed-count {
  font-size: 12px;
  color: var(--muted);
}
.filter {
  position: relative;
}
.filter > summary {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 140px;
}
.filter > summary::after {
  content: '⌄';
  float: right;
  margin-left: 10px;
}
.filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  max-width: 320px;
  max-height: 330px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px #17202718;
  border-radius: 10px;
  padding: 16px;
  z-index: 20;
}
.filter-panel .check {
  padding: 7px 0;
  font-size: 13px;
  display: flex;
}
.filter-panel .check span {
  overflow-wrap: anywhere;
}
.filter-panel .button {
  width: 100%;
  margin-top: 10px;
}
.update-info {
  color: var(--muted);
  font-size: 11px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.update-info .error {
  color: var(--danger);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr));
  gap: var(--gap);
  align-items: stretch;
}
.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.news-card:hover {
  box-shadow: 0 5px 20px #1720270b;
}
.card-body {
  padding: 20px 20px 16px;
  flex: 1;
}
.card-source {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.paper-name {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 7px;
}
.paper-name::before {
  content: '';
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.unread-dot {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #328cce;
  flex-shrink: 0;
}
.keyword-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.keyword {
  font-size: 10px;
  color: #96513e;
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 3px 7px;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.card-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 21px;
  line-height: 1.33;
  letter-spacing: -0.3px;
  font-weight: 600;
  margin: 0;
  overflow-wrap: anywhere;
}
.card-title a:hover {
  color: var(--accent);
  text-decoration: none;
}
.news-card.is-read .card-title {
  color: #65717a;
}
.card-image {
  aspect-ratio: var(--image-ratio);
  background: linear-gradient(130deg, #e9edef, #f4f5f6);
  position: relative;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-fallback {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  justify-content: center;
  color: #8f9ba3;
  font-size: 11px;
  position: absolute;
  inset: 0;
}
.image-fallback svg {
  width: 30px;
  height: 30px;
  opacity: 0.7;
}
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 11px 13px 5px;
}
.card-action {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 5px;
  min-height: 34px;
  border-radius: 5px;
}
.card-action svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.card-action:hover {
  background: var(--bg);
}
.card-action[aria-pressed='true'] {
  color: var(--accent);
}
.card-date {
  display: block;
  padding: 2px 19px 14px;
  color: #89939b;
  font-size: 10px;
}
.load-more {
  display: block;
  margin: 28px auto 0;
  min-width: 180px;
}
.empty-state {
  text-align: center;
  padding: 70px 25px;
  border: 1px dashed #cbd3d9;
  border-radius: var(--radius);
  background: #ffffff80;
}
.empty-state svg {
  width: 42px;
  height: 42px;
  color: #9daab3;
  margin-bottom: 15px;
}
.empty-state p {
  max-width: 430px;
  margin: 0 auto 20px;
  color: var(--muted);
}
.new-items {
  margin-bottom: 18px;
  border-color: #f2c9b9;
  background: #fff8f4;
  color: #a1452e;
}
.panel {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
}
.panel > p {
  color: var(--muted);
  font-size: 13px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-grid .full {
  grid-column: 1/-1;
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 550;
}
input,
select,
textarea {
  border: 1px solid #d2d9de;
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
  width: 100%;
  min-height: 41px;
  color: var(--ink);
}
input[type='checkbox'] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
}
.help {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.form-error {
  color: var(--danger);
  padding: 10px;
  background: #fff0f1;
  border-radius: 6px;
  font-size: 12px;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 22px;
  align-items: start;
}
.setting-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
}
.setting-line:last-child {
  border-bottom: 0;
}
.setting-line p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.setting-line input[type='number'] {
  width: 105px;
}
.toggle {
  appearance: none !important;
  width: 40px !important;
  height: 23px !important;
  border: 0;
  border-radius: 20px;
  background: #c6cdd2;
  position: relative;
  padding: 0;
  cursor: pointer;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: white;
  transition: transform 0.15s;
}
.toggle:checked {
  background: var(--success);
}
.toggle:checked::after {
  transform: translateX(17px);
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row .description {
  min-width: 0;
  flex: 1;
}
.list-row strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.list-row small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.tag {
  border: 1px solid var(--border);
  background: #f7f9fa;
  color: var(--muted);
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 10px;
  white-space: nowrap;
}
.tag.success {
  color: #176b5b;
  background: #ecf7f3;
  border-color: #d5e9e1;
}
.chip-list {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.edit-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--accent-soft);
  border: 1px solid #f6d9ce;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
}
.edit-chip button {
  border: 0;
  background: none;
  padding: 5px;
  color: var(--muted);
}
.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 15px;
}
.inline-form label {
  flex: 1;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat strong {
  display: block;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.7px;
}
.stat span {
  font-size: 11px;
  color: var(--muted);
}
.console {
  margin-top: 16px;
  background: #172027;
  color: #d6e4e8;
  border-radius: 9px;
  padding: 18px;
  max-height: 60vh;
  min-height: 250px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.7 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.danger-note {
  padding: 12px 14px;
  border-left: 3px solid var(--danger);
  background: #fff5f5;
  font-size: 12px;
}
.cleanup-preview {
  background: #f7f9fb;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 16px;
  margin-top: 16px;
}
.narrow {
  max-width: 760px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #172027;
  color: white;
  box-shadow: 0 10px 30px #17202730;
  padding: 13px 20px;
  border-radius: 9px;
  font-size: 13px;
  max-width: min(90vw, 600px);
}
.toast.error {
  background: #94353b;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: min(540px, calc(100vw - 32px));
  box-shadow: 0 25px 90px #0003;
  color: var(--ink);
}
dialog::backdrop {
  background: #17202785;
}
.dialog-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}
.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-intro {
  background: var(--nav);
  color: white;
  padding: 55px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-intro h1 {
  font-family: Georgia, serif;
  font-size: clamp(38px, 4vw, 62px);
  line-height: 1.13;
  font-weight: 400;
  letter-spacing: -1.6px;
}
.login-intro .eyebrow {
  color: #f3967e;
}
.login-intro p:not(.eyebrow) {
  color: #b8c8d0;
  font-size: 16px;
  line-height: 1.8;
}
.login-intro small {
  color: #8b9ca7;
}
.login-box {
  align-self: center;
  justify-self: center;
  max-width: 400px;
  width: 100%;
  padding: 30px;
}
.login-box h2 {
  font-size: 30px;
}
.login-box > p.muted {
  margin-bottom: 30px;
}
.login-box .primary {
  width: 100%;
  justify-content: space-between;
  font-size: 13px;
}
@media (min-width: 1500px) {
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  :root {
    --sidebar: 194px;
    --gap: 17px;
  }
  main {
    padding: 28px;
  }
  .topbar {
    padding: 0 28px;
  }
  .sidebar {
    padding: 24px 12px 18px;
  }
  .sidebar .brand {
    font-size: 23px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .login-intro {
    padding: 40px;
  }
}
@media (max-width: 760px) {
  :root {
    --sidebar: 0px;
    --gap: 17px;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px;
    display: block;
    overflow: visible;
  }
  .sidebar .brand {
    padding: 0;
    font-size: 23px;
  }
  .sidebar .brand img {
    width: 29px;
    height: 29px;
  }
  .sidebar-label {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    margin-top: 13px;
    padding-bottom: 2px;
  }
  .nav-item {
    padding: 8px 10px;
    white-space: nowrap;
    font-size: 11px;
    gap: 6px;
  }
  .nav-item svg {
    width: 15px;
    height: 15px;
  }
  .sidebar-footer {
    position: absolute;
    right: 14px;
    top: 14px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar-footer .avatar,
  .sidebar-footer small {
    display: none;
  }
  .sidebar-footer strong {
    max-width: 100px;
    font-size: 11px;
  }
  .topbar {
    height: 49px;
    padding: 0 20px;
    font-size: 10px;
  }
  .live-badge {
    font-size: 9px;
    padding: 4px 7px;
  }
  .workspace {
    margin: 0;
  }
  main {
    padding: 25px 20px;
  }
  .page-heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 28px;
  }
  .page-heading > .button {
    font-size: 11px;
    padding: 8px 10px;
  }
  .page-heading > .button svg {
    display: none;
  }
  .toolbar {
    padding: 12px;
    gap: 10px;
  }
  .toolbar .row {
    gap: 7px;
  }
  .filter-panel {
    right: auto;
    left: 0;
    min-width: 235px;
  }
  .workspace-footer {
    padding: 18px 20px;
    font-size: 10px;
  }
  .workspace-footer span:last-child {
    max-width: 240px;
    text-align: right;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 20px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 12px;
  }
  .stat strong {
    font-size: 22px;
  }
  .list-row {
    flex-wrap: wrap;
  }
  .list-row .description {
    flex-basis: 65%;
  }
  .login-view {
    grid-template-columns: 1fr;
  }
  .login-intro {
    padding: 25px;
    min-height: 235px;
    gap: 25px;
  }
  .login-intro h1 {
    font-size: 35px;
    margin-bottom: 0;
  }
  .login-intro p:not(.eyebrow),
  .login-intro > small {
    display: none;
  }
  .login-intro .eyebrow {
    margin-bottom: 8px;
  }
  .login-box {
    padding: 35px 25px;
    max-width: 450px;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  }
  .card-title {
    font-size: 23px;
  }
  .card-action {
    min-height: 40px;
  }
  .toast {
    bottom: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.actions {
  flex-wrap: wrap;
}
.grow {
  min-width: 0;
}
.offline-page {
  max-width: 650px;
  text-align: center;
  padding: 20vh 25px;
  margin: auto;
}
