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

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
}

html {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: 'Utopia Std', serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
}

.tool-card {
  width: min(100%, 820px);
  background: var(--card);
  border-radius: clamp(14px, 3vw, 20px);
  padding: clamp(20px, 5vw, 36px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.intro {
  margin: 16px 0 28px;
  max-width: 680px;
  color: #52616f;
  font-size: clamp(1rem, 2.8vw, 1.08rem);
  line-height: 1.5;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.input-row label {
  grid-column: 1 / -1;
  font-weight: 700;
  color: #334155;
}

.salary-input-wrap {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.salary-input-wrap span {
  flex-shrink: 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 700;
}

.salary-input-wrap input {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  padding: 16px 14px;
  font-size: 1.1rem;
  background: transparent;
  color: var(--text);
}

button {
  border: none;
  border-radius: 12px;
  padding: 17px 22px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
}

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

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.results {
  margin-top: 30px;
  border-top: 1px solid var(--border);
  padding-top: 26px;
}

.hidden {
  display: none;
}

#mainResult {
  margin: 0 0 22px;
  font-size: clamp(1.35rem, 6vw, 2.3rem);
  line-height: 1.2;
}

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

.result-box {
  min-width: 0;
  padding: 18px;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.result-box strong {
  display: block;
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  color: #0f172a;
  overflow-wrap: anywhere;
}

.median-message {
  margin-top: 20px;
  font-size: clamp(1rem, 3vw, 1.05rem);
  line-height: 1.5;
  color: #334155;
}

.footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.footer-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.footer-right {
  flex-shrink: 0;
}

.vcij-logo {
  width: clamp(84px, 24vw, 110px);
  height: auto;
  opacity: 0.85;
}

/* Tablet */
@media (max-width: 720px) {
  .page {
    align-items: flex-start;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

/* Phone */
@media (max-width: 460px) {
  .page {
    padding: 12px;
  }

  .tool-card {
    border-radius: 14px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}