:root {
  --bg:         #f0ecff;
  --surface:    #fdfcff;
  --border:     #8d7bb7;
  --text:       #190319;
  --text-muted: #2d1d52;
  --accent:     #3311cc;
  --positive:   rgb(10, 150, 16);
  --font:       'IBM Plex Sans', system-ui, sans-serif;
  --font-weight: 300;
  --font-size:  1rem;
  --radius:     4px;
  --gap:        16px;
}

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

body {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(180, 120, 255, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 15%, rgba(255, 100, 200, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(80, 200, 255, 0.3) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(100, 255, 200, 0.25) 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size);
  font-weight: var(--font-weight);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── buttons ───────────────────────────────────── */

.btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font);
  font-size: var(--font-size);
  font-weight: var(--font-weight);
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  touch-action: manipulation;
  width: 100%;
}

.btn:hover,
.btn:active {
  background: var(--accent);
  color: var(--bg);
}

/* ghost — navigation / low-emphasis actions */
.btn-ghost {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-weight: var(--font-weight);
  cursor: pointer;
  padding: 4px 0;
  touch-action: manipulation;
}

.btn-ghost:hover,
.btn-ghost:active {
  color: var(--accent);
}

/* small outlined — inline card actions, easy tap target */
.btn-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-weight: var(--font-weight);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
}

.btn-sm:hover,
.btn-sm:active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── shared field ──────────────────────────────── */

.field {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size);
  font-weight: var(--font-weight);
  padding: 10px 12px;
  border-radius: var(--radius);
  outline: none;
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
}

.field:focus {
  border-color: var(--accent);
}

.field::placeholder {
  color: var(--text-muted);
}

/* ── add row (collapsed by default, toggle with .is-open) ── */

.add-row {
  display: flex;
  gap: 8px;
  overflow: hidden;
  max-height: 0;
  margin-bottom: 0;
  transition: max-height 0.25s ease, margin-bottom 0.25s ease;
}

.add-row.is-open {
  max-height: 80px;
  margin-bottom: var(--gap);
}

.add-row .btn {
  width: auto;
  white-space: nowrap;
}

/* ── tooltips ──────────────────────────────────── */

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: var(--font-weight);
  line-height: 1.5;
  padding: 6px 8px;
  pointer-events: none;
  z-index: 10;
  text-transform: none;
  letter-spacing: 0;
}

/* ── shared states ─────────────────────────────── */

.empty-state {
  color: var(--text-muted);
  font-size: 12px;
  padding: var(--gap) 0;
}

/* ── section chrome ────────────────────────────── */

.section-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--gap);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 700px) {
  .section-view {
    max-width: 680px;
  }
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: var(--gap) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--gap);
}

.section-title {
  flex: 1;
  font-size: 16px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}

/* header nav buttons — auto-width, minimum tap target */
.section-header .btn {
  width: auto;
  min-width: 44px;
  text-align: center;
  padding-left: 14px;
  padding-right: 14px;
}
