/* The hub page. Plain, provisional styles; the design belongs to stage 3. */
body {
  margin: 0;
  font: 16px/1.5 system-ui, sans-serif;
  color: #1f2328;
  background: #ffffff;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 { margin: 0 0 8px; }

#area-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#area-form input {
  min-width: 16em;
  padding: 6px 8px;
  font: inherit;
}

#area-form button,
.consent-card button {
  padding: 6px 14px;
  font: inherit;
  color: #ffffff;
  background: #1d4ed8;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  cursor: pointer;
}

#network-list a { overflow-wrap: anywhere; }

:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* The hub's consent card, a dialog added to <body>. */
.consent-card { max-width: 560px; width: 85%; border: 1px solid #888; border-radius: 12px; padding: 24px; }
.consent-card h2 { margin: 0 0 12px; font-size: 1.25em; }
.consent-card dl { display: grid; grid-template-columns: fit-content(40%) 1fr; gap: 4px 16px; margin: 12px 0; }
.consent-card dt { font-weight: 600; }
.consent-card dd { margin: 0; overflow-wrap: anywhere; }
.consent-card button { margin-right: 8px; }
.consent-card .consent-decline { color: inherit; background: transparent; border-color: currentColor; }

/* Assistant layout, from the skill's assistant.css. */
.assistant { margin-top: 48px; }

/* The runtime reads these variables for its chat, settings and agent panels. White text
   sits on --ns-primary and --ns-accent, so both keep at least 4.5:1 contrast with white. */
#agent-app {
  --ns-font: system-ui, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #1f2328;
  --ns-primary: #1d4ed8;
  --ns-accent: #1d4ed8;
  --ns-border: #d0d7de;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #f6f8fa;
  --ns-muted: #59636e;
}

.assistant-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  margin-top: 16px;
}

/* Set the height once the runtime has mounted the chat, so a failed load leaves no
   empty box. */
#agent-app.ns-composed-app [data-ns-slot="chat"] { height: 720px; }
#agent-app .ns-chat { background: var(--ns-bg); }

#agent-app input[type="checkbox"],
#agent-app input[type="radio"] { width: auto; }
#agent-app .ns-header { flex-wrap: wrap; }
#agent-app .ns-settings-body label { margin: 4px 0; font-weight: 400; }
#agent-app .ns-w-label { font-family: inherit; }
#agent-app .ns-widget label { margin: 0; }
#agent-app .ns-w-radio label,
#agent-app .ns-w-multi label,
#agent-app .ns-w-toggle { font-weight: 400; }
#agent-app .ns-w-toggle { font-size: 13px; }
#agent-app button { margin: 0; }
#agent-app .ns-w-choice { color: var(--ns-fg); }
#agent-app .ns-devtoggle:not(.on):hover,
#agent-app .ns-modal-close:hover { background: transparent; }
#agent-app .ns-w-choice:disabled:hover { background: #fafbfc; }
#agent-app .ns-msg { overflow-wrap: break-word; }

/* The runtime's own dialogs are added to <body>, outside #agent-app. */
body > dialog h2 { margin: 0 0 12px; font: 700 1.25em system-ui, sans-serif; }

@media (max-width: 760px) {
  .assistant-panels { grid-template-columns: 1fr; }
  .consent-card dl { grid-template-columns: 1fr; gap: 0; }
  .consent-card dd { margin-bottom: 8px; }
}
