:root {
  --atg-bg: #ffffff;
  --atg-fg: #0f172a;
  --atg-muted: #475569;
  --atg-border: #e2e8f0;
  --atg-card: #f8fafc;
  --atg-active: #e5e7eb;
}

.atg-wrap { max-width: 980px; margin: 1.5rem auto; padding: 0 1rem; color: var(--atg-fg); }
.atg-wrap h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
.atg-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; border: 1px solid var(--atg-border); padding: .6rem .9rem; border-radius: .6rem; background: #fff; }
.atg-tab { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--atg-border); background: #fff; padding: .55rem 1rem; border-radius: .5rem; cursor: pointer; color: inherit; font-weight: 600; line-height: 1; }
.atg-tab.is-active { background: var(--atg-active); border-color: #cbd5e1; box-shadow: 0 0 0 1px rgba(0,0,0,.02) inset; }

.atg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: .75rem; grid-auto-rows: 1fr; }
@media (min-width: 720px) { .atg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .atg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.atg-card { background: var(--atg-card); border: 1px solid var(--atg-border); border-radius: .9rem; overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.atg-card button.atg-card-btn { all: unset; cursor: pointer; display: contents; }
.atg-card figure { width: 100%; aspect-ratio: 4 / 3; background: #e5e7eb; }
.atg-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atg-card .meta { padding: .6rem .7rem; display: grid; gap: .2rem; }
.atg-card .name { font-weight: 700; line-height: 1.2; }
.atg-card .sub { font-size: .85rem; color: var(--atg-muted); }
.atg-card.selected { outline: 2px solid #cbd5e1; outline-offset: 2px; background: #fff; }

.atg-inputs { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-top: 1rem; margin-bottom: .75rem; }
@media (min-width: 720px) { .atg-inputs { grid-template-columns: repeat(4, 1fr); } }
.atg-input label { font-weight: 600; display: inline-block; margin-bottom: .25rem; }
.atg-input input { width: 100%; padding: .55rem .65rem; border: 1px solid var(--atg-border); border-radius: .5rem; font-size: 1rem; background: #fff; }
.atg-cardbox { background: #fff; border: 1px solid var(--atg-border); border-radius: .75rem; padding: .75rem; }

.atg-result { margin-top: .5rem; }
.atg-panel { background: #fff; border: 1px solid var(--atg-border); border-radius: .9rem; padding: .9rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.atg-panel-head { display: grid; grid-template-columns: 72px 1fr; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.atg-thumb { width: 72px; height: 54px; border-radius: .4rem; overflow: hidden; background: #e5e7eb; }
.atg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atg-panel h2 { font-size: 1.1rem; margin: 0; }
.atg-panel #atg-panel-sub { margin-top: .2rem; }
.atg-result .stat { display: grid; gap: .25rem; padding: .55rem .65rem; background: #fff; border: 1px solid var(--atg-border); border-radius: .6rem; }
.atg-result .stat + .stat { margin-top: .5rem; }
.atg-result .big { font-size: 1.25rem; font-weight: 800; }
.atg-smallmuted { color: var(--atg-muted); font-size: .85rem; }
