:root {
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-accent: #1f6feb;
  --color-accent-soft: rgba(31, 111, 235, 0.08);
  --color-text-main: #112033;
  --color-text-muted: #6b7280;
  --color-border-subtle: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.05);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top left, #eef2ff 0, #f9fafb 45%, #f5f7fb 100%);
  color: var(--color-text-main);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0.8)
    );
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.app-title {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 20px 12px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-title::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ffffff, #1f6feb);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.16);
}

.app-main {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px 32px;
}

.tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px;
  border-radius: 999px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid rgba(226, 232, 240, 0.9);
  gap: 2px;
}

.tab {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.08s ease;
}

.tab.active {
  background: var(--color-accent);
  color: #f9fafb;
  box-shadow: 0 8px 20px rgba(31, 111, 235, 0.35);
}

.tab:not(.active):hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.03);
  color: var(--color-text-main);
}

.tab.disabled {
  opacity: 0.55;
  cursor: default;
}

.tab-panel {
  display: none;
  margin-top: 20px;
}

.tab-panel.active {
  display: block;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.card-imds {
  width: 1100px;
  max-width: 100%;
  margin-inline: auto;
}

.card-title {
  margin: 2px 0 2px;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.card-subtitle {
  margin: 0 0 18px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.form {
  margin-bottom: 18px;
}

.form-spacer {
  height: 8px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field-row.mod-part-row > * {
  flex: 1;
}

.text-input {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  padding: 9px 11px;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  background: #f9fafb;
}

.text-input::placeholder {
  color: #9ca3af;
}

.text-input:focus {
  outline: none;
  border-color: rgba(31, 111, 235, 0.75);
  box-shadow: 0 0 0 1px rgba(31, 111, 235, 0.35);
  background: #ffffff;
}

.display-field {
  background: #fffbe6;
  font-weight: 600;
  font-style: italic;
  cursor: default;
}

.display-field:focus {
  box-shadow: none;
  border-color: var(--color-border-subtle);
}

.primary-button {
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #1f6feb, #2563eb);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 550;
  color: #f9fafb;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.38);
  transition: transform 0.08s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.primary-button:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.46);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.4);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.result-box {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  padding: 10px 12px;
  background: linear-gradient(
      120deg,
      rgba(31, 111, 235, 0.03),
      rgba(31, 111, 235, 0.01)
    ),
    #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  font-size: 14px;
}

.result-box-empty {
  font-style: italic;
  color: var(--color-text-muted);
}

.result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--color-text-muted);
}

.result-value {
  font-weight: 550;
}

.result-error {
  color: #b91c1c;
}

.result-success {
  color: #14532d;
}

.copy-button {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.copy-button:hover {
  background: rgba(226, 232, 240, 0.9);
}

.imds-result {
  min-height: 120px;
  padding: 18px 20px;
  margin-top: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  white-space: pre;
  font-size: 13px;
}

.imds-result .result-value {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 4px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 13px;
}

.result-table thead {
  background: rgba(148, 163, 184, 0.08);
}

.result-table th,
.result-table td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  user-select: text;
}

.result-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 600;
}

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

.result-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.app-footer {
  padding: 14px 20px 20px;
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

@media (max-width: 640px) {
  .app-main {
    padding-inline: 14px;
  }

  .card {
    padding-inline: 16px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button {
    justify-content: center;
    width: 100%;
  }
}

