/* ปุ่มบนการ์ดของเว็บไซต์ (tools.js): บันทึก PNG · ขยายเต็มจอ */
.ar-card[data-tools] { position: relative; }
.ar-card[data-tools] > .ar-card-h { padding-right: 5.25rem; }
.ar-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
.ar-tool {
  width: 2.25rem; height: 2.25rem; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--cds-radius); background: transparent; color: var(--color-fg-muted); cursor: pointer;
}
.ar-tool:hover { background: color-mix(in srgb, var(--color-fg) 8%, transparent); color: var(--color-fg); }
.ar-tool:focus-visible { outline: 2px solid var(--color-fg); outline-offset: 1px; }
.ar-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ar-tool[aria-busy='true'] { cursor: progress; opacity: 0.55; }
@media (pointer: coarse) {
  .ar-tool { width: 2.75rem; height: 2.75rem; }
  .ar-tools { top: 4px; right: 4px; }
  .ar-card[data-tools] > .ar-card-h { padding-right: 6rem; }
}

/* ขยายเต็มจอ: การ์ดย้ายเข้า <dialog> */
.ar-max {
  width: min(90rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); margin: auto; padding: 0;
  border: 0; border-radius: var(--cds-radius); background: var(--color-panel); color: var(--color-fg);
  overflow: auto; overscroll-behavior: contain;
}
.ar-max::backdrop { background: rgb(0 0 0 / 0.5); }
.ar-max > .ar-card { border: 0; border-radius: 0; padding: var(--cds-pad-lg) clamp(var(--cds-pad-lg), 2vw, 2rem); }
.ar-max .ar-tbl-box { max-height: none !important; }
@media (max-width: 40rem) {
  .ar-max { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
}

/* ข้อความแจ้งมุมล่าง */
.ar-toast {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 1000; max-width: min(36rem, calc(100vw - 2rem));
  padding: 0.6rem 1rem; border-radius: var(--cds-radius); background: var(--color-fg); color: var(--color-panel);
  font-size: var(--cds-font-size-caption); line-height: 1.5;
}
.ar-toast:empty { display: none; }

@media print { .ar-tools, .ar-toast { display: none !important; } }
