/**
 * a2ui-catalog-v1 — modern skins for A2UI Basic Catalog widgets
 * (Row, Column, Card, Text, TextField, Button, Tabs, …).
 *
 * DEMO / future paint attach: closed catalog widgets only — not freeform SoftID pages.
 * Live chrome (apps bar / dock) stays Manifest-driven.
 *
 * Visual: Design.MD — white canvas, #0C0C0C ink, accent only #E6FD10.
 * Type: Space Grotesk / Inter. Brand wordmark stays Nunito in the shell.
 */
:root,
[data-skin="a2ui-catalog-v1"] {
  --a2-ink: #0C0C0C;
  --a2-ink-soft: #0C0C0C;
  --a2-teal: #0C0C0C;
  --a2-mint: #FFFFFF;
  --a2-mint-deep: #E6FD10;
  --a2-canvas: #FFFFFF;
  --a2-canvas-deep: #F4F4F2;
  --a2-surface: #F4F4F2;
  --a2-surface-2: #FFFFFF;
  --a2-line: rgba(12, 12, 12, 0.12);
  --a2-line-strong: rgba(12, 12, 12, 0.22);
  --a2-muted: #707070;
  --a2-danger: #ba1a1a;
  --a2-ok: #0C0C0C;

  --a2-atmosphere: #FFFFFF;

  --a2-font-display: "Space Grotesk", sans-serif;
  --a2-font-body: Inter, sans-serif;

  --a2-xs: 0.6875rem;
  --a2-sm: 0.8125rem;
  --a2-md: 0.9375rem;
  --a2-lg: 1.125rem;
  --a2-xl: 1.5rem;
  --a2-2xl: clamp(1.7rem, 2.2vw, 2.15rem);

  --a2-space-1: 0.5rem;
  --a2-space-2: 0.75rem;
  --a2-space-3: 1.25rem;
  --a2-space-4: 2rem;
  --a2-radius: 16px;
  --a2-radius-lg: 28px;
  --a2-control-h: 2.55rem;
  --a2-shadow: none;
  --a2-focus: 2px solid #0C0C0C;
}

.a2ui-paint,
[data-a2ui-root] {
  font-family: var(--a2-font-body);
  color: var(--a2-ink);
  background: #ffffff;
  border-radius: var(--a2-radius-lg);
  padding: var(--a2-space-4) var(--a2-space-3);
  min-height: 20rem;
  position: relative;
  overflow: hidden;
  animation: a2ui-fade-in 420ms ease both;
}

.a2ui-paint > * { position: relative; z-index: 1; }

@keyframes a2ui-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes a2ui-tab-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes a2ui-modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Layout */
.a2-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
}
.a2-col {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.a2-gap-sm { gap: var(--a2-space-1); }
.a2-gap-md { gap: var(--a2-space-2); }
.a2-gap-lg { gap: var(--a2-space-3); }
.a2-align-start { align-items: flex-start; }
.a2-align-center { align-items: center; }
.a2-align-end { align-items: flex-end; }
.a2-align-stretch { align-items: stretch; }
.a2-justify-start { justify-content: flex-start; }
.a2-justify-center { justify-content: center; }
.a2-justify-end { justify-content: flex-end; }
.a2-justify-spaceBetween { justify-content: space-between; }
.a2-justify-spaceAround { justify-content: space-around; }

.a2-row > .a2-field,
.a2-row > .a2-choice {
  flex: 1 1 12rem;
  min-width: min(100%, 12rem);
}

/* Card */
.a2-card {
  background: var(--a2-surface);
  border: 1px solid var(--a2-line);
  border-radius: var(--a2-radius-lg);
  padding: var(--a2-space-3);
  box-shadow: none;
}
.a2-card:hover {
  border-color: #0C0C0C;
}

/* Text */
.a2-text { margin: 0; line-height: 1.45; }
.a2-text-h1 {
  font-family: var(--a2-font-display);
  font-size: var(--a2-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.a2-text-h2, .a2-text-h3 {
  font-family: var(--a2-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.a2-text-h2 { font-size: var(--a2-xl); }
.a2-text-h3 { font-size: var(--a2-lg); }
.a2-text-body { font-size: var(--a2-md); color: var(--a2-ink-soft); }
.a2-text-caption {
  font-size: var(--a2-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a2-muted);
  font-weight: 600;
}
.a2-text-h4, .a2-text-h5 { font-weight: 600; font-size: var(--a2-md); }

/* Field */
.a2-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.a2-field > span {
  font-size: var(--a2-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a2-muted);
}
.a2-field input,
.a2-field textarea,
.a2-choice select {
  height: var(--a2-control-h);
  border: 1px solid var(--a2-line-strong);
  border-radius: 12px;
  background: var(--a2-surface-2);
  padding: 0 0.85rem;
  font: 500 var(--a2-md)/1.2 var(--a2-font-body);
  color: var(--a2-ink);
  transition: border-color 150ms ease;
}
.a2-field textarea { height: auto; min-height: 5rem; padding: 0.75rem 0.85rem; resize: vertical; }
.a2-field input:focus,
.a2-field textarea:focus,
.a2-choice select:focus {
  outline: none;
  border: 2px solid #0C0C0C;
}
.a2-field .req::after { content: " *"; color: var(--a2-danger); }

/* ChoicePicker */
.a2-choice { display: flex; flex-direction: column; gap: 0.35rem; }
.a2-choice > span {
  font-size: var(--a2-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a2-muted);
}
.a2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.a2-chip {
  border: 1px solid var(--a2-line-strong);
  background: var(--a2-surface-2);
  color: var(--a2-ink);
  border-radius: 9999px;
  padding: 0.45rem 0.85rem;
  font: 600 var(--a2-sm)/1 var(--a2-font-body);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.a2-chip[aria-pressed="true"] {
  background: #E6FD10;
  color: #0C0C0C;
  border-color: #E6FD10;
}
.a2-chip:hover { border-color: #0C0C0C; }

/* CheckBox / Slider / Date */
.a2-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: var(--a2-sm);
  font-weight: 500;
  cursor: pointer;
}
.a2-check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--a2-teal);
}
.a2-slider {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.a2-slider > span {
  font-size: var(--a2-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a2-muted);
  display: flex;
  justify-content: space-between;
}
.a2-slider input[type="range"] {
  width: 100%;
  accent-color: var(--a2-mint-deep);
}
.a2-datetime {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.a2-datetime > span {
  font-size: var(--a2-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a2-muted);
}
.a2-datetime input {
  height: var(--a2-control-h);
  border: 1px solid var(--a2-line-strong);
  border-radius: 12px;
  background: var(--a2-surface-2);
  padding: 0 0.85rem;
  font: 500 var(--a2-md)/1.2 var(--a2-font-body);
}

/* Button */
.a2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--a2-control-h);
  padding: 0 1.15rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  font: 700 var(--a2-sm)/1 var(--a2-font-body);
  cursor: pointer;
}
.a2-btn-primary {
  background: #0C0C0C;
  color: #FFFFFF;
}
.a2-btn-primary:hover { background: #1E1E1E; }
.a2-btn-primary:active { transform: scale(0.98); }
.a2-btn-ghost {
  background: transparent;
  border-color: var(--a2-line-strong);
  color: var(--a2-ink);
}
.a2-btn-ghost:hover { background: #F4F4F2; }

/* Tabs */
.a2-tabs { width: 100%; }
.a2-tablist {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--a2-line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: var(--a2-space-3);
}
.a2-tab {
  border: 0;
  background: transparent;
  color: var(--a2-muted);
  font: 700 var(--a2-sm)/1 var(--a2-font-body);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.a2-tab[aria-selected="true"] {
  background: #0C0C0C;
  color: #FFFFFF;
}
.a2-tabpanel {
  animation: a2ui-tab-in 280ms ease both;
}

/* List / Divider / Icon / Image */
.a2-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.a2-list-h { flex-direction: row; flex-wrap: wrap; }
.a2-list > li {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--a2-line);
  border-radius: var(--a2-radius);
  padding: 0.75rem 0.9rem;
}
.a2-divider {
  border: 0;
  height: 1px;
  width: 100%;
  background: rgba(12, 12, 12, 0.12);
  margin: 0.25rem 0;
}
.a2-divider-v {
  width: 1px;
  height: auto;
  align-self: stretch;
  background: var(--a2-line-strong);
}
.a2-icon {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: #F4F4F2;
  color: var(--a2-teal);
  flex: 0 0 auto;
}
.a2-icon svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.a2-image {
  display: block;
  border-radius: 16px;
  object-fit: cover;
  background: var(--a2-teal);
}
.a2-image-icon { width: 4.5rem; height: 4.5rem; }

/* Modal */
.a2-modal-root { display: inline-flex; }
.a2-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, 0.45);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 1rem;
}
.a2-modal-panel {
  width: min(28rem, 100%);
  background: var(--a2-surface-2);
  border: 1px solid var(--a2-line);
  border-radius: var(--a2-radius-lg);
  padding: var(--a2-space-3);
  box-shadow: var(--a2-shadow);
  animation: a2ui-modal-in 220ms ease both;
}

.a2-demo-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--a2-space-3);
  padding: 0.65rem 0.9rem;
  border-left: 3px solid #E6FD10;
  background: #F4F4F2;
  font-size: var(--a2-sm);
  color: var(--a2-muted);
  border-radius: 12px;
}
.a2-demo-banner strong { color: var(--a2-teal); }
.a2-demo-banner code {
  font-size: 0.75em;
  background: #F4F4F2;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

@media (max-width: 720px) {
  .a2ui-paint { padding: var(--a2-space-3) var(--a2-space-2); }
  .a2-tablist { width: 100%; }
}
