/* Selected baseline: 9b7b5ea. Add only harbour scenery and account-flow motion. */

:root {
  --harbour-ease-out: cubic-bezier(.23, 1, .32, 1);
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body,
:root[data-console-theme="night"] body {
  background:
    linear-gradient(105deg, rgba(3, 14, 19, .55) 0%, rgba(3, 14, 19, .18) 46%, rgba(3, 14, 19, .48) 100%),
    url("/console/assets/harbourmind-client-scene.jpg") center / cover no-repeat fixed,
    #071b29;
}

.shell {
  min-width: 0;
  background: transparent;
}

.main {
  position: relative;
  min-width: 0;
}

.main:before {
  position: absolute;
  z-index: 0;
  top: -48px;
  left: 0;
  width: calc(100vw - 228px);
  height: 390px;
  background: url("/console/assets/harbourmind-client-scene.jpg") center / cover no-repeat;
  content: "";
  mask-image: linear-gradient(180deg, #000 34%, rgba(0, 0, 0, .88) 58%, transparent 100%);
  opacity: .62;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 34%, rgba(0, 0, 0, .88) 58%, transparent 100%);
}

.top,
.card,
.overview,
.activation-path {
  position: relative;
  z-index: 1;
}

.top .status,
.top button.secondary,
.top .console-theme-toggle,
.top .console-controls .hm-platform-language {
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--deck) 82%, transparent);
  color: var(--text);
  box-shadow: 0 8px 26px rgba(0, 8, 13, .12);
  backdrop-filter: blur(14px) saturate(1.08);
}

.top .status {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 999px;
}

.rail,
:root[data-console-theme="night"] .rail {
  background: rgba(2, 17, 26, .84);
  backdrop-filter: blur(18px) saturate(1.06);
}

.rail .brand > span {
  min-width: 0;
}

.rail .brand small {
  display: none;
}

.rail-foot > .coordinates {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  overflow: hidden;
  padding: 0 2px 4px;
  color: #668c85;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .14em;
  white-space: nowrap;
  animation: harbour-coordinate-breathe 8.4s ease-in-out infinite;
}

.rail-foot > .coordinates:before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(86, 228, 208, .24);
  content: "";
  animation: harbour-coordinate-lock 5.6s var(--harbour-ease-out) infinite;
}

.rail-foot > .coordinates:after {
  position: absolute;
  right: 2px;
  bottom: 0;
  left: 15px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(86, 228, 208, .72), transparent);
  content: "";
  opacity: 0;
  transform: translateX(-100%);
  animation: harbour-coordinate-sweep 8.4s cubic-bezier(.45, 0, .35, 1) infinite;
}

@keyframes harbour-coordinate-breathe {
  0%,
  100% {
    opacity: .64;
    text-shadow: 0 0 0 rgba(86, 228, 208, 0);
  }
  46%,
  58% {
    opacity: .96;
    text-shadow: 0 0 12px rgba(86, 228, 208, .18);
  }
}

@keyframes harbour-coordinate-lock {
  0%,
  42%,
  100% {
    box-shadow: 0 0 0 0 rgba(86, 228, 208, .24);
    opacity: .72;
  }
  54% {
    box-shadow: 0 0 0 1px rgba(86, 228, 208, .18);
    opacity: 1;
  }
  76% {
    box-shadow: 0 0 0 6px rgba(86, 228, 208, 0);
    opacity: .78;
  }
}

@keyframes harbour-coordinate-sweep {
  0%,
  22% {
    opacity: 0;
    transform: translateX(-100%);
  }
  34%,
  62% {
    opacity: .66;
  }
  76%,
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

.console-boot {
  background:
    linear-gradient(rgba(3, 19, 29, .88), rgba(3, 19, 29, .94)),
    url("/console/assets/harbourmind-client-scene.jpg") center / cover,
    #03131d;
}

.sign-in-intro .brand {
  position: absolute;
  z-index: 2;
  top: 34px;
  left: 38px;
}

.sign-in-intro .brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font: 8px ui-monospace, monospace;
  letter-spacing: .14em;
}

.sign-in-story {
  position: relative;
  z-index: 1;
}

.sign-in-intro .coordinates {
  position: absolute;
  z-index: 2;
  right: 38px;
  bottom: 28px;
  color: var(--muted);
  font: 8px ui-monospace, monospace;
  letter-spacing: .1em;
}

body:has(#sign-in:not([hidden])),
:root[data-console-theme="night"] body:has(#sign-in:not([hidden])) {
  background:
    linear-gradient(90deg, rgba(3, 14, 19, .58), rgba(3, 14, 19, .1)),
    url("/console/assets/harbourmind-client-scene.jpg") center / cover no-repeat fixed,
    #071b29;
}

.activation-path {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(9, 40, 53, .92), rgba(5, 25, 36, .94));
}

.harbour-current {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(86, 228, 208, .06);
  pointer-events: none;
}

.harbour-current span {
  position: absolute;
  top: 0;
  left: -18%;
  width: 18%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  animation: harbour-current 5.8s cubic-bezier(.45, 0, .35, 1) infinite;
}

@keyframes harbour-current {
  0%,
  18% {
    opacity: 0;
    transform: translateX(0);
  }
  28%,
  72% {
    opacity: 1;
  }
  82%,
  100% {
    opacity: 0;
    transform: translateX(655%);
  }
}

.activation-step.next .journey-index {
  position: relative;
}

.activation-step.next .journey-index:after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(242, 196, 109, .30);
  border-radius: 12px;
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: harbour-next-step 2.6s var(--harbour-ease-out) infinite;
}

@keyframes harbour-next-step {
  0%,
  100% {
    opacity: 0;
    transform: scale(.88);
  }
  34% {
    opacity: .7;
  }
  68% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@media (hover: hover) and (pointer: fine) {
  .activation-step a {
    transition:
      border-color 160ms var(--harbour-ease-out),
      background-color 160ms var(--harbour-ease-out),
      transform 160ms var(--harbour-ease-out);
  }

  .activation-step a:hover {
    transform: translateY(-1px);
  }
}

:root[data-console-theme="day"] body {
  background:
    linear-gradient(180deg, rgba(237, 246, 245, .86), rgba(237, 246, 245, .92)),
    url("/console/assets/harbourmind-client-scene.jpg") center / cover no-repeat fixed,
    #edf6f5;
}

:root[data-console-theme="day"] .main:before {
  background:
    linear-gradient(90deg, rgba(237, 246, 245, .78) 0%, rgba(237, 246, 245, .52) 48%, rgba(237, 246, 245, .32) 100%),
    url("/console/assets/harbourmind-client-scene.jpg") center / cover no-repeat;
  opacity: 1;
}

:root[data-console-theme="night"] .main:before {
  background:
    linear-gradient(90deg, rgba(2, 8, 20, .48) 0%, rgba(2, 8, 20, .18) 48%, rgba(2, 8, 20, .30) 100%),
    url("/console/assets/harbourmind-client-scene.jpg") center / cover no-repeat;
  opacity: .86;
}

:root[data-console-theme="day"] .rail {
  background: rgba(248, 251, 250, .94);
}

:root[data-console-theme="day"] .rail-foot > .coordinates {
  color: #3f6f69;
}

:root[data-console-theme="day"] .card,
:root[data-console-theme="day"] .activation-path {
  border-color: rgba(30, 91, 88, .17);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 48px rgba(32, 83, 78, .075);
}

:root[data-console-theme="day"] .top .status,
:root[data-console-theme="day"] .top button.secondary,
:root[data-console-theme="day"] .top .console-theme-toggle,
:root[data-console-theme="day"] .top .console-controls .hm-platform-language {
  border-color: rgba(30, 91, 88, .18);
  background: rgba(255, 255, 255, .88);
  color: #18353a;
}

:root[data-console-theme="night"] .top .status,
:root[data-console-theme="night"] .top button.secondary,
:root[data-console-theme="night"] .top .console-theme-toggle,
:root[data-console-theme="night"] .top .console-controls .hm-platform-language {
  border-color: rgba(120, 166, 207, .22);
  background: rgba(4, 15, 29, .76);
  color: #f2f7fb;
}

:root[data-console-theme="day"] .activation-step .journey-label small,
:root[data-console-theme="day"] .activation-step .journey-state,
:root[data-console-theme="day"] .activation-hmt-summary span {
  color: #536c6f;
}

:root[data-console-theme="night"] .activation-step .journey-label small,
:root[data-console-theme="night"] .activation-step .journey-state,
:root[data-console-theme="night"] .activation-hmt-summary span {
  color: #aabec9;
}

.activation-step .journey-label small,
.activation-step .journey-state {
  font-size: 10px;
}

:root[data-console-theme="day"] #models .price-tabs {
  border-color: rgba(30, 91, 88, .18);
  background: #eaf2f0;
}

:root[data-console-theme="day"] #models .price-tabs button {
  color: #536c6f;
}

:root[data-console-theme="day"] #models .price-tabs button.active {
  background: #fff;
  color: #087f75;
  box-shadow:
    0 3px 10px rgba(32, 83, 78, .10),
    inset 0 0 0 1px rgba(8, 127, 117, .18);
}

:root[data-console-theme="night"] #models .price-tabs button:not(.active) {
  color: #aabec9;
}

/* Keep the classic credential editor native to each theme and equally legible. */
:root[data-console-theme="night"] .key-dialog {
  --amber: #f2c46d;
  --line: rgba(132, 184, 205, .24);
  --mint: #65e8d5;
  --muted: #aec1ca;
  --text: #f2faf8;
  border-color: var(--line);
  background: linear-gradient(145deg, #0b2230, #071522 68%);
  color: var(--text);
  color-scheme: dark;
  box-shadow: 0 34px 110px rgba(0, 4, 12, .78);
}

:root[data-console-theme="night"] .key-dialog input,
:root[data-console-theme="night"] .key-dialog select,
:root[data-console-theme="night"] .key-dialog textarea {
  border-color: rgba(132, 184, 205, .24);
  background: #06131f;
  color: var(--text);
}

:root[data-console-theme="night"] .key-dialog input::placeholder,
:root[data-console-theme="night"] .key-dialog textarea::placeholder {
  color: #8197a2;
}

:root[data-console-theme="night"] .key-dialog .key-scope-summary,
:root[data-console-theme="night"] .key-dialog .key-radio-card {
  background: rgba(255, 255, 255, .025);
}

:root[data-console-theme="night"] .key-dialog .key-radio-card:hover {
  border-color: rgba(101, 232, 213, .44);
  background: rgba(101, 232, 213, .055);
}

:root[data-console-theme="night"] .key-dialog .key-radio-card:has(input:checked) {
  border-color: rgba(101, 232, 213, .58);
  background: rgba(101, 232, 213, .10);
  box-shadow: inset 0 0 0 1px rgba(101, 232, 213, .12);
}

:root[data-console-theme="night"] .key-dialog .secondary,
:root[data-console-theme="night"] .key-dialog .button.secondary,
:root[data-console-theme="night"] .key-dialog .dialog-close {
  border-color: rgba(132, 184, 205, .24);
  background: rgba(255, 255, 255, .035);
  color: var(--text);
}

:root[data-console-theme="night"] .key-dialog .secondary:hover,
:root[data-console-theme="night"] .key-dialog .button.secondary:hover,
:root[data-console-theme="night"] .key-dialog .dialog-close:hover {
  border-color: rgba(101, 232, 213, .46);
  background: rgba(101, 232, 213, .08);
}

/* Restore the selected classic Key editor: asset list, compact two-column scope. */
.key-dialog .key-choice-group {
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 16px 0;
}

.key-dialog .key-choice-group legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.key-asset-readiness {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--mint) 28%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--mint) 5%, var(--deck));
}

.key-asset-readiness-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.key-asset-readiness-head span,
.key-asset-readiness-head strong,
.key-asset-readiness-head small {
  display: block;
}

.key-asset-readiness-head strong {
  font-size: 12px;
}

.key-asset-readiness-head small {
  margin-top: 3px;
  color: var(--muted);
  font: 700 9px ui-monospace, monospace;
}

.key-asset-readiness-head a {
  flex: none;
  color: var(--mint);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.key-ready-model-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 126px;
  margin-top: 11px;
  overflow: auto;
}

.key-ready-model {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--deck) 88%, var(--mint));
  font-size: 10px;
}

.key-ready-model strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-ready-model b {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--mint);
  font: 800 9px ui-monospace, monospace;
}

.key-ready-loading,
.key-ready-empty {
  grid-column: 1 / -1;
  padding: 9px;
  color: var(--muted);
  font-size: 10px;
}

.key-ready-empty a {
  color: var(--mint);
  font-weight: 800;
  text-decoration: none;
}

.key-dialog .key-radio-card {
  align-items: flex-start;
  gap: 10px;
  min-height: 0;
  padding: 13px;
  background: transparent;
}

.key-dialog .key-radio-card input {
  width: 16px;
  height: 16px;
  margin: 2px 0;
}

.key-dialog .key-radio-card strong {
  font-size: 11px;
  line-height: normal;
}

.key-dialog .key-radio-card small {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.45;
}

.key-dialog .key-model-picker {
  grid-column: 1 / -1;
  padding-top: 0;
}

.key-dialog .key-choice-group > small,
.key-dialog #key-model-field > .key-radio-card {
  grid-column: 1 / -1;
}

.key-dialog .key-model-checks {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.key-dialog #key-channel-field {
  grid-template-columns: 1fr;
}

.key-dialog .key-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.key-dialog .key-line-head a {
  color: var(--mint);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.key-dialog .key-line-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
}

.key-dialog .key-line-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--mint) 62%, var(--line));
  background: color-mix(in srgb, var(--mint) 8%, transparent);
}

.key-dialog .key-line-card:has(input:disabled) {
  opacity: .55;
}

.key-dialog .key-line-card input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--mint);
}

.key-dialog .key-line-card > span {
  display: block;
  min-width: 0;
}

.key-dialog .key-line-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.key-dialog .key-line-card em {
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mint) 16%, transparent);
  color: var(--mint);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.key-dialog .key-line-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.key-dialog .key-more {
  margin: 4px 0 16px;
  border-top: 1px solid var(--line);
}

.key-dialog .key-more summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  cursor: pointer;
  list-style: none;
}

.key-dialog .key-more summary::-webkit-details-marker {
  display: none;
}

.key-dialog .key-more summary span {
  font-weight: 700;
}

.key-dialog .key-more summary small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

@media (max-width: 840px) {
  .main:before {
    width: 100vw;
  }

  .sign-in-intro .brand {
    top: 24px;
    left: 30px;
  }

  .sign-in-story {
    margin-top: 52px;
  }

  .sign-in-intro .coordinates {
    position: static;
    margin-top: 24px;
  }
}

@media (max-width: 560px) {
  .key-dialog .key-choice-group,
  .key-ready-model-list {
    grid-template-columns: 1fr;
  }

  .key-asset-readiness-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  body,
  :root[data-console-theme="night"] body,
  :root[data-console-theme="day"] body,
  body:has(#sign-in:not([hidden])),
  :root[data-console-theme="night"] body:has(#sign-in:not([hidden])) {
    background-attachment: scroll;
  }
}

@media (prefers-reduced-motion: reduce) {
  .harbour-current span,
  .activation-step.next .journey-index:after,
  .rail-foot > .coordinates,
  .rail-foot > .coordinates:before,
  .rail-foot > .coordinates:after {
    animation: none;
  }

  .rail-foot > .coordinates {
    opacity: .82;
  }

  .activation-step a {
    transition: none;
  }
}

/* Key setup: route first, compact searchable model permissions. */
.key-dialog:is(#key-editor-dialog, #key-model-dialog) { width: min(640px, calc(100% - 24px)); scrollbar-color: var(--line) transparent; }
:is(#key-editor-dialog, #key-model-dialog) .eyebrow { display: none; }
:is(#key-editor-dialog, #key-model-dialog) .key-dialog-head h2 { margin-top: 0; font-family: inherit; font-size: 24px; }
:is(#key-editor-dialog, #key-model-dialog) .key-choice-group legend { margin-bottom: 8px; color: var(--text); font-size: 13px; font-weight: 650; }
:is(#key-editor-dialog, #key-model-dialog) #key-channel-field { grid-template-columns: 1fr 1fr; }
:is(#key-editor-dialog, #key-model-dialog) .key-line-card { align-items: center; min-height: 54px; padding: 12px; cursor: pointer; }
:is(#key-editor-dialog, #key-model-dialog) .key-line-card input { flex: none; margin: 0; }
:is(#key-editor-dialog, #key-model-dialog) .key-line-card strong { flex-wrap: wrap; font-size: 13px; }
:is(#key-editor-dialog, #key-model-dialog) .key-line-title { font-weight: 600; }
:is(#key-editor-dialog, #key-model-dialog) #key-channel-field > small { font-size: 11px; }
:is(#key-editor-dialog, #key-model-dialog) #key-model-field { grid-template-columns: 1fr; gap: 10px; }
:is(#key-editor-dialog, #key-model-dialog) .key-catalog-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.key-catalog-toggle strong { display: block; font-size: 13px; font-weight: 600; }
.key-catalog-toggle small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
:is(#key-editor-dialog, #key-model-dialog) .key-catalog-toggle input { appearance: none; flex: none; width: 36px; height: 22px; min-height: 0; margin: 0; padding: 2px; border: 1px solid var(--line); border-radius: 20px; background: var(--deck); cursor: pointer; transition: background-color .16s ease; }
.key-catalog-toggle input::before { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .16s ease; }
:is(#key-editor-dialog, #key-model-dialog) .key-catalog-toggle input:checked { background: var(--mint); border-color: var(--mint); }
.key-catalog-toggle input:checked::before { transform: translateX(14px); background: var(--deck); }
:is(#key-editor-dialog, #key-model-dialog) .key-scope-summary { display: block; margin: 0; padding: 0; border: 0; background: none; }
:is(#key-editor-dialog, #key-model-dialog) .key-scope-summary strong { color: var(--muted); font-size: 11px; font-weight: 400; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-picker { margin: 0; }
.key-picker-toolbar { display: flex; gap: 6px; }
:is(#key-editor-dialog, #key-model-dialog) .key-picker-toolbar input { flex: 1; width: 0; min-height: 38px; font-size: 12px; }
:is(#key-editor-dialog, #key-model-dialog) .key-picker-toolbar button { flex: none; min-height: 38px; padding: 6px 10px; font-size: 11px; }
.key-picker-status { display: flex; justify-content: space-between; margin: 9px 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; max-height: 200px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; overscroll-behavior: contain; scrollbar-color: var(--line) transparent; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks .key-radio-card { align-items: center; min-height: 38px; gap: 8px; padding: 8px; border: 1px solid transparent; border-radius: 6px; box-shadow: none; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks .key-radio-card span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks input { width: 15px; height: 15px; margin: 0; }
:is(#key-editor-dialog, #key-model-dialog) [hidden] { display: none !important; }
:is(#key-editor-dialog, #key-model-dialog) #key-unavailable-model-note, :is(#key-editor-dialog, #key-model-dialog) #key-model-empty { margin: 8px 0 0; font-size: 11px; line-height: 1.5; }
:is(#key-editor-dialog, #key-model-dialog) .key-connection { margin: 10px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
:is(#key-editor-dialog, #key-model-dialog) .key-connection dl { gap: 8px; margin: 12px 0; }
:is(#key-editor-dialog, #key-model-dialog) .key-connection dl > div { grid-template-columns: 120px minmax(0, 1fr); }
:is(#key-editor-dialog, #key-model-dialog) .key-connection code { white-space: pre-wrap; }
:is(#key-editor-dialog, #key-model-dialog) .key-dialog-actions { position: sticky; bottom: 0; margin-top: 18px; padding: 14px 0; background: var(--deck); }
:is(#key-editor-dialog, #key-model-dialog) input:focus-visible, :is(#key-editor-dialog, #key-model-dialog) button:focus-visible, :is(#key-editor-dialog, #key-model-dialog) .key-line-card:has(input:focus-visible) { outline: 2px solid var(--mint); outline-offset: 3px; }
@media (max-width: 560px) {
  :is(#key-editor-dialog, #key-model-dialog) #key-channel-field { grid-template-columns: 1fr; }
  :is(#key-editor-dialog, #key-model-dialog) .key-model-checks { grid-template-columns: 1fr; max-height: 190px; }
  :is(#key-editor-dialog, #key-model-dialog) .key-connection dl > div { grid-template-columns: 1fr; gap: 3px; }
  :is(#key-editor-dialog, #key-model-dialog) .key-dialog-actions { bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  :is(#key-editor-dialog, #key-model-dialog) .key-catalog-toggle input, .key-catalog-toggle input::before { transition: none; }
}

/* Keep the full catalog visible while explaining another route's availability. */
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks .key-model-other-line { cursor: default; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks .key-model-other-line > span { color: var(--muted); }
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks .key-radio-card { flex-wrap: wrap; column-gap: 8px; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks .key-radio-card > span { flex: 1; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-line-hint { flex-basis: 100%; margin: 0 0 0 23px; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.5; }

/* A short default creation flow; model restrictions stay in More settings. */
:is(#key-editor-dialog, #key-model-dialog) .key-dialog-head .muted:empty, :is(#key-editor-dialog, #key-model-dialog) #key-message:empty { display: none; }
:is(#key-editor-dialog, #key-model-dialog) .gift-purpose { margin: 12px 0 16px; gap: 4px 20px; }
:is(#key-editor-dialog, #key-model-dialog) .gift-purpose legend { margin-bottom: 3px; font-size: 12px; }
:is(#key-editor-dialog, #key-model-dialog) .gift-purpose label { min-height: 36px; font-size: 13px; }
:is(#key-editor-dialog, #key-model-dialog) .key-options { margin-top: 18px; border-top: 1px solid var(--line); }
:is(#key-editor-dialog, #key-model-dialog) .key-options:has(#key-model-field[hidden]) { display: none; }
:is(#key-editor-dialog, #key-model-dialog) .key-options > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; }
:is(#key-editor-dialog, #key-model-dialog) .key-options > summary::-webkit-details-marker { display: none; }
:is(#key-editor-dialog, #key-model-dialog) .key-options > summary > span::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 10px 2px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .16s ease; }
:is(#key-editor-dialog, #key-model-dialog) .key-options[open] > summary > span::before { transform: rotate(45deg); }
:is(#key-editor-dialog, #key-model-dialog) .key-options > summary > small { color: var(--muted); font-size: 11px; font-weight: 400; text-align: right; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-checks { display: block; max-height: 290px; padding: 6px; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-group { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; margin-bottom: 12px; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-group:last-child { margin-bottom: 0; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-group-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding: 0 6px; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-group-head strong { font-size: 12px; font-weight: 600; }
:is(#key-editor-dialog, #key-model-dialog) .key-model-group-head button { padding: 5px; font-size: 11px; }
:is(#key-editor-dialog, #key-model-dialog) summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 4px; }
@media(max-width:560px) {
  :is(#key-editor-dialog, #key-model-dialog) .key-model-group { grid-template-columns: 1fr; }
  :is(#key-editor-dialog, #key-model-dialog) .key-options > summary { align-items: flex-start; padding-top: 16px; }
}
@media(prefers-reduced-motion:reduce) {
  :is(#key-editor-dialog, #key-model-dialog) .key-options > summary > span::before { transition: none; }
}

/* Copy one route at a time and keep feedback inside the active dialog. */
.key-address-item { margin: 12px 0; min-width: 0; }
.key-address-item > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.key-address-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.key-address-row button { flex: none; min-height: 36px; padding: 6px 10px; font-size: 11px; }
:is(#key-editor-dialog, #key-model-dialog) .key-address-row code, #key-created-integration .key-address-row code { flex: 1; min-width: 0; margin: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); font-size: 11px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
#key-created-integration { margin: 16px 0; border-top: 1px solid var(--line); }
#key-created-integration > strong { display: block; margin-top: 14px; font-size: 13px; }
#key-created-integration > p, #key-created-integration > a { font-size: 11px; line-height: 1.6; }
#key-created-integration > a { color: var(--mint); }
.key-copy-status { margin: 8px 0; color: var(--mint); font-size: 11px; line-height: 1.6; }
.key-copy-status.error { color: var(--bad); }
.key-copy-status:empty { display: none; }

/* Model scope is an applied draft; catalog enrollment is a separate setting. */
#key-editor-dialog .key-setting-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 0; }
#key-editor-dialog .key-setting-row strong { display:block; font-size:13px; font-weight:600; }
#key-editor-dialog .key-setting-row small { display:block; margin-top:5px; color:var(--muted); font-size:12px; }
#key-editor-dialog .key-setting-row button { min-height:36px; padding:7px 12px; font-size:12px; }
#key-editor-dialog .key-catalog-toggle { border-top:1px solid var(--line); padding-top:16px; }
#key-model-dialog { width:min(640px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:24px; overflow-y:auto; }
#key-model-dialog .key-dialog-head { margin-bottom:16px; }
#key-model-dialog .key-dialog-head p { margin:7px 0 0; font-size:12px; }
#key-model-dialog .key-scope-summary { margin:0 0 14px; font-size:12px; color:var(--muted); }
#key-model-dialog .key-model-checks { max-height:min(48dvh,440px); }
#key-model-dialog .key-dialog-actions { position:sticky; bottom:-24px; margin-top:16px; padding:16px 0; background:var(--deck); }
#key-model-dialog .message:empty { display:none; }
#key-model-dialog [hidden] { display:none !important; }
@media(max-width:560px) { #key-model-dialog { padding:18px; } #key-model-dialog .key-dialog-actions { bottom:-18px; } }
