body {
  background: #0d112f;
  color: #fff;
  font-family: "Urbanist", sans-serif;
  margin: 0;
}

/* Wrapper */
.formatter-wrapper {
  max-width: 1150px;
  margin: 100px auto;
  padding: 0 16px;
}

.formatter-wrapper h1 {
  font-size: 34px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
}

.tool-description {
  text-align: center;
  font-size: 16px;
  color: #b3b9d1;
  margin-bottom: 25px;
}

/* Suggested cards */
.formatter-tool-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 12px 4px 24px;
  scrollbar-width: none;
}
.formatter-tool-row::-webkit-scrollbar {
  display: none;
}

.formatter-tool-card {
  min-width: 220px;
  background: radial-gradient(circle at top, #1f2145 0, #050814 70%);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(124, 58, 237, 0.42);
  text-align: left;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7), 0 26px 55px rgba(0, 0, 0, 0.8);
  transition: 0.3s ease;
}
.formatter-tool-card:hover {
  transform: translateY(-8px);
  border-color: #9c4bff;
  box-shadow: 0 38px 85px rgba(0, 0, 0, 0.92);
}

.icon-box {
  font-size: 32px;
  margin-bottom: 8px;
}
.icon-box.primary { color: #38bdf8; }
.icon-box.secondary { color: #22c55e; }
.icon-box.accent { color: #a855f7; }

.formatter-tool-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
}
.card-desc {
  font-size: 12px;
  color: #9aa3c5;
  margin-bottom: 12px;
}

/* Layout */
.converter-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.3fr;
  gap: 22px;
}

.left-panel,
.right-panel {
  background: #0a0f2c;
  border-radius: 14px;
  border: 1px solid #1f2947;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Fields */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: #b3b9d1;
}

input[type="text"],
input[type="number"],
input[type="color"],
select {
  background: #11192f;
  border-radius: 8px;
  border: 1px solid #334155;
  padding: 8px 10px;
  font-size: 14px;
  color: #e5e7ff;
}

input[type="range"] {
  width: 100%;
}

input[type="file"] {
  font-size: 11px;
  color: #e5e7ff;
}

.hint-text {
  font-size: 12px;
  color: #94a3b8;
}
.hint-text.tiny {
  font-size: 11px;
}

.error-text {
  font-size: 11px;
  color: #f97373;
}

/* Checkbox label */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cbd5f5;
}

.align-bottom {
  justify-content: flex-end;
}

/* Buttons */
.btn-tool {
  background: #7c3aed;
  padding: 9px 10px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s;
  text-align: center;
}
.btn-tool:hover {
  background: #6d28d9;
}

.btn-tool.primary {
  background: #22c55e;
}
.btn-tool.primary:hover {
  background: #16a34a;
}

.btn-tool.danger {
  background: #f73d5d;
}
.btn-tool.danger:hover {
  background: #dc2626;
}

.btn-tool.small {
  padding: 6px 8px;
  font-size: 12px;
}

.btn-tool:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Button rows */
.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Preview / summary card */
.preview-card {
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

#summaryHostLabel {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: #e5e7ff;
}

/* TLS summary grid */
.tls-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-item {
  background: radial-gradient(circle at top left, #1e293b 0, #020617 60%);
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 11px;
  color: #9ca3c5;
}

.summary-value {
  font-size: 14px;
  font-weight: 700;
  color: #e5e7ff;
}

.preview-meta {
  font-size: 12px;
  color: #9ca3c5;
  margin: 0;
}

/* TLS detail cards */
.tls-detail-card {
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tls-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tls-detail-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

/* Tables */
.tls-table-wrapper {
  border-radius: 8px;
  border: 1px solid #111827;
  overflow: hidden;
  background: #020617;
}

.tls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tls-table thead {
  background: #020617;
}

.tls-table th,
.tls-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #111827;
  text-align: left;
}

.tls-table th {
  font-weight: 600;
  color: #9ca3c5;
  font-size: 11px;
}

.tls-table td {
  color: #e5e7ff;
}

.tls-table-empty {
  text-align: center;
  color: #9ca3c5;
}

/* Issues list */
.tls-issues-list {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #e5e7ff;
}

.tls-issues-list li {
  margin-bottom: 4px;
}

.tls-issue-empty {
  list-style: none;
  padding-left: 0;
  color: #9ca3c5;
}

/* Raw JSON */
.cipher-raw {
  background: #0d0f28;
  border: 1px solid #1f2937;
  border-radius: 6px;
  font-size: 12px;
  padding: 10px;
  max-height: 220px;
  overflow-y: auto;
  color: #94a3b8;
}

/* Gallery */
.gallery-wrapper {
  margin-top: 14px;
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gallery-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.gallery-empty {
  font-size: 12px;
  color: #9ca3c5;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.gallery-card {
  background: #020617;
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-thumb {
  background: #020617;
  border-radius: 8px;
  border: 1px solid #111827;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
}

/* Grade pill */
.grade-pill {
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  border: 2px solid #1f2937;
}
.grade-good {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.grade-ok {
  background: rgba(163, 230, 53, 0.15);
  color: #a3e635;
}
.grade-warn {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}
.grade-bad {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.grade-unknown {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5f5;
}

.gallery-meta {
  font-size: 11px;
  color: #cbd5f5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-meta .type {
  font-weight: 600;
}

.gallery-meta .data {
  color: #9ca3c5;
}

.gallery-meta .time {
  color: #64748b;
  font-size: 10px;
}

.gallery-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* Status */
.status-msg {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  color: #9aa3c5;
}

/* Responsive */
@media (max-width: 900px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }

  .btn-row {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .tls-summary-grid {
    grid-template-columns: 1fr;
  }
}
