.grade-tool-entry[hidden] {
  display: none !important;
}

.grade-tool-entry {
  margin-top: 10px;
}

.grade-tool-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(137, 71, 33, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 207, 148, 0.56), transparent 32%),
    radial-gradient(circle at 90% 16%, rgba(110, 163, 151, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(255, 248, 239, 0.98), rgba(243, 250, 248, 0.98));
  box-shadow: 0 14px 30px rgba(18, 43, 41, 0.1);
}

.grade-tool-banner::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 136px;
  height: 136px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(154, 65, 19, 0.12) 0%, rgba(154, 65, 19, 0) 68%);
  pointer-events: none;
}

.grade-tool-banner-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.grade-tool-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(154, 65, 19, 0.1);
  color: #8d3e16;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grade-tool-banner-title {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 800;
  color: #16211f;
  line-height: 1.15;
  letter-spacing: 0.03em;
}

.grade-tool-banner-desc {
  margin: 6px 0 0;
  color: rgba(22, 33, 31, 0.72);
  line-height: 1.45;
  font-size: 13px;
  max-width: 500px;
}

.grade-tool-launch-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.grade-tool-open-btn {
  min-width: 132px;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid rgba(28, 123, 98, 0.14);
  border-radius: 14px;
  background: linear-gradient(135deg, #9a4113, #1c7b62);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(70, 56, 20, 0.15);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.grade-tool-open-btn[hidden] {
  display: none !important;
}

.grade-tool-open-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.grade-tool-open-btn.is-disabled,
.grade-tool-open-btn:disabled {
  cursor: not-allowed;
  transform: none;
  filter: saturate(0.55);
  opacity: 0.72;
  border-color: rgba(73, 88, 92, 0.18);
  background: linear-gradient(135deg, rgba(143, 153, 158, 0.96), rgba(111, 123, 131, 0.96));
  color: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.grade-tool-open-btn.is-disabled:hover,
.grade-tool-open-btn:disabled:hover {
  transform: none;
  filter: saturate(0.55);
}

.grade-tool-open-btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: #163029;
  border: 1px solid rgba(22, 48, 41, 0.12);
  box-shadow: 0 8px 18px rgba(15, 61, 62, 0.05);
}

.grade-tool-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background: rgba(11, 18, 22, 0.56);
  backdrop-filter: blur(10px);
}

.grade-tool-modal.is-open {
  display: flex;
}

.grade-tool-dialog {
  width: min(760px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background:
    radial-gradient(circle at top right, rgba(255, 220, 168, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(248, 252, 250, 0.98));
  box-shadow: 0 34px 70px rgba(7, 17, 22, 0.32);
  color: #182220;
}

.grade-tool-dialog-inner {
  padding: 26px;
}

.grade-tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.grade-tool-title {
  margin: 8px 0 0;
  font-size: 26px;
  line-height: 1.18;
}

.grade-tool-sub {
  margin: 10px 0 0;
  color: rgba(24, 34, 32, 0.7);
  line-height: 1.6;
  font-size: 14px;
}

.grade-tool-close {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: rgba(15, 61, 62, 0.08);
  color: #0f3d3e;
  font-size: 20px;
  cursor: pointer;
}

.grade-tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.9fr);
  gap: 14px;
  margin-top: 18px;
}

.grade-tool-chip-card,
.grade-tool-note-card {
  border-radius: 22px;
  padding: 18px;
  border: 1px solid rgba(15, 61, 62, 0.1);
}

.grade-tool-chip-card {
  background: linear-gradient(135deg, rgba(128, 57, 22, 0.94), rgba(27, 114, 92, 0.94));
  color: #fffdf8;
}

.grade-tool-chip-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.82;
  text-transform: uppercase;
}

.grade-tool-chip-value {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 800;
}

.grade-tool-chip-sub {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  font-size: 13px;
}

.grade-tool-note-card {
  background: rgba(255, 255, 255, 0.92);
}

.grade-tool-note-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #0f3d3e;
  text-transform: uppercase;
}

.grade-tool-note-text {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(24, 34, 32, 0.76);
  white-space: pre-wrap;
}

.grade-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.grade-tool-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grade-tool-field.span-2 {
  grid-column: 1 / -1;
}

.grade-tool-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.grade-tool-label {
  font-size: 13px;
  font-weight: 700;
  color: #21312d;
}

.grade-tool-meta {
  font-size: 12px;
  color: rgba(33, 49, 45, 0.56);
}

.grade-tool-field input,
.grade-tool-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(18, 46, 42, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: #14211e;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}

.grade-tool-static-box {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(18, 46, 42, 0.1);
  background:
    linear-gradient(135deg, rgba(245, 252, 249, 0.96), rgba(255, 248, 239, 0.96));
  color: #1b302c;
  font-size: 14px;
  line-height: 1.65;
  box-sizing: border-box;
}

.grade-tool-field input:focus,
.grade-tool-field select:focus {
  border-color: rgba(15, 61, 62, 0.52);
  box-shadow: 0 0 0 4px rgba(15, 61, 62, 0.1);
}

.grade-tool-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.grade-tool-inline-btn {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 61, 62, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: #0f3d3e;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.grade-tool-hint {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(24, 34, 32, 0.62);
}

.grade-tool-status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 61, 62, 0.1);
  background: rgba(255, 255, 255, 0.76);
  color: #1a2a26;
  font-size: 14px;
  line-height: 1.6;
}

.grade-tool-status.warn {
  border-color: rgba(183, 110, 0, 0.18);
  background: rgba(255, 244, 224, 0.9);
  color: #8a5200;
}

.grade-tool-status.ok {
  border-color: rgba(26, 114, 79, 0.18);
  background: rgba(229, 248, 241, 0.9);
  color: #136247;
}

.grade-tool-status.bad {
  border-color: rgba(191, 42, 64, 0.16);
  background: rgba(255, 236, 240, 0.92);
  color: #a01e39;
}

.grade-tool-result {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grade-tool-result-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 61, 62, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

.grade-tool-result-card strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(24, 34, 32, 0.56);
}

.grade-tool-result-card span {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #182220;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.grade-tool-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.grade-tool-primary,
.grade-tool-secondary {
  min-width: 120px;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.grade-tool-primary {
  border: none;
  background: linear-gradient(135deg, #0f3d3e, #1f7a65);
  color: #fff;
}

.grade-tool-secondary {
  border: 1px solid rgba(15, 61, 62, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: #0f3d3e;
}

@media (max-width: 860px) {
  .grade-tool-banner,
  .grade-tool-head,
  .grade-tool-hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .grade-tool-banner {
    padding: 14px;
  }

  .grade-tool-launch-row {
    width: 100%;
  }

  .grade-tool-open-btn,
  .grade-tool-inline-btn,
  .grade-tool-primary,
  .grade-tool-secondary {
    width: 100%;
  }

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

  .grade-tool-actions {
    flex-direction: column-reverse;
  }
}
