:root {
  --bg: #0b0f14;
  --card: #111824;
  --text: #e8eef7;
  --muted: #9fb0c6;
  --line: #1e2a3c;
  --btn: #2b76ff;
  --btn2: #2a3447;
  --danger: #ff3b3b;
  --ok: #2ad17f;
  --no: #ff3b3b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 20% 0%, #15243a, var(--bg));
  color: var(--text);
}

.hidden { display: none !important; }
.wrap { width: 100%; margin: 24px 0; padding: 0 14px; }
.header { margin-bottom: 14px; }
.title { margin: 0; font-size: 28px; }
.subtitle { margin: 4px 0 0; color: var(--muted); }

.card {
  background: rgba(17,24,36,.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.auth_gate { display: grid; place-items: center; min-height: 100vh; }
.gate_card { min-width: min(95vw, 460px); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.input {
  width: 380px;
  max-width: 100%;
  background: #0e1521;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
}
.input:focus { outline: 2px solid rgba(43,118,255,.3); }

.btn {
  background: var(--btn);
  color: white;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn_secondary { background: var(--btn2); }
.btn_danger { background: rgba(255,59,59,.16); border-color: rgba(255,59,59,.3); color: #ffd5d5; }
.btn_xs { padding: 6px 9px; border-radius: 8px; }

.h2 { margin: 0 0 6px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.status { color: var(--muted); margin-top: 10px; }

.top_grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.table_meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filters_wrap { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.tag_filter_label { color: var(--muted); font-size: 12px; }
.tag_filter_select { width: 180px; padding: 8px 10px; }
.chip {
  border: 1px solid var(--line);
  color: #d7e6ff;
  background: transparent;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}
.chip.active {
  background: rgba(42, 209, 127, .16);
  border-color: rgba(42, 209, 127, .4);
}

.table_wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.saved_views_section {
  margin-top: 100px;
  margin-bottom: 100px;
}

.saved_views_list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved_view_name_row {
  margin-bottom: 12px;
}

#view_filename {
  width: min(520px, 100%);
}

.saved_view_item a {
  color: #9ec4ff;
}

.save_view_fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.table { width: 100%; border-collapse: collapse; min-width: 1220px; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { text-align: left; background: rgba(13,18,28,.95); }
th.sortable { cursor: pointer; user-select: none; }

.domain_sep { border-left: 2px solid rgba(255,255,255,.08); }
.trademark_sep { border-left: 2px solid rgba(255,255,255,.08); }
.actions_col {
  border-left: 2px solid rgba(255,255,255,.08);
  min-width: 160px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.check_cell { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.domain_name { color: var(--muted); font-size: 12px; font-weight: 700; }
.res {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.1);
}
.res_ok { color: #bfffe3; border-color: rgba(42,209,127,.35); background: rgba(42,209,127,.12); }
.res_no { color: #ffd1d1; border-color: rgba(255,59,59,.35); background: rgba(255,59,59,.12); }

tr.processing { opacity: .45; transition: opacity .2s ease; }
.tag_input { width: 220px; margin-bottom: 6px; }
.similar_marks { max-width: 360px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 980px) {
  .top_grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 10px; }
  .actions_top { display: flex; gap: 8px; flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .title { font-size: 24px; }
  .card { padding: 12px; }
  .input { width: 100%; }
  .row > .btn { width: 100%; }
  .table_meta { flex-direction: column; align-items: stretch; }
  .filters { width: 100%; }
  .filters_wrap { width: 100%; }
  .tag_filter_select { width: 100%; }
}

@media (max-width: 540px) {
  .wrap { margin: 14px 0; padding: 0 8px; }
  th, td { padding: 8px; }
}
