:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.app {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  background: #ffffff;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #425466;
}

textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  border: 1px solid #b8c2cc;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.35;
}

textarea:focus {
  outline: 3px solid #c7dbff;
  border-color: #2f6fed;
}

button {
  height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: #2357d8;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status {
  min-height: 24px;
  margin: 12px 2px;
  font-size: 0.94rem;
  color: #5b6776;
}

.status.error {
  color: #a03528;
}

.status.warning {
  color: #8a5a00;
}

.status.success {
  color: #19663a;
}

.results {
  display: grid;
  gap: 24px;
}

.portfolio {
  display: grid;
  gap: 0;
}

.tab {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  border: 1px solid #cfd7e3;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #eef3f8;
}

.tab button {
  width: auto;
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-right: 1px solid #cfd7e3;
  border-radius: 0;
  padding: 0 16px;
  background: transparent;
  color: #425466;
  font-size: 0.94rem;
  font-weight: 800;
}

.tab button:hover {
  background: #e0e7f0;
}

.tab button.active {
  background: #ffffff;
  color: #1f2933;
}

.tabcontent {
  display: none;
}

.notice,
.patent {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  background: #ffffff;
}

.notice {
  padding: 12px 16px;
  color: #8a392f;
}

.notice p {
  margin: 4px 0;
}

.patent {
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.patent-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #d8dde6;
}

.patent-header h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.patent-header p {
  margin: 4px 0 0;
  color: #5f6c7b;
}

.patent-header a {
  flex: 0 0 auto;
  color: #2357d8;
  font-weight: 700;
  text-decoration: none;
}

.summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px 0;
}

.summary span {
  border: 1px solid #cfd7e3;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f8fafc;
  font-size: 0.85rem;
  font-weight: 700;
  color: #4c5c6d;
}

.map-wrap,
.chart-wrap {
  padding: 18px 20px 22px;
}

h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #2d3b49;
}

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

.chart-header h2 {
  margin: 0;
}

.copy-table-button {
  width: auto;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #1f2933;
  background: #ffffff;
  color: #1f2933;
  font-size: 0.86rem;
}

.copy-table-button:hover {
  background: #f1f3f5;
}

.claim-set-map {
  display: grid;
  gap: 6px;
  padding: 6px 0 18px;
}

.claim-set-map:not(:last-child) {
  border-bottom: 1px solid #e5e9ef;
}

.claim-set-map h3 {
  margin: 0;
  color: #1f2933;
  font-size: 0.94rem;
}

.claim-map-rendered {
  width: 100%;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 10px;
  background: #ffffff;
  overflow: auto;
}

.claim-set-svg svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
  max-height: none;
  margin: 0 auto;
}

.claim-map-node {
  cursor: pointer;
}

.claim-map-node ellipse,
.claim-map-node polygon,
.claim-map-node path {
  transition: fill 120ms ease;
}

.map-note {
  margin-top: 8px;
  color: #000000;
  font-size: 0.84rem;
  font-style: italic;
  text-align: right;
}

.dot-source {
  margin-top: 10px;
  font-size: 0.84rem;
}

.dot-source summary {
  cursor: pointer;
  color: #2357d8;
  font-weight: 800;
}

.dot-source pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
  color: #243241;
  white-space: pre;
}

.dot-output {
  width: 100%;
  min-height: 260px;
  max-height: 520px;
  margin-top: 8px;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
  color: #243241;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  resize: vertical;
}

.claim-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.92rem;
}

.claim-table th,
.claim-table td {
  border: 1px solid #cfd7e3;
  vertical-align: top;
}

.claim-table th {
  padding: 9px 10px;
  background: #eef3f8;
  color: #2d3b49;
  text-align: left;
  font-size: 0.86rem;
}

.claim-table th:nth-child(1),
.claim-table td:nth-child(1) {
  width: 42%;
}

.claim-table th:nth-child(2),
.claim-table td:nth-child(2) {
  width: 25%;
}

.claim-table th:nth-child(3),
.claim-table td:nth-child(3) {
  width: 33%;
}

.claim-table td {
  padding: 10px;
  background: #ffffff;
  line-height: 1.42;
}

.claim-heading td {
  padding: 8px 10px;
  background: #e5eaf1;
  font-weight: 800;
}

.language strong {
  color: #1c4db8;
}

.comparison h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #4f5f70;
}

.comparison h3:not(:first-child) {
  margin-top: 14px;
}

.muted {
  color: #798696;
  font-style: italic;
}

.similar {
  margin: 0 0 10px;
}

.score {
  display: inline-block;
  min-width: 42px;
  margin-right: 4px;
  color: #19663a;
  font-weight: 800;
}

.diff ins {
  color: #b21f1f;
  font-weight: 800;
  text-decoration: none;
}

.diff del {
  color: #8b96a3;
  text-decoration: line-through;
}

@media (max-width: 780px) {
  .app {
    width: min(100vw - 20px, 1240px);
    padding-top: 10px;
  }

  .toolbar,
  .patent-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  button {
    width: 100%;
  }

  .claim-table {
    min-width: 920px;
  }

  .chart-wrap {
    overflow-x: auto;
  }
}

.reference-note {
  margin: 0;
  color: #000000;
  font-weight: 700;
}
