body {
  font-family: Calibri, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

h1#pageTitle {
  margin-bottom: 0 !important;
  margin-top: 0;
}

p#byline {
  margin-top: 0 !important;
  margin-bottom: 1rem;
  font-size: 0.9em;
  color: #666;
  line-height: 1.2;
}

p#byline a,
p#byline a:link,
p#byline a:visited,
p#byline a:active {
  color: inherit !important;
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
}

p#byline a:hover {
  color: inherit !important;
  text-decoration: underline !important;
}

.info-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border-radius: 50%;
  background-color: #0078d4;
  color: white;
  font-size: 12px;
  font-weight: bold;
  line-height: 16px;
  text-align: center;
  cursor: help;
  vertical-align: middle;
  position: relative;
}

.info-icon::before {
  content: "i";
}

.info-icon:hover {
  background-color: #005a9e;
}

.classification-board {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.classification-column {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.5rem;
  background-color: #f9f9f9;
}

.classification-column[data-type="system"] {
  background-color: #E6F2FF;
  border-color: #99CCFF;
}

.classification-column[data-type="supersystem"] {
  background-color: #FFE6CC;
  border-color: #FF9900;
}


.classification-column h3 {
  margin-top: 0;
  font-size: 1rem;
  text-align: center;
}

.classification-dropzone {
  min-height: 4rem;
  padding: 0.5rem;
  border: 1px dashed #bbb;
  border-radius: 4px;
  background-color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.classification-dropzone[data-type-id="system"] {
  background-color: #E6F2FF;
  border-color: #99CCFF;
}

.classification-dropzone[data-type-id="supersystem"] {
  background-color: #FFE6CC;
  border-color: #FF9900;
}


.classification-dropzone.drop-hover {
  border-color: #0078d4;
  background-color: #e6f2fb;
}

.classification-dropzone[data-type-id="system"].drop-hover {
  border-color: #0066CC;
  background-color: #CCE5FF;
}

.classification-dropzone[data-type-id="supersystem"].drop-hover {
  border-color: #CC6600;
  background-color: #FFD9B3;
}


.component-chip {
  padding: 0.25rem 0.5rem;
  border-radius: 16px;
  border: 1px solid #0078d4;
  background-color: #ffffff;
  color: #0078d4;
  font-size: 0.85rem;
  cursor: grab;
}

.component-chip:active {
  cursor: grabbing;
}

.view-toggle {
  margin-bottom: 1rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 50px;
  height: 24px;
  background-color: #ccc;
  border-radius: 24px;
  transition: background-color 0.3s;
  cursor: pointer;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
  background-color: #0078d4;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(26px);
}

.csv-editable-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  background-color: white;
}

.csv-editable-table th {
  background-color: #f5f5f5;
  padding: 0.5rem;
  text-align: left;
  border: 1px solid #ddd;
  font-weight: bold;
}

.csv-editable-table td {
  padding: 0;
  border: 1px solid #ddd;
}

.csv-editable-table td input {
  width: 100%;
  padding: 0.5rem;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
}

.csv-editable-table td input:focus {
  background-color: #f0f8ff;
}

.csv-editable-table .delete-row-btn {
  width: 100%;
  padding: 0.5rem;
  background-color: #ff4444;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 4px;
}

.csv-editable-table .delete-row-btn:hover {
  background-color: #cc0000;
}

#addRowBtn {
  padding: 0.5rem 1rem;
  background-color: #0078d4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

#addRowBtn:hover {
  background-color: #005a9e;
}

#patent-claim-input {
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #ddd;
}

#patentClaimInput {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem;
  font-family: inherit;
  font-size: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

#analyzeClaimBtn:hover:not(:disabled) {
  background-color: #005a9e;
}

#analyzeClaimBtn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

#analysisStatus {
  padding: 0.75rem;
  border-radius: 4px;
  font-weight: 500;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

#loadingSpinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#apiKeyInput {
  font-family: monospace;
  font-size: 0.9rem;
}




/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-title-block {
  flex: 1 1 auto;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding-top: 0.25rem;
}

/* ── Help Link ───────────────────────────────────────────── */
.help-link {
  color: #0078d4;
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border: 1px solid #0078d4;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.help-link:hover {
  background-color: #0078d4;
  color: white;
}

/* ── Language Selector ───────────────────────────────────── */
.language-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.language-selector label {
  font-weight: bold;
  margin: 0;
  white-space: nowrap;
}

.language-selector select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
}

.language-selector select:hover {
  border-color: #0078d4;
}

.language-selector select:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}
