.al-ui {
  --al-accent: #116253;
  container-type: inline-size;
  background: #fff;
  color: #192d2a;
  border: 1px solid #dce5e2;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(20,48,38,.06);
  padding: clamp(16px, 3vw, 36px);
  font: 400 16px/1.5 system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.al-ui *, .al-ui { box-sizing: border-box; }
.al-ui h2, .al-ui h3 { color: inherit; margin: 0 0 20px; line-height: 1.2; }
.al-ui h2 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.04em; }
.al-ui h3 { font-size: 21px; }
.al-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.al-compose { flex: 2 1 300px; min-width: 0; }
.al-ui aside { flex: 1 1 190px; padding: 24px; border-radius: 12px; background: #edf6f2; }
.al-ui aside strong { display: block; font-size: .82em; color: #47645b; }
.al-ui aside br { display: none; }
.al-ui form label { font-weight: 600; }
.al-ui form input[name=title], .al-ui textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  border: 1px solid #aabab5; border-radius: 8px; background: #fcfdfc; color: #192d2a; font: inherit;
}
.al-ui textarea { resize: vertical; min-height: 120px; }
.al-ui button { border: 0; border-radius: 8px; padding: 12px 22px; background: var(--al-accent); color: white; font: 650 15px system-ui; cursor: pointer; }
.al-ui button:hover { background: #094b40; }
.al-ui a { color: var(--al-accent); font-weight: 650; }
.al-ui :focus-visible { outline: 3px solid #267fbe; outline-offset: 3px; }
.al-ui table { width: 100%; border: 0; border-collapse: collapse; font-size: 14px; }
.al-ui th, .al-ui td { padding: 14px 10px; text-align: left; border: 0; border-bottom: 1px solid #dae5df; }
.al-ui th { background: #f1f6f3; color: #486056; font-weight: 600; }
.al-ui td:first-child { font-weight: 650; }
.al-pin, .al-ui .al-new { display: inline-block; border-radius: 20px; background: #9c284c; color: white; padding: .12em .55em; font: bold 12px/1.5 system-ui; }
.al-ui .al-new { display: table; margin-bottom: 4px; }
.al-empty { background: #f4f8f6; border-radius: 10px; padding: 28px; }
.al-empty p, .al-ui article p { margin: 6px 0 0; }
.al-ui article { width: fit-content; max-width: 88%; padding: 14px 20px; margin: 12px 0; border-radius: 14px; background: #f0f3f4; }
.al-ui article.al-own { margin-left: auto; background: #e6f3eb; }
.al-ui article + form { margin-top: 24px; padding-top: 12px; border-top: 1px solid #dae5df; }
@container (max-width: 600px) {
  .al-ui table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .al-ui tbody, .al-ui table { display: block; }
  .al-ui tr { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 14px 0; border-bottom: 1px solid #dae5df; }
  .al-ui td { padding: 0; border: 0; }
  .al-ui td:first-child { grid-column: 1 / -1; font-size: 16px; }
  .al-ui td:last-child { text-align: right; }
}

/* Keep embedded forms and their text legible inside branded dashboard themes. */
.al-ui[data-al-theme] {
  --panel:#fff; --text:#192d2a; --soft:#edf5f2; --own:#e1f2e9;
  --line:#c1d1cb; --field:#fff; --muted:#49655c; --cta:#116253; --on-cta:#fff;
  color-scheme:light;
  background:var(--panel) !important; color:var(--text) !important; border-color:var(--line);
}
.al-ui[data-al-theme="dark"] {
  --panel:#181e22; --text:#eff5f3; --soft:#243034; --own:#23453c;
  --line:#50615f; --field:#12191c; --muted:#bdcec8; --cta:#8de0bc; --on-cta:#102e22;
  --al-accent:#8de0bc; color-scheme:dark;
}
.al-ui[data-al-theme] :is(p,label,h2,h3,article,strong,th,td) { color:var(--text) !important; }
.al-ui[data-al-theme] :is(form,section.al-compose,table,tbody,tr,td) { background:transparent !important; }
.al-ui[data-al-theme] form { display:block; padding:0; box-shadow:none; }
.al-ui[data-al-theme] form :is(p,label,input[name=title],textarea) { display:block; width:100% !important; max-width:none !important; }
.al-ui[data-al-theme] form label br { display:none; }
.al-ui[data-al-theme] :is(input[name=title],textarea) { background:var(--field) !important; color:var(--text) !important; border-color:var(--line); }
.al-ui[data-al-theme] ::placeholder { color:var(--muted); opacity:1; }
.al-ui[data-al-theme] :is(aside,article,th,.al-empty) { background:var(--soft) !important; }
.al-ui[data-al-theme] article.al-own { background:var(--own) !important; }
.al-ui[data-al-theme] .al-new { color:white !important; }
.al-ui[data-al-theme] :is(td,th,article + form) { border-color:var(--line); }
.al-ui[data-al-theme] button { background:var(--cta) !important; color:var(--on-cta) !important; }
.al-ui[data-al-theme] button:hover { filter:brightness(.92); }
.al-notices { margin-bottom:28px; }
.al-notice { border:1px solid var(--line); border-radius:10px; padding:16px; margin:12px 0; }
.al-notice summary { cursor:pointer; font-weight:650; }
.al-notice small { display:inline-block; margin-left:10px; font-weight:400; }
.al-notice-body { margin-top:18px; }
.al-notice-body img,.al-notice-body video { max-width:100%; height:auto; }
.al-notice-body iframe { width:100%; max-width:100%; aspect-ratio:16/9; height:auto; border:0; }
.al-modal { width:min(740px, calc(100vw - 32px)); max-height:85vh; margin:auto; overflow:auto; }
.al-modal::backdrop { background:rgba(0,0,0,.65); }
.al-modal-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:24px; flex-wrap:wrap; }
