:root {
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --ink: #10212b;
  --muted: #62717b;
  --line: #dbe5ea;
  --blue: #1769e0;
  --blue-dark: #0e4dab;
  --cyan: #0c9ea8;
  --green: #228b55;
  --orange: #d97819;
  --red: #c2413a;
  --shadow: 0 22px 60px rgba(24, 46, 64, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 105, 224, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(12, 158, 168, 0.12), transparent 34%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: #0f202b;
  color: #fff;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 900;
}

.brand p,
.eyebrow {
  margin: 0 0 5px;
  color: #6c7f89;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand p {
  color: #91a7b3;
}

.brand h1 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.tool-nav {
  display: grid;
  gap: 8px;
}

.nav-btn {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #dce8ef;
  text-align: left;
  font-weight: 750;
}

.nav-btn:hover,
.nav-btn.active {
  background: #ffffff;
  color: #10212b;
}

.content {
  width: min(1220px, 100%);
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(1.8rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}

.tool-panel {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

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

.hero {
  min-height: 280px;
  border-radius: 8px;
  display: grid;
  align-items: end;
  padding: clamp(22px, 4vw, 40px);
  background:
    linear-gradient(120deg, rgba(15, 32, 43, 0.92), rgba(15, 32, 43, 0.6)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 42px),
    linear-gradient(135deg, #1769e0, #0c9ea8);
  color: #fff;
}

.hero .eyebrow {
  color: #9de9ef;
}

.hero h3 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.03;
}

.hero p:last-child {
  max-width: 700px;
  margin: 16px 0 0;
  color: #d8edf2;
  line-height: 1.65;
}

.metric-grid,
.form-grid,
.wan-grid,
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.metric-grid article,
.wan-block,
.checklist-grid label {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-2);
}

.metric-grid strong,
.metric-grid span {
  display: block;
}

.metric-grid strong {
  margin-bottom: 7px;
}

.metric-grid span {
  color: var(--muted);
  line-height: 1.45;
}

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

.panel-heading h3 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.08;
}

label {
  display: grid;
  gap: 8px;
  color: #2b404b;
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 44px;
  border-radius: 8px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-weight: 850;
}

.primary-btn {
  margin-top: 16px;
  background: var(--blue);
  color: #fff;
}

.primary-btn:hover {
  background: var(--blue-dark);
}

.secondary-btn {
  background: #10212b;
  color: #fff;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.result-box {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 15px;
  background: #f8fbff;
  color: #153143;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.result-box.empty {
  color: var(--muted);
  border-left-color: #b9c9d4;
}

.result-box.good {
  border-left-color: var(--green);
}

.result-box.warn {
  border-left-color: var(--orange);
}

.result-box.bad {
  border-left-color: var(--red);
}

.wan-block h4 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.wan-block {
  display: grid;
  gap: 12px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.checkline {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.checkline input,
.checklist-grid input {
  width: auto;
}

.checklist-grid {
  margin-bottom: 16px;
}

.checklist-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .content {
    padding: 18px;
  }

  .topbar {
    display: block;
  }

  .status-pill {
    margin-top: 14px;
  }

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

@media (max-width: 680px) {
  .tool-nav,
  .metric-grid,
  .form-grid,
  .wan-grid,
  .checklist-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    display: block;
  }

  .panel-heading .ghost-btn {
    margin-top: 12px;
  }
}
