:root {
  --ar-bg: #f7fafc;
  --ar-sidebar-bg: #0177c1;
  --ar-sidebar-text: #ffffff;
  --ar-search-bg: #f7fafc;
  --ar-search-text: #1f2937;
  --ar-search-placeholder: #5f6875;
  --ar-search-border: #0177c1;
  --ar-search-hover: #6fb43f;
  --ar-search-focus: #0177c1;
  --ar-search-focus-ring: rgba(1, 119, 193, 0.24);
  --ar-panel: #ffffff;
  --ar-text: #1f2937;
  --ar-muted: #667085;
  --ar-primary: #0177c1;
  --ar-primary-dark: #005f9d;
  --ar-accent: #6fb43f;
  --ar-border: #d9e2ec;
  --ar-danger: #b42318;
  --ar-danger-sidebar: #facc15;
  --ar-success: #067647;
  --ar-shadow: rgba(1, 119, 193, 0.12);
  --ar-font-body: "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif;
  --ar-font-headings: var(--ar-font-body);
}

.ar-app {
  color: var(--ar-text);
  font-family: var(--ar-font-body, "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif);
  margin: 24px 0;
  container-type: inline-size;
}

.ar-version-label {
  margin: 10px 0 0;
  color: var(--ar-muted, #667085);
  font-family: var(--ar-font-body, "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.4;
  opacity: .58;
  text-align: center;
}

.ar-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  width: min(100%, 1440px, calc((100dvh - 48px) * 16 / 9));
  max-height: calc(100dvh - 48px);
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin-inline: auto;
  border: 1px solid var(--ar-border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--ar-bg);
  box-shadow: 0 18px 60px var(--ar-shadow);
}

.ar-sidebar {
  background: var(--ar-sidebar-bg);
  color: var(--ar-text);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-right: 6px solid var(--ar-accent);
}

.ar-mobile-sidebar-toggle {
  display: none;
}

.ar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ar-border);
}

.ar-brand-logo {
  display: block;
  width: 118px;
  max-width: 55%;
  height: auto;
  object-fit: contain;
}

.ar-brand strong {
  display: block;
  color: var(--ar-primary);
  font-size: 18px;
  line-height: 1.1;
}

.ar-brand span {
  display: block;
  font-size: 13px;
  color: var(--ar-muted);
  margin-top: 2px;
}

.ar-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ar-primary), var(--ar-accent));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
}

.ar-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.ar-main-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  padding: 28px 28px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ar-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.ar-topbar h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  color: var(--ar-primary);
  font-weight: 700;
}

.ar-topbar p {
  margin: 0;
  color: var(--ar-muted);
}

.ar-top-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ar-top-controls label {
  font-size: 13px;
  color: var(--ar-muted);
}

.ar-top-controls select {
  display: block;
  margin-top: 4px;
  border: 1px solid var(--ar-border);
  border-radius: 12px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ar-text);
  font-family: inherit;
}

.ar-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--ar-border);
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--ar-text) !important;
}

.ar-button,
.ar-login-box .ar-button {
  border: 0;
  background: var(--ar-primary);
  color: #fff !important;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s ease;
  font-family: inherit;
}

.ar-button:hover {
  background: var(--ar-primary-dark);
  transform: translateY(-1px);
}

.ar-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.ar-button-secondary,
.ar-login-box .ar-button-secondary {
  background: #eef7ed;
  color: var(--ar-primary) !important;
}

.ar-button-secondary:hover {
  background: #e1f2dc;
}

.ar-full {
  width: 100%;
}

.ar-section-title {
  margin-top: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ar-accent);
  font-weight: 800;
}

.ar-conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  max-height: none;
  padding-right: 4px;
}

.ar-sidebar-search {
  display: grid;
  gap: 8px;
}

.ar-input {
  width: 100%;
  border: 1px solid var(--ar-border);
  border-radius: 14px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ar-text);
  font: inherit;
}

.ar-input:focus {
  outline: none;
  border-color: var(--ar-primary);
  box-shadow: 0 0 0 4px rgba(1, 119, 193, 0.12);
}

.ar-sidebar-summary {
  margin: 0;
}

.ar-conversation {
  width: 100%;
  text-align: left;
  border: 1px solid var(--ar-border);
  background: #fff;
  color: var(--ar-text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  min-height: 0;
}

.ar-conversation:hover,
.ar-conversation.is-active {
  border-color: var(--ar-primary);
  box-shadow: 0 8px 22px rgba(1,119,193,0.08);
}

.ar-conversation span,
.ar-conversation small {
  display: block;
}

.ar-conversation-title {
  font-weight: 700;
}

.ar-conversation small {
  color: var(--ar-muted);
  margin-top: 4px;
}

.ar-conversation-meta {
  font-size: 12px;
  line-height: 1.35;
}

.ar-conversation-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ar-conversation-action,
.ar-conversation-delete {
  border: 1px solid var(--ar-border);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ar-primary);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}

.ar-conversation-action:hover {
  border-color: var(--ar-primary);
  background: #f8fcff;
}

.ar-conversation-empty {
  margin: 0;
  padding: 14px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.08);
  line-height: 1.4;
}

.ar-conversation-rename-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.ar-conversation-rename-form input {
  border: 1px solid var(--ar-border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.ar-conversation-rename-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ar-conversation-rename-actions button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ar-conversation-rename-actions button[type="submit"] {
  background: var(--ar-accent);
  color: #fff;
}

.ar-conversation-rename-actions button[type="button"] {
  background: rgba(255, 255, 255, 0.88);
  color: var(--ar-primary);
}

.ar-link-button {
  background: transparent;
  color: var(--ar-primary);
  border: 0;
  text-align: left;
  cursor: pointer;
  padding: 4px 0;
  opacity: 0.95;
  font-family: inherit;
}

.ar-link-button:hover {
  opacity: 1;
  text-decoration: underline;
}

.ar-danger {
  color: var(--ar-danger) !important;
}

.ar-notice {
  background: #ffffff;
  border: 1px solid var(--ar-border);
  color: var(--ar-muted);
  border-radius: 16px;
  padding: 12px 14px;
}

.ar-notice-success {
  border-color: rgba(111,180,63,0.4);
  color: var(--ar-success);
  background: #f3fbef;
}

.ar-notice-error {
  border-color: rgba(180,35,24,0.25);
  color: var(--ar-danger);
  background: #fff4f2;
}

.ar-starters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Startvragen-layout:
   1 vraag: volledige breedte
   2 vragen: onder elkaar
   3 vragen: onder elkaar
   4 vragen: 2 rijen met 2 vragen
   5 vragen: 2 rijen met 2 vragen + laatste over volledige breedte
   6 vragen: 3 rijen met 2 vragen */
.ar-starters-count-1,
.ar-starters-count-2,
.ar-starters-count-3 {
  grid-template-columns: minmax(0, 1fr);
}

.ar-starters-count-4,
.ar-starters-count-5,
.ar-starters-count-6 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ar-starters-count-5 button:last-child {
  grid-column: 1 / -1;
}

.ar-starters button {
  border: 1px solid var(--ar-border);
  background: #fff;
  color: var(--ar-text);
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-family: inherit;
  min-height: 72px;
  line-height: 1.24;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.ar-starters button:hover {
  border-color: var(--ar-primary);
  box-shadow: 0 8px 22px rgba(1,119,193,0.10);
}

.ar-chat {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  overflow-anchor: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px;
}

.ar-message {
  max-width: 78%;
  background: #fff;
  border: 1px solid var(--ar-border);
  padding: 13px 15px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(1,119,193,0.06);
}

.ar-message-user {
  align-self: flex-end;
  background: #eaf6ff;
  border-color: #bfdff5;
}

.ar-message-user[data-chat-request-id] {
  scroll-margin-block-start: 18px;
}

.ar-message-assistant {
  align-self: flex-start;
}

.ar-thinking-bubble {
  width: min(100%, 430px);
  background:
    radial-gradient(circle at 18% 15%, rgba(111, 180, 63, 0.13), transparent 38%),
    linear-gradient(135deg, #ffffff 0%, #f5fbff 100%);
  border-color: rgba(1, 119, 193, 0.24);
  box-shadow:
    0 12px 30px rgba(1, 119, 193, 0.10),
    0 0 24px rgba(111, 180, 63, 0.08);
}

.ar-thinking-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.ar-thinking-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(1, 119, 193, 0.07);
  box-shadow: 0 0 16px rgba(1, 119, 193, 0.12);
}

.ar-thinking-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ar-primary);
  opacity: 0.42;
  animation: ar-thinking-pulse 1.8s ease-in-out infinite;
}

.ar-thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ar-thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.ar-thinking-spark {
  position: absolute;
  top: -7px;
  right: -6px;
  color: var(--ar-accent);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(111, 180, 63, 0.45);
  animation: ar-thinking-spark 2.4s ease-in-out infinite;
}

.ar-thinking-text {
  color: #344054;
  font-weight: 650;
  line-height: 1.4;
}

.ar-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes ar-thinking-pulse {
  0%, 70%, 100% {
    opacity: 0.36;
    transform: translateY(0) scale(0.92);
  }
  35% {
    opacity: 0.95;
    transform: translateY(-2px) scale(1.05);
  }
}

@keyframes ar-thinking-spark {
  0%, 100% {
    opacity: 0.55;
    transform: scale(0.9) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.08) rotate(12deg);
  }
}

.ar-message-hr {
  align-self: flex-start;
  background: #f5fbf4;
  border-color: #cfe4ca;
}

.ar-message-system {
  align-self: center;
  max-width: 100%;
  width: min(100%, 700px);
  background: #f8fafc;
  border-style: dashed;
  border-color: #d0d5dd;
  box-shadow: none;
}

.ar-message-system.ar-message-compact-status {
  width: auto;
  max-width: min(100%, 520px);
  padding: 8px 12px;
  border-style: solid;
  border-color: #dbe6f2;
  background: #f6f9fc;
  border-radius: 999px;
}

.ar-message-system.ar-message-compact-status .ar-message-label {
  margin-bottom: 2px;
  font-size: 11px;
}

.ar-message-system.ar-message-compact-status .ar-message-content {
  font-size: 14px;
  color: #475467;
}

.ar-message-label {
  font-size: 12px;
  color: var(--ar-muted);
  font-weight: 800;
  margin-bottom: 6px;
}

.ar-message-system .ar-message-label {
  color: #475467;
}

.ar-message-content h1,
.ar-message-content h2,
.ar-message-content h3 {
  margin: 12px 0 6px;
  color: var(--ar-primary);
}

.ar-message-content ul {
  margin: 6px 0 6px 20px;
}

.ar-officient-card {
  margin-top: 12px;
  border: 1px solid rgba(1, 119, 193, 0.18);
  background: linear-gradient(180deg, #f8fcff 0%, #ffffff 100%);
  border-radius: 16px;
  padding: 14px 15px;
  display: grid;
  gap: 12px;
}

.ar-officient-card h4 {
  margin: 0;
  color: var(--ar-primary);
  font-size: 17px;
  line-height: 1.2;
}

.ar-officient-card p {
  margin: 0;
}

.ar-officient-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ar-accent);
}

.ar-officient-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ar-officient-card label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--ar-muted);
  font-weight: 700;
}

.ar-officient-card input,
.ar-officient-card select,
.ar-officient-card textarea {
  width: 100%;
  border: 1px solid var(--ar-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ar-text);
  font: inherit;
}

.ar-officient-card textarea {
  min-height: 88px;
  resize: vertical;
}

.ar-officient-card input:focus,
.ar-officient-card select:focus,
.ar-officient-card textarea:focus {
  outline: none;
  border-color: var(--ar-primary);
  box-shadow: 0 0 0 4px rgba(1, 119, 193, 0.12);
}

.ar-officient-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(1, 119, 193, 0.05);
  border: 1px solid rgba(1, 119, 193, 0.12);
  border-radius: 14px;
}

.ar-officient-warning,
.ar-officient-error {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.ar-officient-warning {
  color: #8a4b00;
  background: #fff6e5;
  border: 1px solid rgba(216, 119, 0, 0.16);
}

.ar-officient-error {
  color: var(--ar-danger);
  background: #fff4f2;
  border: 1px solid rgba(180, 35, 24, 0.16);
}

.ar-officient-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ar-officient-card-success {
  border-color: rgba(111, 180, 63, 0.28);
  background: linear-gradient(180deg, #f6fcf2 0%, #ffffff 100%);
}

.ar-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ar-followup-button {
  border: 1px solid var(--ar-border);
  background: #fff;
  color: var(--ar-primary);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.25;
}

.ar-followup-button:hover {
  border-color: var(--ar-primary);
  box-shadow: 0 8px 22px rgba(1,119,193,0.10);
  background: #f8fcff;
}

.ar-message-tools {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.ar-message-tool {
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: #fff;
  color: var(--ar-primary);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.ar-message-tool:hover,
.ar-message-tool:focus {
  border-color: var(--ar-primary);
  box-shadow: 0 0 0 3px rgba(1, 119, 193, 0.10);
  outline: none;
}

.ar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ar-message-form {
  display: grid;
  flex: 0 0 auto;
  align-self: stretch;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  width: auto;
  max-width: none;
  box-sizing: border-box;
  margin: 0 28px 28px;
  background: #fff;
  border: 1px solid var(--ar-border);
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 -10px 28px rgba(247, 250, 252, 0.92);
}

.ar-message-input-wrap {
  min-width: 0;
}

.ar-message-form-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.ar-message-form textarea {
  border: 0;
  resize: none;
  outline: none;
  font: inherit;
  padding: 8px;
  min-height: 56px;
  width: 100%;
  background: transparent;
  box-sizing: border-box;
}

.ar-message-form-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 4px 8px 2px;
  color: var(--ar-muted);
  font-size: 12px;
}

.ar-message-form-hint,
.ar-message-count {
  color: var(--ar-muted);
}

.ar-message-form-hint {
  min-width: 0;
}

.ar-message-count {
  justify-self: end;
  white-space: nowrap;
  line-height: 1.4;
  padding-inline-end: 2px;
}

.ar-message-submit {
  width: auto;
  min-width: 132px;
  max-width: 100%;
  min-height: 44px;
  justify-self: start;
  align-self: end;
}

.ar-muted {
  color: var(--ar-muted);
  font-size: 13px;
  line-height: 1.45;
}

.ar-login-box {
  border: 1px solid var(--ar-border);
  border-radius: 22px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(1,119,193,0.08);
}

@media (prefers-reduced-motion: reduce) {
  .ar-thinking-dot,
  .ar-thinking-spark {
    animation: none !important;
    transform: none !important;
  }

  .ar-thinking-dot {
    opacity: 0.72;
  }

  .ar-thinking-spark {
    opacity: 0.85;
  }
}

@media (max-width: 900px) {
  .ar-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .ar-mobile-sidebar-toggle {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid var(--ar-border);
    background: var(--ar-sidebar-bg);
    color: var(--ar-bg);
    font-family: var(--ar-font-headings);
    font-weight: 700;
    cursor: pointer;
  }
  .ar-mobile-sidebar-icon {
    font-size: 22px;
    line-height: 1;
  }
  .ar-sidebar {
    grid-column: 1;
    grid-row: 2;
    z-index: 10;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: none;
    border-right: 0;
    border-top: 0;
    border-bottom: 6px solid var(--ar-accent);
  }
  .ar-shell.is-sidebar-open .ar-sidebar {
    display: flex;
  }
  .ar-main {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    box-sizing: border-box;
  }
  .ar-starters,
  .ar-starters-count-1,
  .ar-starters-count-2,
  .ar-starters-count-3,
  .ar-starters-count-4,
  .ar-starters-count-5,
  .ar-starters-count-6 {
    grid-template-columns: 1fr;
  }
  .ar-message {
    max-width: 94%;
  }
  .ar-officient-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ar-topbar {
    flex-direction: column;
  }
  .ar-conversation-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .ar-conversation-actions {
    flex-direction: row;
  }
  .ar-message-form {
    grid-template-columns: 1fr;
  }
  .ar-message-form-meta {
    grid-template-columns: minmax(0, 1fr) max-content;
  }
}

@media (max-width: 640px) {
  .ar-main-scroll {
    padding: 18px 18px 10px;
  }

  .ar-message-form {
    margin: 0 18px 18px;
  }

  .ar-message-form-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .ar-message-form-footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .ar-message-count {
    justify-self: start;
  }

  .ar-message-submit {
    width: auto;
    min-width: 132px;
    max-width: 100%;
    min-height: 44px;
    justify-self: start;
    padding: 10px 20px;
  }
}

@media (orientation: portrait) {
  .ar-app {
    margin: 12px 0;
  }

  .ar-shell {
    width: min(100%, 720px, calc((100dvh - 24px) * 9 / 16));
    max-height: calc(100dvh - 24px);
    aspect-ratio: 9 / 16;
  }
}

/* Agilon HR Helpdesk registration page */
.ar-register-wrap {
  max-width: 1120px;
  margin: 48px auto;
  padding: 24px;
  font-family: var(--ar-font-body, "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif);
}

.ar-register-card {
  max-width: 620px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 32px;
  padding: clamp(28px, 5vw, 52px);
  box-shadow: 0 24px 80px rgba(1, 119, 193, 0.12);
  color: #1f2a44;
}

.ar-register-brandline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.ar-register-logo {
  width: 150px;
  max-width: 55%;
  height: auto;
  display: block;
}

.ar-register-brandline span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(111, 180, 63, 0.12);
  color: #6FB43F;
  font-weight: 800;
}

.ar-register-kicker {
  color: #6FB43F;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 8px;
}

.ar-register-card h1 {
  margin: 0 0 14px;
  color: #0177C1;
  font-size: clamp(34px, 5vw, 56px);
  line-height: .95;
  font-weight: 800;
}

.ar-register-intro {
  color: #5b6b84;
  font-size: 19px;
  line-height: 1.55;
  margin: 0 0 28px;
}

.ar-register-form {
  display: grid;
  gap: 18px;
}

.ar-register-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: #1f2a44;
}

.ar-register-form input[type="text"],
.ar-register-form input[type="email"],
.ar-register-form input[type="password"] {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cfe0ef;
  border-radius: 18px;
  padding: 12px 16px;
  font: inherit;
  color: #1f2a44;
  background: #fff;
}

.ar-password-field {
  position: relative;
  display: block;
}

.ar-password-field input[type="text"],
.ar-password-field input[type="password"] {
  padding-right: 114px;
}

.ar-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(1, 119, 193, 0.16);
  border-radius: 999px;
  background: #f8fbfe;
  color: #0177C1;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ar-password-field.is-ready .ar-password-toggle {
  display: inline-flex;
}

.ar-password-toggle:hover,
.ar-password-toggle:focus {
  border-color: #0177C1;
  background: #eef7ff;
  box-shadow: 0 0 0 4px rgba(1, 119, 193, 0.10);
  outline: none;
}

.ar-password-toggle-icon {
  display: inline-flex;
  line-height: 0;
}

.ar-register-form input:focus {
  outline: none;
  border-color: #0177C1;
  box-shadow: 0 0 0 4px rgba(1, 119, 193, 0.12);
}

.ar-register-form small,
.ar-register-check span {
  color: #667085;
  font-weight: 500;
  line-height: 1.45;
}

.ar-register-check {
  grid-template-columns: 22px 1fr;
  align-items: flex-start;
  gap: 12px !important;
  padding: 16px;
  background: rgba(1, 119, 193, 0.05);
  border-radius: 18px;
}

.ar-register-check input {
  margin-top: 3px;
}

.ar-register-submit {
  width: 100%;
  min-height: 56px;
  font-size: 17px;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
}

.ar-register-login {
  margin: 22px 0 0;
  color: #667085;
  text-align: center;
}

.ar-register-login a {
  color: #0177C1;
  font-weight: 800;
}

.ar-register-error,
.ar-register-success {
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-weight: 700;
}

.ar-register-error {
  background: #fff2f0;
  color: #b42318;
  border: 1px solid #f3b5ad;
}

.ar-register-success {
  background: #f1f8ee;
  color: #2f7a17;
  border: 1px solid rgba(111, 180, 63, .35);
}

/* Agilon HR Helpdesk access and login pages */
.ar-access-wrap,
.ar-auth-wrap {
  max-width: 1120px;
  margin: 48px auto;
  padding: 24px;
  font-family: var(--ar-font-body, "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif);
}

.ar-access-card,
.ar-auth-card {
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 32px;
  padding: clamp(28px, 5vw, 56px);
  box-shadow: 0 24px 80px rgba(1, 119, 193, 0.12);
  color: #1f2a44;
}

.ar-access-card {
  max-width: 780px;
}

.ar-auth-brandline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.ar-auth-brandline span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(111, 180, 63, 0.12);
  color: #6FB43F;
  font-weight: 800;
}

.ar-access-card h1,
.ar-auth-card h1 {
  margin: 0 0 14px;
  color: #0177C1;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: .95;
  font-weight: 800;
}

.ar-access-card p,
.ar-auth-card p {
  color: #5b6b84;
  font-size: 19px;
  line-height: 1.55;
}

.ar-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 26px 0 22px;
}

.ar-access-actions .ar-button {
  min-width: 160px;
  min-height: 54px;
  text-decoration: none;
}

.ar-access-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: #5b6b84;
}

.ar-access-list li {
  position: relative;
  padding-left: 28px;
  line-height: 1.45;
  font-weight: 650;
}

.ar-access-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: 12px;
  height: 12px;
  border-radius: 4px 10px 10px 10px;
  background: #6FB43F;
  transform: rotate(-18deg);
}

.ar-auth-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 22px;
  color: #667085;
}

.ar-auth-links a {
  color: #0177C1;
  font-weight: 800;
  text-decoration: none;
}

.ar-auth-links a:hover {
  text-decoration: underline;
}

.ar-remember-check {
  background: rgba(111, 180, 63, 0.08);
}

@media (max-width: 640px) {
  .ar-officient-actions {
    flex-direction: column;
  }

  .ar-officient-actions .ar-button {
    width: 100%;
  }

  .ar-auth-brandline,
  .ar-register-brandline {
    align-items: flex-start;
    flex-direction: column;
  }

  .ar-access-actions .ar-button {
    width: 100%;
  }

  .ar-password-field input[type="text"],
  .ar-password-field input[type="password"] {
    padding-right: 104px;
  }

  .ar-password-toggle {
    right: 8px;
    padding: 8px 10px;
  }
}


.ar-ai-disclaimer {
  margin: 14px 0 16px;
  padding: 13px 16px;
  border: 1px solid rgba(1, 119, 193, 0.18);
  background: linear-gradient(135deg, rgba(1,119,193,0.06), rgba(111,180,63,0.08));
  color: var(--ar-muted);
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.ar-ai-disclaimer-app {
  margin-top: -4px;
  margin-bottom: 2px;
}

.ar-access-card .ar-ai-disclaimer,
.ar-register-card .ar-ai-disclaimer,
.ar-auth-card .ar-ai-disclaimer {
  text-align: left;
}

/* v1.2.0 conversation list */

.ar-conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.ar-conversation-row.is-active .ar-conversation {
  border-color: var(--ar-primary);
  box-shadow: 0 8px 22px rgba(1,119,193,0.08);
}

.ar-conversation-delete {
  color: var(--ar-danger);
}

.ar-conversation-delete:hover {
  border-color: var(--ar-danger);
  color: var(--ar-danger);
  background: #fff5f5;
}

/* v0.2.0 dynamic branding */
.ar-topbar h1,
.ar-button,
.ar-section-title,
.ar-brand strong,
.ar-register-kicker,
.ar-register-card h1,
.ar-auth-card h1,
.ar-starters button {
  font-family: var(--ar-font-headings, var(--ar-font-body, inherit));
}


.ar-public-guest .ar-conversation-list .ar-muted {
  font-size: 0.95rem;
}


.ar-button-loading,
.ar-button-loading:disabled {
  cursor: wait;
  opacity: 0.72;
  position: relative;
}

.ar-button-loading::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.6em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  vertical-align: -0.1em;
  animation: ar-spin 0.8s linear infinite;
}

@keyframes ar-spin {
  to {
    transform: rotate(360deg);
  }
}

.ar-social-login-wrap {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.ar-social-login {
  text-align: center;
  justify-content: center;
}

.ar-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ar-muted);
  font-size: 13px;
  margin: 4px 0;
}

.ar-auth-divider::before,
.ar-auth-divider::after {
  content: "";
  height: 1px;
  background: var(--ar-border);
  flex: 1;
}


/* Commerciële launchfixes voor login, toegang en links */
.ar-access-wrap a:not(.ar-button),
.ar-auth-wrap a:not(.ar-button),
.ar-register-wrap a:not(.ar-button),
.ar-app a:not(.ar-button) {
  color: var(--ar-primary);
}

.ar-access-wrap a:not(.ar-button):hover,
.ar-auth-wrap a:not(.ar-button):hover,
.ar-register-wrap a:not(.ar-button):hover,
.ar-app a:not(.ar-button):hover {
  color: var(--ar-primary-dark);
}

.ar-button,
.ar-login-box .ar-button,
.ar-access-actions .ar-button,
.ar-register-submit,
.ar-social-login {
  background: var(--ar-primary);
  color: var(--ar-button-text, var(--ar-bg)) !important;
}

.ar-button:hover,
.ar-login-box .ar-button:hover,
.ar-access-actions .ar-button:hover,
.ar-register-submit:hover,
.ar-social-login:hover {
  background: var(--ar-primary-dark);
  color: var(--ar-button-text, var(--ar-bg)) !important;
}

.ar-button-secondary,
.ar-login-box .ar-button-secondary {
  background: var(--ar-primary);
  color: var(--ar-button-text, var(--ar-bg)) !important;
}

.ar-button-secondary:hover,
.ar-login-box .ar-button-secondary:hover {
  background: var(--ar-primary-dark);
  color: var(--ar-button-text, var(--ar-bg)) !important;
}

.ar-register-kicker,
.ar-section-title,
.ar-auth-brandline span,
.ar-register-brandline span {
  color: var(--ar-accent);
}

.ar-auth-brandline span,
.ar-register-brandline span,
.ar-remember-check {
  background: color-mix(in srgb, var(--ar-accent) 12%, #ffffff);
}

.ar-access-list li::before {
  background: var(--ar-accent);
}

.ar-access-card h1,
.ar-auth-card h1,
.ar-register-card h1 {
  color: var(--ar-primary);
}

.ar-register-form input:focus {
  border-color: var(--ar-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ar-primary) 14%, transparent);
}


/* Commerciële sidebar-contrastfixes */
.ar-sidebar .ar-brand strong,
.ar-sidebar .ar-brand span {
  color: var(--ar-bg) !important;
}

.ar-sidebar .ar-button.ar-full,
.ar-sidebar [data-ar-action="new-conversation"] {
  background: var(--ar-accent) !important;
  color: var(--ar-bg) !important;
}

.ar-sidebar .ar-button.ar-full:hover,
.ar-sidebar [data-ar-action="new-conversation"]:hover {
  background: var(--ar-accent) !important;
  color: var(--ar-bg) !important;
  filter: brightness(0.94);
}

.ar-sidebar .ar-link-button:not(.ar-danger) {
  color: var(--ar-bg) !important;
}

.ar-sidebar .ar-link-button:not(.ar-danger):hover {
  color: var(--ar-bg) !important;
  text-decoration: underline;
}

.ar-sidebar .ar-link-button.ar-danger {
  color: var(--ar-danger-sidebar) !important;
}

.ar-sidebar .ar-link-button.ar-danger:hover {
  color: var(--ar-danger-sidebar) !important;
  text-decoration: underline;
  filter: brightness(1.05);
}

.ar-sidebar .ar-section-title {
  color: var(--ar-bg) !important;
  opacity: 0.9;
}

.ar-sidebar .ar-sidebar-summary {
  color: rgba(255, 255, 255, 0.9);
}

.ar-sidebar .ar-input,
.ar-sidebar .ar-conversation-rename-form input {
  background: rgba(255, 255, 255, 0.98);
}

.ar-sidebar .ar-conversation {
  color: var(--ar-text);
}

.ar-sidebar .ar-conversation small {
  color: var(--ar-primary);
}

.ar-sidebar .ar-conversation-action,
.ar-sidebar .ar-conversation-delete {
  background: rgba(255, 255, 255, 0.98);
}

/*
 * 1.6.1 gerichte theme-isolatie. De !important-regels zijn alleen op de
 * sidebar en zoekinput toegepast om klassieke thema-, block-theme- en
 * browserregels met vergelijkbare of hogere specificiteit te neutraliseren.
 */
[data-agilon-hr-helpdesk-root].ar-app > .ar-shell > .ar-sidebar,
[data-agilon-hr-helpdesk-root].ar-app > .ar-shell.is-sidebar-open > .ar-sidebar,
[data-agilon-hr-helpdesk-root].ar-app > .ar-shell > .ar-mobile-sidebar-toggle {
  background-color: var(--ar-sidebar-bg) !important;
  background-image: none !important;
  color: var(--ar-sidebar-text) !important;
}

[data-agilon-hr-helpdesk-root].ar-app > .ar-shell > .ar-sidebar::before,
[data-agilon-hr-helpdesk-root].ar-app > .ar-shell > .ar-sidebar::after {
  background-color: var(--ar-sidebar-bg) !important;
}

[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar .ar-brand strong,
[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar .ar-brand span,
[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar .ar-section-title,
[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar .ar-sidebar-summary {
  color: var(--ar-sidebar-text) !important;
}

[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box !important;
  background-color: var(--ar-search-bg) !important;
  background-image: none !important;
  color: var(--ar-search-text) !important;
  -webkit-text-fill-color: var(--ar-search-text) !important;
  border: 1px solid var(--ar-search-border) !important;
  caret-color: var(--ar-search-text) !important;
  box-shadow: none !important;
  outline: 2px solid transparent !important;
  outline-offset: 2px !important;
}

[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input::placeholder {
  color: var(--ar-search-placeholder) !important;
  opacity: 1 !important;
}

[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input:hover:not(:disabled) {
  border-color: var(--ar-search-hover) !important;
}

[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input:focus,
[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input:focus-visible {
  border-color: var(--ar-search-focus) !important;
  outline-color: var(--ar-search-focus) !important;
  box-shadow: 0 0 0 4px var(--ar-search-focus-ring) !important;
}

[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input:disabled {
  background-color: var(--ar-bg) !important;
  color: var(--ar-search-placeholder) !important;
  -webkit-text-fill-color: var(--ar-search-placeholder) !important;
  border-color: var(--ar-search-placeholder) !important;
  cursor: not-allowed;
  opacity: 0.72;
}

[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input:-webkit-autofill,
[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input:-webkit-autofill:hover,
[data-agilon-hr-helpdesk-root].ar-app .ar-sidebar-search > #ar-conversation-search.ar-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ar-search-text) !important;
  caret-color: var(--ar-search-text) !important;
  border-color: var(--ar-search-focus) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--ar-search-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--ar-search-bg) inset !important;
  transition: background-color 99999s ease-out 0s;
}


/* Testfasewaarschuwing in de AI-disclaimer */
.ar-ai-disclaimer-main {
  display: inline;
}

.ar-ai-disclaimer-warning {
  display: block;
  margin-top: 6px;
  color: var(--ar-warning, #b42318);
  font-weight: 700;
}

/* Antwoordfeedback v1.1 */
.ar-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, .25);
  font-size: .92rem;
  color: rgba(31, 41, 55, .78);
}

.ar-feedback button {
  border: 1px solid rgba(148, 163, 184, .55);
  background: #fff;
  color: var(--ar-primary);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ar-feedback button.is-selected {
  border-color: var(--ar-primary);
  background: #eef7ff;
}

.ar-feedback button:hover,
.ar-feedback button:focus {
  border-color: var(--ar-primary);
  box-shadow: 0 0 0 3px rgba(1, 119, 193, .10);
  outline: none;
}

.ar-feedback-form {
  display: grid;
  gap: 10px;
}

.ar-feedback-detail-form {
  display: grid;
  gap: 8px;
  width: 100%;
}

.ar-feedback-detail-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--ar-text);
}

.ar-feedback-detail-form textarea {
  width: 100%;
  border: 1px solid var(--ar-border);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  min-height: 84px;
}

.ar-feedback-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ar-feedback-actions button[type="submit"] {
  background: var(--ar-primary);
  color: #fff;
}

.ar-feedback-cancel {
  background: #fff;
}

.ar-feedback-thanks {
  color: var(--ar-primary);
  font-weight: 700;
}

.ar-case-feedback {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, .25);
  font-size: .92rem;
  color: rgba(31, 41, 55, .82);
}

.ar-case-feedback > span {
  font-weight: 700;
  color: var(--ar-text);
}

.ar-case-feedback-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ar-case-feedback button {
  border: 1px solid rgba(148, 163, 184, .55);
  background: #fff;
  color: var(--ar-primary);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ar-case-feedback button:hover,
.ar-case-feedback button:focus {
  border-color: var(--ar-primary);
  box-shadow: 0 0 0 3px rgba(1, 119, 193, .10);
  outline: none;
}

.ar-case-feedback button[disabled] {
  opacity: .6;
  cursor: wait;
}

.ar-case-feedback small {
  color: var(--ar-muted);
}

.ar-case-feedback-thanks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.ar-case-feedback-thanks strong {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #ecfdf3;
  color: #067647;
  font-size: .9rem;
}
