:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1a2433;
  --ink-soft: #5b6675;
  --line: #e3e7ee;
  --brand: #15426b;
  --brand-2: #1e6091;
  --accent: #c79a3a;
  --green: #1f9d55;
  --amber: #d98e04;
  --red: #d23b3b;
  --gray: #9aa3b0;
  --shadow: 0 1px 3px rgba(20,40,70,.08), 0 4px 16px rgba(20,40,70,.06);
}

* { box-sizing: border-box; }
/* Elements styled with display: flex/grid must still disappear when hidden
   (an empty notice bar and the Euronext-only ISIN field used to show). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 22px;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; display: block; flex: none;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.18));
}
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: .3px; }
.subtitle { margin: 0; font-size: 12px; opacity: .85; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.meta { text-align: right; font-size: 12px; opacity: .92; }
.meta-line { white-space: nowrap; }

/* ---- Buttons ---- */
.btn {
  font: inherit; cursor: pointer; border: none; border-radius: 8px;
  padding: 9px 16px; font-weight: 600; transition: all .15s ease;
}
.btn-sort {
  background: #fff; color: var(--ink-soft); border: 1px solid var(--line);
  padding: 7px 13px; font-weight: 500;
}
.btn-sort.active, .btn-sort:hover { border-color: var(--brand-2); color: var(--brand); }
.arrow { font-size: 11px; opacity: .7; }

/* ---- Market badges ---- */
.badges { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 22px 0; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 5px 13px 5px 10px; font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow); cursor: default;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }
.dot.gray { background: var(--gray); }
.badge .b-count { color: var(--ink-soft); font-weight: 500; }
.badge.has-msg { cursor: help; }

/* ---- Toolbar ---- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 22px 6px; flex-wrap: wrap;
}
.sort-group { display: flex; align-items: center; gap: 8px; }
.sort-label { color: var(--ink-soft); font-size: 13px; }
.hint { color: var(--ink-soft); font-size: 12.5px; }

/* ---- Table ---- */
main { padding: 8px 22px 60px; overflow-x: auto; }
/* min-width: the fixed column widths below (and .col-title's minimum) add up
   to 1202px; auto table layout never makes those columns narrower. */
.filings-table {
  width: 100%; min-width: 1202px; border-collapse: collapse; background: var(--card);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.filings-table thead th {
  background: #eef1f6; color: var(--ink-soft); text-align: left;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 11px 14px; border-bottom: 2px solid var(--line); white-space: nowrap;
}
.filings-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.col-sn { width: 42px; color: var(--ink-soft); }
.col-company { width: 290px; }
.col-market { width: 84px; }
.col-mcap { width: 106px; text-align: right; }
.col-type { width: 122px; }
.col-title { min-width: 360px; }
.col-date {
  width: 112px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.col-ticker {
  width: 86px; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-soft);
}

/* Company groups: emphasize the first row of each group. */
tr.group-start td { border-top: 2px solid #d7dde7; }
td.company-cell { font-weight: 600; }
td.company-cell a { color: var(--brand-2); text-decoration: none; }
td.company-cell a:hover { text-decoration: underline; }
.company-actions { margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.company-actions > * { white-space: nowrap; }
.btn-hide {
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--ink-soft); padding: 2px 8px;
}
.btn-hide:hover { border-color: var(--red); color: var(--red); background: #fff7f7; }
.company-warn { color: var(--amber); font-size: 12px; font-weight: 600; margin-top: 3px; }
.company-fail { color: var(--red); font-size: 12px; font-weight: 600; margin-top: 3px; }
.company-stale { color: var(--ink-soft); font-size: 11.5px; margin-top: 3px; }

td.mcap-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mcap-na { color: var(--gray); font-weight: 400; }

.market-tag {
  display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px;
  font-weight: 600; background: #eef3f8; color: var(--brand-2);
}
.type-tag {
  display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11.5px;
  font-weight: 600; white-space: nowrap;
}
.type-ANNUAL { background: #fbecd0; color: #8a6310; }
.type-INTERIM { background: #d7eafb; color: #1e5a8a; }
.type-QUARTERLY { background: #e0f3e6; color: #1f7a45; }
.type-TRADING_STATEMENT { background: #efe3f7; color: #6b3a91; }
.type-OTHER { background: #eceff3; color: #5b6675; }

.title-main { color: var(--ink); margin-bottom: 5px; }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-link {
  font-size: 12px; text-decoration: none; padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--brand-2); background: #fff; white-space: nowrap;
}
.file-link:hover { border-color: var(--brand-2); background: #f3f7fb; }
.file-link.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.file-link.primary:hover { filter: brightness(1.1); }
.file-link.disabled { color: var(--gray); border-style: dashed; pointer-events: none; }

.no-data { color: var(--ink-soft); font-style: italic; }
.empty-state { text-align: center; color: var(--ink-soft); padding: 50px 20px; }

/* ---- Filters ---- */
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.f-input {
  font: inherit; font-size: 13px; width: 108px; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.f-date { width: 140px; }
.f-input:focus { outline: none; border-color: var(--brand-2); }
.f-input.f-invalid { border-color: var(--red); background: #fff7f7; }
.company-actions .file-link.btn-mini { font-size: 11.5px; padding: 2px 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.f-num { width: 96px; }
.f-date { width: 130px; cursor: pointer; background: #fff; }

/* ---- Date picker ---- */
.datepicker {
  position: absolute; z-index: 70; width: 250px; padding: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  font-size: 13px; user-select: none;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.dp-nav {
  font: inherit; font-size: 16px; width: 28px; height: 28px; border: none; border-radius: 6px;
  background: none; cursor: pointer; color: var(--brand);
}
.dp-nav:hover:not(:disabled) { background: #eef1f6; }
.dp-nav:disabled { color: var(--gray); cursor: default; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-dow { font-size: 11px; font-weight: 700; color: var(--ink-soft); padding: 3px 0; }
.dp-day {
  font: inherit; border: none; border-radius: 6px; padding: 5px 0; background: none;
  cursor: pointer; color: var(--ink);
}
.dp-day:hover:not(:disabled) { background: #eef1f6; }
.dp-day:disabled { color: #c3c9d2; cursor: not-allowed; }
.dp-day.dp-today { font-weight: 700; color: var(--brand-2); }
.dp-day.dp-selected { background: var(--brand); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.dp-link { font: inherit; font-weight: 600; color: var(--brand-2); background: none; border: none; cursor: pointer; padding: 2px 4px; }
.dp-link:hover { text-decoration: underline; }

/* One fixed line under the filters, so its text never moves the filters. */
.status-line {
  height: 20px; line-height: 20px; padding: 0 22px; margin-top: 2px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Hide and update notices under the filters. */
.hint-row { display: flex; align-items: center; gap: 10px; padding-right: 22px; }
.hint-row .status-line { flex: 1; min-width: 0; }
.hint-row .btn { font-size: 12.5px; padding: 3px 10px; }
.notice {
  margin: 6px 22px 0; padding: 8px 12px; border-radius: 8px; font-size: 13px;
  background: #f1f6fc; border: 1px solid #d5e3f3; color: var(--ink);
}
.notice .btn { font-size: 12.5px; padding: 3px 10px; margin-left: 8px; }

/* ---- Filters: same weight as the Sort row, roomier ---- */
/* Same grey and weight as the Sort row's buttons. */
.filter-group .sort-label { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.filter-group .f-input { font-size: 14px; font-weight: 500; color: var(--ink-soft); padding: 7px 10px; }
.filter-group .f-num { width: 120px; }
.filter-group .f-date { width: 150px; }
.filter-group .filter-gap { margin-left: 26px; }

/* ---- Feedback, footer, analytics banner, Privacy page ---- */
.btn-feedback {
  color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.55); border-radius: 8px; padding: 5px 12px; white-space: nowrap;
}
.btn-feedback:hover { background: rgba(255,255,255,.14); }
.site-footer { padding: 18px 22px 28px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.site-footer a, .text-body a { color: var(--brand-2); }
.btn-feedback { background: transparent; font-family: inherit; cursor: pointer; }
.btn-primary { background: var(--brand-2); color: #fff; }
.btn-primary:hover { background: var(--brand); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.link-button { font: inherit; color: var(--brand-2); background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; }
.feedback-dialog {
  width: min(460px, calc(100% - 32px)); border: none; border-radius: 12px; padding: 20px 22px;
  box-shadow: var(--shadow); color: var(--ink);
}
.feedback-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.feedback-dialog h2 { margin: 0 0 6px; font-size: 18px; }
.feedback-dialog label { display: block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.feedback-dialog input, .feedback-dialog textarea {
  display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px;
  font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; resize: vertical;
}
.feedback-dialog input:focus, .feedback-dialog textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
.fb-note, .fb-optional { color: var(--ink-soft); font-size: 13px; font-weight: 400; margin: 0; }
.fb-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#fb-turnstile:not(:empty) { margin-top: 12px; }
.fb-status { min-height: 1.4em; margin: 10px 0 0; font-size: 13px; color: #b42318; }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.text-page { background: var(--card); }
.text-body { max-width: 680px; margin: 0 auto; padding: 24px 16px 48px; font-size: 15px; line-height: 1.6; }
.text-body h1 { font-size: 24px; margin: 16px 0 8px; }
.text-body h2 { font-size: 17px; margin: 24px 0 4px; }

/* ---- Phones ---- */
/* The update times go under the title instead of being cut off, the header
   scrolls away instead of covering the top of the screen, and the status line
   wraps instead of ending in "…". */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 12px 22px; position: static; }
  .meta { text-align: left; }
  .meta-line { white-space: normal; }
  .status-line { height: auto; white-space: normal; }
}
