:root {
  --bg: #eef3f9;
  --bg-accent: #dfe9f7;
  --panel: #ffffff;
  --panel-soft: #f7fafe;
  --ink: #12263f;
  --muted: #5c6f87;
  --accent: #0f5ed7;
  --accent-soft: #e4efff;
  --accent-strong: #0a4cb0;
  --danger: #b42318;
  --border: #d4dfec;
  --shadow: 0 18px 48px rgba(18, 38, 63, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', 'Segoe UI', Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% -10%, #c9dcff 0%, transparent 34%),
    radial-gradient(circle at 85% -18%, #dce7fa 0%, transparent 38%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
}

.app-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 16px 42px;
}

.header-card,
.control-card,
.result-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.header-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(140deg, #ffffff 0%, #f3f8ff 55%, #eaf2ff 100%);
}

.header-card::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, #c6daff 0%, transparent 74%);
  pointer-events: none;
}

.header-card h1 {
  margin: 0;
  font-size: 1.62rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.header-subtitle {
  margin: 6px 0 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.header-meta {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #c9daf5;
  background: #edf4ff;
  color: #21486f;
  font-size: 0.83rem;
  font-weight: 600;
}

.control-card {
  margin-top: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

.prompt-wrap {
  position: relative;
  margin-top: 12px;
}

label {
  font-size: 0.8rem;
  color: #51647d;
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.prompt-input {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  resize: vertical;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.5;
  outline: none;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(18, 38, 63, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-input:focus {
  border-color: #95b9f2;
  box-shadow: 0 0 0 4px rgba(15, 94, 215, 0.14);
}

.prompt-input:disabled {
  background: #eef3fa;
  color: #5b6d84;
  border-color: #ccd8e8;
  cursor: not-allowed;
}

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  max-height: 240px;
  overflow: auto;
  z-index: 30;
  box-shadow: 0 20px 34px rgba(18, 38, 63, 0.12);
}

.suggestions li {
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  color: #213751;
}

.suggestions li:hover {
  background: var(--accent-soft);
}

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

.quick-domain-button {
  border: 1px solid #cbdcf2;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  color: #1f446f;
  padding: 9px 10px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.quick-domain-button:hover {
  border-color: #8db2eb;
  box-shadow: 0 6px 14px rgba(15, 94, 215, 0.16);
  transform: translateY(-1px);
}

.quick-domain-button.active {
  border-color: #0f5ed7;
  background: linear-gradient(180deg, #dce9ff 0%, #cfe2ff 100%);
  color: #0d3f84;
  box-shadow: 0 8px 16px rgba(15, 94, 215, 0.24);
}

.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

input,
select,
button {
  font: inherit;
}

input[type='datetime-local'],
input[type='text'] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  font-weight: 600;
  color: #24415f;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type='datetime-local']:focus,
input[type='text']:focus {
  outline: none;
  border-color: #95b9f2;
  box-shadow: 0 0 0 3px rgba(15, 94, 215, 0.12);
}

.actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

button.primary {
  background: linear-gradient(180deg, #1e69df 0%, var(--accent) 100%);
  color: #ffffff;
  border: 1px solid #0c57cb;
  border-radius: 11px;
  padding: 10px 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 94, 215, 0.28);
}

button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #1f66d4 0%, var(--accent-strong) 100%);
}

button.primary:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid #c5d8f5;
  border-radius: 11px;
  padding: 10px 17px;
  font-weight: 700;
  cursor: pointer;
}

button.secondary:hover:not(:disabled) {
  border-color: #86ace7;
  background: #f5f9ff;
}

button.secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  color: #51647d;
  font-size: 0.9rem;
  font-weight: 600;
}

.status.error {
  color: var(--danger);
}

.result-card {
  margin-top: 14px;
}

.range-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #cfddf3;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
}

.range-arrow {
  width: 34px;
  height: 34px;
  border: 1px solid #c4d7f3;
  border-radius: 999px;
  background: #ffffff;
  color: #123d7a;
  cursor: pointer;
  font-weight: 700;
  flex-shrink: 0;
}

.range-arrow:hover:not(:disabled) {
  border-color: #8cb1eb;
  background: #f3f8ff;
}

.range-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.range-label {
  text-align: center;
  color: #1c3d69;
  font-size: 0.93rem;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-button {
  border: 1px solid #cddcf0;
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  color: #38597f;
  cursor: pointer;
}

.tab-button.active {
  background: #eaf2ff;
  border-color: #92b5ec;
  color: #194c91;
}

.tab-panel {
  display: none;
}

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

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric {
  background: linear-gradient(170deg, #f9fbff 0%, #edf4ff 100%);
  border: 1px solid #d4e2f5;
  border-radius: 12px;
  padding: 12px;
}

.metric .label {
  color: #5a6f8b;
  font-size: 0.72rem;
  margin: 0;
}

.metric .value {
  margin-top: 7px;
  font-size: 1.14rem;
  font-weight: 800;
  color: #1b3e68;
}

.chart-wrap {
  position: relative;
  height: 216px;
  border: 1px solid #dce7f5;
  border-radius: 14px;
  background: #ffffff;
  padding: 8px 10px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.breakdown {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.breakdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.breakdown th,
.breakdown td {
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid #edf3fb;
}

@media (max-width: 920px) {
  .quick-domains {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .actions {
    align-items: flex-start;
  }

  .status {
    width: 100%;
  }

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

  .chart-wrap {
    height: 188px;
  }

  .range-label {
    font-size: 0.85rem;
  }
}
