/* ============================================================
   base.css — Reset & Typography
   invbox.io
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-ink);
  background: var(--color-surface-alt);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img, svg {
  display: block;
  max-width: 100%;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* ── Typography ── */
h1 { font-size: var(--text-3xl); font-weight: var(--weight-bold); line-height: var(--line-height-tight); color: var(--color-ink); }
h2 { font-size: var(--text-2xl); font-weight: var(--weight-bold); line-height: var(--line-height-tight); color: var(--color-ink); }
h3 { font-size: var(--text-xl);  font-weight: var(--weight-bold); line-height: var(--line-height-tight); color: var(--color-ink); }
h4 { font-size: var(--text-lg);  font-weight: var(--weight-bold); line-height: var(--line-height-tight); color: var(--color-ink); }
h5 { font-size: var(--text-md);  font-weight: var(--weight-medium); color: var(--color-ink); }
h6 { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--color-ink); }

p {
  font-size: var(--text-base);
  color: var(--color-ink-secondary);
  line-height: var(--line-height-normal);
}

small {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}

strong {
  font-weight: var(--weight-bold);
}

/* ── Utility Classes ── */
.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.text-base   { font-size: var(--text-base); }
.text-md     { font-size: var(--text-md); }
.text-lg     { font-size: var(--text-lg); }
.text-xl     { font-size: var(--text-xl); }

.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-ink-secondary); }
.text-muted     { color: var(--color-ink-muted); }
.text-danger    { color: var(--color-danger); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }

.font-regular { font-weight: var(--weight-regular); }
.font-medium  { font-weight: var(--weight-medium); }
.font-bold    { font-weight: var(--weight-bold); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Spacing Utilities ── */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }

/* ── Flex & Grid Utilities ── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ── Display Utilities ── */
.hidden  { display: none; }
.block   { display: block; }
.inline  { display: inline; }
.w-full  { width: 100%; }
.h-full  { height: 100%; }

/* ── Scroll ── */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-4) 0;
}

/* ── Screen reader only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Footer ── */
#accFooter {
  position:fixed;
  bottom:0;
  inset-inline-start:0;
  inset-inline-end:0;
  height:40px;
  background:var(--color-surface);
  border-top:1px solid var(--color-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 var(--space-5);
  font-size:var(--text-xs);
  color:var(--color-ink-muted);
  z-index:10;
}
/* ── Floating action-items toast (inline migration companion) ── */
#accNotifBar {
  position: fixed;
  bottom: 116px;
  inset-inline-end: var(--space-6);
  width: 340px;
  z-index: var(--z-dropdown);
  transition: opacity .3s ease, transform .3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
