:root {
  --bg: #f8f8f8;
  --surface: #ffffff;
  --surface-2: #fbfbfb;
  --text: #1c2430;
  --text-muted: #74829a;
  --border: #e8e8e8;
  --accent: #111827;
  --accent-strong: #000000;
  --accent-soft: rgba(17, 24, 39, 0.08);
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  --shadow-soft: 0 4px 14px rgba(15, 23, 42, 0.04);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Inter", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}

.page-nav {
  margin-bottom: 46px;
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  text-align: center;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.brand-block {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.nav-header-spacer {
  display: none;
}

.brand-heading {
  margin: 0;
  font: inherit;
  line-height: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.05;
  text-decoration: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
}

.site-subtitle {
  margin: 14px 0 30px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.icon-button,
.button-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button:not(.btn-outline):not(.language-trigger) > .icon,
.register-btn > .icon {
  filter: invert(1);
}

.export-link > .icon {
  filter: none;
}

.nav-menu {
  margin: 0;
  justify-content: center;
}

.mobile-menu-button,
.mobile-nav-overlay,
.mobile-nav-drawer {
  display: none;
}

.page-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  padding: 72px 0 64px;
}

.language-picker {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 20;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  color: #52637a;
  font-size: 13px;
  font-weight: 600;
}

.language-trigger:hover,
.language-trigger:focus-visible,
.language-picker.open .language-trigger {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.58);
}

.language-trigger .icon {
  width: 16px;
  height: 16px;
}

.language-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.16s ease;
}

.language-picker.open .language-chevron {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 118px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.language-option {
  display: block;
  padding: 7px 9px;
  border-radius: 4px;
  color: #52637a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.language-option:hover,
.language-option.active {
  color: var(--text);
  background: var(--surface-2);
}

.site-footer {
  margin-top: auto;
  padding-top: 34px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.footer-links a:hover {
  color: var(--text);
}

.container {
  display: flex;
  flex: 1;
  flex-direction: column;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
}

.tool-title {
  display: none;
  margin: 18px 0 42px;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.query-card {
  padding: 20px;
  margin-bottom: 20px;
}

.faq-panel {
  border: 1px dashed #d9dde5;
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  margin-bottom: 20px;
  background: transparent;
}

.faq-header {
  margin-bottom: 10px;
}

.faq-list {
  display: grid;
  gap: 0;
}

.faq-item {
  border-top: 1px dashed #e3e7ee;
  padding: 11px 0;
}

.faq-item:first-child {
  border-top: none;
}

.faq-item h3 {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.faq-item p {
  margin: 5px 0 0;
  color: #6f7b8f;
  font-size: 13px;
  line-height: 1.75;
}

.result-card {
  padding: 20px;
}

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

.result-header {
  min-height: 32px;
  margin-bottom: 12px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.mode-row {
  gap: 8px;
  margin: 0;
}
.mode-form-row {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  width: 100%;
  align-items: flex-start;
  column-gap: 12px;
  row-gap: 12px;
  flex-wrap: wrap;
  box-shadow: none;
}
.mode-form-row label {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  min-width: 0;
}

.op-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  color: var(--text-muted);
  padding: 0;
  font-weight: 500;
  width: 12px;
}

.mode-form-row input,
.mode-form-row select,
.mode-form-row textarea {
  flex: 1 1 auto;
  min-width: 0;
}

.mode-form-row textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: 13px/1.5 var(--mono);
  resize: vertical;
}

.mode-form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}

.form-break {
  flex-basis: 100%;
  height: 1px;
  background: #f1f1f1;
  margin: 2px 0;
}

.query-preview {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#runBtn,
#runBtnAll,
#runBtnBulk,
#runBtnHack {
  flex: 0 0 auto;
  margin-left: auto;
}
.mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
}
.mode-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-option.active {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}
.mode-option:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.mode-option.active:hover {
  color: #1d4ed8;
  background: #dbeafe;
}

.mode-option:visited,
.mode-option:focus {
  text-decoration: none;
}

#pagerRow {
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 0;
}

input,
select {
  padding: 10px 12px;
  font-size: 14px;
  height: 40px;
  line-height: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:focus {
  background: #fff;
}

select:focus {
  background-color: #fff;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-image: url("../assets/icons/chevron-down.svg");
  background-position: calc(100% - 12px) 50%;
  background-size: 18px 18px;
  background-repeat: no-repeat;
}

select.select-open {
  background-image: url("../assets/icons/chevron-up.svg");
}

button {
  padding: 0 18px;
  font-size: 13px;
  height: 40px;
  line-height: 40px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.04s ease;
  box-shadow: none;
}

button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-outline {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.export-row {
  justify-content: flex-end;
  margin: 0;
}

.export-link {
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.export-link:visited {
  color: #2563eb;
}

.export-link:hover,
.export-link:focus {
  color: #1d4ed8;
  text-decoration: none;
}

.pager-link {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent);
  padding: 0 12px;
  height: 32px;
  line-height: 1;
  font-size: 13px;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.pager-link:hover {
  background: var(--surface-2);
  border-color: #d8dce3;
}

.pager-link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#pageInfo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

#tldInput { min-width: 120px; width: 140px; }
#wordCategory {
  flex: 0 1 140px;
  min-width: 140px;
}
#runBtn,
#runBtnAll,
#runBtnBulk,
#runBtnHack {
  width: 120px;
}
#prefixInput,
#suffixInput {
  width: auto;
  flex: 1 1 160px;
  max-width: none;
}

.tld-block {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 220px;
  min-width: 220px;
}

#allTldBlock {
  flex-basis: 360px;
  min-width: 320px;
}

.tld-presets {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.tld-preset {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  box-shadow: none;
}

.tld-preset:hover {
  background: var(--surface-2);
  border-color: #d8dce3;
  color: var(--text);
}

.tld-input-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
}

.dropdown {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border-radius: 10px;
  z-index: 10;
  display: none;
  padding: 4px;
}

.dropdown-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 8px;
  color: var(--text);
}

.dropdown-item:hover { background: var(--surface-2); }

.tld-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  max-width: 100%;
}
.tld-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  height: 28px;
  line-height: 1;
  box-shadow: none;
  overflow: hidden;
}
.tld-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  margin-right: -10px;
  margin-left: 10px;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  height: 100%;
  line-height: 1;
  box-shadow: none;
}
.tld-chip .tld-chip-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  height: 100%;
}
.tld-chip-preset {
  background: var(--surface-2);
  border-color: #d8dce3;
  padding: 0;
}
.tld-chip-preset button {
  margin-left: 0;
}
.tld-chip-preset button:last-child {
  margin-right: 0;
}
.tld-chip button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tld-chip-muted {
  padding: 0 10px;
  color: var(--text-muted);
  background: var(--surface-2);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-top: 0;
  overflow: hidden;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  line-height: 1;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.empty-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-muted);
  text-align: center;
  padding: 32px 20px;
}

.empty-state-icon {
  width: 28px;
  height: 28px;
  opacity: 0.5;
}

.empty-state-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.empty-state-text {
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid #f1f1f1;
  padding: 0 14px;
  text-align: left;
  font-size: 13px;
  height: 48px;
  line-height: 1;
  vertical-align: middle;
}

th {
  background: #fbfbfb;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}

thead th {
  border-bottom-color: #f1f1f1;
}

tr:last-child td {
  border-bottom: none;
}

.mono { font-family: var(--mono); }
.muted-cell { color: var(--text-muted); }

th:first-child,
td:first-child {
  font-family: var(--mono);
  max-width: 260px;
}

th:nth-child(2),
td:nth-child(2) { max-width: 210px; }
th:last-child,
td:last-child {
  width: 1%;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
}

.status-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  line-height: 1;
}

.status-text {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  line-height: 1;
  vertical-align: middle;
}
.status-text.ok { color: #1f9d62; }
.status-text.bad { color: #d23a3a; }
.status-text.warn { color: #b7791f; }
.status-text.fail { color: #6b7280; }
.status-text.loading { color: var(--text-muted); }
.status-ok { background: #21b26f; }
.status-bad { background: #e34a4a; }
.status-warn { background: #f0ad4e; }
.status-fail { background: #8a93a3; }

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(31, 42, 58, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hint-text {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  margin-left: 6px;
  vertical-align: middle;
}

.whois-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.whois-link {
  display: inline-flex;
  align-items: center;
  color: #52637a;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  vertical-align: middle;
}

.whois-separator {
  color: #c2c8d2;
  font-size: 13px;
  line-height: 1;
}

.whois-link:visited {
  color: #52637a;
}

.whois-link:hover,
.whois-link:focus {
  color: #1f2937;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.register-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
}
.register-btn .icon {
  display: block;
  width: 14px;
  height: 14px;
}
.register-btn span {
  line-height: 1;
}
.register-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.2);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
