* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: #f3f4f6;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
}

a {
  color: #2563eb;
}

.page {
  flex: 1;
  padding: 32px 16px 40px;
}

.site-footer {
  padding: 20px 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  text-align: center;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.site-footer__link {
  color: #4b5563;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-footer__link:hover {
  color: #2563eb;
}

.page__inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hero {
  margin-bottom: 24px;
}

.hero__eyebrow {
  margin: 0 0 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.2;
}

.hero__lead {
  margin: 0;
  color: #4b5563;
}

.panel {
  margin-top: 20px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.panel--structure {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.panel--error {
  border-color: #fecaca;
  background: #fff7f7;
}

.form__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.form__row {
  display: flex;
  gap: 12px;
}

.form__input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
}

.form__input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form__button {
  padding: 14px 20px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.form__button:hover {
  background: #1d4ed8;
}

.form__button--secondary {
  background: #0f766e;
}

.form__button--secondary:hover {
  background: #0f5d57;
}

.form__help {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.form__subdomain {
  margin-top: 18px;
}

.form__subdomain-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.form__counter {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
}

.tag-input:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

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

.tag-input__tag {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
}

.tag-input__remove {
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.tag-input__field {
  flex: 1;
  min-width: 180px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  font-size: 16px;
}

.tag-input__field:focus {
  outline: none;
}

.tag-input__field::placeholder {
  color: #9ca3af;
}

.form__feedback {
  min-height: 22px;
  margin: 8px 0 0;
  color: #b45309;
  font-size: 13px;
  font-weight: 700;
}

.candidate-picker {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}

.candidate-picker__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.candidate-picker__action {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.candidate-picker__action:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.candidate-picker__action--select-all {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.candidate-picker__action--select-all:hover {
  border-color: #60a5fa;
  background: #dbeafe;
  color: #1d4ed8;
}

.candidate-picker__action--clear-all {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.candidate-picker__action--clear-all:hover {
  border-color: #f87171;
  background: #fee2e2;
  color: #b91c1c;
}

.message {
  margin: 0;
}

.message--error {
  color: #b91c1c;
  font-weight: 700;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-heading__title {
  margin: 0 0 4px;
  font-size: 24px;
}

.section-heading__meta {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.structure-map {
  width: min(860px, 100%);
  margin: 0 auto;
}

.structure-map__lead {
  margin: 0 0 18px;
  color: #4b5563;
  font-size: 14px;
}

.structure-map__note {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

.structure-list {
  position: relative;
  display: grid;
  gap: 16px;
  padding-left: 26px;
}

.structure-overview__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.structure-list::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: linear-gradient(180deg, #bfdbfe 0%, #dbeafe 100%);
}

.structure-card {
  position: relative;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.structure-card::before {
  content: '';
  position: absolute;
  top: 28px;
  left: -18px;
  width: 18px;
  height: 2px;
  background: #bfdbfe;
}

.structure-card__eyebrow {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.structure-card__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  word-break: break-word;
}

.structure-card__description {
  margin: 10px 0 16px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
}

.structure-role-card {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
}

.structure-card--wildcard-hint .structure-role-card {
  background: #fffbeb;
  border-color: #fde68a;
}

.structure-role-card__summary {
  display: grid;
  gap: 4px;
  margin: 0;
  color: #111827;
  line-height: 1.5;
}

.structure-role-card__label {
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.structure-role-card__provider {
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  word-break: break-word;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.detail-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.detail-card__title {
  margin: 0 0 8px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}

.detail-card__value {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.export {
  margin-top: 20px;
}

.export__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form__button--detail {
  background: #374151;
}

.form__button--detail:hover {
  background: #1f2937;
}

.notice-list {
  margin: 0;
  padding-left: 20px;
}

.notice-list li + li {
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.55);
}

.modal-card {
  width: min(560px, 100%);
  padding: 24px;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.modal-card__eyebrow {
  margin: 0 0 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.modal-card__title {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
}

.modal-card__message {
  margin: 12px 0 0;
  color: #111827;
  font-size: 15px;
  line-height: 1.7;
}

.modal-card__note {
  margin: 12px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.modal-card__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.record-group + .record-group {
  margin-top: 24px;
}

.record-group__title {
  margin: 0 0 12px;
  font-size: 20px;
}

.record-block + .record-block {
  margin-top: 16px;
}

.record-block__title {
  margin: 0 0 10px;
  font-size: 16px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.data-table--dns {
  table-layout: fixed;
}

.data-table__col--class {
  width: 8%;
}

.data-table__col--host {
  width: 22%;
}

.data-table__col--pri {
  width: 8%;
}

.data-table__col--target {
  width: 24%;
}

.data-table__col--ip {
  width: 20%;
}

.data-table__col--ttl {
  width: 8%;
}

.data-table__col--type {
  width: 10%;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  word-break: break-word;
}

.data-table th {
  background: #f9fafb;
  font-weight: 700;
}

.empty-text {
  margin: 0;
  color: #6b7280;
}

.whois-raw {
  margin-top: 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #f9fafb;
}

.whois-raw__summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.whois-raw__summary::-webkit-details-marker {
  display: none;
}

.whois-raw__summary::before {
  content: '＋';
  margin-right: 8px;
}

.whois-raw[open] .whois-raw__summary::before {
  content: '－';
}

.whois-raw__content {
  margin: 0;
  padding: 0 16px 16px;
  overflow-x: auto;
  color: #111827;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  padding: 0 6px;
  background: #eff6ff;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 767px) {
  .page {
    padding: 20px 12px 32px;
  }

  .site-footer {
    padding: 16px 12px 20px;
  }

  .panel {
    padding: 18px;
    border-radius: 14px;
  }

  .form__row {
    flex-direction: column;
  }

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

  .form__button {
    width: 100%;
  }

  .export__actions form {
    width: 100%;
  }

  .modal-card {
    padding: 20px;
    border-radius: 16px;
  }

  .modal-card__title {
    font-size: 22px;
  }

  .modal-card__actions form {
    width: 100%;
  }

  .structure-list {
    padding-left: 18px;
  }

  .structure-card {
    padding: 16px;
  }

  .structure-card::before {
    left: -14px;
    width: 14px;
  }

  .structure-overview__grid {
    grid-template-columns: 1fr;
  }

  .structure-role-card {
    padding: 16px;
  }
}
