.kt-card {
  --kt-ink: #20251f;
  --kt-muted: #687068;
  --kt-line: #d9ded5;
  --kt-paper: #fbfcf8;
  --kt-soft: #f0f3ec;
  --kt-green: #a8e34b;
  --kt-green-ink: #23320f;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--kt-line);
  border-radius: 10px;
  color: var(--kt-ink);
  background: var(--kt-paper);
  font: 400 12px/1.45 "DM Sans", "Segoe UI", sans-serif;
  overflow: hidden;
}

.kt-card *,
.kt-card *::before,
.kt-card *::after { box-sizing: border-box; }

/* Author display rules must not override the browser's hidden attribute. */
.kt-card [hidden] { display: none !important; }

.kt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  color: #f4f6f1;
  background: #292e2a;
}

.kt-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--kt-green);
  color: #20251f;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -1px;
}

.kt-brand { min-width: 0; }
.kt-brand-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .055em;
  line-height: 1.2;
}
.kt-brand-caption {
  margin-top: 2px;
  color: #b9c0b7;
  font-size: 10px;
}

.kt-source {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 0 0 8px;
  padding: 3px;
  border: 1px solid var(--border, #414641);
  border-radius: 7px;
  background: var(--surface2, #222624);
}

.kt-source button {
  min-width: 0;
  padding: 6px 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text, #e6e9e4);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.kt-source button[aria-pressed="true"] {
  background: #a8e34b;
  color: #20251f;
  box-shadow: 0 1px 3px #20251f1a;
}
.kt-source button:focus-visible,
.kt-card button:focus-visible,
.kt-card select:focus-visible,
.kt-card input:focus-visible {
  outline: 2px solid #689d27;
  outline-offset: 2px;
}

.kt-body { padding: 11px 10px 10px; }
.kt-kicker {
  margin: 0 0 8px;
  color: var(--kt-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.kt-credential-row { display: flex; gap: 5px; }
.kt-credential-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
}
.kt-card .kt-credential-options label {
  color: #20251f;
  font-size: 11px;
  margin-bottom: 0;
}
.kt-card .kt-token-help {
  color: #20251f;
  background: #fff;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
}
.kt-remember { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.kt-card .kt-remember input {
  flex: none;
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: #689d27;
}
.kt-token-dialog {
  width: min(380px, calc(100vw - 40px));
  box-sizing: border-box;
  margin: auto;
  padding: 20px;
  border: 1px solid var(--kt-line);
  border-radius: 10px;
  background: var(--kt-paper);
  color: var(--kt-ink);
  font: 400 13px/1.6 "Segoe UI", sans-serif;
}
.kt-token-dialog::backdrop { background: #0009; }
.kt-token-dialog h3 { margin: 0 0 10px; font-size: 16px; }
.kt-token-dialog ol { padding-left: 20px; margin: 0 0 14px; }
.kt-token-dialog li { margin-bottom: 5px; }
.kt-token-dialog a { color: #476d21; }
.kt-token-dialog button { float: right; }
.kt-card input,
.kt-card select {
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #cbd2c6;
  border-radius: 5px;
  color: var(--kt-ink);
  background: #fff;
  font: inherit;
}
.kt-card input { flex: 1; }
.kt-card input::placeholder { color: #858d83; }
.kt-card button {
  border: 1px solid #cbd2c6;
  border-radius: 5px;
  padding: 6px 9px;
  color: var(--kt-ink);
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.kt-card button:hover:not(:disabled) { background: #f1f4ee; }
.kt-card button:disabled,
.kt-card select:disabled,
.kt-card input:disabled { opacity: .58; cursor: not-allowed; }
.kt-card .kt-primary {
  border-color: var(--kt-green);
  background: var(--kt-green);
  color: var(--kt-green-ink);
}
.kt-card .kt-primary:hover:not(:disabled) { background: #b6ed69; }
.kt-card .kt-danger {
  border-color: #e5c8c1;
  color: #994536;
}

.kt-key-note {
  margin: 8px 0 0;
  color: var(--kt-muted);
  font-size: 10px;
  line-height: 1.5;
}
.kt-key-note a { color: #476d21; font-weight: 700; }
.kt-connected {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.kt-connected-title { font-size: 12px; font-weight: 800; }
.kt-connected-sub { margin-top: 2px; color: var(--kt-muted); font-size: 10px; }
.kt-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }

.kt-selectors { display: grid; gap: 8px; }
.kt-field { display: grid; gap: 4px; }
.kt-field label {
  color: #596259;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.kt-field select { width: 100%; }
.kt-state-line {
  min-height: 18px;
  margin-top: 8px;
  color: var(--kt-muted);
  font-size: 10px;
}
.kt-state-line[data-error="true"] { color: #a34435; }
.kt-state-line[data-kind="success"] { color: #476d21; }
.kt-state-line[data-kind="loading"] { color: #596259; }
.kt-blank {
  margin: 0;
  padding: 10px;
  border: 1px dashed #cbd2c6;
  border-radius: 6px;
  color: var(--kt-muted);
  background: #f7f9f4;
  font-size: 10px;
}
.kt-resolve {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: left;
}
.kt-conflict-note {
  margin: 8px 0 0;
  color: #81563c;
  font-size: 10px;
}

@media (max-width: 360px) {
  .kt-connected { flex-direction: column; }
  .kt-actions { justify-content: flex-start; }
  .kt-credential-row { flex-wrap: wrap; }
  .kt-credential-row input { flex-basis: 100%; }
}
