.geoagent-control {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);
  color: #17202a;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

.geoagent-control-toggle {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #17202a;
  cursor: pointer;
}

.geoagent-control-toggle:hover {
  background-color: rgb(0 0 0 / 5%);
}

.geoagent-control-icon,
.geoagent-control-icon svg {
  width: 22px;
  height: 22px;
}

.geoagent-control-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.geoagent-control-icon svg {
  stroke: currentColor;
}

.geoagent-panel {
  position: absolute;
  z-index: 1000;
  display: none;
  max-width: calc(100% - 20px);
  max-height: min(720px, calc(100% - 20px));
  padding: 14px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: color-mix(in srgb, #ffffff 94%, transparent);
  box-shadow: 0 18px 50px rgb(15 23 42 / 18%);
  color: #17202a;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.geoagent-panel.expanded {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.geoagent-panel-resize-handle {
  position: absolute;
  top: 44px;
  bottom: 8px;
  z-index: 2;
  width: 10px;
  cursor: ew-resize;
  touch-action: none;
}

.geoagent-panel.resize-left .geoagent-panel-resize-handle {
  left: -5px;
}

.geoagent-panel.resize-right .geoagent-panel-resize-handle,
.geoagent-panel:not(.resize-left) .geoagent-panel-resize-handle {
  right: -5px;
}

.geoagent-panel-resize-handle::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 36px;
  border-radius: 999px;
  background: #c7d2df;
  content: "";
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

.geoagent-panel-resize-handle:hover::before,
.geoagent-panel.resizing .geoagent-panel-resize-handle::before {
  opacity: 1;
}

body.geoagent-panel-resizing {
  cursor: ew-resize;
  user-select: none;
}

.geoagent-panel * {
  box-sizing: border-box;
}

.geoagent-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.geoagent-panel-title {
  overflow: hidden;
  color: #17202a;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geoagent-title-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.geoagent-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #5f6b7a;
  font-size: 12px;
  font-weight: 650;
}

.geoagent-status.connected {
  background: #dff6ee;
  color: #076448;
}

.geoagent-status.error {
  background: #fee4e2;
  color: #b42318;
}

.geoagent-icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #fff;
  color: #5f6b7a;
  cursor: pointer;
}

.geoagent-icon-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.geoagent-panel-content {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.geoagent-panel label {
  display: grid;
  gap: 5px;
  color: #5f6b7a;
  font-size: 12px;
  font-weight: 650;
}

.geoagent-panel input,
.geoagent-panel select,
.geoagent-panel textarea,
.geoagent-panel button {
  font: inherit;
}

.geoagent-panel input,
.geoagent-panel select,
.geoagent-panel textarea {
  width: 100%;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #fff;
  color: #17202a;
}

.geoagent-panel input,
.geoagent-panel select {
  height: 36px;
  padding: 0 10px;
}

.geoagent-panel select {
  cursor: pointer;
}

.geoagent-panel textarea {
  min-height: 86px;
  max-height: min(180px, 24vh);
  resize: vertical;
  overflow: auto;
  padding: 9px 10px;
  line-height: 1.35;
}

.geoagent-settings-grid {
  display: grid;
  grid-template-columns: 1fr minmax(110px, 0.55fr);
  gap: 8px;
  align-items: end;
}

.geoagent-settings-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.geoagent-settings-grid:has(.geoagent-bedrock-region-row:not([hidden])) label:nth-child(3) {
  grid-column: auto;
}

.geoagent-bedrock-region-row[hidden] {
  display: none;
}

.geoagent-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.geoagent-toggle-row[hidden] {
  display: none;
}

.geoagent-panel .geoagent-checkbox-row {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #fff;
  color: #17202a;
  font-size: 12px;
  font-weight: 700;
}

.geoagent-panel .geoagent-checkbox-row input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #0f766e;
}

.geoagent-panel .geoagent-checkbox-row span {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
}

.geoagent-log {
  min-height: 160px;
  max-height: min(280px, calc(100vh - 360px));
  overflow: auto;
  padding: 10px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #f6f8fb;
  scrollbar-color: #8a96a6 #e6ebf1;
  scrollbar-width: thin;
  font-size: 13px;
  line-height: 1.4;
}

.geoagent-panel textarea,
.geoagent-text.markdown pre,
.geoagent-text.markdown table {
  scrollbar-color: #8a96a6 #e6ebf1;
  scrollbar-width: thin;
}

.geoagent-log::-webkit-scrollbar,
.geoagent-panel textarea::-webkit-scrollbar,
.geoagent-text.markdown pre::-webkit-scrollbar,
.geoagent-text.markdown table::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.geoagent-log::-webkit-scrollbar-track,
.geoagent-panel textarea::-webkit-scrollbar-track,
.geoagent-text.markdown pre::-webkit-scrollbar-track,
.geoagent-text.markdown table::-webkit-scrollbar-track {
  background: #e6ebf1;
}

.geoagent-log::-webkit-scrollbar-thumb,
.geoagent-panel textarea::-webkit-scrollbar-thumb,
.geoagent-text.markdown pre::-webkit-scrollbar-thumb,
.geoagent-text.markdown table::-webkit-scrollbar-thumb {
  border: 3px solid #e6ebf1;
  border-radius: 999px;
  background: #8a96a6;
}

.geoagent-log::-webkit-scrollbar-thumb:hover,
.geoagent-panel textarea::-webkit-scrollbar-thumb:hover,
.geoagent-text.markdown pre::-webkit-scrollbar-thumb:hover,
.geoagent-text.markdown table::-webkit-scrollbar-thumb:hover {
  background: #647386;
}

.geoagent-entry {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e3e8ef;
}

.geoagent-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.geoagent-role {
  margin-bottom: 3px;
  color: #5f6b7a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.geoagent-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.geoagent-text.markdown {
  white-space: normal;
}

.geoagent-text.markdown > :first-child {
  margin-top: 0;
}

.geoagent-text.markdown > :last-child {
  margin-bottom: 0;
}

.geoagent-text.markdown p,
.geoagent-text.markdown ul,
.geoagent-text.markdown ol,
.geoagent-text.markdown pre,
.geoagent-text.markdown blockquote,
.geoagent-text.markdown table {
  margin: 0 0 8px;
}

.geoagent-text.markdown ul,
.geoagent-text.markdown ol {
  padding-left: 18px;
}

.geoagent-text.markdown li {
  margin: 2px 0;
}

.geoagent-text.markdown a {
  color: #0f766e;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.geoagent-text.markdown code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #e8edf3;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.geoagent-text.markdown pre {
  max-width: 100%;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background: #111827;
  color: #f8fafc;
}

.geoagent-text.markdown pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
}

.geoagent-text.markdown blockquote {
  padding-left: 10px;
  border-left: 3px solid #c7d2df;
  color: #5f6b7a;
}

.geoagent-text.markdown table {
  display: block;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
}

.geoagent-text.markdown th,
.geoagent-text.markdown td {
  padding: 4px 6px;
  border: 1px solid #d8dee8;
  text-align: left;
  vertical-align: top;
}

.geoagent-form {
  display: grid;
  min-height: 0;
}

.geoagent-form label {
  min-height: 0;
}

.geoagent-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-top: 8px;
}

.geoagent-panel button.geoagent-send,
.geoagent-panel button.geoagent-copy,
.geoagent-panel button.geoagent-clear {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.geoagent-panel button.secondary {
  border-color: #d7dde5;
  background: #fff;
  color: #17202a;
}

.geoagent-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 700px) {
  .geoagent-panel {
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-height: min(72vh, 620px);
  }

  .geoagent-settings-grid {
    grid-template-columns: 1fr;
  }

  .geoagent-panel-resize-handle {
    display: none;
  }
}
