.icon-button,
.plain-icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 226, 234, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.icon-button svg,
.plain-icon-button svg {
  width: 20px;
  height: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  border-color: transparent;
}

.button.accent {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button.ghost {
  background: transparent;
  box-shadow: none;
}

.button.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button svg {
  width: 18px;
  height: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.module-card,
.list-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.module-card img {
  width: 72px;
  height: 54px;
  border-radius: var(--radius);
  object-fit: cover;
  flex: 0 0 auto;
}

.module-card h3,
.list-card h3 {
  margin: 0 0 4px;
  font-size: 1.04rem;
}

.module-card p,
.list-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.tag-row,
.action-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.chip.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

button.chip {
  min-height: 44px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--primary-strong);
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: linear-gradient(90deg, var(--primary), var(--indigo), var(--accent));
  border-radius: inherit;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottom-nav-height) + 28px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 14px;
  color: #fff;
  background: #111827;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.offline-warning {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  color: #7f1d1d;
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.45;
}
