.arcl-page {
  --arcl-green: #16734d;
  --arcl-green-dark: #0c4d34;
  --arcl-gold: #c48224;
  --arcl-soft: #eaf5ef;
  --arcl-ink: #17231f;
  background: #f5f8f6;
}

.arcl-main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 54px) 64px;
}

.arcl-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.arcl-intro-copy { max-width: 900px; }
.arcl-title-row { display: flex; align-items: center; gap: 18px; }
.arcl-title-row h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 3vw, 2.75rem); letter-spacing: 0; }
.arcl-title-row p { margin: 0; color: var(--muted); line-height: 1.65; }

.arcl-mark {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid #afd2be;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 10px 24px rgba(12, 77, 52, 0.16);
}


.arcl-intro-status { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.arcl-connection { padding: 9px 12px; border: 1px solid #c9ddd2; border-radius: 8px; color: #51635b; background: #fff; font-size: 0.78rem; font-weight: 750; }
.arcl-connection[data-state="ready"] { color: #0d6845; border-color: #9bcbb1; background: #e9f6ef; }
.arcl-connection[data-state="error"] { color: #9b3d31; border-color: #efc3bb; background: #fff0ed; }

.arcl-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid #cfddd5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(24, 55, 43, 0.1);
}

.arcl-sidebar { padding: 24px; border-right: 1px solid #dce7e1; background: #f3f8f5; }
.arcl-sidebar-heading h2, .arcl-chat-header h2 { margin: 0 0 8px; font-size: 1.25rem; }
.arcl-sidebar-heading > p:last-child { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.arcl-language-label { display: block; margin: 22px 0 7px; color: #3f5048; font-size: 0.78rem; font-weight: 800; }
.arcl-language { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid #c9d8d0; border-radius: 8px; color: var(--arcl-ink); background: #fff; font: inherit; }

.arcl-question-groups { display: grid; gap: 18px; margin-top: 24px; }
.arcl-question-group h3 { margin: 0 0 8px; color: #607169; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.arcl-question-list { display: grid; gap: 7px; }
.arcl-question-list button { width: 100%; padding: 10px 11px; border: 1px solid #d2dfd8; border-radius: 8px; color: #29483b; background: #fff; font: inherit; font-size: 0.8rem; line-height: 1.4; text-align: left; cursor: pointer; }
.arcl-question-list button:hover, .arcl-question-list button:focus-visible { border-color: #71ad8c; background: #eaf5ef; outline: none; }

.arcl-scope-note { margin-top: 24px; padding: 14px; border-left: 3px solid var(--arcl-gold); background: #fffaf0; }
.arcl-scope-note strong { font-size: 0.78rem; }
.arcl-scope-note p { margin: 5px 0 0; color: #725b35; font-size: 0.75rem; line-height: 1.5; }

.arcl-chat-panel { display: grid; grid-template-rows: auto minmax(360px, 1fr) auto auto auto; min-width: 0; background: #fff; }
.arcl-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid #e1e9e5; }
.arcl-chat-header .eyebrow { margin-bottom: 5px; }
.arcl-session-facts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.arcl-session-facts span { padding: 6px 9px; border: 1px solid #d8e4de; border-radius: 8px; color: #627168; background: #f7faf8; font-size: 0.72rem; font-weight: 700; }

.arcl-chat-log { min-height: 0; max-height: 620px; overflow-y: auto; padding: 24px; scroll-behavior: smooth; }
.arcl-message { display: flex; gap: 10px; margin-bottom: 18px; }
.arcl-message.user { justify-content: flex-end; }
.arcl-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--arcl-green-dark); font-size: 0.68rem; font-weight: 900; }
.arcl-message.user .arcl-avatar { order: 2; background: #385c85; }
.arcl-bubble { max-width: min(820px, 88%); padding: 13px 15px; border: 1px solid #dbe7e0; border-radius: 8px; color: #24342d; background: #f6faf8; font-size: 0.9rem; line-height: 1.6; overflow-wrap: anywhere; }
.arcl-message.user .arcl-bubble { border-color: #cbdbe9; background: #eef5fa; }
.arcl-bubble > :last-child { margin-bottom: 0; }
.arcl-bubble p { margin: 0 0 10px; }
.arcl-bubble h3 { margin: 14px 0 7px; font-size: 0.96rem; }
.arcl-bubble ul, .arcl-bubble ol { margin: 7px 0 12px; padding-left: 22px; }
.arcl-bubble strong { color: #123d2b; }
.arcl-table-wrap { max-width: 100%; overflow-x: auto; margin: 10px 0; border: 1px solid #d7e2dc; border-radius: 8px; }
.arcl-bubble table { width: 100%; border-collapse: collapse; min-width: 520px; background: #fff; font-size: 0.78rem; }
.arcl-bubble th, .arcl-bubble td { padding: 9px 10px; border-bottom: 1px solid #e4ece8; text-align: left; white-space: nowrap; }
.arcl-bubble th { color: #174b35; background: #eaf5ef; font-weight: 800; }
.arcl-message-tools { display: flex; justify-content: flex-end; margin-top: 9px; }
.arcl-speak { padding: 5px 8px; border: 1px solid #c8d9d0; border-radius: 8px; color: #315a48; background: #fff; font: inherit; font-size: 0.72rem; cursor: pointer; }

.arcl-status { min-height: 24px; padding: 0 24px; color: #5c6e65; font-size: 0.78rem; }
.arcl-status.error { color: #a53f32; }
.arcl-composer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 14px 24px; border-top: 1px solid #e0e9e4; }
.arcl-composer > .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.arcl-composer textarea { width: 100%; min-height: 72px; max-height: 220px; resize: none; padding: 11px 12px; border: 1px solid #bfcec6; border-radius: 8px; color: var(--arcl-ink); background: #fff; font: inherit; line-height: 1.4; }
.arcl-composer textarea:focus { border-color: var(--arcl-green); outline: 2px solid rgba(22, 115, 77, 0.14); }
.arcl-voice-button, .arcl-send-button { min-height: 44px; padding: 0 14px; border-radius: 8px; font: inherit; font-weight: 800; cursor: pointer; }
.arcl-voice-button { border: 1px solid #b9cec3; color: #285b43; background: #eef7f2; }
.arcl-voice-button.listening { color: #fff; border-color: #a94336; background: #a94336; }
.arcl-send-button { border: 1px solid var(--arcl-green-dark); color: #fff; background: var(--arcl-green-dark); }
.arcl-voice-button:disabled, .arcl-send-button:disabled { cursor: not-allowed; opacity: 0.55; }
.arcl-input-note { margin: 0; padding: 0 24px 15px; color: #78877f; font-size: 0.7rem; text-align: right; }

.arcl-capabilities { margin-top: 42px; }
.arcl-capability-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.arcl-capability-grid article { padding: 18px; border: 1px solid #d5e1db; border-radius: 8px; background: #fff; }
.arcl-capability-grid strong { color: #174c35; }
.arcl-capability-grid p { margin: 8px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }

@media (max-width: 980px) {
  .arcl-intro { align-items: flex-start; }
  .arcl-workspace { grid-template-columns: minmax(0, 1fr); }
  .arcl-sidebar { border-right: 0; border-bottom: 1px solid #dce7e1; }
  .arcl-question-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arcl-scope-note { display: none; }
  .arcl-capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .arcl-main { padding: 16px 12px 44px; }
  .arcl-intro { display: grid; }
  .arcl-title-row { align-items: flex-start; }
  .arcl-mark { width: 54px; height: 54px; }
  .arcl-title-row h1 { font-size: 1.55rem; }
  .arcl-intro-status { justify-content: space-between; }
  .arcl-connection { flex: 1; }
  .arcl-sidebar { padding: 18px; }
  .arcl-question-groups { display: block; }
  .arcl-question-group { margin-top: 12px; }
  .arcl-question-list { display: flex; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .arcl-question-list button { min-width: 230px; scroll-snap-align: start; }
  .arcl-chat-header { align-items: flex-start; padding: 17px; }
  .arcl-session-facts { display: none; }
  .arcl-chat-log { min-height: 430px; max-height: 58vh; padding: 17px; }
  .arcl-bubble { max-width: calc(100% - 44px); font-size: 0.86rem; }
  .arcl-composer { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px; }
  .arcl-voice-button, .arcl-send-button { width: 48px; padding: 0; font-size: 0; }
  .arcl-voice-button::after { content: "Mic"; font-size: 0.72rem; }
  .arcl-send-button::after { content: "Send"; font-size: 0.68rem; }
  .arcl-input-note { display: none; }
  .arcl-capability-grid { grid-template-columns: minmax(0, 1fr); }
}
