.case-modern {
  box-sizing: border-box;
  color: #111827;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.94rem;
  line-height: 1.5;
  padding: 0 0 18px;
}

.tool-detail-main:has(.case-modern) > .tool-detail-heading { display: none; }
.tool-detail-workspace:has(.case-modern) {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.case-modern *,
.case-modern *::before,
.case-modern *::after { box-sizing: inherit; }
.case-modern button,
.case-modern textarea { font: inherit; }
.case-modern svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.case-hero {
  align-items: center;
  background: linear-gradient(110deg, #fff 52%, #f7f4ff);
  border: 0;
  border-radius: 0;
  display: flex;
  justify-content: space-between;
  margin: 0 0 14px;
  min-height: 84px;
  padding: 10px 14px;
}
.case-title { align-items: center; display: flex; gap: 14px; min-width: 0; }
.case-title > span {
  align-items: center;
  background: linear-gradient(145deg, #eee9ff, #fbfaff);
  border: 1px solid #cfc3ff;
  border-radius: 14px;
  color: #5934f5;
  display: flex;
  flex: 0 0 58px;
  height: 58px;
  justify-content: center;
  width: 58px;
}
.case-title > span b { font-size: 1.55rem; font-weight: 700; line-height: 1; }
.case-title > span i { font-size: 1.05rem; font-style: normal; font-weight: 700; line-height: 1; margin: 9px 0 0 -3px; }
.case-title h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.75rem, 2.4vw, 2.15rem);
  line-height: 1.1;
  margin: 0 0 6px;
}
.case-title p { color: #43536d; font-size: 0.92rem; margin: 0; }

.case-reset,
.case-input footer button,
.case-upload,
#caseCopyResult {
  align-items: center;
  background: #fff;
  border: 1px solid #d4deea;
  border-radius: 9px;
  color: #162039;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  white-space: nowrap;
}
.case-reset:hover,
.case-input footer button:hover,
.case-upload:hover,
#caseCopyResult:hover { border-color: #7454fa; color: #4f2ee9; }
.case-reset svg,
.case-input footer svg,
#caseCopyResult svg { height: 18px; width: 18px; }

.case-workspace {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.case-card { background: #fff; border: 1px solid #d9e2ed; border-radius: 13px; min-width: 0; }
.case-input,
.case-modes,
.case-results { padding: 16px; }
.case-input,
.case-results { display: flex; flex-direction: column; }
.case-modes { grid-column: 1 / -1; }

.case-input > header,
.case-modes > header,
.case-results > header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.case-input > header {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  justify-content: space-between;
}
.case-input header > div { align-items: center; display: flex; gap: 12px; min-width: 0; }
.case-input header b,
.case-modes header > b,
.case-results header > b {
  align-items: center;
  background: #eee9ff;
  border-radius: 10px;
  color: #5632f5;
  display: flex;
  flex: 0 0 40px;
  font-size: 1rem;
  height: 40px;
  justify-content: center;
}
.case-card h2 { font-size: 1rem; line-height: 1.3; margin: 0; }
.case-input h2 { white-space: nowrap; }
.case-modes header p,
.case-results header p { color: #617088; font-size: 0.82rem; margin: 3px 0 0; }
.case-input header > span { color: #526178; font-size: 0.78rem; padding-top: 10px; white-space: nowrap; }
.case-input textarea {
  border: 1px solid #ced9e7;
  border-radius: 10px;
  color: #15213a;
  display: block;
  font-size: 0.9rem;
  line-height: 1.65;
  flex: 1;
  min-height: 260px;
  outline: none;
  padding: 15px;
  resize: vertical;
  width: 100%;
}
.case-input textarea:focus { border-color: #7758ff; box-shadow: 0 0 0 3px rgba(89, 50, 245, 0.09); }
.case-input footer { display: flex; gap: 10px; margin-top: 12px; }
.case-upload { color: #4e2ef1; position: relative; }
.case-upload input { height: 1px; opacity: 0; position: absolute; width: 1px; }

.case-modes > div { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.case-modes button {
  background: #fff;
  border: 1px solid #d4deea;
  border-radius: 11px;
  color: #15213a;
  cursor: pointer;
  min-height: 88px;
  padding: 12px 14px;
  position: relative;
  text-align: left;
}
.case-modes button:hover { border-color: #9b86ff; }
.case-modes button.is-active {
  background: #f7f5ff;
  border-color: #643cf7;
  box-shadow: 0 0 0 1px #643cf7 inset;
  padding-left: 42px;
}
.case-modes button.is-active::before {
  align-items: center;
  background: #5935f5;
  border-radius: 50%;
  color: #fff;
  content: "✓";
  display: flex;
  font-size: 0.72rem;
  font-weight: 900;
  height: 21px;
  justify-content: center;
  left: 12px;
  position: absolute;
  top: 14px;
  width: 21px;
}
.case-modes button strong { display: block; font-size: 0.9rem; line-height: 1.25; margin-bottom: 4px; overflow-wrap: anywhere; }
.case-modes button span { color: #53637c; display: block; font-size: 0.78rem; line-height: 1.35; }

.case-aside {
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.case-aside .case-card { padding: 16px; }
.case-aside h2 { font-size: 0.98rem; margin-bottom: 12px; }
.case-aside p { color: #506079; font-size: 0.82rem; margin: 0; overflow-wrap: anywhere; }
.case-example {
  background: #f4f0ff;
  border: 1px solid #ded5ff;
  border-radius: 9px;
  display: grid;
  font-size: 0.8rem;
  margin-top: 14px;
  padding: 11px;
}
.case-example b { color: #5632f5; margin-bottom: 3px; }
.case-aside dl { display: grid; gap: 10px; margin: 0; }
.case-aside dl div { align-items: center; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) auto; }
.case-aside dt { color: #4e5d75; font-size: 0.79rem; overflow-wrap: anywhere; }
.case-aside dd { color: #111827; font-size: 0.82rem; font-weight: 800; margin: 0; min-width: 2ch; text-align: right; }
.case-tip { background: #fffaf0; }
.case-tip h2 { align-items: center; display: flex; gap: 8px; }
.case-tip h2 span { align-items: center; background: #fff0ca; border-radius: 50%; color: #dc8200; display: flex; height: 27px; justify-content: center; width: 27px; }

.case-results > header { align-items: center; }
.case-results > header > div { flex: 1; }
#caseCopyResult { margin-left: auto; }
.case-result-main { border: 1px solid #d5dfeb; border-radius: 11px; display: flex; flex: 1; flex-direction: column; overflow: hidden; }
.case-result-main > div {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #dbe3ed;
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
}
.case-result-main strong { font-size: 0.9rem; }
.case-result-main span { color: #69778c; font-size: 0.76rem; }
.case-result-main pre {
  color: #15213a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 0;
  flex: 1;
  max-height: 360px;
  min-height: 218px;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.case-status { color: #087d3a; font-size: 0.78rem; min-height: 20px; margin: 9px 2px 0; }
.case-status.is-error { color: #c5273e; }

@media (max-width: 1280px) {
  .case-modes > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .case-workspace { grid-template-columns: 1fr; }
  .case-input,
  .case-modes,
  .case-results,
  .case-aside { grid-column: 1; }
  .case-aside { grid-template-columns: 1fr; }
  .case-modes > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .case-modern { padding: 0 0 14px; }
  .case-hero { align-items: flex-start; padding: 16px; }
  .case-title { gap: 12px; }
  .case-title > span { flex-basis: 54px; height: 54px; width: 54px; }
  .case-title > span b { font-size: 1.4rem; }
  .case-title > span i { font-size: 1rem; }
  .case-title h1 { font-size: 1.55rem; }
  .case-title p { font-size: 0.82rem; }
  .case-reset { min-height: 38px; padding: 0 11px; }
  .case-input,
  .case-modes,
  .case-results { padding: 14px; }
  .case-input > header { grid-template-columns: 1fr; }
  .case-input header > span { padding: 0 0 0 52px; }
  .case-input textarea { min-height: 230px; }
  .case-results > header { align-items: flex-start; flex-wrap: wrap; }
  #caseCopyResult { margin-left: 52px; }
}
@media (max-width: 440px) {
  .case-title > span { display: none; }
  .case-reset { font-size: 0; height: 38px; width: 38px; }
  .case-reset svg { height: 18px; width: 18px; }
  .case-modes > div { grid-template-columns: 1fr; }
  #caseCopyResult { margin-left: 0; width: 100%; }
}
