@font-face {
  font-family: "PolymathText";
  src: url("Assets/Font/PolymathText-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PolymathText";
  src: url("Assets/Font/PolymathText-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "PolymathText";
  src: url("Assets/Font/PolymathText-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PolymathText";
  src: url("Assets/Font/PolymathText-SemiboldIt.otf") format("opentype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #060606;
  --bg-accent: #060606;
  --card: #121212;
  --ink: #f9f9f9;
  --muted: #b5b5b5;
  --line: #292929;
  --primary: #404040;
  --primary-soft: #1b1b1b;
  --ghost: #404040;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "PolymathText", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #060606;
  overflow: hidden;
}

.bg {
  min-height: 100vh;
  padding: 24px;
  height: 100%;
}

.hero {
  max-width: 1240px;
  margin: 0 auto 40px;
}

.hero h1 {
  font-size: clamp(2.3rem, 3.2vw, 3.6rem);
  margin: 12px 0 10px;
  letter-spacing: -0.02em;
}

.hero p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.header-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header-logo {
  height: 20px;
  width: auto;
  color: #9e9e9e;
  margin-bottom: 12px;
}

.layout {
  display: grid;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.layout.full {
  max-width: 100%;
  height: 100%;
}

.layout.split {
  grid-template-columns: minmax(280px, 30%) minmax(0, 70%);
  align-items: start;
  height: 100%;
}

.card {
  background: var(--card);
  border: none;
  border-radius: 16px;
  padding: 24px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.header-card h1 {
  font-size: 1.6rem;
  margin: 10px 0 6px;
  letter-spacing: -0.01em;
}

.header-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-head h2 {
  margin: 0;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.grid.two {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stack {
  display: grid;
  gap: 16px;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f0f0f;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  resize: vertical;
  color: var(--ink);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.panel {
  height: 100%;
}

.output-panel {
  overflow: auto;
}

.left-col {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  height: 100%;
  min-height: 0;
}

.input-panel {
  flex: 1;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

.input-panel .stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#inputTableWrap {
  flex: 1 1 auto;
  overflow: auto;
  position: relative;
  min-height: 0;
}

#inputTableWrap::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  display: block;
  height: 28px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0), #121212);
  pointer-events: none;
}

.output-panel .table-wrap::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  display: block;
  height: 28px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0), #121212);
  pointer-events: none;
}

#inputTableWrap thead th {
  position: sticky;
  top: 0;
  background: #151515;
  z-index: 1;
}

#outputTable thead th {
  position: sticky;
  top: 0;
  background: #151515;
  z-index: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 680px;
}

thead {
  background: #151515;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.align-right {
  text-align: right;
}

td input {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  padding: 2px 0;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent);
}

td input:focus {
  outline: none;
  background: #141414;
}

.row-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn,
.file-button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  border: none;
  cursor: pointer;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 18px;
  background: #404040;
  color: #f9f9f9;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 40px;
  line-height: 1;
}

.btn:hover,
.file-button.btn:hover {
  background: #4a4a4a;
}

.btn-primary {
  background: var(--primary);
  color: #f9f9f9;
}

.btn-primary:hover {
  background: #4a4a4a;
}

.btn-remove:hover {
  background: #3a1f1f;
  color: #f9f9f9;
}

.btn-remove svg {
  width: 16px;
  height: 16px;
  display: block;
}

.btn-icon {
  padding: 10px;
  min-width: 40px;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-ghost {
  background: #404040;
}

.file-button input {
  display: none;
}

.file-button.btn {
  appearance: none;
  margin-bottom: 0;
}

button.btn {
  appearance: none;
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hint.subtle {
  margin-top: 6px;
  font-size: 0.8rem;
  display: none;
}

.search-targets {
  display: grid;
  gap: 10px;
}

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

.target-btn.is-active {
  background: #9e9e9e;
}

.target-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.custom-url {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f0f0f;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.custom-url:focus {
  outline: none;
  background: #141414;
}

.custom-url.show-hint + .hint.subtle {
  display: block;
}


.btn-status {
  min-width: 132px;
}

#outputTable .status-col {
  width: 142px;
  min-width: 142px;
}

#outputTable th:last-child,
#outputTable td:last-child {
  width: 56px;
  min-width: 56px;
  padding-right: 16px;
}

.btn-status.done {
  background: #f9f9f9;
  color: #060606;
}

.btn-status.done:hover {
  background: #f9f9f9;
}

.btn-status.skipped {
  background: #2a2a2a;
  color: #f9f9f9;
}

.btn-status:hover {
  background: #4a4a4a;
}


.hidden {
  display: none;
}

@media (max-width: 720px) {
  .card {
    padding: 18px;
  }

  table {
    min-width: 560px;
  }
}

@media (max-width: 1020px) {
  .layout.split {
    grid-template-columns: 1fr;
  }
}
