*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

body {
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: linear-gradient(180deg, #f9fafc 0%, #f5f7fb 100%);
  color: #1f2937;
  padding: 2.25rem 2rem;
}

h1 {
  font-size: clamp(1.55rem, 2.4vw, 2.05rem);
  font-weight: 800;
  margin-bottom: .7rem;
  color: #111827;
  letter-spacing: -0.03em;
}

.topttl {
  width: 100%;
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: .7rem;
}

.logo {
  height: 4rem;
  width: auto;
  display: block;
  flex: 0 0 auto;
  margin-left: auto;
}

.theme-toggle {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: .38rem .45rem;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex: 0 0 auto;
  transition: color .15s, border-color .15s, background .15s;
}

.theme-toggle:hover {
  color: #374151;
  background: #f3f4f6;
  border-color: #9ca3af;
}

.theme-toggle .material-symbols-outlined {
  font-size: 1.4rem;
}

.day-section {
  width: 100%;
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

.day-section.show-all-rows tr.article-row.is-extra-row {
  display: table-row;
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: 1rem;
}

.day-section h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .58rem .82rem;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.day-section h2 .material-symbols-outlined {
  font-size: 1.15rem;
  color: #6b7280;
}

.day-section h2::after {
  content: none;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e6eaf0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .08);
}

thead th {
  background: #fff;
  color: #8b95a7;
  font-weight: 700;
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid #e8edf3;
}

tbody tr:hover {
  background: #fbfdff;
}

td {
  padding: .5rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #edf1f5;
}

td.desc {
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: .95rem;
  flex-wrap: nowrap;
}

td.desc b {
  font-weight: 500;
  line-height: 1.35;
  min-width: 0;
}

td.desc .article-icon {
  border: 1px solid #e4e7ec;
  border-radius: .55rem;
  background: #f8fafc;
  color: #8a94a4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  padding: .25rem;
  flex: 0 0 auto;
}

th.link-col  {
  white-space: nowrap;
  text-align: center;
  min-width: 54px;
}

td.link {
    font-weight: 600;
    font-size: x-small;
    text-align: center;
}

td.link:hover {
    text-decoration: underline;
}

th.link-col,
td.link { width: 160px; }

td.link .material-symbols-outlined {
    font-size: 0.85rem;
    vertical-align: middle;
}

td.link a {
  color: #3b61f3;
  font-weight: 600;
  text-decoration: none;
}
td.link a:hover { text-decoration: underline; }

th.score-col {
  text-align: center;
  min-width: 54px;
  width: 110px;
  font-weight: 700;
  text-wrap-mode: nowrap;
}
td.score > div {
  text-align: center;
  font-weight: 700;
  width: 50px;
  border-radius: 8px;
  padding: 5px;
  margin-left: auto;
  margin-right: auto;
}

td.score {
  background-clip: content-box;
}

th.score-col {
    cursor: help;
}

.score-info {
  display: inline-block;
  color: #b0b8c6;
  font-size: 1.1rem;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.article-row {
  cursor: pointer;
}

.article-row td.desc b::after {
  content: "⇓ Rozwiń ⇓";
  display: inline-block;
  width: 10ch;
  color: #99a2b1;
  font-weight: 400;
  margin-left: .5rem;
  white-space: nowrap;
  visibility: hidden;
}

.article-row:hover td.desc b::after {
  visibility: visible;
}

.article-row.expanded td.desc b::after {
  content: "⇑ Zwiń ⇑";
}

.details-row {
  display: none;
}

.article-row.is-extra-row {
  display: none;
}

.details-row.is-extra-row {
  display: none;
}

.details-row td {
  background: #f8fafc;
  color: #2d3748;
  padding: .95rem 1.25rem;
  border-bottom: 1px solid #edf1f5;
  cursor: initial;
}

.details-content {
  white-space: pre-wrap;
  line-height: 1.45;
  padding-left: 2.85rem;
}

.section-toggle {
  display: block;
  margin: .95rem auto 0;
  padding: .45rem 1rem;
  border: 1px solid #d8dee8;
  background: #fff;
  color: #637083;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
}

.section-toggle:hover {
  color: #374151;
  background: #f8fafd;
}

.custom-tooltip {
    position: fixed;

    background: #fffbeb;
    color: #1c1917;
    border: 1px solid #fde68a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);

    padding: 10px 12px;
    border-radius: 6px;

    font-size: 13px;
    line-height: 1.4;

    white-space: normal;
    max-width: 380px;
    text-align: left;

    opacity: 0;
    transition: opacity 0.15s ease;

    pointer-events: none;
    z-index: 999999;
}

.custom-tooltip p:not(:first-child):not(:last-child) {
    margin-top: 0.7em;
    margin-bottom: 0.7em;
}

.custom-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #fde68a;
}

.custom-tooltip.visible {
    opacity: 1;
}

html.dark body { background: linear-gradient(180deg,#0f0f12 0%,#141419 100%); color: #e2e8f0; }
html.dark h1 { color: #f1f5f9; }
html.dark .theme-toggle { border-color: #374151; color: #9ca3af; }
html.dark .theme-toggle:hover { color: #e2e8f0; background: #1f1f26; border-color: #4a4a54; }
html.dark .day-section h2 { background: #1a1a20; border-color: #2a2a30; color: #cbd5e1; }
html.dark .day-section h2 .material-symbols-outlined { color: #64748b; }
html.dark table { background: #161619; border-color: #272729; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
html.dark thead th { background: #161619; color: #8a8a99; border-bottom-color: #272729; }
html.dark tbody tr:hover { background: #1f1f26; }
html.dark td { border-bottom-color: #272729; }
html.dark td.desc { color: #e2e8f0; }
html.dark td.desc .article-icon { border-color: #2a2a30; background: #1f1f26; color: #8a8a99; }
html.dark td.link a { color: #7c9ef5; }
html.dark td.score > div { filter: brightness(0.8) saturate(1); color: #333; }
html.dark .article-row td.desc b::after { color: #5a5a6a; }
html.dark .details-row td { background: #141419; color: #999999; border-bottom-color: #272729; }
html.dark .section-toggle { border-color: #2a2a30; background: #161619; color: #8a8a99; }
html.dark .section-toggle:hover { color: #999999; background: #1f1f26; }
html.dark .custom-tooltip { background: #1f1f26; color: #e2e8f0; border: 1px solid #3a3a45; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
html.dark .custom-tooltip::after { border-top-color: #3a3a45; }

@media (max-width: 640px) {
  body {
    padding: 1.25rem .85rem;
  }

  h1 {
    margin-bottom: .85rem;
  }

  .topttl {
    gap: .45rem;
  }

  .day-section h2 {
    font-size: .92rem;
    padding: .5rem .65rem;
  }

  thead th,
  td {
    padding: .62rem .45rem;
  }

  td.desc b {
    gap: .55rem;
    font-size: .93rem;
  }

  td.desc b::before {
    width: 2rem;
    height: 1.85rem;
    font-size: .9rem;
  }

  th.link-col,
  td.link,
  th.score-col,
  td.score {
    width: 68px;
    min-width: 68px;
  }
  .score-info {
    display: none;
  }
}

html.mobile-details td.desc .article-icon {
  display: none;
}

html.mobile-details td.desc {
  gap: .5rem;
}

html.mobile-details .article-row:hover td.desc b::after,
html.mobile-details .article-row.expanded td.desc b::after {
  display: none;
}

html.mobile-details .details-row td {
  padding-left: 0;
}

html.mobile-details .details-row td:not(:first-child) {
  display: none;
}

html.mobile-details .details-content {
  padding-left: 0.5rem;
}
