/* Shared DIAM dialog and toast. Light gray, one layout, no blur, no gradient, no motion.
   Primary action is deep green. A quiet cancel sits beside it. Red is only for a destructive confirm.
   A thin brass line is the only gold. Status uses the shared traffic lights (--go / --wait / --stop). */
dialog.diam-dlg,dialog.diam-dlg *{box-sizing:border-box}
dialog.diam-dlg{
  border:1px solid var(--line,#E2E9E7);
  background:#F3F5F4;
  color:var(--ink,#16201C);
  padding:0;
  width:min(440px,calc(100vw - 32px));
  max-height:min(86vh,640px);
  overflow:auto;
  border-radius:14px;
  box-shadow:0 8px 28px rgba(22,32,28,.16);
  margin:auto;
}
dialog.diam-dlg::backdrop{background:rgba(22,32,28,.45)}
dialog.diam-dlg[open]{display:flex;flex-direction:column}
.diam-dlg-bar{height:3px;background:var(--brass,#C7A24C);flex:0 0 auto}
.diam-dlg-head{display:flex;align-items:center;gap:10px;padding:16px 18px 0}
.diam-dlg-title{margin:0;font-family:Spectral,Georgia,serif;font-size:1.25rem;font-weight:600;color:var(--oasis,#0D3B34);line-height:1.3}
.diam-dlg-body{padding:10px 18px 0;font-size:1rem;line-height:1.45;white-space:pre-wrap}
.diam-id{white-space:nowrap}
.diam-dlg-input{display:block;width:calc(100% - 36px);margin:12px 18px 0;min-height:48px;padding:10px 12px;border:1px solid var(--line,#E2E9E7);border-radius:10px;background:#fff;font:inherit;font-size:1rem;color:inherit}
.diam-dlg-err{margin:10px 18px 0;color:var(--stop,#E10600);font-weight:700;font-size:.95rem;line-height:1.4}
.diam-dlg-err[hidden]{display:none}
.diam-dlg-actions{display:flex;gap:8px;justify-content:flex-end;padding:16px 18px 18px}
.diam-dlg-btn{min-height:44px;padding:10px 16px;border-radius:10px;font:inherit;font-weight:700;font-size:1rem;cursor:pointer;border:1px solid transparent}
.diam-dlg-btn.primary{background:var(--oasis,#0D3B34);color:#fff}
.diam-dlg-btn.quiet{background:transparent;color:var(--ink-soft,#5C6B65)}
.diam-dlg-btn.danger{background:var(--stop,#E10600);color:#fff}
.diam-dlg-btn:focus-visible,.diam-dlg-input:focus-visible{outline:3px solid var(--teal,#0F8A7A);outline-offset:2px}
.diam-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.diam-toasts{position:fixed;left:12px;right:12px;bottom:calc(16px + env(safe-area-inset-bottom, 0px));z-index:80;display:flex;flex-direction:column;align-items:flex-end;gap:8px;pointer-events:none}
.diam-toast{pointer-events:auto;display:flex;align-items:flex-start;gap:10px;padding:12px 14px;background:#F3F5F4;border:1px solid var(--line,#E2E9E7);border-radius:12px;box-shadow:0 4px 16px rgba(22,32,28,.12);color:var(--ink,#16201C);max-width:min(440px,100%);cursor:pointer}
.diam-toast-ok{border-left:4px solid var(--go,#12B000)}
.diam-toast-wait{border-left:4px solid var(--wait,#F5A000)}
.diam-toast-stop{border-left:4px solid var(--stop,#E10600)}
.diam-toast .diam-lite{margin-top:4px}
.diam-toast-tx{white-space:pre-wrap;line-height:1.4;flex:1}
.diam-toast-x{border:0;background:transparent;color:var(--ink-soft,#5C6B65);font:inherit;font-weight:700;min-height:44px;padding:0 4px;cursor:pointer}
.diam-toast-x:focus-visible{outline:3px solid var(--teal,#0F8A7A);outline-offset:2px}
@media(max-width:760px){
  dialog.diam-dlg{position:fixed;inset:auto 0 0 0;width:100%;max-width:100%;margin:0;max-height:92vh;border-radius:16px 16px 0 0;border-bottom:0;padding:0}
  .diam-dlg-head{padding-left:20px;padding-right:20px}
  .diam-dlg-body{padding-left:20px;padding-right:20px}
  .diam-dlg-input{width:calc(100% - 40px);margin-left:20px;margin-right:20px}
  .diam-dlg-err{margin-left:20px;margin-right:20px}
  /* 20px keeps a 3px ring plus 2px offset off the screen edge. The home-indicator inset sits under the buttons. */
  .diam-dlg-actions{padding:16px 20px calc(16px + env(safe-area-inset-bottom, 0px))}
  .diam-dlg-btn{flex:1;min-height:52px;font-size:1.05rem}
  .diam-toasts{align-items:stretch;bottom:calc(12px + env(safe-area-inset-bottom, 0px))}
  .diam-toast{max-width:none}
}
@media(prefers-reduced-motion:reduce){
  dialog.diam-dlg,.diam-toast{animation:none;transition:none}
}
