:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eef3f8;
  --ink: #17202a;
  --muted: #607080;
  --line: #d8e0e8;
  --accent: #0b7285;
  --accent-strong: #075865;
  --warning: #b45309;
  --danger: #b42318;
  --ok: #157347;
  --shadow: 0 18px 40px rgba(32, 48, 64, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  width: min(1420px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: #253241;
}

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

.editorGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  gap: 18px;
  min-height: calc(100vh - 140px);
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.panelHeader h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.panelHeader span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.inputPanel {
  display: flex;
  flex-direction: column;
}

textarea {
  width: 100%;
  min-height: 620px;
  flex: 1;
  resize: vertical;
  border: 0;
  outline: none;
  padding: 18px;
  color: var(--ink);
  background: #fff;
  line-height: 1.75;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Hiragino Sans",
    "Yu Gothic", monospace;
  font-size: 15px;
}

textarea:focus {
  box-shadow: inset 0 0 0 2px rgba(11, 114, 133, 0.35);
}

.resultPanel {
  display: flex;
  flex-direction: column;
  min-height: 620px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.summary:empty {
  display: none;
}

.summaryItem {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summaryItem strong {
  display: block;
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1;
}

.summaryItem span {
  color: var(--muted);
  font-size: 12px;
}

.emptyState {
  margin: 18px;
  padding: 28px;
  border: 1px dashed #adc0d2;
  border-radius: 8px;
  color: var(--ok);
  background: #f3fbf7;
  text-align: center;
}

.issueList {
  overflow: auto;
  padding: 0 14px 14px;
}

.issueList:empty {
  display: none;
}

.issue {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.issue:last-child {
  border-bottom: 0;
}

.where {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.where strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.issueBody {
  min-width: 0;
}

.issueTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.issueTitle h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff3e0;
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
}

.message {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.locations {
  display: grid;
  gap: 8px;
}

.locationGroupHeading {
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #eef3f8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.locationGroupHeading:first-child {
  margin-top: 0;
}

.location {
  min-width: 0;
}

.moreNotice {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.snippet {
  overflow: hidden;
  max-width: 100%;
  margin: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Hiragino Sans",
    "Yu Gothic", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mark {
  color: #fff;
  background: var(--danger);
  border-radius: 4px;
  padding: 1px 3px;
}

@media (max-width: 920px) {
  .app {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  .editorGrid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  textarea,
  .resultPanel {
    min-height: 420px;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 12px;
  }

  .actions,
  .toggle,
  button {
    width: 100%;
  }

  .toggle,
  button {
    justify-content: center;
  }

  .issue {
    grid-template-columns: 1fr;
    gap: 6px;
  }

}
